Compare commits
701 Commits
wip/gl-tex
...
shader-cac
Author | SHA1 | Date | |
---|---|---|---|
|
e8d497b83a | ||
|
37767e056f | ||
|
c7e1ab67c6 | ||
|
4a2e73a07c | ||
|
f8e1924355 | ||
|
d50708b024 | ||
|
934354fb8c | ||
|
ea0290c50e | ||
|
4fc072925c | ||
|
69101a11b5 | ||
|
50b8ee3a5f | ||
|
ccde20ea08 | ||
|
7ee4bfd9d6 | ||
|
e6d104bfa0 | ||
|
2f9790b02e | ||
|
c2c1262766 | ||
|
0c9c6498c3 | ||
|
d0adffe6eb | ||
|
d64635a760 | ||
|
dfb06e1c7a | ||
|
139a627a85 | ||
|
7ccf6a7df7 | ||
|
5c9ae36c50 | ||
|
102f802b04 | ||
|
35305bfc85 | ||
|
48613eca27 | ||
|
69e1128cd3 | ||
|
6100a9d692 | ||
|
56782123d2 | ||
|
5cdb33d1c4 | ||
|
b7d7602750 | ||
|
b1b05bee53 | ||
|
85a7d0a201 | ||
|
6ff76a483c | ||
|
9665c4d651 | ||
|
8646f9da19 | ||
|
490abbb292 | ||
|
cc0a69e101 | ||
|
5c66f2ec19 | ||
|
331af6815b | ||
|
33b2bfa81f | ||
|
1b62d28cbb | ||
|
69441cbace | ||
|
b9445f4d7e | ||
|
06661da8b0 | ||
|
b26e584e29 | ||
|
81d19154a3 | ||
|
f494d6ae1f | ||
|
353ad30b12 | ||
|
e2ee2a6dab | ||
|
5e99646e1c | ||
|
cc9908353c | ||
|
9afbf02bc2 | ||
|
3f28a6851b | ||
|
8e3e321da4 | ||
|
aa1d1e4189 | ||
|
a269e9a266 | ||
|
5415d05359 | ||
|
60719bb67c | ||
|
7fdcc58532 | ||
|
9b83116fcb | ||
|
e6d24f4c15 | ||
|
ce743f28a1 | ||
|
b8b6324c4c | ||
|
8c43f22e3e | ||
|
438b4b6b5c | ||
|
b16ac01a03 | ||
|
448d2502d9 | ||
|
6bad307180 | ||
|
98a9f2b3c1 | ||
|
433517fdc9 | ||
|
7240178988 | ||
|
eb382c1321 | ||
|
cfeab26de0 | ||
|
f8ecd488cd | ||
|
b83cd9e818 | ||
|
ba65c1ae58 | ||
|
fe45cf9c09 | ||
|
1cfa88ed91 | ||
|
e84c6acc4f | ||
|
df600669a2 | ||
|
f680d5d130 | ||
|
9c0c1702d5 | ||
|
5ff9e34fbb | ||
|
0c3d757ba2 | ||
|
b8e6d06372 | ||
|
6b50788901 | ||
|
6bdb004dfd | ||
|
e239de064b | ||
|
0b8215e0b1 | ||
|
563cb69c6d | ||
|
b01ee88f11 | ||
|
ade14779b1 | ||
|
cb4ec6f384 | ||
|
4fff16860f | ||
|
1e3d9e1293 | ||
|
877b48579e | ||
|
39851fbdbf | ||
|
945379d623 | ||
|
3f2894fec1 | ||
|
8d05fcd35c | ||
|
7e102f8879 | ||
|
1d5d46ff29 | ||
|
2a4ffd4a59 | ||
|
8202f333ea | ||
|
0ce19eed08 | ||
|
ef693f317c | ||
|
f5ff44595a | ||
|
101cf7dcbd | ||
|
f260e76ede | ||
|
68379cab9b | ||
|
09e6b4dc01 | ||
|
9165dd33ed | ||
|
47d79a4257 | ||
|
5a32469303 | ||
|
5290d9d8c7 | ||
|
7862894f11 | ||
|
a1898d678b | ||
|
d6ba10bacf | ||
|
c4ecc3f4f7 | ||
|
63edf43e86 | ||
|
5c7ee3a483 | ||
|
4f87861c9a | ||
|
cb41d1586f | ||
|
f353bbd0bc | ||
|
1873304e7b | ||
|
77a5d00047 | ||
|
706a6cf0a3 | ||
|
b304655e2d | ||
|
28c27f37ee | ||
|
dcc6124209 | ||
|
feb7bf2fbe | ||
|
695d141f32 | ||
|
b83ba41f2d | ||
|
e798eedfb6 | ||
|
e6cd6f8db6 | ||
|
4ac450b324 | ||
|
f440c48dea | ||
|
19ca2789c0 | ||
|
63e060a21d | ||
|
3dce0dcca7 | ||
|
9a7e721181 | ||
|
890080ebf7 | ||
|
391727bd0d | ||
|
1d26879fa5 | ||
|
0124740fa0 | ||
|
3f367277fe | ||
|
4240119d64 | ||
|
a9fec38680 | ||
|
22780044ec | ||
|
4353ad224f | ||
|
85eef63b32 | ||
|
9e9db8607b | ||
|
8ef2b10f70 | ||
|
50ffa86d18 | ||
|
2210078a64 | ||
|
25ab5b9f0b | ||
|
f261bf2fc6 | ||
|
922b2cf99a | ||
|
c8b0c55284 | ||
|
93aa5ce167 | ||
|
781400f6d3 | ||
|
f7326ff828 | ||
|
9561b97dc4 | ||
|
bd986f9534 | ||
|
a15080c640 | ||
|
f431e28ce3 | ||
|
0ad27cc598 | ||
|
1a1373779f | ||
|
2aee39d12c | ||
|
158df3c1bb | ||
|
f1e1e9a71e | ||
|
04a3b8b6df | ||
|
09a21f1cd2 | ||
|
0f4ab5862a | ||
|
2362e4d41e | ||
|
182f39aba7 | ||
|
3d9cb477aa | ||
|
357175f0b1 | ||
|
b410b48eed | ||
|
5bd85058d9 | ||
|
7cf6da60da | ||
|
9700a98f48 | ||
|
800bcb5cb4 | ||
|
e4338c4d42 | ||
|
29cccf5e84 | ||
|
4db1a5f5c4 | ||
|
4642e86284 | ||
|
ea84e974e6 | ||
|
abc9b944f9 | ||
|
87fa7ff314 | ||
|
6dc29f2852 | ||
|
0f13a232c6 | ||
|
82a99a3643 | ||
|
d54ca3c74f | ||
|
ee8e42f19b | ||
|
41a5e744d8 | ||
|
a25dcd0f74 | ||
|
7351848c75 | ||
|
bb04808eea | ||
|
004d0f2fc1 | ||
|
fb763cd4ca | ||
|
a5e20c5ffc | ||
|
3ca298ec94 | ||
|
ad85a75c2e | ||
|
1a8e7d97ae | ||
|
1eb22e7927 | ||
|
fd28bddde1 | ||
|
ca4f08136a | ||
|
16689a1e81 | ||
|
24e708a770 | ||
|
64e128629f | ||
|
6cfb720ab7 | ||
|
3e6fea0550 | ||
|
146082d464 | ||
|
b64a403100 | ||
|
12409ee075 | ||
|
cbe40f5f46 | ||
|
2935ef8128 | ||
|
c6541853ab | ||
|
0a08c03885 | ||
|
af18796312 | ||
|
9e54c22c49 | ||
|
01f996447e | ||
|
a8608618a9 | ||
|
1f4839d4c8 | ||
|
3c7ee010f5 | ||
|
7844320f10 | ||
|
c9557c207f | ||
|
2016f56176 | ||
|
3427639b08 | ||
|
3e50092869 | ||
|
536714a147 | ||
|
bcf1aa7cb2 | ||
|
d1be2b29cf | ||
|
89ee42db54 | ||
|
ccb6b8585c | ||
|
2b35332fd6 | ||
|
7e39b12858 | ||
|
3faa7e04db | ||
|
4beeb6173b | ||
|
5970dac167 | ||
|
9fa1e68151 | ||
|
c59948169d | ||
|
a4e16ce3cc | ||
|
d4764cc89b | ||
|
8f43d7e188 | ||
|
a721d8b78f | ||
|
d774406573 | ||
|
3322599e99 | ||
|
7f0ef81e11 | ||
|
927f48d289 | ||
|
45072c3a64 | ||
|
a891a3ae26 | ||
|
4bb8352ab5 | ||
|
62aa487500 | ||
|
454814c6b4 | ||
|
0b4e0ce509 | ||
|
35f92b5695 | ||
|
55d35dd13e | ||
|
ba52be36c2 | ||
|
eaf899061a | ||
|
0a7880110e | ||
|
a475e6671c | ||
|
e35132054e | ||
|
ebfadae568 | ||
|
65e3dda065 | ||
|
f82b3fdb90 | ||
|
d66bfb1a9a | ||
|
a4c2819f91 | ||
|
3a5630358f | ||
|
afffc696f4 | ||
|
a0729f9683 | ||
|
04fadc508b | ||
|
16bf07fe33 | ||
|
2f16c092a5 | ||
|
55664f95ab | ||
|
8b800fa775 | ||
|
d978d4af59 | ||
|
d417595a05 | ||
|
90c8619f42 | ||
|
955dca950c | ||
|
5f2283c0ab | ||
|
f06f0a0dee | ||
|
a48eaa1954 | ||
|
417e8d6ca4 | ||
|
d4c9a35193 | ||
|
81a7f8e00c | ||
|
f91ea2ce37 | ||
|
5838ac3d1d | ||
|
27abc9fefe | ||
|
b939af0090 | ||
|
4e2790ea74 | ||
|
9a5947758c | ||
|
44469197d5 | ||
|
9d045db142 | ||
|
73ffb7f5e9 | ||
|
a0d2d1f44b | ||
|
fe1586ca3d | ||
|
b52da5682e | ||
|
3b45019ba2 | ||
|
9aedafa39e | ||
|
fc9dc97430 | ||
|
86cd5c04bd | ||
|
d11c78c46f | ||
|
3a377bb0a3 | ||
|
bde1328a07 | ||
|
7ec3b52d97 | ||
|
86f3e67775 | ||
|
13d943f763 | ||
|
e5813b3ae7 | ||
|
5fe14e06da | ||
|
2072953375 | ||
|
d0757f6436 | ||
|
6bb1f0dbf3 | ||
|
fe8225e573 | ||
|
e4578ca7bf | ||
|
362ef4449c | ||
|
be9001f0da | ||
|
3ee4d6fc0f | ||
|
a78e9f2261 | ||
|
da8e83f9cb | ||
|
9ded44b3de | ||
|
f5c3b2c691 | ||
|
0f533ed61d | ||
|
527d265bea | ||
|
d55da3fd44 | ||
|
7c18911c00 | ||
|
890cd45ce4 | ||
|
eed279ad91 | ||
|
694f1d8ecd | ||
|
e23f641e49 | ||
|
7eb3736760 | ||
|
00d37c80f8 | ||
|
e0771a54a2 | ||
|
01fda3b85e | ||
|
28cda7f516 | ||
|
faabb808be | ||
|
38fa5ab57b | ||
|
034017425c | ||
|
4dfe4a6476 | ||
|
6cc824af43 | ||
|
db6fed1496 | ||
|
325f6121ba | ||
|
074e7001dc | ||
|
8920639a2b | ||
|
160e6ad6f6 | ||
|
b49c6cdcb1 | ||
|
cc6d60afa4 | ||
|
5ec41fb47b | ||
|
122e7b16e6 | ||
|
a207ab6105 | ||
|
de537a0755 | ||
|
2f5d5ca9f8 | ||
|
49a7bf267b | ||
|
f5e290517a | ||
|
7dc4669d01 | ||
|
22457822eb | ||
|
564397f391 | ||
|
4519c6696c | ||
|
84b4f85f1a | ||
|
0bb1e1b1fd | ||
|
53410bab0f | ||
|
31a0739bf3 | ||
|
aa175ec2f5 | ||
|
8a062f4f9a | ||
|
2d50d9ebe6 | ||
|
ee8132a439 | ||
|
0234e8e2c9 | ||
|
f44642c7cb | ||
|
9beb5490f5 | ||
|
da431b2a43 | ||
|
cfbac153a3 | ||
|
ddcc9b9f2f | ||
|
8ebec46db5 | ||
|
71ae2fae2e | ||
|
1596c61003 | ||
|
891c37a4cb | ||
|
8c2c748c11 | ||
|
235ff253ff | ||
|
331c4b5954 | ||
|
7ba53de1e8 | ||
|
c2b4da128a | ||
|
ec2cdac298 | ||
|
ce2b6d9eb7 | ||
|
d8956aeff2 | ||
|
634717d0b9 | ||
|
88de098711 | ||
|
4ac3f916d0 | ||
|
67b959f1a7 | ||
|
48f68bb881 | ||
|
26e2af26ed | ||
|
78c130543c | ||
|
4b33cc5f89 | ||
|
6fa2c7e3b7 | ||
|
32873cc94b | ||
|
881046b46e | ||
|
94d6d56913 | ||
|
971f46e1f2 | ||
|
d2b5436462 | ||
|
cac3e7705d | ||
|
c02090b1f6 | ||
|
1355c9ae88 | ||
|
813ccb6378 | ||
|
3c33e541cd | ||
|
83c74ff7d0 | ||
|
7c59ac2e4a | ||
|
67258c69f0 | ||
|
9db76cebb4 | ||
|
354eab70da | ||
|
a9cd2d8181 | ||
|
c7294ab90e | ||
|
94493414b5 | ||
|
fef4f0704a | ||
|
dc1612b865 | ||
|
7d7045bc35 | ||
|
04cc589a61 | ||
|
ef556689f8 | ||
|
ca794f909a | ||
|
15cc20e7b5 | ||
|
29bcc38ae6 | ||
|
e6bf832514 | ||
|
79bd123911 | ||
|
ab322e33aa | ||
|
4e23daa998 | ||
|
eb66d6bcc6 | ||
|
f5afc17d26 | ||
|
8720b2d8c5 | ||
|
7835385264 | ||
|
21e3a8daeb | ||
|
a302fd34e8 | ||
|
45603f70a8 | ||
|
4cfaee99e7 | ||
|
0b9dca3d55 | ||
|
fd20e42932 | ||
|
94093fd18e | ||
|
01d7ec2c83 | ||
|
79426a0a50 | ||
|
4095cac75c | ||
|
af4474f752 | ||
|
1fea980930 | ||
|
4c952da6cb | ||
|
52f877d606 | ||
|
82d459f015 | ||
|
ece26b847b | ||
|
e9ecfeaca6 | ||
|
69fa3c4876 | ||
|
8a38f62915 | ||
|
c200758c26 | ||
|
1828c6b1cd | ||
|
96f8eec50b | ||
|
88d419456d | ||
|
a7e96675bd | ||
|
bfc81767ba | ||
|
65c3f532cf | ||
|
a7df2fe7f3 | ||
|
4a0854484f | ||
|
8ad81a35e1 | ||
|
9ea80a7506 | ||
|
b3be9868d8 | ||
|
8f273d5e02 | ||
|
96f6f218ef | ||
|
809603c16c | ||
|
19a13b316e | ||
|
de0039546b | ||
|
7272610a02 | ||
|
5b4082ac87 | ||
|
39d1537211 | ||
|
a732ebf521 | ||
|
fef3dfc43e | ||
|
909fdc99ad | ||
|
db4895fbe5 | ||
|
f42ebef9d1 | ||
|
4c2f904ac4 | ||
|
cfcd0f888d | ||
|
1253e7bfcb | ||
|
710c39027b | ||
|
95ddb57562 | ||
|
1b8a768279 | ||
|
f22403a317 | ||
|
f64c32113a | ||
|
ad776cc57b | ||
|
78c6f713dd | ||
|
689537d75b | ||
|
6757f42c66 | ||
|
ffa85a41d0 | ||
|
e61e6a864b | ||
|
c65819e289 | ||
|
dd4bb00a24 | ||
|
c481a773af | ||
|
cc951ac6c8 | ||
|
d8e476f4db | ||
|
1395f78679 | ||
|
46436158eb | ||
|
6cef9514ae | ||
|
21f599eea4 | ||
|
d564e397e2 | ||
|
656f67eeb7 | ||
|
c2531b7ff2 | ||
|
753138a7cc | ||
|
716f7cd3f7 | ||
|
dfc1f76be7 | ||
|
7f25cc9d4e | ||
|
327e7a4ccc | ||
|
7b32900c55 | ||
|
1440db1570 | ||
|
2e7fef7d18 | ||
|
d1a8ed0214 | ||
|
4b7017ef35 | ||
|
c5bece5cef | ||
|
490899e271 | ||
|
b9ea25c25c | ||
|
970d2e3f45 | ||
|
dd9249a87f | ||
|
aa32fc1708 | ||
|
160a4208ed | ||
|
395550c671 | ||
|
7d44735893 | ||
|
21e9fe4f55 | ||
|
3b568fbe77 | ||
|
7ee69fc7b2 | ||
|
365707e4eb | ||
|
91c6b56c99 | ||
|
da6b68d2b7 | ||
|
6aa66f59ce | ||
|
4040986545 | ||
|
bb7beb5ade | ||
|
032dabe137 | ||
|
c306e448b3 | ||
|
55c9576d83 | ||
|
99bcccd884 | ||
|
c300c530ea | ||
|
f771046a00 | ||
|
c289d7c176 | ||
|
5c3c95a96c | ||
|
d54321c1ca | ||
|
1362609120 | ||
|
89ac1d6197 | ||
|
1cfbe9c3d0 | ||
|
3a4c6c18b3 | ||
|
5e9f5c17b5 | ||
|
ff5928754f | ||
|
396056e011 | ||
|
619a19f6fd | ||
|
808921dd3e | ||
|
6a47dc26e4 | ||
|
df68ef8553 | ||
|
3bb95a09bb | ||
|
9c7874214e | ||
|
f08bc40fbb | ||
|
453a50dc95 | ||
|
ff41829b3f | ||
|
7437d34eb9 | ||
|
eb3049d6b5 | ||
|
601c5fd734 | ||
|
89f6b8751e | ||
|
65beb0fc22 | ||
|
d07b14f4d2 | ||
|
4f50c68296 | ||
|
fab9449414 | ||
|
0a51f38963 | ||
|
614c3e6721 | ||
|
c73e22dadb | ||
|
de6c0037b7 | ||
|
1a9a0c2577 | ||
|
5b63583c0b | ||
|
0fe3fafac1 | ||
|
d400c50ca3 | ||
|
4c150d8eb5 | ||
|
2616e6857c | ||
|
1772cfd4d8 | ||
|
d0ea070c23 | ||
|
db267433c0 | ||
|
452f2f0394 | ||
|
faeb572dd5 | ||
|
f964fe3ee5 | ||
|
00990ec307 | ||
|
a5363b9e5d | ||
|
3b0e6720af | ||
|
bfcb978079 | ||
|
66a3b07183 | ||
|
fd25a8cdf2 | ||
|
4abdc43688 | ||
|
4d16c5abc0 | ||
|
697b05c90c | ||
|
3c45a56934 | ||
|
ee6fc6492f | ||
|
8891967f2b | ||
|
4ad658f91e | ||
|
b726f60f90 | ||
|
fd148d1ef5 | ||
|
baa3df51ad | ||
|
cd6408b47a | ||
|
d70bfea8e9 | ||
|
5aaf752013 | ||
|
76258c8e3a | ||
|
c739db0e29 | ||
|
676e2e088e | ||
|
83a687f891 | ||
|
cf030e9ffc | ||
|
2cbe094b91 | ||
|
4fa4b8525e | ||
|
3d65019e98 | ||
|
98e30f82b9 | ||
|
8f7a8ada18 | ||
|
f52100c46e | ||
|
2432e53652 | ||
|
888dfe499d | ||
|
c655759cef | ||
|
334acbfc39 | ||
|
dfc131c7ec | ||
|
55874470ff | ||
|
bb8baa2b76 | ||
|
38b25599d8 | ||
|
df0b4d6684 | ||
|
fcaa9aa22d | ||
|
1ed17df7a0 | ||
|
0ec744a3a5 | ||
|
b8828023e6 | ||
|
3a2aa2bd80 | ||
|
a379ddefc3 | ||
|
fe142b10bf | ||
|
e090c1f1a9 | ||
|
a313417879 | ||
|
8916ff8ffe | ||
|
02892c59d1 | ||
|
bdd2f68ab5 | ||
|
3e0fab6b93 | ||
|
e8986d18c2 | ||
|
972c0fa998 | ||
|
c8a936cdcc | ||
|
6fd6ff2ea1 | ||
|
cb5c739f93 | ||
|
228b35c111 | ||
|
6e70079e63 | ||
|
c1882fe44e | ||
|
684624005a | ||
|
1fb5d389db | ||
|
794d9d266e | ||
|
60fdeda599 | ||
|
a29306cb1e | ||
|
f00f5508d4 | ||
|
063592f350 | ||
|
6806c28b1e | ||
|
e3557f681c | ||
|
f83b3c8af2 | ||
|
b91fc17a19 | ||
|
37482c81c7 | ||
|
f2019e61db | ||
|
fbd79d8fea | ||
|
fb81686a89 | ||
|
d6c2ef3b71 | ||
|
e22990302a | ||
|
42ff22f222 | ||
|
4d36a0bf35 | ||
|
af0d876bb7 | ||
|
ffef28a7e8 | ||
|
f942d6f53c | ||
|
7d9af6d700 | ||
|
8f4e0705dc | ||
|
87bdfbb02c | ||
|
e4be37eb60 | ||
|
8224e7ac72 | ||
|
2dca8f935c | ||
|
f595c0dc1b | ||
|
3265013268 | ||
|
351559fcfa | ||
|
6c805ecb0f | ||
|
8a432b42a2 | ||
|
aee4634ee5 | ||
|
cc9a4c1720 | ||
|
d607312080 | ||
|
41dac661a0 | ||
|
41a922928e | ||
|
182272c0ab | ||
|
e1d81d096c | ||
|
47b7bfd2ba | ||
|
5e302ae2cc | ||
|
34c63b8e4f | ||
|
0429008b16 | ||
|
6ea827cde5 | ||
|
cdb2fcb554 | ||
|
4f50bf23d3 | ||
|
18dc994de7 | ||
|
5e7b3030b9 | ||
|
7c47c7cdaf | ||
|
e7b3909fd1 | ||
|
27c76db956 | ||
|
e763dac72e | ||
|
8ab2c79b77 | ||
|
12be5ccbb7 | ||
|
8ad1b09a3a | ||
|
c2d4f05ce0 | ||
|
c475047501 | ||
|
3604816b9c | ||
|
cb0d2616ff | ||
|
229ef9d776 | ||
|
d3329bb36b | ||
|
5590a2a943 | ||
|
736ccd34f0 | ||
|
b6d85b9e31 |
43
.gitlab-ci.yml
Normal file
43
.gitlab-ci.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
stages:
|
||||
- build
|
||||
- flatpak
|
||||
|
||||
gtk:
|
||||
image: ebassi/gitlab-gtk:latest
|
||||
stage: build
|
||||
before_script:
|
||||
- export CCACHE_DISABLE=true_
|
||||
script:
|
||||
- bash -x ./.gitlab-ci/test-docker.sh
|
||||
cache:
|
||||
paths:
|
||||
- subprojects/gdk-pixbuf/
|
||||
- subprojects/glib/
|
||||
- subprojects/graphene/
|
||||
- subprojects/libepoxy/
|
||||
- subprojects/pango/
|
||||
artifacts:
|
||||
when: on_failure
|
||||
name: "gtk-${CI_COMMIT_REF_NAME}"
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||
|
||||
flatpak:demo:
|
||||
image: registry.gitlab.com/alatiera/gnome-nightly-oci/gnome-master:latest
|
||||
stage: flatpak
|
||||
script:
|
||||
- bash -x ./.gitlab-ci/flatpak-build.sh org.gtk.Demo
|
||||
artifacts:
|
||||
paths:
|
||||
- org.gtk.Demo-dev.flatpak
|
||||
expire_in: 1 day
|
||||
|
||||
flatpak:widget-factory:
|
||||
image: registry.gitlab.com/alatiera/gnome-nightly-oci/gnome-master:latest
|
||||
stage: flatpak
|
||||
script:
|
||||
- bash -x ./.gitlab-ci/flatpak-build.sh org.gtk.WidgetFactory
|
||||
artifacts:
|
||||
paths:
|
||||
- org.gtk.WidgetFactory-dev.flatpak
|
||||
expire_in: 1 day
|
79
.gitlab-ci/Dockerfile
Normal file
79
.gitlab-ci/Dockerfile
Normal file
@@ -0,0 +1,79 @@
|
||||
FROM fedora:27
|
||||
|
||||
RUN dnf -y install \
|
||||
adwaita-icon-theme \
|
||||
atk-devel \
|
||||
at-spi2-atk-devel \
|
||||
avahi-gobject-devel \
|
||||
cairo-devel \
|
||||
cairo-gobject-devel \
|
||||
ccache \
|
||||
colord-devel \
|
||||
cups-devel \
|
||||
desktop-file-utils \
|
||||
elfutils-libelf-devel \
|
||||
fribidi-devel \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
gdk-pixbuf2-devel \
|
||||
gdk-pixbuf2-modules \
|
||||
gettext \
|
||||
git \
|
||||
glib2-devel \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
gobject-introspection-devel \
|
||||
graphene-devel \
|
||||
gstreamer1-devel \
|
||||
gstreamer1-plugins-good \
|
||||
gstreamer1-plugins-bad-free-devel \
|
||||
gstreamer1-plugins-base-devel \
|
||||
iso-codes \
|
||||
itstool \
|
||||
json-glib-devel \
|
||||
libattr-devel \
|
||||
libepoxy-devel \
|
||||
libffi-devel \
|
||||
libmount-devel \
|
||||
librsvg2 \
|
||||
libselinux-devel \
|
||||
libXcomposite-devel \
|
||||
libXcursor-devel \
|
||||
libXcursor-devel \
|
||||
libXdamage-devel \
|
||||
libXfixes-devel \
|
||||
libXi-devel \
|
||||
libXinerama-devel \
|
||||
libxkbcommon-devel \
|
||||
libXrandr-devel \
|
||||
libXrender-devel \
|
||||
libxslt \
|
||||
mesa-dri-drivers \
|
||||
mesa-libEGL-devel \
|
||||
mesa-libwayland-egl-devel \
|
||||
ninja-build \
|
||||
pango-devel \
|
||||
pcre-devel \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-wheel \
|
||||
redhat-rpm-config \
|
||||
sassc \
|
||||
systemtap-sdt-devel \
|
||||
vulkan-devel \
|
||||
wayland-devel \
|
||||
wayland-protocols-devel \
|
||||
which \
|
||||
xorg-x11-server-Xvfb \
|
||||
&& dnf clean all
|
||||
|
||||
RUN pip3 install meson
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
||||
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user
|
||||
|
||||
ENV LANG C.UTF-8
|
44
.gitlab-ci/flatpak-build.sh
Normal file
44
.gitlab-ci/flatpak-build.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
appid=$1
|
||||
|
||||
builddir=app
|
||||
repodir=repo
|
||||
|
||||
flatpak-builder \
|
||||
--stop-at=gtk \
|
||||
${builddir} \
|
||||
build-aux/flatpak/${appid}.json
|
||||
|
||||
flatpak-builder \
|
||||
--run ${builddir} build-aux/flatpak/${appid}.json \
|
||||
meson \
|
||||
--prefix /app \
|
||||
--libdir /app/lib \
|
||||
--buildtype debug \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dprint-backends=file \
|
||||
-Dbuild-tests=false \
|
||||
-Dbuild-examples=false \
|
||||
-Dintrospection=false \
|
||||
-Ddemos=true \
|
||||
_build .
|
||||
|
||||
flatpak-builder \
|
||||
--run ${builddir} build-aux/flatpak/${appid}.json \
|
||||
ninja -C _build install
|
||||
|
||||
flatpak-builder \
|
||||
--finish-only \
|
||||
--repo=${repodir} \
|
||||
${builddir} \
|
||||
build-aux/flatpak/${appid}.json
|
||||
|
||||
flatpak build-bundle \
|
||||
${repodir} \
|
||||
${appid}-dev.flatpak \
|
||||
--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
|
||||
${appid}
|
11
.gitlab-ci/run-docker.sh
Executable file
11
.gitlab-ci/run-docker.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
TAG="ebassi/gitlab-gtk:latest"
|
||||
|
||||
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
|
||||
--file "Dockerfile" .
|
||||
sudo docker run --rm --security-opt label=disable \
|
||||
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
|
||||
--tty --interactive "${TAG}" bash
|
23
.gitlab-ci/test-docker.sh
Executable file
23
.gitlab-ci/test-docker.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
srcdir=$(pwd)
|
||||
|
||||
meson \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dbroadway-backend=true \
|
||||
-Dvulkan=yes \
|
||||
_build $srcdir
|
||||
|
||||
cd _build
|
||||
|
||||
ninja
|
||||
|
||||
xvfb-run -a -s "-screen 0 1024x768x24" \
|
||||
meson test \
|
||||
--print-errorlogs \
|
||||
--suite=gtk+ \
|
||||
--no-suite=gtk+:gsk \
|
||||
--no-suite=gtk+:a11y
|
39
.gitlab/issue_templates/Bug.md
Normal file
39
.gitlab/issue_templates/Bug.md
Normal file
@@ -0,0 +1,39 @@
|
||||
## Steps to reproduce
|
||||
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
|
||||
<!--
|
||||
You should try and reproduce with the demos applications available
|
||||
under the `demos` directory, or the test programs in the `tests` directory.
|
||||
Alternatively, please attach a *small and self-contained* example that
|
||||
exhibits the issue.
|
||||
-->
|
||||
|
||||
## Current behavior
|
||||
<!--
|
||||
Please describe the current behaviour
|
||||
-->
|
||||
|
||||
## Expected outcome
|
||||
<!--
|
||||
Please describe the expected outcome
|
||||
-->
|
||||
|
||||
## Version information
|
||||
<!--
|
||||
- which version of GTK+ you are using
|
||||
- what operating system and version
|
||||
- for Linux, which distribution
|
||||
- if you built GTK+ yourself, the list of options used to configure the build
|
||||
-->
|
||||
|
||||
## Additional information
|
||||
<!--
|
||||
- If the bug was a crash, the exact text that was printed out
|
||||
when the crash occurred.
|
||||
- If the bug was a crash, attaching a stack trace obtained using
|
||||
GDB is appreciated; follow the instructions on the wiki:
|
||||
https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces
|
||||
-->
|
@@ -1,30 +1,41 @@
|
||||
If you want to hack on the GTK+ project, you'll need to have the development
|
||||
tools appropriate for your operating system, including:
|
||||
|
||||
- Python (2.7 or 3.x)
|
||||
- Meson
|
||||
- Ninja
|
||||
- Gettext (19.7 or newer)
|
||||
- a C99 compatible compiler
|
||||
- Python 3.x
|
||||
- Meson
|
||||
- Ninja
|
||||
- Gettext (19.7 or newer)
|
||||
- a C99 compatible compiler
|
||||
|
||||
Up-to-date instructions about developing GNOME applications and libraries
|
||||
can be found here:
|
||||
|
||||
https://developer.gnome.org
|
||||
* https://developer.gnome.org
|
||||
|
||||
Information about using git with GNOME can be found here:
|
||||
Information about using GitLab with GNOME can be found here:
|
||||
|
||||
https://wiki.gnome.org/Git
|
||||
* https://wiki.gnome.org/GitLab
|
||||
|
||||
In order to get Git GTK+ installed on your system, you need to have the
|
||||
required versions of all the GTK+ dependencies; typically, this means a
|
||||
recent version of GLib, Cairo, Pango, and ATK.
|
||||
recent version of GLib, Cairo, Pango, and ATK, as well as the platform
|
||||
specific dependencies for the windowing system you are using (Wayland, X11,
|
||||
Windows, or macOS).
|
||||
|
||||
**Note**: if you plan to push changes to back to the master repository and
|
||||
have a GNOME account, you want to use the following instead:
|
||||
You should start by forking the GTK repository from the GitLab web UI, and
|
||||
cloning from your fork:
|
||||
|
||||
```ssh
|
||||
$ git clone https://gitlab.gnome.org/yourusername/gtk.git
|
||||
$ cd gtk
|
||||
```
|
||||
|
||||
**Note**: if you plan to push changes to back to the main repository and
|
||||
have a GNOME account, you can skip the fork, and use the following instead:
|
||||
|
||||
```sh
|
||||
$ git clone ssh://<username>@git.gnome.org/git/gtk+
|
||||
$ git clone git@gitlab.gnome.org:GNOME/gtk.git
|
||||
$ cd gtk
|
||||
```
|
||||
|
||||
To compile the Git version of GTK+ on your system, you will need to
|
||||
@@ -32,9 +43,21 @@ configure your build using Meson:
|
||||
|
||||
```sh
|
||||
$ meson _builddir .
|
||||
$ cd _builddir
|
||||
$ ninja
|
||||
```
|
||||
|
||||
For information about submitting patches and pushing changes to Git, see the
|
||||
`README.md` and `README.commits` files. In particular, don't, under any
|
||||
circumstances, push anything to Git before reading and understanding
|
||||
`README.commmits`.
|
||||
**Note**: For information about submitting patches and pushing changes
|
||||
to Git, see the `README.md` and `README.commits` files. In particular,
|
||||
don't, under any circumstances, push anything to Git before reading and
|
||||
understanding `README.commmits`.
|
||||
|
||||
Typically, you should work on your own branch:
|
||||
|
||||
```sh
|
||||
$ git checkout -b your-branch
|
||||
```
|
||||
|
||||
Once you've finished working on the bug fix or feature, push the branch
|
||||
to the Git repository and open a new merge request, to let the GTK
|
||||
maintainers review your contribution.
|
||||
|
46
README.md
46
README.md
@@ -1,6 +1,8 @@
|
||||
GTK+ — The GTK toolkit
|
||||
======================
|
||||
|
||||
[](https://gitlab.gnome.org/GNOME/gtk/pipelines)
|
||||
|
||||
General information
|
||||
-------------------
|
||||
|
||||
@@ -34,8 +36,8 @@ Building and installing
|
||||
|
||||
In order to build GTK+ you will need:
|
||||
|
||||
- a C99 compatible compiler
|
||||
- Python 3
|
||||
- [a C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
|
||||
- [Python 3](https://www.python.org/)
|
||||
- [Meson](http://mesonbuild.com)
|
||||
- [Ninja](https://ninja-build.org)
|
||||
|
||||
@@ -59,10 +61,10 @@ If you are building the X11 backend, you will also need:
|
||||
- xrender
|
||||
- xi
|
||||
- xext
|
||||
- xfixes (optional)
|
||||
- xcursor (optional)
|
||||
- xdamage (optional)
|
||||
- xcomposite (optional)
|
||||
- xfixes
|
||||
- xcursor
|
||||
- xdamage
|
||||
- xcomposite
|
||||
- [atk-bridge-2.0](https://download.gnome.org/sources/at-spi2-atk)
|
||||
|
||||
If you are building the Wayland backend, you will also need:
|
||||
@@ -105,8 +107,7 @@ Or [online](https://developer.gnome.org/gtk4/stable/gtk-building.html)
|
||||
How to report bugs
|
||||
------------------
|
||||
|
||||
Bugs should be reported to the GNOME [bug tracking system](https://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2b).
|
||||
You will need an account for yourself.
|
||||
Bugs should be reported on the [issues page](https://gitlab.gnome.org/GNOME/gtk/issues/new).
|
||||
|
||||
In the bug report please include:
|
||||
|
||||
@@ -121,11 +122,12 @@ In the bug report please include:
|
||||
|
||||
* How to reproduce the bug.
|
||||
|
||||
If you can reproduce it with one of the test programs that are built
|
||||
in the tests/ subdirectory, that will be most convenient. Otherwise,
|
||||
please include a short test program that exhibits the behavior.
|
||||
As a last resort, you can also provide a pointer to a larger piece
|
||||
of software that can be downloaded.
|
||||
If you can reproduce it with one of the demo applications that are
|
||||
built in the demos/ subdirectory, on one of the test programs that
|
||||
are built in the tests/ subdirectory, that will be most convenient.
|
||||
Otherwise, please include a short test program that exhibits the
|
||||
behavior. As a last resort, you can also provide a pointer to a
|
||||
larger piece of software that can be downloaded.
|
||||
|
||||
* If the bug was a crash, the exact text that was printed out
|
||||
when the crash occurred.
|
||||
@@ -133,24 +135,6 @@ In the bug report please include:
|
||||
* Further information such as stack traces may be useful, but
|
||||
is not necessary.
|
||||
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Patches should also be submitted to the bug tracking system. If the patch
|
||||
fixes an existing bug, add the patch as an attachment to that bug report;
|
||||
otherwise, enter a new bug report that describes the patch, and attach the
|
||||
patch to that bug report.
|
||||
|
||||
Patches should be in Git-formatted form. You should use `git format-patch`
|
||||
to generate them. We recommend using [git-bz](http://git.fishsoup.net/man/git-bz.html).
|
||||
|
||||
For more information on the recommended workflow, please read
|
||||
[this wiki page](https://wiki.gnome.org/Git/WorkingWithPatches).
|
||||
|
||||
Please, follow the `CODING_STYLE` document in order to conform to GTK+'s
|
||||
coding style when submitting a code contribution.
|
||||
|
||||
Release notes
|
||||
-------------
|
||||
|
||||
|
59
build-aux/flatpak/org.gtk.Demo.json
Normal file
59
build-aux/flatpak/org.gtk.Demo.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"app-id": "org.gtk.Demo",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "master",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"command": "gtk4-demo",
|
||||
"tags": ["devel", "development", "nightly"],
|
||||
"rename-desktop-file": "gtk4-demo.desktop",
|
||||
"rename-icon": "gtk4-demo",
|
||||
"desktop-file-name-prefix": "(Development) ",
|
||||
"finish-args": [
|
||||
"--device=dri",
|
||||
"--share=ipc",
|
||||
"--socket=x11",
|
||||
"--socket=wayland",
|
||||
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*",
|
||||
"--talk-name=ca.desrt.conf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
|
||||
],
|
||||
"cleanup": [
|
||||
"/include",
|
||||
"/lib/pkgconfig", "/share/pkgconfig",
|
||||
"/share/aclocal",
|
||||
"/man", "/share/man", "/share/gtk-doc",
|
||||
"*.la", ".a",
|
||||
"/lib/girepository-1.0",
|
||||
"/share/gir-1.0",
|
||||
"/share/doc"
|
||||
],
|
||||
"modules": [
|
||||
{
|
||||
"name": "graphene",
|
||||
"buildsystem": "meson",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/ebassi/graphene.git"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gtk",
|
||||
"buildsystem": "meson",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/GNOME/gtk.git"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
59
build-aux/flatpak/org.gtk.WidgetFactory.json
Normal file
59
build-aux/flatpak/org.gtk.WidgetFactory.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"app-id": "org.gtk.WidgetFactory",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "master",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"command": "gtk4-widget-factory",
|
||||
"tags": ["devel", "development", "nightly"],
|
||||
"rename-desktop-file": "gtk4-widget-factory.desktop",
|
||||
"rename-icon": "gtk4-widget-factory",
|
||||
"desktop-file-name-prefix": "(Development) ",
|
||||
"finish-args": [
|
||||
"--device=dri",
|
||||
"--share=ipc",
|
||||
"--socket=x11",
|
||||
"--socket=wayland",
|
||||
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*",
|
||||
"--talk-name=ca.desrt.conf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
|
||||
],
|
||||
"cleanup": [
|
||||
"/include",
|
||||
"/lib/pkgconfig", "/share/pkgconfig",
|
||||
"/share/aclocal",
|
||||
"/man", "/share/man", "/share/gtk-doc",
|
||||
"*.la", ".a",
|
||||
"/lib/girepository-1.0",
|
||||
"/share/gir-1.0",
|
||||
"/share/doc"
|
||||
],
|
||||
"modules": [
|
||||
{
|
||||
"name": "graphene",
|
||||
"buildsystem": "meson",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/ebassi/graphene.git"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gtk",
|
||||
"buildsystem": "meson",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/GNOME/gtk.git"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@@ -16,6 +16,11 @@ if [ -z "$DESTDIR" ]; then
|
||||
echo Updating icon cache...
|
||||
gtk-update-icon-cache -q -t -f ${gtk_datadir}/icons/hicolor
|
||||
|
||||
echo Updating input method modules cache...
|
||||
gtk4-query-immodules > ${gtk_libdir}/gtk-${gtk_api_version}/${gtk_abi_version}/immodules.cache
|
||||
echo Updating module cache for print backends...
|
||||
mkdir -p ${gtk_libdir}/gtk-4.0/4.0.0/printbackends
|
||||
gio-querymodules ${gtk_libdir}/gtk-4.0/4.0.0/printbackends
|
||||
|
||||
echo Updating module cache for input methods...
|
||||
mkdir -p ${gtk_libdir}/gtk-4.0/4.0.0/immodules
|
||||
gio-querymodules ${gtk_libdir}/gtk-4.0/4.0.0/immodules
|
||||
fi
|
||||
|
@@ -41,6 +41,9 @@
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#mesondefine HAVE_DLFCN_H
|
||||
|
||||
/* Have the ffmpeg library */
|
||||
#mesondefine HAVE_FFMPEG
|
||||
|
||||
/* Define to 1 if you have the <ftw.h> header file. */
|
||||
#mesondefine HAVE_FTW_H
|
||||
|
||||
@@ -53,6 +56,9 @@
|
||||
/* Define if gio-unix is available */
|
||||
#mesondefine HAVE_GIO_UNIX
|
||||
|
||||
/* Define if GStreamer support is available */
|
||||
#mesondefine HAVE_GSTREAMER
|
||||
|
||||
/* Define to 1 if you have the `httpGetAuthString' function. */
|
||||
#mesondefine HAVE_HTTPGETAUTHSTRING
|
||||
|
||||
|
@@ -470,14 +470,14 @@ demo_application_window_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
window_state_changed (GtkWidget *widget)
|
||||
surface_state_changed (GtkWidget *widget)
|
||||
{
|
||||
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
|
||||
GdkWindowState new_state;
|
||||
GdkSurfaceState new_state;
|
||||
|
||||
new_state = gdk_window_get_state (gtk_widget_get_window (widget));
|
||||
window->maximized = (new_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
|
||||
window->fullscreen = (new_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
|
||||
new_state = gdk_surface_get_state (gtk_widget_get_surface (widget));
|
||||
window->maximized = (new_state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
|
||||
window->fullscreen = (new_state & GDK_SURFACE_STATE_FULLSCREEN) != 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -485,15 +485,15 @@ demo_application_window_realize (GtkWidget *widget)
|
||||
{
|
||||
GTK_WIDGET_CLASS (demo_application_window_parent_class)->realize (widget);
|
||||
|
||||
g_signal_connect_swapped (gtk_widget_get_window (widget), "notify::state",
|
||||
G_CALLBACK (window_state_changed), widget);
|
||||
g_signal_connect_swapped (gtk_widget_get_surface (widget), "notify::state",
|
||||
G_CALLBACK (surface_state_changed), widget);
|
||||
}
|
||||
|
||||
static void
|
||||
demo_application_window_unrealize (GtkWidget *widget)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (gtk_widget_get_window (widget),
|
||||
window_state_changed, widget);
|
||||
g_signal_handlers_disconnect_by_func (gtk_widget_get_surface (widget),
|
||||
surface_state_changed, widget);
|
||||
|
||||
GTK_WIDGET_CLASS (demo_application_window_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
@@ -7,35 +7,29 @@
|
||||
<property name="icon-name">document-open</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="primary-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkMenuToolButton" id="menutool">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">document-open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">application-exit</property>
|
||||
<property name="action-name">app.quit</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">applications-other</property>
|
||||
<property name="action-name">win.logo</property>
|
||||
</object>
|
||||
@@ -54,7 +48,6 @@
|
||||
<object class="GtkBox" id="content_area">
|
||||
<child>
|
||||
<object class="GtkLabel" id="message">
|
||||
<property name="visible">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -64,10 +57,9 @@
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="label" translatable="yes">_OK</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
<signal name="clicked" handler="clicked_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
@@ -81,11 +73,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<child>
|
||||
<object class="GtkTextView">
|
||||
<property name="visible">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="buffer">buffer</property>
|
||||
@@ -100,7 +90,6 @@
|
||||
<child>
|
||||
<object class="GtkStatusbar" id="status">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
|
@@ -2,21 +2,16 @@
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="resizable">0</property>
|
||||
<property name="title">CSS Blend Modes</property>
|
||||
<property name="default_width">400</property>
|
||||
<property name="default_height">300</property>
|
||||
<property name="default-width">400</property>
|
||||
<property name="default-height">300</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">12</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="row-spacing">12</property>
|
||||
<property name="column-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Blend mode:</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
@@ -24,128 +19,108 @@
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<property name="min_content_width">150</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="min-content-width">150</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackSwitcher">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="hhomogeneous">False</property>
|
||||
<property name="vhomogeneous">False</property>
|
||||
<property name="transition_type">crossfade</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="hhomogeneous">0</property>
|
||||
<property name="vhomogeneous">0</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="row_spacing">12</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="row-spacing">12</property>
|
||||
<property name="column-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Duck</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Background</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<style>
|
||||
<class name="duck"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<style>
|
||||
<class name="gradient"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">
|
||||
Blended picture</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="blend0"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -157,87 +132,72 @@ Blended picture</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="row_spacing">12</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="row-spacing">12</property>
|
||||
<property name="column-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Red</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Blue</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<style>
|
||||
<class name="red"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<style>
|
||||
<class name="blue"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">
|
||||
Blended picture</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="blend1"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -249,71 +209,59 @@ Blended picture</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="row-spacing">6</property>
|
||||
<property name="column-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<style>
|
||||
<class name="cyan"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<style>
|
||||
<class name="magenta"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<style>
|
||||
<class name="yellow"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="blend2"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Cyan</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
@@ -321,14 +269,12 @@ Blended picture</property>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Magenta</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
@@ -336,14 +282,12 @@ Blended picture</property>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Yellow</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
@@ -351,14 +295,12 @@ Blended picture</property>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Blended picture</property>
|
||||
<property name="xalign">0</property>
|
||||
<attributes>
|
||||
@@ -366,8 +308,8 @@ Blended picture</property>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@@ -378,14 +320,13 @@ Blended picture</property>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@@ -68,19 +68,19 @@ enum
|
||||
static GtkWidget *
|
||||
find_toplevel_at_pointer (GdkDisplay *display)
|
||||
{
|
||||
GdkWindow *pointer_window;
|
||||
GdkSurface *pointer_window;
|
||||
GtkWidget *widget = NULL;
|
||||
|
||||
pointer_window = gdk_device_get_window_at_position (gtk_get_current_event_device (),
|
||||
pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (),
|
||||
NULL, NULL);
|
||||
|
||||
/* The user data field of a GdkWindow is used to store a pointer
|
||||
/* The user data field of a GdkSurface is used to store a pointer
|
||||
* to the widget that created it.
|
||||
*/
|
||||
if (pointer_window)
|
||||
{
|
||||
gpointer widget_ptr;
|
||||
gdk_window_get_user_data (pointer_window, &widget_ptr);
|
||||
gdk_surface_get_user_data (pointer_window, &widget_ptr);
|
||||
widget = widget_ptr;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ query_for_toplevel (GdkDisplay *display,
|
||||
device = gtk_get_current_event_device ();
|
||||
|
||||
if (gdk_seat_grab (gdk_device_get_seat (device),
|
||||
gtk_widget_get_window (popup),
|
||||
gtk_widget_get_surface (popup),
|
||||
GDK_SEAT_CAPABILITY_ALL_POINTING,
|
||||
FALSE, cursor, NULL, NULL, NULL) == GDK_GRAB_SUCCESS)
|
||||
{
|
||||
|
@@ -93,8 +93,8 @@ paste_button_clicked (GtkWidget *button,
|
||||
gdk_clipboard_read_text_async (clipboard, NULL, paste_received, entry);
|
||||
}
|
||||
|
||||
static GdkTexture *
|
||||
get_image_texture (GtkImage *image)
|
||||
static GdkPaintable *
|
||||
get_image_paintable (GtkImage *image)
|
||||
{
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
@@ -102,15 +102,15 @@ get_image_texture (GtkImage *image)
|
||||
|
||||
switch (gtk_image_get_storage_type (image))
|
||||
{
|
||||
case GTK_IMAGE_TEXTURE:
|
||||
return g_object_ref (gtk_image_get_texture (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);
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
|
||||
icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, 48, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
|
||||
if (icon_info == NULL)
|
||||
return NULL;
|
||||
return gtk_icon_info_load_texture (icon_info);
|
||||
return GDK_PAINTABLE (gtk_icon_info_load_texture (icon_info));
|
||||
default:
|
||||
g_warning ("Image storage type %d not handled",
|
||||
gtk_image_get_storage_type (image));
|
||||
@@ -123,11 +123,14 @@ drag_begin (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gpointer data)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
texture = get_image_texture (GTK_IMAGE (widget));
|
||||
if (texture)
|
||||
gtk_drag_set_icon_texture (context, texture, -2, -2);
|
||||
paintable = get_image_paintable (GTK_IMAGE (widget));
|
||||
if (paintable)
|
||||
{
|
||||
gtk_drag_set_icon_paintable (context, paintable, -2, -2);
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -138,11 +141,11 @@ drag_data_get (GtkWidget *widget,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
texture = get_image_texture (GTK_IMAGE (widget));
|
||||
if (texture)
|
||||
gtk_selection_data_set_texture (selection_data, texture);
|
||||
paintable = get_image_paintable (GTK_IMAGE (widget));
|
||||
if (GDK_IS_TEXTURE (paintable))
|
||||
gtk_selection_data_set_texture (selection_data, GDK_TEXTURE (paintable));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -157,7 +160,7 @@ drag_data_received (GtkWidget *widget,
|
||||
GdkTexture *texture;
|
||||
|
||||
texture = gtk_selection_data_get_texture (selection_data);
|
||||
gtk_image_set_from_texture (GTK_IMAGE (data), texture);
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (data), GDK_PAINTABLE (texture));
|
||||
g_object_unref (texture);
|
||||
}
|
||||
}
|
||||
@@ -167,16 +170,16 @@ copy_image (GtkMenuItem *item,
|
||||
gpointer data)
|
||||
{
|
||||
GdkClipboard *clipboard;
|
||||
GdkTexture *texture;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
|
||||
texture = get_image_texture (GTK_IMAGE (data));
|
||||
paintable = get_image_paintable (GTK_IMAGE (data));
|
||||
|
||||
if (texture)
|
||||
{
|
||||
gdk_clipboard_set_texture (clipboard, texture);
|
||||
g_object_unref (texture);
|
||||
}
|
||||
if (GDK_IS_TEXTURE (paintable))
|
||||
gdk_clipboard_set_texture (clipboard, GDK_TEXTURE (paintable));
|
||||
|
||||
if (paintable)
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -190,7 +193,7 @@ paste_image_received (GObject *source,
|
||||
if (texture == NULL)
|
||||
return;
|
||||
|
||||
gtk_image_set_from_texture (GTK_IMAGE (data), texture);
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (data), GDK_PAINTABLE (texture));
|
||||
g_object_unref (texture);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -121,6 +121,7 @@
|
||||
<gresource prefix="/images">
|
||||
<file>alphatest.png</file>
|
||||
<file>floppybuddy.gif</file>
|
||||
<file>gtk-logo.webm</file>
|
||||
</gresource>
|
||||
<gresource prefix="/pixbufs">
|
||||
<file>apple-red.png</file>
|
||||
@@ -181,6 +182,9 @@
|
||||
<file>overlay.c</file>
|
||||
<file>overlay2.c</file>
|
||||
<file>pagesetup.c</file>
|
||||
<file>paintable.c</file>
|
||||
<file>paintable_animated.c</file>
|
||||
<file>paintable_mediastream.c</file>
|
||||
<file>panes.c</file>
|
||||
<file>pickers.c</file>
|
||||
<file>pixbufs.c</file>
|
||||
@@ -201,10 +205,10 @@
|
||||
<file>textview.c</file>
|
||||
<file>textscroll.c</file>
|
||||
<file>theming_style_classes.c</file>
|
||||
<file>toolpalette.c</file>
|
||||
<file>transparent.c</file>
|
||||
<file>tree_store.c</file>
|
||||
<file>textmask.c</file>
|
||||
<file>video_player.c</file>
|
||||
</gresource>
|
||||
<gresource prefix="/textview">
|
||||
<file>floppybuddy.gif</file>
|
||||
|
@@ -31,16 +31,14 @@
|
||||
</accessibility>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="default_height">250</property>
|
||||
<property name="default_width">440</property>
|
||||
<property name="default-height">250</property>
|
||||
<property name="default-width">440</property>
|
||||
<property name="title" translatable="yes">Builder</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox1">
|
||||
<property name="visible">1</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkMenuBar" id="menubar1">
|
||||
<property name="visible">1</property>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-menubar">
|
||||
<property name="AtkObject::accessible-name">The menubar</property>
|
||||
@@ -48,35 +46,30 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">1</property>
|
||||
<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="visible">1</property>
|
||||
<property name="label" translatable="yes">_New</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="open_item">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">_Open</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="save_item">
|
||||
<property name="visible">1</property>
|
||||
<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="visible">1</property>
|
||||
<property name="label" translatable="yes">Save _As</property>
|
||||
<property name="use-underline">1</property>
|
||||
<accelerator key="s" modifiers="primary | shift-mask" signal="activate"/>
|
||||
@@ -84,12 +77,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="quit_item">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">_Quit</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.quit</property>
|
||||
@@ -101,28 +92,24 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">1</property>
|
||||
<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="visible">1</property>
|
||||
<property name="label" translatable="yes">_Copy</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="cut_item">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">_Cut</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="paste_item">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">_Paste</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
@@ -133,14 +120,12 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">1</property>
|
||||
<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="visible">1</property>
|
||||
<property name="label" translatable="yes">_Help</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.help</property>
|
||||
@@ -148,7 +133,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="about_item">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">_About</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.about</property>
|
||||
@@ -162,7 +146,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar" id="toolbar1">
|
||||
<property name="visible">1</property>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-toolbar">
|
||||
<property name="AtkObject::accessible-name">The toolbar</property>
|
||||
@@ -170,7 +153,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">New</property>
|
||||
<property name="tooltip-text" translatable="yes">Create a new file</property>
|
||||
<property name="icon-name">document-new</property>
|
||||
@@ -178,7 +160,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Open</property>
|
||||
<property name="tooltip-text" translatable="yes">Open a file</property>
|
||||
<property name="icon-name">document-open</property>
|
||||
@@ -186,7 +167,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Save</property>
|
||||
<property name="tooltip-text" translatable="yes">Save a file</property>
|
||||
<property name="icon-name">document-save</property>
|
||||
@@ -195,12 +175,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Copy</property>
|
||||
<property name="tooltip-text" translatable="yes">Copy selected object into the clipboard</property>
|
||||
<property name="icon-name">edit-copy</property>
|
||||
@@ -208,7 +186,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Cut</property>
|
||||
<property name="tooltip-text" translatable="yes">Cut selected object into the clipboard</property>
|
||||
<property name="icon-name">edit-cut</property>
|
||||
@@ -216,7 +193,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Paste</property>
|
||||
<property name="tooltip-text" translatable="yes">Paste object from the clipboard</property>
|
||||
<property name="icon-name">edit-paste</property>
|
||||
@@ -229,12 +205,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="shadow_type">in</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="expand">1</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
<property name="visible">1</property>
|
||||
<property name="model">liststore1</property>
|
||||
<property name="tooltip-column">3</property>
|
||||
<child internal-child="accessible">
|
||||
@@ -287,7 +261,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStatusbar" id="statusbar1">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
|
@@ -299,7 +299,7 @@ pressed_cb (GtkGesture *gesture,
|
||||
rect.height = 0;
|
||||
|
||||
gtk_menu_popup_at_rect (GTK_MENU (menu),
|
||||
gtk_widget_get_window (widget),
|
||||
gtk_widget_get_surface (widget),
|
||||
&rect,
|
||||
GDK_GRAVITY_NORTH_WEST,
|
||||
GDK_GRAVITY_NORTH_WEST,
|
||||
|
@@ -4,8 +4,8 @@
|
||||
* of various kinds.
|
||||
*
|
||||
* This demo has two drawing areas. The checkerboard area shows
|
||||
* how you can just draw something; all you have to do is write
|
||||
* a signal handler for expose_event, as shown here.
|
||||
* how you can just draw something; all you have to do is set a function
|
||||
* via gtk_drawing_area_set_draw_func(), as shown here.
|
||||
*
|
||||
* The "scribble" area is a bit more advanced, and shows how to handle
|
||||
* events such as button presses and mouse motion. Click the mouse
|
||||
@@ -137,7 +137,7 @@ checkerboard_draw (GtkDrawingArea *da,
|
||||
/* At the start of a draw handler, a clip region has been set on
|
||||
* the Cairo context, and the contents have been cleared to the
|
||||
* widget's background color. The docs for
|
||||
* gdk_window_begin_paint_region() give more details on how this
|
||||
* gdk_surface_begin_paint_region() give more details on how this
|
||||
* works.
|
||||
*/
|
||||
|
||||
|
@@ -34,31 +34,31 @@
|
||||
<property name="title" translatable="yes">Filter Model</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin">10</property>
|
||||
<property name="row_spacing">10</property>
|
||||
<property name="column_spacing">10</property>
|
||||
<property name="column_homogeneous">1</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="column-homogeneous">1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Original</property>
|
||||
<property name="xalign">0</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="treeview1"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="model">liststore1</property>
|
||||
<property name="headers_clickable">0</property>
|
||||
<property name="headers-clickable">0</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||
</child>
|
||||
@@ -84,18 +84,20 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label1"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview2">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="headers_clickable">0</property>
|
||||
<property name="search_column">0</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="headers-clickable">0</property>
|
||||
<property name="search-column">0</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection3"/>
|
||||
</child>
|
||||
@@ -133,46 +135,52 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label2"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Computed Columns</property>
|
||||
<property name="xalign">0</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="treeview2"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Filtered</property>
|
||||
<property name="xalign">0</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="treeview3"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview3">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="headers_clickable">0</property>
|
||||
<property name="search_column">0</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="headers-clickable">0</property>
|
||||
<property name="search-column">0</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection5"/>
|
||||
</child>
|
||||
@@ -192,10 +200,13 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label3"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -5,34 +5,30 @@
|
||||
<property name="title" translatable="yes">Fishbowl</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="">
|
||||
<property name="visible">True</property>
|
||||
<property name="show-title-buttons">True</property>
|
||||
<property name="show-title-buttons">1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="info_label">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" bind-source="bowl" bind-property="count">0</property>
|
||||
<property name="label" bind-source="bowl" bind-property="count"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="changes_allow">
|
||||
<property name="active">False</property>
|
||||
<property name="visible" bind-source="changes_allow" bind-property="active" bind-flags="invert-boolean">True</property>
|
||||
<property name="visible" bind-source="changes_allow" bind-property="active" bind-flags="invert-boolean"/>
|
||||
<property name="icon-name">changes-allow</property>
|
||||
<property name="relief">none</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -43,7 +39,7 @@
|
||||
<property name="relief">none</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -7,19 +7,16 @@
|
||||
<property name="default-height">500</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="visible">1</property>
|
||||
<property name="show-title-buttons">1</property>
|
||||
<property name="title">Font Explorer</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="visible">1</property>
|
||||
<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"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">view-refresh-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -29,24 +26,19 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkFontButton" id="font">
|
||||
<property name="visible">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="font">Sans 12</property>
|
||||
@@ -57,7 +49,6 @@
|
||||
<object class="GtkExpander">
|
||||
<child type="label">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Font Features</property>
|
||||
<attributes>
|
||||
@@ -87,10 +78,8 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander">
|
||||
<property name="visible">1</property>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="variations_heading">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Font Variations</property>
|
||||
<property name="xalign">0</property>
|
||||
<attributes>
|
||||
@@ -100,7 +89,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="variations_grid">
|
||||
<property name="visible">1</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
</object>
|
||||
@@ -118,7 +106,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
@@ -126,10 +113,8 @@
|
||||
<property name="spacing">20</property>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="visible">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0</property>
|
||||
@@ -142,7 +127,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry">
|
||||
<property name="visible">1</property>
|
||||
<property name="text">Grumpy wizards make toxic brew for the evil Queen and Jack. A quick movement of the enemy will jeopardize six gunboats. The job of waxing linoleum frequently peeves chintzy kids. My girl wove six dozen plaid jackets before she quit. Twelve ziggurats quickly jumped a finch box.
|
||||
|
||||
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) – вдрызг! В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
|
||||
@@ -161,7 +145,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="settings">
|
||||
<property name="visible">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">end</property>
|
||||
@@ -176,22 +159,20 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="description">
|
||||
<property name="visible">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="width-chars">50</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="monospace"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="description">
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="width-chars">50</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="monospace"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="edit_toggle">
|
||||
<property name="icon-name">document-edit-symbolic</property>
|
||||
|
@@ -208,7 +208,7 @@ plane_drag_gesture_end (GtkGestureDrag *gesture,
|
||||
static void
|
||||
gtk_font_plane_init (GtkFontPlane *plane)
|
||||
{
|
||||
gtk_widget_set_has_window (GTK_WIDGET (plane), FALSE);
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (plane), FALSE);
|
||||
gtk_widget_set_can_focus (GTK_WIDGET (plane), TRUE);
|
||||
|
||||
plane->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (plane));
|
||||
|
@@ -33,7 +33,7 @@ demos = []
|
||||
for demo_file in in_files:
|
||||
filename = demo_file[demo_file.rfind('/')+1:]
|
||||
demo_name = filename.replace(".c", "")
|
||||
with open(demo_file, 'r') as f:
|
||||
with open(demo_file, 'r', encoding='utf-8') as f:
|
||||
title = f.readline().replace("/*", "").strip()
|
||||
|
||||
|
||||
|
BIN
demos/gtk-demo/gtk-logo.webm
Normal file
BIN
demos/gtk-demo/gtk-logo.webm
Normal file
Binary file not shown.
@@ -56,7 +56,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkFishbowl, gtk_fishbowl, GTK_TYPE_CONTAINER)
|
||||
static void
|
||||
gtk_fishbowl_init (GtkFishbowl *fishbowl)
|
||||
{
|
||||
gtk_widget_set_has_window (GTK_WIDGET (fishbowl), FALSE);
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (fishbowl), FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
960
demos/gtk-demo/gtkgears.c
Normal file
960
demos/gtk-demo/gtkgears.c
Normal file
@@ -0,0 +1,960 @@
|
||||
/* The rendering code in here is taken from es2gears, which has the
|
||||
* following copyright notice:
|
||||
*
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Ported to GLES2.
|
||||
* Kristian Høgsberg <krh@bitplanet.net>
|
||||
* May 3, 2010
|
||||
*
|
||||
* Improve GLES2 port:
|
||||
* * Refactor gear drawing.
|
||||
* * Use correct normals for surfaces.
|
||||
* * Improve shader.
|
||||
* * Use perspective projection transformation.
|
||||
* * Add FPS count.
|
||||
* * Add comments.
|
||||
* Alexandros Frantzis <alexandros.frantzis@linaro.org>
|
||||
* Jul 13, 2010
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
#include "gtkgears.h"
|
||||
|
||||
#define STRIPS_PER_TOOTH 7
|
||||
#define VERTICES_PER_TOOTH 34
|
||||
#define GEAR_VERTEX_STRIDE 6
|
||||
|
||||
#ifndef HAVE_SINCOS
|
||||
static void
|
||||
sincos (double x, double *_sin, double *_cos)
|
||||
{
|
||||
*_sin = sin (x);
|
||||
*_cos = cos (x);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Struct describing the vertices in triangle strip
|
||||
*/
|
||||
struct vertex_strip {
|
||||
/** The first vertex in the strip */
|
||||
GLint first;
|
||||
/** The number of consecutive vertices in the strip after the first */
|
||||
GLint count;
|
||||
};
|
||||
|
||||
/* Each vertex consist of GEAR_VERTEX_STRIDE GLfloat attributes */
|
||||
typedef GLfloat GearVertex[GEAR_VERTEX_STRIDE];
|
||||
|
||||
/**
|
||||
* Struct representing a gear.
|
||||
*/
|
||||
struct gear {
|
||||
/** The array of vertices comprising the gear */
|
||||
GearVertex *vertices;
|
||||
/** The number of vertices comprising the gear */
|
||||
int nvertices;
|
||||
/** The array of triangle strips comprising the gear */
|
||||
struct vertex_strip *strips;
|
||||
/** The number of triangle strips comprising the gear */
|
||||
int nstrips;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
/* The view rotation [x, y, z] */
|
||||
GLfloat view_rot[GTK_GEARS_N_AXIS];
|
||||
|
||||
/* The Vertex Array Object */
|
||||
GLuint vao;
|
||||
|
||||
/* The shader program */
|
||||
GLuint program;
|
||||
|
||||
/* The gears */
|
||||
struct gear *gear1;
|
||||
struct gear *gear2;
|
||||
struct gear *gear3;
|
||||
|
||||
/** The Vertex Buffer Object holding the vertices in the graphics card */
|
||||
GLuint gear_vbo[3];
|
||||
|
||||
/** The location of the shader uniforms */
|
||||
GLuint ModelViewProjectionMatrix_location;
|
||||
GLuint NormalMatrix_location;
|
||||
GLuint LightSourcePosition_location;
|
||||
GLuint MaterialColor_location;
|
||||
|
||||
/* The current gear rotation angle */
|
||||
GLfloat angle;
|
||||
|
||||
/* The projection matrix */
|
||||
GLfloat ProjectionMatrix[16];
|
||||
|
||||
/* The direction of the directional light for the scene */
|
||||
GLfloat LightSourcePosition[4];
|
||||
|
||||
gint64 first_frame_time;
|
||||
guint tick;
|
||||
GtkLabel *fps_label;
|
||||
} GtkGearsPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GtkGears, gtk_gears, GTK_TYPE_GL_AREA)
|
||||
|
||||
static gboolean gtk_gears_render (GtkGLArea *area,
|
||||
GdkGLContext *context);
|
||||
static void gtk_gears_reshape (GtkGLArea *area,
|
||||
int width,
|
||||
int height);
|
||||
static void gtk_gears_realize (GtkWidget *widget);
|
||||
static void gtk_gears_unrealize (GtkWidget *widget);
|
||||
static gboolean gtk_gears_tick (GtkWidget *widget,
|
||||
GdkFrameClock *frame_clock,
|
||||
gpointer user_data);
|
||||
|
||||
static void destroy_gear (struct gear *g);
|
||||
|
||||
GtkWidget *
|
||||
gtk_gears_new (void)
|
||||
{
|
||||
return g_object_new (gtk_gears_get_type (),
|
||||
"has-depth-buffer", TRUE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gears_init (GtkGears *gears)
|
||||
{
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
|
||||
|
||||
priv->view_rot[GTK_GEARS_X_AXIS] = 20.0;
|
||||
priv->view_rot[GTK_GEARS_Y_AXIS] = 30.0;
|
||||
priv->view_rot[GTK_GEARS_Z_AXIS] = 20.0;
|
||||
|
||||
priv->LightSourcePosition[0] = 5.0;
|
||||
priv->LightSourcePosition[1] = 5.0;
|
||||
priv->LightSourcePosition[2] = 10.0;
|
||||
priv->LightSourcePosition[3] = 1.0;
|
||||
|
||||
priv->tick = gtk_widget_add_tick_callback (GTK_WIDGET (gears), gtk_gears_tick, gears, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gears_finalize (GObject *obj)
|
||||
{
|
||||
GtkGears *gears = GTK_GEARS (obj);
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
|
||||
|
||||
gtk_widget_remove_tick_callback (GTK_WIDGET (gears), priv->tick);
|
||||
|
||||
g_clear_object (&priv->fps_label);
|
||||
|
||||
g_clear_pointer (&priv->gear1, destroy_gear);
|
||||
g_clear_pointer (&priv->gear2, destroy_gear);
|
||||
g_clear_pointer (&priv->gear3, destroy_gear);
|
||||
|
||||
G_OBJECT_CLASS (gtk_gears_parent_class)->finalize (obj);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gears_class_init (GtkGearsClass *klass)
|
||||
{
|
||||
GTK_GL_AREA_CLASS (klass)->render = gtk_gears_render;
|
||||
GTK_GL_AREA_CLASS (klass)->resize = gtk_gears_reshape;
|
||||
|
||||
GTK_WIDGET_CLASS (klass)->realize = gtk_gears_realize;
|
||||
GTK_WIDGET_CLASS (klass)->unrealize = gtk_gears_unrealize;
|
||||
|
||||
G_OBJECT_CLASS (klass)->finalize = gtk_gears_finalize;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fills a gear vertex.
|
||||
*
|
||||
* @param v the vertex to fill
|
||||
* @param x the x coordinate
|
||||
* @param y the y coordinate
|
||||
* @param z the z coortinate
|
||||
* @param n pointer to the normal table
|
||||
*
|
||||
* @return the operation error code
|
||||
*/
|
||||
static GearVertex *
|
||||
vert (GearVertex *v,
|
||||
GLfloat x,
|
||||
GLfloat y,
|
||||
GLfloat z,
|
||||
GLfloat n[3])
|
||||
{
|
||||
v[0][0] = x;
|
||||
v[0][1] = y;
|
||||
v[0][2] = z;
|
||||
v[0][3] = n[0];
|
||||
v[0][4] = n[1];
|
||||
v[0][5] = n[2];
|
||||
|
||||
return v + 1;
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_gear (struct gear *g)
|
||||
{
|
||||
g_free (g->strips);
|
||||
g_free (g);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a gear wheel.
|
||||
*
|
||||
* @param inner_radius radius of hole at center
|
||||
* @param outer_radius radius at center of teeth
|
||||
* @param width width of gear
|
||||
* @param teeth number of teeth
|
||||
* @param tooth_depth depth of tooth
|
||||
*
|
||||
* @return pointer to the constructed struct gear
|
||||
*/
|
||||
static struct gear *
|
||||
create_gear (GLfloat inner_radius,
|
||||
GLfloat outer_radius,
|
||||
GLfloat width,
|
||||
GLint teeth,
|
||||
GLfloat tooth_depth)
|
||||
{
|
||||
GLfloat r0, r1, r2;
|
||||
GLfloat da;
|
||||
GearVertex *v;
|
||||
struct gear *gear;
|
||||
double s[5], c[5];
|
||||
GLfloat normal[3];
|
||||
int cur_strip = 0;
|
||||
int i;
|
||||
|
||||
/* Allocate memory for the gear */
|
||||
gear = g_malloc (sizeof *gear);
|
||||
|
||||
/* Calculate the radii used in the gear */
|
||||
r0 = inner_radius;
|
||||
r1 = outer_radius - tooth_depth / 2.0;
|
||||
r2 = outer_radius + tooth_depth / 2.0;
|
||||
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
|
||||
/* Allocate memory for the triangle strip information */
|
||||
gear->nstrips = STRIPS_PER_TOOTH * teeth;
|
||||
gear->strips = g_malloc0_n (gear->nstrips, sizeof (*gear->strips));
|
||||
|
||||
/* Allocate memory for the vertices */
|
||||
gear->vertices = g_malloc0_n (VERTICES_PER_TOOTH * teeth, sizeof(*gear->vertices));
|
||||
v = gear->vertices;
|
||||
|
||||
for (i = 0; i < teeth; i++) {
|
||||
/* A set of macros for making the creation of the gears easier */
|
||||
#define GEAR_POINT(p, r, da) do { p.x = (r) * c[(da)]; p.y = (r) * s[(da)]; } while(0)
|
||||
#define SET_NORMAL(x, y, z) do { \
|
||||
normal[0] = (x); normal[1] = (y); normal[2] = (z); \
|
||||
} while(0)
|
||||
|
||||
#define GEAR_VERT(v, point, sign) vert((v), p[(point)].x, p[(point)].y, (sign) * width * 0.5, normal)
|
||||
|
||||
#define START_STRIP do { \
|
||||
gear->strips[cur_strip].first = v - gear->vertices; \
|
||||
} while(0);
|
||||
|
||||
#define END_STRIP do { \
|
||||
int _tmp = (v - gear->vertices); \
|
||||
gear->strips[cur_strip].count = _tmp - gear->strips[cur_strip].first; \
|
||||
cur_strip++; \
|
||||
} while (0)
|
||||
|
||||
#define QUAD_WITH_NORMAL(p1, p2) do { \
|
||||
SET_NORMAL((p[(p1)].y - p[(p2)].y), -(p[(p1)].x - p[(p2)].x), 0); \
|
||||
v = GEAR_VERT(v, (p1), -1); \
|
||||
v = GEAR_VERT(v, (p1), 1); \
|
||||
v = GEAR_VERT(v, (p2), -1); \
|
||||
v = GEAR_VERT(v, (p2), 1); \
|
||||
} while(0)
|
||||
struct point {
|
||||
GLfloat x;
|
||||
GLfloat y;
|
||||
};
|
||||
|
||||
/* Create the 7 points (only x,y coords) used to draw a tooth */
|
||||
struct point p[7];
|
||||
|
||||
/* Calculate needed sin/cos for varius angles */
|
||||
sincos(i * 2.0 * G_PI / teeth + da * 0, &s[0], &c[0]);
|
||||
sincos(i * 2.0 * M_PI / teeth + da * 1, &s[1], &c[1]);
|
||||
sincos(i * 2.0 * M_PI / teeth + da * 2, &s[2], &c[2]);
|
||||
sincos(i * 2.0 * M_PI / teeth + da * 3, &s[3], &c[3]);
|
||||
sincos(i * 2.0 * M_PI / teeth + da * 4, &s[4], &c[4]);
|
||||
|
||||
GEAR_POINT(p[0], r2, 1);
|
||||
GEAR_POINT(p[1], r2, 2);
|
||||
GEAR_POINT(p[2], r1, 0);
|
||||
GEAR_POINT(p[3], r1, 3);
|
||||
GEAR_POINT(p[4], r0, 0);
|
||||
GEAR_POINT(p[5], r1, 4);
|
||||
GEAR_POINT(p[6], r0, 4);
|
||||
|
||||
/* Front face */
|
||||
START_STRIP;
|
||||
SET_NORMAL(0, 0, 1.0);
|
||||
v = GEAR_VERT(v, 0, +1);
|
||||
v = GEAR_VERT(v, 1, +1);
|
||||
v = GEAR_VERT(v, 2, +1);
|
||||
v = GEAR_VERT(v, 3, +1);
|
||||
v = GEAR_VERT(v, 4, +1);
|
||||
v = GEAR_VERT(v, 5, +1);
|
||||
v = GEAR_VERT(v, 6, +1);
|
||||
END_STRIP;
|
||||
|
||||
/* Inner face */
|
||||
START_STRIP;
|
||||
QUAD_WITH_NORMAL(4, 6);
|
||||
END_STRIP;
|
||||
|
||||
/* Back face */
|
||||
START_STRIP;
|
||||
SET_NORMAL(0, 0, -1.0);
|
||||
v = GEAR_VERT(v, 6, -1);
|
||||
v = GEAR_VERT(v, 5, -1);
|
||||
v = GEAR_VERT(v, 4, -1);
|
||||
v = GEAR_VERT(v, 3, -1);
|
||||
v = GEAR_VERT(v, 2, -1);
|
||||
v = GEAR_VERT(v, 1, -1);
|
||||
v = GEAR_VERT(v, 0, -1);
|
||||
END_STRIP;
|
||||
|
||||
/* Outer face */
|
||||
START_STRIP;
|
||||
QUAD_WITH_NORMAL(0, 2);
|
||||
END_STRIP;
|
||||
|
||||
START_STRIP;
|
||||
QUAD_WITH_NORMAL(1, 0);
|
||||
END_STRIP;
|
||||
|
||||
START_STRIP;
|
||||
QUAD_WITH_NORMAL(3, 1);
|
||||
END_STRIP;
|
||||
|
||||
START_STRIP;
|
||||
QUAD_WITH_NORMAL(5, 3);
|
||||
END_STRIP;
|
||||
}
|
||||
|
||||
gear->nvertices = (v - gear->vertices);
|
||||
|
||||
return gear;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiplies two 4x4 matrices.
|
||||
*
|
||||
* The result is stored in matrix m.
|
||||
*
|
||||
* @param m the first matrix to multiply
|
||||
* @param n the second matrix to multiply
|
||||
*/
|
||||
static void
|
||||
multiply (GLfloat *m, const GLfloat *n)
|
||||
{
|
||||
GLfloat tmp[16];
|
||||
const GLfloat *row, *column;
|
||||
div_t d;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
tmp[i] = 0;
|
||||
d = div(i, 4);
|
||||
row = n + d.quot * 4;
|
||||
column = m + d.rem;
|
||||
for (j = 0; j < 4; j++)
|
||||
tmp[i] += row[j] * column[j * 4];
|
||||
}
|
||||
memcpy(m, &tmp, sizeof tmp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotates a 4x4 matrix.
|
||||
*
|
||||
* @param[in,out] m the matrix to rotate
|
||||
* @param angle the angle to rotate
|
||||
* @param x the x component of the direction to rotate to
|
||||
* @param y the y component of the direction to rotate to
|
||||
* @param z the z component of the direction to rotate to
|
||||
*/
|
||||
static void
|
||||
rotate(GLfloat *m, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
|
||||
{
|
||||
double s = sin (angle);
|
||||
double c = cos (angle);
|
||||
|
||||
GLfloat r[16] = {
|
||||
x * x * (1 - c) + c, y * x * (1 - c) + z * s, x * z * (1 - c) - y * s, 0,
|
||||
x * y * (1 - c) - z * s, y * y * (1 - c) + c, y * z * (1 - c) + x * s, 0,
|
||||
x * z * (1 - c) + y * s, y * z * (1 - c) - x * s, z * z * (1 - c) + c, 0,
|
||||
0, 0, 0, 1
|
||||
};
|
||||
|
||||
multiply(m, r);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates a 4x4 matrix.
|
||||
*
|
||||
* @param[in,out] m the matrix to translate
|
||||
* @param x the x component of the direction to translate to
|
||||
* @param y the y component of the direction to translate to
|
||||
* @param z the z component of the direction to translate to
|
||||
*/
|
||||
static void
|
||||
translate(GLfloat *m, GLfloat x, GLfloat y, GLfloat z)
|
||||
{
|
||||
GLfloat t[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1 };
|
||||
|
||||
multiply(m, t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an identity 4x4 matrix.
|
||||
*
|
||||
* @param m the matrix make an identity matrix
|
||||
*/
|
||||
static void
|
||||
identity(GLfloat *m)
|
||||
{
|
||||
GLfloat t[16] = {
|
||||
1.0, 0.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0, 0.0,
|
||||
0.0, 0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0,
|
||||
};
|
||||
|
||||
memcpy(m, t, sizeof(t));
|
||||
}
|
||||
|
||||
/**
|
||||
* Transposes a 4x4 matrix.
|
||||
*
|
||||
* @param m the matrix to transpose
|
||||
*/
|
||||
static void
|
||||
transpose(GLfloat *m)
|
||||
{
|
||||
GLfloat t[16] = {
|
||||
m[0], m[4], m[8], m[12],
|
||||
m[1], m[5], m[9], m[13],
|
||||
m[2], m[6], m[10], m[14],
|
||||
m[3], m[7], m[11], m[15]};
|
||||
|
||||
memcpy(m, t, sizeof(t));
|
||||
}
|
||||
|
||||
/**
|
||||
* Inverts a 4x4 matrix.
|
||||
*
|
||||
* This function can currently handle only pure translation-rotation matrices.
|
||||
* Read http://www.gamedev.net/community/forums/topic.asp?topic_id=425118
|
||||
* for an explanation.
|
||||
*/
|
||||
static void
|
||||
invert(GLfloat *m)
|
||||
{
|
||||
GLfloat t[16];
|
||||
identity(t);
|
||||
|
||||
// Extract and invert the translation part 't'. The inverse of a
|
||||
// translation matrix can be calculated by negating the translation
|
||||
// coordinates.
|
||||
t[12] = -m[12]; t[13] = -m[13]; t[14] = -m[14];
|
||||
|
||||
// Invert the rotation part 'r'. The inverse of a rotation matrix is
|
||||
// equal to its transpose.
|
||||
m[12] = m[13] = m[14] = 0;
|
||||
transpose(m);
|
||||
|
||||
// inv(m) = inv(r) * inv(t)
|
||||
multiply(m, t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate a perspective projection transformation.
|
||||
*
|
||||
* @param m the matrix to save the transformation in
|
||||
* @param fovy the field of view in the y direction
|
||||
* @param aspect the view aspect ratio
|
||||
* @param zNear the near clipping plane
|
||||
* @param zFar the far clipping plane
|
||||
*/
|
||||
void perspective(GLfloat *m, GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar)
|
||||
{
|
||||
GLfloat tmp[16];
|
||||
double sine, cosine, cotangent, deltaZ;
|
||||
GLfloat radians = fovy / 2 * M_PI / 180;
|
||||
identity(tmp);
|
||||
|
||||
deltaZ = zFar - zNear;
|
||||
sincos(radians, &sine, &cosine);
|
||||
|
||||
if ((deltaZ == 0) || (sine == 0) || (aspect == 0))
|
||||
return;
|
||||
|
||||
cotangent = cosine / sine;
|
||||
|
||||
tmp[0] = cotangent / aspect;
|
||||
tmp[5] = cotangent;
|
||||
tmp[10] = -(zFar + zNear) / deltaZ;
|
||||
tmp[11] = -1;
|
||||
tmp[14] = -2 * zNear * zFar / deltaZ;
|
||||
tmp[15] = 0;
|
||||
|
||||
memcpy(m, tmp, sizeof(tmp));
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a gear.
|
||||
*
|
||||
* @param gear the gear to draw
|
||||
* @param transform the current transformation matrix
|
||||
* @param x the x position to draw the gear at
|
||||
* @param y the y position to draw the gear at
|
||||
* @param angle the rotation angle of the gear
|
||||
* @param color the color of the gear
|
||||
*/
|
||||
static void
|
||||
draw_gear(GtkGears *self,
|
||||
struct gear *gear,
|
||||
GLuint gear_vbo,
|
||||
GLfloat *transform,
|
||||
GLfloat x,
|
||||
GLfloat y,
|
||||
GLfloat angle,
|
||||
const GLfloat color[4])
|
||||
{
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (self);
|
||||
GLfloat model_view[16];
|
||||
GLfloat normal_matrix[16];
|
||||
GLfloat model_view_projection[16];
|
||||
int n;
|
||||
|
||||
/* Translate and rotate the gear */
|
||||
memcpy(model_view, transform, sizeof (model_view));
|
||||
translate(model_view, x, y, 0);
|
||||
rotate(model_view, 2 * G_PI * angle / 360.0, 0, 0, 1);
|
||||
|
||||
/* Create and set the ModelViewProjectionMatrix */
|
||||
memcpy(model_view_projection, priv->ProjectionMatrix, sizeof(model_view_projection));
|
||||
multiply(model_view_projection, model_view);
|
||||
|
||||
glUniformMatrix4fv(priv->ModelViewProjectionMatrix_location, 1, GL_FALSE,
|
||||
model_view_projection);
|
||||
|
||||
/*
|
||||
* Create and set the NormalMatrix. It's the inverse transpose of the
|
||||
* ModelView matrix.
|
||||
*/
|
||||
memcpy(normal_matrix, model_view, sizeof (normal_matrix));
|
||||
invert(normal_matrix);
|
||||
transpose(normal_matrix);
|
||||
glUniformMatrix4fv(priv->NormalMatrix_location, 1, GL_FALSE, normal_matrix);
|
||||
|
||||
/* Set the gear color */
|
||||
glUniform4fv(priv->MaterialColor_location, 1, color);
|
||||
|
||||
/* Set the vertex buffer object to use */
|
||||
glBindBuffer(GL_ARRAY_BUFFER, gear_vbo);
|
||||
|
||||
/* Set up the position of the attributes in the vertex buffer object */
|
||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), NULL);
|
||||
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (GLfloat *) 0 + 3);
|
||||
|
||||
/* Enable the attributes */
|
||||
glEnableVertexAttribArray(0);
|
||||
glEnableVertexAttribArray(1);
|
||||
|
||||
/* Draw the triangle strips that comprise the gear */
|
||||
for (n = 0; n < gear->nstrips; n++) {
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, gear->strips[n].first, gear->strips[n].count);
|
||||
}
|
||||
|
||||
/* Disable the attributes */
|
||||
glDisableVertexAttribArray(1);
|
||||
glDisableVertexAttribArray(0);
|
||||
}
|
||||
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
gtk_gears_reshape (GtkGLArea *area, int width, int height)
|
||||
{
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private ((GtkGears *) area);
|
||||
|
||||
/* Update the projection matrix */
|
||||
perspective (priv->ProjectionMatrix, 60.0, width / (float)height, 1.0, 1024.0);
|
||||
|
||||
/* Set the viewport */
|
||||
glViewport (0, 0, (GLint) width, (GLint) height);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_gears_render (GtkGLArea *area,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
static const GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
|
||||
static const GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
|
||||
static const GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
|
||||
|
||||
GtkGears *self = GTK_GEARS (area);
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (self);
|
||||
GLfloat transform[16];
|
||||
|
||||
identity (transform);
|
||||
|
||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
/* Translate and rotate the view */
|
||||
translate (transform, 0, 0, -20);
|
||||
rotate (transform, 2 * G_PI * priv->view_rot[0] / 360.0, 1, 0, 0);
|
||||
rotate (transform, 2 * G_PI * priv->view_rot[1] / 360.0, 0, 1, 0);
|
||||
rotate (transform, 2 * G_PI * priv->view_rot[2] / 360.0, 0, 0, 1);
|
||||
|
||||
/* Draw the gears */
|
||||
draw_gear (self, priv->gear1, priv->gear_vbo[0], transform, -3.0, -2.0, priv->angle, red);
|
||||
draw_gear (self, priv->gear2, priv->gear_vbo[1], transform, 3.1, -2.0, -2 * priv->angle - 9.0, green);
|
||||
draw_gear (self, priv->gear3, priv->gear_vbo[2], transform, -3.1, 4.2, -2 * priv->angle - 25.0, blue);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static const char vertex_shader_gl[] =
|
||||
"#version 150\n"
|
||||
"\n"
|
||||
"in vec3 position;\n"
|
||||
"in vec3 normal;\n"
|
||||
"\n"
|
||||
"uniform mat4 ModelViewProjectionMatrix;\n"
|
||||
"uniform mat4 NormalMatrix;\n"
|
||||
"uniform vec4 LightSourcePosition;\n"
|
||||
"uniform vec4 MaterialColor;\n"
|
||||
"\n"
|
||||
"smooth out vec4 Color;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" // Transform the normal to eye coordinates\n"
|
||||
" vec3 N = normalize(vec3(NormalMatrix * vec4(normal, 1.0)));\n"
|
||||
"\n"
|
||||
" // The LightSourcePosition is actually its direction for directional light\n"
|
||||
" vec3 L = normalize(LightSourcePosition.xyz);\n"
|
||||
"\n"
|
||||
" // Multiply the diffuse value by the vertex color (which is fixed in this case)\n"
|
||||
" // to get the actual color that we will use to draw this vertex with\n"
|
||||
" float diffuse = max(dot(N, L), 0.0);\n"
|
||||
" Color = diffuse * MaterialColor;\n"
|
||||
"\n"
|
||||
" // Transform the position to clip coordinates\n"
|
||||
" gl_Position = ModelViewProjectionMatrix * vec4(position, 1.0);\n"
|
||||
"}";
|
||||
|
||||
static const char fragment_shader_gl[] =
|
||||
"#version 150\n"
|
||||
"\n"
|
||||
"smooth in vec4 Color;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" gl_FragColor = Color;\n"
|
||||
"}";
|
||||
|
||||
static const char vertex_shader_gles[] =
|
||||
"attribute vec3 position;\n"
|
||||
"attribute vec3 normal;\n"
|
||||
"\n"
|
||||
"uniform mat4 ModelViewProjectionMatrix;\n"
|
||||
"uniform mat4 NormalMatrix;\n"
|
||||
"uniform vec4 LightSourcePosition;\n"
|
||||
"uniform vec4 MaterialColor;\n"
|
||||
"\n"
|
||||
"varying vec4 Color;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" // Transform the normal to eye coordinates\n"
|
||||
" vec3 N = normalize(vec3(NormalMatrix * vec4(normal, 1.0)));\n"
|
||||
"\n"
|
||||
" // The LightSourcePosition is actually its direction for directional light\n"
|
||||
" vec3 L = normalize(LightSourcePosition.xyz);\n"
|
||||
"\n"
|
||||
" // Multiply the diffuse value by the vertex color (which is fixed in this case)\n"
|
||||
" // to get the actual color that we will use to draw this vertex with\n"
|
||||
" float diffuse = max(dot(N, L), 0.0);\n"
|
||||
" Color = diffuse * MaterialColor;\n"
|
||||
"\n"
|
||||
" // Transform the position to clip coordinates\n"
|
||||
" gl_Position = ModelViewProjectionMatrix * vec4(position, 1.0);\n"
|
||||
"}";
|
||||
|
||||
static const char fragment_shader_gles[] =
|
||||
"precision mediump float;\n"
|
||||
"varying vec4 Color;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" gl_FragColor = Color;\n"
|
||||
"}";
|
||||
|
||||
static void
|
||||
gtk_gears_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkGLArea *glarea = GTK_GL_AREA (widget);
|
||||
GtkGears *gears = GTK_GEARS (widget);
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
|
||||
GdkGLContext *context;
|
||||
GLuint vao, v, f, program;
|
||||
const char *p;
|
||||
char msg[512];
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_gears_parent_class)->realize (widget);
|
||||
|
||||
gtk_gl_area_make_current (glarea);
|
||||
if (gtk_gl_area_get_error (glarea) != NULL)
|
||||
return;
|
||||
|
||||
context = gtk_gl_area_get_context (glarea);
|
||||
|
||||
glEnable (GL_CULL_FACE);
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
|
||||
/* Create the VAO */
|
||||
glGenVertexArrays (1, &vao);
|
||||
glBindVertexArray (vao);
|
||||
priv->vao = vao;
|
||||
|
||||
/* Compile the vertex shader */
|
||||
if (gdk_gl_context_get_use_es (context))
|
||||
p = vertex_shader_gles;
|
||||
else
|
||||
p = vertex_shader_gl;
|
||||
v = glCreateShader(GL_VERTEX_SHADER);
|
||||
glShaderSource(v, 1, &p, NULL);
|
||||
glCompileShader(v);
|
||||
glGetShaderInfoLog(v, sizeof msg, NULL, msg);
|
||||
g_print ("vertex shader info: %s\n", msg);
|
||||
|
||||
/* Compile the fragment shader */
|
||||
if (gdk_gl_context_get_use_es (context))
|
||||
p = fragment_shader_gles;
|
||||
else
|
||||
p = fragment_shader_gl;
|
||||
f = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
glShaderSource(f, 1, &p, NULL);
|
||||
glCompileShader(f);
|
||||
glGetShaderInfoLog(f, sizeof msg, NULL, msg);
|
||||
g_print ("fragment shader info: %s\n", msg);
|
||||
|
||||
/* Create and link the shader program */
|
||||
program = glCreateProgram();
|
||||
glAttachShader(program, v);
|
||||
glAttachShader(program, f);
|
||||
glBindAttribLocation(program, 0, "position");
|
||||
glBindAttribLocation(program, 1, "normal");
|
||||
|
||||
glLinkProgram(program);
|
||||
glGetProgramInfoLog(program, sizeof msg, NULL, msg);
|
||||
g_print ("program info: %s\n", msg);
|
||||
glDeleteShader (v);
|
||||
glDeleteShader (f);
|
||||
|
||||
/* Enable the shaders */
|
||||
glUseProgram(program);
|
||||
priv->program = program;
|
||||
|
||||
/* Get the locations of the uniforms so we can access them */
|
||||
priv->ModelViewProjectionMatrix_location = glGetUniformLocation(program, "ModelViewProjectionMatrix");
|
||||
priv->NormalMatrix_location = glGetUniformLocation(program, "NormalMatrix");
|
||||
priv->LightSourcePosition_location = glGetUniformLocation(program, "LightSourcePosition");
|
||||
priv->MaterialColor_location = glGetUniformLocation(program, "MaterialColor");
|
||||
|
||||
/* Set the LightSourcePosition uniform which is constant throught the program */
|
||||
glUniform4fv(priv->LightSourcePosition_location, 1, priv->LightSourcePosition);
|
||||
|
||||
/* make the gears */
|
||||
priv->gear1 = create_gear(1.0, 4.0, 1.0, 20, 0.7);
|
||||
|
||||
/* Store the vertices in a vertex buffer object (VBO) */
|
||||
glGenBuffers (1, &(priv->gear_vbo[0]));
|
||||
glBindBuffer (GL_ARRAY_BUFFER, priv->gear_vbo[0]);
|
||||
glBufferData (GL_ARRAY_BUFFER,
|
||||
priv->gear1->nvertices * sizeof(GearVertex),
|
||||
priv->gear1->vertices,
|
||||
GL_STATIC_DRAW);
|
||||
|
||||
priv->gear2 = create_gear(0.5, 2.0, 2.0, 10, 0.7);
|
||||
glGenBuffers (1, &(priv->gear_vbo[1]));
|
||||
glBindBuffer (GL_ARRAY_BUFFER, priv->gear_vbo[1]);
|
||||
glBufferData (GL_ARRAY_BUFFER,
|
||||
priv->gear2->nvertices * sizeof(GearVertex),
|
||||
priv->gear2->vertices,
|
||||
GL_STATIC_DRAW);
|
||||
|
||||
priv->gear3 = create_gear(1.3, 2.0, 0.5, 10, 0.7);
|
||||
glGenBuffers (1, &(priv->gear_vbo[2]));
|
||||
glBindBuffer (GL_ARRAY_BUFFER, priv->gear_vbo[2]);
|
||||
glBufferData (GL_ARRAY_BUFFER,
|
||||
priv->gear3->nvertices * sizeof(GearVertex),
|
||||
priv->gear3->vertices,
|
||||
GL_STATIC_DRAW);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gears_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkGLArea *glarea = GTK_GL_AREA (widget);
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private ((GtkGears *) widget);
|
||||
|
||||
gtk_gl_area_make_current (glarea);
|
||||
if (gtk_gl_area_get_error (glarea) != NULL)
|
||||
return;
|
||||
|
||||
/* Release the resources associated with OpenGL */
|
||||
if (priv->gear_vbo[0] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[0]));
|
||||
|
||||
if (priv->gear_vbo[1] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[1]));
|
||||
|
||||
if (priv->gear_vbo[2] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[2]));
|
||||
|
||||
if (priv->vao != 0)
|
||||
glDeleteVertexArrays (1, &priv->vao);
|
||||
|
||||
if (priv->program != 0)
|
||||
glDeleteProgram (priv->program);
|
||||
|
||||
priv->ModelViewProjectionMatrix_location = 0;
|
||||
priv->NormalMatrix_location = 0;
|
||||
priv->LightSourcePosition_location = 0;
|
||||
priv->MaterialColor_location = 0;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_gears_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_gears_tick (GtkWidget *widget,
|
||||
GdkFrameClock *frame_clock,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkGears *gears = GTK_GEARS (widget);
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
|
||||
GdkFrameTimings *timings, *previous_timings;
|
||||
gint64 previous_frame_time = 0;
|
||||
gint64 frame_time;
|
||||
gint64 history_start, history_len;
|
||||
gint64 frame;
|
||||
char *s;
|
||||
|
||||
frame = gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
frame_time = gdk_frame_clock_get_frame_time (frame_clock);
|
||||
|
||||
if (priv->first_frame_time == 0)
|
||||
{
|
||||
/* No need for changes on first frame */
|
||||
priv->first_frame_time = frame_time;
|
||||
if (priv->fps_label)
|
||||
gtk_label_set_label (priv->fps_label, "FPS: ---");
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
/* glxgears advances 70 degrees per second, so do the same */
|
||||
|
||||
priv->angle = fmod ((frame_time - priv->first_frame_time) / (double)G_USEC_PER_SEC * 70.0, 360.0);
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
|
||||
history_start = gdk_frame_clock_get_history_start (frame_clock);
|
||||
|
||||
if (priv->fps_label && frame % 60 == 0)
|
||||
{
|
||||
history_len = frame - history_start;
|
||||
if (history_len > 0)
|
||||
{
|
||||
previous_timings = gdk_frame_clock_get_timings (frame_clock, frame - history_len);
|
||||
previous_frame_time = gdk_frame_timings_get_frame_time (previous_timings);
|
||||
|
||||
s = g_strdup_printf ("FPS: %-4.1f", (G_USEC_PER_SEC * history_len) / (double)(frame_time - previous_frame_time));
|
||||
gtk_label_set_label (priv->fps_label, s);
|
||||
g_free (s);
|
||||
}
|
||||
}
|
||||
|
||||
timings = gdk_frame_clock_get_current_timings (frame_clock);
|
||||
previous_timings = gdk_frame_clock_get_timings (frame_clock,
|
||||
gdk_frame_timings_get_frame_counter (timings) - 1);
|
||||
if (previous_timings != NULL)
|
||||
previous_frame_time = gdk_frame_timings_get_frame_time (previous_timings);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_gears_set_axis (GtkGears *gears, int axis, double value)
|
||||
{
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
|
||||
|
||||
if (axis < 0 || axis >= GTK_GEARS_N_AXIS)
|
||||
return;
|
||||
|
||||
priv->view_rot[axis] = value;
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (gears));
|
||||
}
|
||||
|
||||
double
|
||||
gtk_gears_get_axis (GtkGears *gears, int axis)
|
||||
{
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
|
||||
|
||||
if (axis < 0 || axis >= GTK_GEARS_N_AXIS)
|
||||
return 0.0;
|
||||
|
||||
return priv->view_rot[axis];
|
||||
}
|
||||
|
||||
void
|
||||
gtk_gears_set_fps_label (GtkGears *gears, GtkLabel *label)
|
||||
{
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
|
||||
|
||||
if (label)
|
||||
g_object_ref (label);
|
||||
|
||||
g_clear_object (&priv->fps_label);
|
||||
|
||||
priv->fps_label = label;
|
||||
}
|
48
demos/gtk-demo/gtkgears.h
Normal file
48
demos/gtk-demo/gtkgears.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef __GTK_GEARS_H__
|
||||
#define __GTK_GEARS_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
enum {
|
||||
GTK_GEARS_X_AXIS,
|
||||
GTK_GEARS_Y_AXIS,
|
||||
GTK_GEARS_Z_AXIS,
|
||||
|
||||
GTK_GEARS_N_AXIS
|
||||
};
|
||||
|
||||
#define GTK_TYPE_GEARS (gtk_gears_get_type ())
|
||||
#define GTK_GEARS(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
|
||||
GTK_TYPE_GEARS, \
|
||||
GtkGears))
|
||||
#define GTK_IS_GEARS(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
|
||||
GTK_TYPE_GEARS))
|
||||
|
||||
typedef struct _GtkGears GtkGears;
|
||||
typedef struct _GtkGearsClass GtkGearsClass;
|
||||
|
||||
struct _GtkGears {
|
||||
GtkGLArea parent;
|
||||
};
|
||||
|
||||
struct _GtkGearsClass {
|
||||
GtkGLAreaClass parent_class;
|
||||
};
|
||||
|
||||
GType gtk_gears_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget *gtk_gears_new (void);
|
||||
void gtk_gears_set_axis (GtkGears *gears,
|
||||
int axis,
|
||||
double value);
|
||||
double gtk_gears_get_axis (GtkGears *gears,
|
||||
int axis);
|
||||
void gtk_gears_set_fps_label (GtkGears *gears,
|
||||
GtkLabel *label);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_GEARS_H__ */
|
@@ -261,9 +261,7 @@ start_progressive_loading (GtkWidget *image)
|
||||
* The timeout simply simulates a slow data source by inserting
|
||||
* pauses in the reading process.
|
||||
*/
|
||||
load_timeout = gdk_threads_add_timeout (150,
|
||||
progressive_timeout,
|
||||
image);
|
||||
load_timeout = g_timeout_add (150, progressive_timeout, image);
|
||||
g_source_set_name_by_id (load_timeout, "[gtk+] progressive_timeout");
|
||||
}
|
||||
|
||||
@@ -319,12 +317,15 @@ toggle_sensitivity_callback (GtkWidget *togglebutton,
|
||||
GtkWidget *
|
||||
do_images (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *video;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *base_vbox;
|
||||
GtkWidget *image;
|
||||
GtkWidget *label;
|
||||
GtkWidget *button;
|
||||
GIcon *gicon;
|
||||
GIcon *gicon;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
@@ -338,9 +339,15 @@ do_images (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (cleanup_callback), NULL);
|
||||
|
||||
base_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
g_object_set (base_vbox, "margin", 16, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (window), base_vbox);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
|
||||
gtk_container_add (GTK_CONTAINER (base_vbox), hbox);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
g_object_set (vbox, "margin", 16, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), vbox);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
@@ -397,6 +404,8 @@ do_images (GtkWidget *do_widget)
|
||||
|
||||
|
||||
/* Progressive */
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), vbox);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
@@ -417,13 +426,32 @@ do_images (GtkWidget *do_widget)
|
||||
|
||||
start_progressive_loading (image);
|
||||
|
||||
/* Video */
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), vbox);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
"<u>Displaying video</u>");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame);
|
||||
|
||||
video = gtk_video_new_for_resource ("/images/gtk-logo.webm");
|
||||
gtk_media_stream_set_loop (gtk_video_get_media_stream (GTK_VIDEO (video)), TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (frame), video);
|
||||
|
||||
/* Sensitivity control */
|
||||
button = gtk_toggle_button_new_with_mnemonic ("_Insensitive");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button);
|
||||
gtk_box_pack_start (GTK_BOX (base_vbox), button);
|
||||
|
||||
g_signal_connect (button, "toggled",
|
||||
G_CALLBACK (toggle_sensitivity_callback),
|
||||
vbox);
|
||||
base_vbox);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@@ -37,7 +37,7 @@ enum
|
||||
static Bug data[] =
|
||||
{
|
||||
{ FALSE, 60482, "Normal", "scrollable notebooks and hidden tabs" },
|
||||
{ FALSE, 60620, "Critical", "gdk_window_clear_area (gdkwindow-win32.c) is not thread-safe" },
|
||||
{ FALSE, 60620, "Critical", "gdk_surface_clear_area (gdksurface-win32.c) is not thread-safe" },
|
||||
{ FALSE, 50214, "Major", "Xft support does not clean up correctly" },
|
||||
{ TRUE, 52877, "Major", "GtkFileSelection needs a refresh method. " },
|
||||
{ FALSE, 56070, "Normal", "Can't click button after setting in sensitive" },
|
||||
|
@@ -3,61 +3,53 @@
|
||||
<!-- interface-requires gtk+ 3.10 -->
|
||||
<!-- interface-requires gtkdemo 3.10 -->
|
||||
<object class="GtkMenu" id="menu1">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem1">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Email message</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem2">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Embed message</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<template class="GtkMessageRow" parent="GtkListBoxRow">
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="visible">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="avatar_image">
|
||||
<property name="width_request">32</property>
|
||||
<property name="height_request">32</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="width-request">32</property>
|
||||
<property name="height-request">32</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin_top">8</property>
|
||||
<property name="margin_bottom">8</property>
|
||||
<property name="margin_start">8</property>
|
||||
<property name="margin_end">8</property>
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">8</property>
|
||||
<property name="margin-end">8</property>
|
||||
<property name="icon-name">image-missing</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="height">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box1">
|
||||
<property name="visible">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<property name="baseline-position">top</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="source_name">
|
||||
<property name="visible">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label" translatable="0">Username</property>
|
||||
<attributes>
|
||||
@@ -69,7 +61,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="source_nick">
|
||||
<property name="visible">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label" translatable="0">@nick</property>
|
||||
<style>
|
||||
@@ -82,7 +73,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="short_time_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label" translatable="yes">38m</property>
|
||||
<style>
|
||||
@@ -90,42 +80,42 @@
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="content_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0</property>
|
||||
<property name="label" translatable="0">Message</property>
|
||||
<property name="wrap">1</property>
|
||||
<accessibility>
|
||||
<role type="static"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="resent_box">
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon_name">media-playlist-repeat</property>
|
||||
<property name="icon-name">media-playlist-repeat</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Resent by</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -135,9 +125,8 @@
|
||||
<child>
|
||||
<object class="GtkLinkButton" id="resent_by_button">
|
||||
<property name="label" translatable="0">reshareer</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="uri">http://www.gtk.org</property>
|
||||
</object>
|
||||
@@ -147,20 +136,18 @@
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box3">
|
||||
<property name="visible">1</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="expand_button">
|
||||
<property name="label" translatable="yes">Expand</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="clicked" handler="expand_clicked" swapped="yes"/>
|
||||
</object>
|
||||
@@ -171,18 +158,16 @@
|
||||
<child>
|
||||
<object class="GtkButton" id="reply-button">
|
||||
<property name="label" translatable="yes">Reply</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reshare-button">
|
||||
<property name="label" translatable="yes">Reshare</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="clicked" handler="reshare_clicked" swapped="yes"/>
|
||||
</object>
|
||||
@@ -193,9 +178,8 @@
|
||||
<child>
|
||||
<object class="GtkButton" id="favorite-buttton">
|
||||
<property name="label" translatable="yes">Favorite</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="clicked" handler="favorite_clicked" swapped="yes"/>
|
||||
</object>
|
||||
@@ -205,14 +189,12 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="more-button">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="popup">menu1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label7">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">More...</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -228,53 +210,44 @@
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="details_revealer">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box5">
|
||||
<property name="visible">1</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box7">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin_top">2</property>
|
||||
<property name="margin_bottom">2</property>
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-bottom">2</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">1</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="n_reshares_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="0"><b>2</b>
|
||||
Reshares</property>
|
||||
<property name="use_markup">1</property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
</child>
|
||||
<child type="label_item"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame2">
|
||||
<property name="visible">1</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="n_favorites_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="0"><b>2</b>
|
||||
FAVORITES</property>
|
||||
<property name="use_markup">1</property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
</child>
|
||||
<child type="label_item"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
@@ -287,10 +260,8 @@ FAVORITES</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box6">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="detailed_time_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="0">4:25 AM - 14 Jun 13 </property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
@@ -300,9 +271,8 @@ FAVORITES</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button5">
|
||||
<property name="label" translatable="yes">Details</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
@@ -321,8 +291,8 @@ FAVORITES</property>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -250,7 +250,7 @@ static gchar *types[] =
|
||||
"GtkTreeSelection ",
|
||||
"GdkDisplay ",
|
||||
"GdkScreen ",
|
||||
"GdkWindow ",
|
||||
"GdkSurface ",
|
||||
"GdkEventButton ",
|
||||
"GdkCursor ",
|
||||
"GtkTreeIter ",
|
||||
@@ -555,7 +555,7 @@ add_data_tab (const gchar *demoname)
|
||||
resource_name = g_strconcat (resource_dir, "/", resources[i], NULL);
|
||||
|
||||
widget = gtk_image_new_from_resource (resource_name);
|
||||
if (gtk_image_get_surface (GTK_IMAGE (widget)) == NULL)
|
||||
if (gtk_image_get_paintable (GTK_IMAGE (widget)) == NULL)
|
||||
{
|
||||
GBytes *bytes;
|
||||
|
||||
|
@@ -22,20 +22,17 @@
|
||||
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="headerbar">
|
||||
<property name="visible">1</property>
|
||||
<property name="show-title-buttons">1</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="action_name">win.run</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="action-name">win.run</property>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Run</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -45,23 +42,19 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="width_request">120</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="min_content_width">150</property>
|
||||
<property name="width-request">120</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="min-content-width">150</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="model">treestore</property>
|
||||
<property name="headers_visible">0</property>
|
||||
<property name="headers-visible">0</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection">
|
||||
<property name="mode">browse</property>
|
||||
@@ -91,77 +84,70 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook" id="notebook">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="scrollable">1</property>
|
||||
<property name="enable_popup">1</property>
|
||||
<property name="show_border">0</property>
|
||||
<property name="enable-popup">1</property>
|
||||
<property name="show-border">0</property>
|
||||
<property name="expand">1</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="info-textview">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="left-margin">20</property>
|
||||
<property name="right-margin">20</property>
|
||||
<property name="top-margin">20</property>
|
||||
<property name="bottom-margin">20</property>
|
||||
<property name="pixels_above_lines">2</property>
|
||||
<property name="pixels_below_lines">2</property>
|
||||
<property name="pixels-above-lines">2</property>
|
||||
<property name="pixels-below-lines">2</property>
|
||||
<property name="editable">0</property>
|
||||
<property name="wrap_mode">word</property>
|
||||
<property name="cursor_visible">0</property>
|
||||
<property name="wrap-mode">word</property>
|
||||
<property name="cursor-visible">0</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_expand">1</property>
|
||||
<property name="tab-expand">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">_Info</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_expand">1</property>
|
||||
<property name="tab_fill">0</property>
|
||||
<property name="tab-expand">1</property>
|
||||
<property name="tab-fill">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="source-scrolledwindow">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="source-textview">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="left-margin">20</property>
|
||||
<property name="right-margin">20</property>
|
||||
<property name="top-margin">20</property>
|
||||
<property name="bottom-margin">20</property>
|
||||
<property name="editable">0</property>
|
||||
<property name="cursor_visible">0</property>
|
||||
<property name="cursor-visible">0</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
<property name="tab_expand">1</property>
|
||||
<property name="tab-expand">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Source</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
<property name="tab_fill">0</property>
|
||||
<property name="tab-fill">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -45,6 +45,9 @@ demos = files([
|
||||
'modelbutton.c',
|
||||
'overlay.c',
|
||||
'overlay2.c',
|
||||
'paintable.c',
|
||||
'paintable_animated.c',
|
||||
'paintable_mediastream.c',
|
||||
'panes.c',
|
||||
'pickers.c',
|
||||
'pixbufs.c',
|
||||
@@ -66,9 +69,9 @@ demos = files([
|
||||
'textview.c',
|
||||
'textscroll.c',
|
||||
'theming_style_classes.c',
|
||||
'toolpalette.c',
|
||||
'transparent.c',
|
||||
'tree_store.c',
|
||||
'video_player.c',
|
||||
])
|
||||
|
||||
gtkdemo_deps = [ libgtk_dep, ]
|
||||
@@ -94,7 +97,9 @@ gtkdemo_resources = gnome.compile_resources('gtkdemo_resources',
|
||||
source_dir: '.')
|
||||
|
||||
executable('gtk4-demo',
|
||||
'main.c', 'gtkfishbowl.c', 'fontplane.c', 'script-names.c', 'language-names.c', demos, demos_h, gtkdemo_resources,
|
||||
'main.c', 'gtkfishbowl.c', 'fontplane.c', 'script-names.c', 'language-names.c',
|
||||
'gtkgears.c',
|
||||
demos, demos_h, gtkdemo_resources,
|
||||
c_args: gtkdemo_args,
|
||||
dependencies: gtkdemo_deps,
|
||||
include_directories: confinc,
|
||||
@@ -126,3 +131,6 @@ install_data('gtk4-demo.desktop', install_dir: gtk_applicationsdir)
|
||||
# GSettings
|
||||
install_data('org.gtk.Demo.gschema.xml', install_dir: gtk_schemasdir)
|
||||
gnome.compile_schemas()
|
||||
|
||||
# appdata
|
||||
install_data('org.gtk.Demo.appdata.xml', install_dir: gtk_appdatadir)
|
@@ -4,23 +4,19 @@
|
||||
<object class="GtkWindow" id="window1">
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="visible">1</property>
|
||||
<property name="show-title-buttons">1</property>
|
||||
<property name="title" translatable="yes">Model Button</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">80</property>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="popover">thing_a</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Color</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
@@ -29,11 +25,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="popover">thing_b</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Flavors</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
@@ -42,11 +36,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="popover">thing_c</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Tools</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
@@ -59,32 +51,25 @@
|
||||
<object class="GtkPopover" id="thing_a">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="action-name">win.color</property>
|
||||
<property name="action-target">'red'</property>
|
||||
<property name="text">Red</property>
|
||||
<property name="inverted">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="action-name">win.color</property>
|
||||
<property name="action-target">'green'</property>
|
||||
<property name="text">Green</property>
|
||||
<property name="inverted">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="action-name">win.color</property>
|
||||
<property name="action-target">'blue'</property>
|
||||
<property name="text">Blue</property>
|
||||
<property name="inverted">1</property>
|
||||
</object>
|
||||
@@ -95,32 +80,27 @@
|
||||
<object class="GtkPopover" id="thing_b">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="action-name">win.chocolate</property>
|
||||
<property name="text">Chocolate</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="action-name">win.vanilla</property>
|
||||
<property name="text">Vanilla</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="action-name">win.sprinkles</property>
|
||||
<property name="text">Add Sprinkles</property>
|
||||
</object>
|
||||
@@ -131,13 +111,11 @@
|
||||
<object class="GtkPopover" id="thing_c">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="text">Hammer</property>
|
||||
<property name="role">check</property>
|
||||
<signal name="clicked" handler="tool_clicked"/>
|
||||
@@ -145,7 +123,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="text">Screwdriver</property>
|
||||
<property name="role">check</property>
|
||||
<signal name="clicked" handler="tool_clicked"/>
|
||||
@@ -153,7 +130,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="text">Drill</property>
|
||||
<property name="role">check</property>
|
||||
<signal name="clicked" handler="tool_clicked"/>
|
||||
|
33
demos/gtk-demo/org.gtk.Demo.appdata.xml
Normal file
33
demos/gtk-demo/org.gtk.Demo.appdata.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.gtk.Demo.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>LGPL-2.0+</project_license>
|
||||
<name>GTK+ Demo</name>
|
||||
<summary>Program to demonstrate GTK+ functions</summary>
|
||||
<description>
|
||||
<p>
|
||||
GTK+ Demo is a collection of examples that demonstrate the major
|
||||
features of the GTK+ toolkit.
|
||||
</p>
|
||||
</description>
|
||||
<screenshots>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gtk4-demo/gtk-demo1.png</image>
|
||||
<caption>The main window</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gtk4-demo/gtk-demo2.png</image>
|
||||
<caption>An example</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<kudos>
|
||||
<kudo>AppMenu</kudo>
|
||||
<kudo>HiDpiIcon</kudo>
|
||||
<kudo>ModernToolkit</kudo>
|
||||
</kudos>
|
||||
<url type="homepage">https://www.gtk.org</url>
|
||||
<translation type="gettext">gtk-4.0</translation>
|
||||
<update_contact>matthias.clasen_at_gmail.com</update_contact>
|
||||
<developer_name>Matthias Clasen and others</developer_name>
|
||||
</component>
|
179
demos/gtk-demo/paintable.c
Normal file
179
demos/gtk-demo/paintable.c
Normal file
@@ -0,0 +1,179 @@
|
||||
/* Paintable/A simple paintable
|
||||
*
|
||||
* GdkPaintable is an interface used by GTK for drawings of any sort
|
||||
* that do not require layouting or positioning.
|
||||
*
|
||||
* This demo code gives a simple example on how a paintable can
|
||||
* be created.
|
||||
*
|
||||
* Paintables can be used in many places inside GTK widgets, but the
|
||||
* most common usage is inside GtkImage and that's what we're going
|
||||
* to do here.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "paintable.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
/* First, add the boilerplate for the object itself.
|
||||
* This part would normally go in the header.
|
||||
*/
|
||||
#define GTK_TYPE_NUCLEAR_ICON (gtk_nuclear_icon_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkNuclearIcon, gtk_nuclear_icon, GTK, NUCLEAR_ICON, GObject)
|
||||
|
||||
/* Declare the struct. */
|
||||
struct _GtkNuclearIcon
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
/* We store this rotation value here.
|
||||
* We are not doing with it here, but it will come in
|
||||
* very useful in the followup demos.
|
||||
*/
|
||||
double rotation;
|
||||
};
|
||||
|
||||
struct _GtkNuclearIconClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
/* This is the function that draws the actual icon.
|
||||
* We make it a custom function and define it in the paintable.h header
|
||||
* so that it can be called from all the other demos, too.
|
||||
*/
|
||||
void
|
||||
gtk_nuclear_snapshot (GtkSnapshot *snapshot,
|
||||
double width,
|
||||
double height,
|
||||
double rotation)
|
||||
{
|
||||
#define RADIUS 0.3
|
||||
cairo_t *cr;
|
||||
double size;
|
||||
|
||||
gtk_snapshot_append_color (snapshot,
|
||||
&(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 },
|
||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
||||
"Yellow background");
|
||||
|
||||
size = MIN (width, height);
|
||||
cr = gtk_snapshot_append_cairo (snapshot,
|
||||
&GRAPHENE_RECT_INIT ((width - size) / 2.0,
|
||||
(height - size) / 2.0,
|
||||
size, size),
|
||||
"Radioactive Icon");
|
||||
cairo_translate (cr, width / 2.0, height / 2.0);
|
||||
cairo_scale (cr, size, size);
|
||||
cairo_rotate (cr, rotation);
|
||||
|
||||
cairo_arc (cr, 0, 0, 0.1, - G_PI, G_PI);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_set_line_width (cr, RADIUS);
|
||||
cairo_set_dash (cr, (double[1]) { RADIUS * G_PI / 3 }, 1, 0.0);
|
||||
cairo_arc (cr, 0, 0, RADIUS, - G_PI, G_PI);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
/* Here, we implement the functionality required by the GdkPaintable interface */
|
||||
static void
|
||||
gtk_nuclear_icon_snapshot (GdkPaintable *paintable,
|
||||
GdkSnapshot *snapshot,
|
||||
double width,
|
||||
double height)
|
||||
{
|
||||
GtkNuclearIcon *nuclear = GTK_NUCLEAR_ICON (paintable);
|
||||
|
||||
/* The snapshot function is the only function we need to implement.
|
||||
* It does the actual drawing of the paintable.
|
||||
*/
|
||||
|
||||
gtk_nuclear_snapshot (snapshot,
|
||||
width, height,
|
||||
nuclear->rotation);
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
gtk_nuclear_icon_get_flags (GdkPaintable *paintable)
|
||||
{
|
||||
/* The flags are very useful to let GTK know that this image
|
||||
* is never going to change.
|
||||
* This allows many optimizations and should therefore always
|
||||
* be set.
|
||||
*/
|
||||
return GDK_PAINTABLE_STATIC_CONTENTS | GDK_PAINTABLE_STATIC_SIZE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_nuclear_icon_paintable_init (GdkPaintableInterface *iface)
|
||||
{
|
||||
iface->snapshot = gtk_nuclear_icon_snapshot;
|
||||
iface->get_flags = gtk_nuclear_icon_get_flags;
|
||||
}
|
||||
|
||||
/* When defining the GType, we need to implement the GdkPaintable interface */
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkNuclearIcon, gtk_nuclear_icon, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
|
||||
gtk_nuclear_icon_paintable_init))
|
||||
|
||||
/* Here's the boilerplate for the GObject declaration.
|
||||
* We don't need to do anything special here, because we keep no
|
||||
* data of our own.
|
||||
*/
|
||||
static void
|
||||
gtk_nuclear_icon_class_init (GtkNuclearIconClass *klass)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_nuclear_icon_init (GtkNuclearIcon *nuclear)
|
||||
{
|
||||
}
|
||||
|
||||
/* And finally, we add a simple constructor.
|
||||
* It is declared in the header so that the other examples
|
||||
* can use it.
|
||||
*/
|
||||
GdkPaintable *
|
||||
gtk_nuclear_icon_new (double rotation)
|
||||
{
|
||||
GtkNuclearIcon *nuclear;
|
||||
|
||||
nuclear = g_object_new (GTK_TYPE_NUCLEAR_ICON, NULL);
|
||||
nuclear->rotation = rotation;
|
||||
|
||||
return GDK_PAINTABLE (nuclear);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_paintable (GtkWidget *do_widget)
|
||||
{
|
||||
GdkPaintable *nuclear;
|
||||
GtkWidget *image;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
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), "Nuclear Icon");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 300, 200);
|
||||
|
||||
nuclear = gtk_nuclear_icon_new (0.0);
|
||||
image = gtk_image_new_from_paintable (nuclear);
|
||||
gtk_container_add (GTK_CONTAINER (window), image);
|
||||
g_object_unref (nuclear);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
15
demos/gtk-demo/paintable.h
Normal file
15
demos/gtk-demo/paintable.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef __PAINTABLE_H__
|
||||
#define __PAINTABLE_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
void gtk_nuclear_snapshot (GtkSnapshot *snapshot,
|
||||
double width,
|
||||
double height,
|
||||
double rotation);
|
||||
|
||||
GdkPaintable * gtk_nuclear_icon_new (double rotation);
|
||||
GdkPaintable * gtk_nuclear_animation_new (void);
|
||||
GtkMediaStream *gtk_nuclear_media_stream_new (void);
|
||||
|
||||
#endif /* __PAINTABLE_H__ */
|
209
demos/gtk-demo/paintable_animated.c
Normal file
209
demos/gtk-demo/paintable_animated.c
Normal file
@@ -0,0 +1,209 @@
|
||||
/* Paintable/An animated paintable
|
||||
*
|
||||
* GdkPaintable also allows paintables to change.
|
||||
*
|
||||
* This demo code gives an example of how this could work. It builds
|
||||
* on the previous simple example.
|
||||
*
|
||||
* Paintables can also change their size, this works similarly, but
|
||||
* we will not demonstrate this here as our icon does not have any size.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "paintable.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
/* First, add the boilerplate for the object itself.
|
||||
* This part would normally go in the header.
|
||||
*/
|
||||
#define GTK_TYPE_NUCLEAR_ANIMATION (gtk_nuclear_animation_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkNuclearAnimation, gtk_nuclear_animation, GTK, NUCLEAR_ANIMATION, GObject)
|
||||
|
||||
/* Do a full rotation in 5 seconds.
|
||||
* We will register the timeout for doing a single step to
|
||||
* be executed every 10ms, which means after 1000 steps
|
||||
* 10s will have elapsed.
|
||||
*/
|
||||
#define MAX_PROGRESS 500
|
||||
|
||||
/* Declare the struct. */
|
||||
struct _GtkNuclearAnimation
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
/* This variable stores the progress of our animation.
|
||||
* We just count upwards until we hit MAX_PROGRESS and
|
||||
* then start from scratch.
|
||||
*/
|
||||
int progress;
|
||||
|
||||
/* This variable holds the ID of the timer that updates
|
||||
* our progress variable.
|
||||
* We need to keep track of it so that we can remove it
|
||||
* again.
|
||||
*/
|
||||
guint source_id;
|
||||
};
|
||||
|
||||
struct _GtkNuclearAnimationClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
/* Again, we implement the functionality required by the GdkPaintable interface */
|
||||
static void
|
||||
gtk_nuclear_animation_snapshot (GdkPaintable *paintable,
|
||||
GdkSnapshot *snapshot,
|
||||
double width,
|
||||
double height)
|
||||
{
|
||||
GtkNuclearAnimation *nuclear = GTK_NUCLEAR_ANIMATION (paintable);
|
||||
|
||||
/* We call the function from the previous example here. */
|
||||
gtk_nuclear_snapshot (snapshot,
|
||||
width, height,
|
||||
2 * G_PI * nuclear->progress / MAX_PROGRESS);
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
gtk_nuclear_animation_get_current_image (GdkPaintable *paintable)
|
||||
{
|
||||
GtkNuclearAnimation *nuclear = GTK_NUCLEAR_ANIMATION (paintable);
|
||||
|
||||
/* For non-static paintables, this function needs to be implemented.
|
||||
* It must return a static paintable with the same contents
|
||||
* as this one currently has.
|
||||
*
|
||||
* Luckily we added the rotation property to the nuclear icon
|
||||
* object previously, so we can just return an instance of that one.
|
||||
*/
|
||||
return gtk_nuclear_icon_new (2 * G_PI * nuclear->progress / MAX_PROGRESS);
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
gtk_nuclear_animation_get_flags (GdkPaintable *paintable)
|
||||
{
|
||||
/* This time, we cannot set the static contents flag because our animation
|
||||
* changes the contents.
|
||||
* However, our size still doesn't change, so report that flag.
|
||||
*/
|
||||
return GDK_PAINTABLE_STATIC_SIZE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_nuclear_animation_paintable_init (GdkPaintableInterface *iface)
|
||||
{
|
||||
iface->snapshot = gtk_nuclear_animation_snapshot;
|
||||
iface->get_current_image = gtk_nuclear_animation_get_current_image;
|
||||
iface->get_flags = gtk_nuclear_animation_get_flags;
|
||||
}
|
||||
|
||||
/* When defining the GType, we need to implement the GdkPaintable interface */
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkNuclearAnimation, gtk_nuclear_animation, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
|
||||
gtk_nuclear_animation_paintable_init))
|
||||
|
||||
/* This time, we need to implement the finalize function,
|
||||
*/
|
||||
static void
|
||||
gtk_nuclear_animation_finalize (GObject *object)
|
||||
{
|
||||
GtkNuclearAnimation *nuclear = GTK_NUCLEAR_ANIMATION (object);
|
||||
|
||||
/* Remove the timeout we registered when constructing
|
||||
* the object.
|
||||
*/
|
||||
g_source_remove (nuclear->source_id);
|
||||
|
||||
/* Don't forget to chain up to the parent class' implementation
|
||||
* of the finalize function.
|
||||
*/
|
||||
G_OBJECT_CLASS (gtk_nuclear_animation_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/* In the class declaration, we need to add our finalize function.
|
||||
*/
|
||||
static void
|
||||
gtk_nuclear_animation_class_init (GtkNuclearAnimationClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
gobject_class->finalize = gtk_nuclear_animation_finalize;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_nuclear_animation_step (gpointer data)
|
||||
{
|
||||
GtkNuclearAnimation *nuclear = data;
|
||||
|
||||
/* Add 1 to the progress and reset it when we've reached
|
||||
* the maximum value.
|
||||
* The animation will rotate by 360 degrees at MAX_PROGRESS
|
||||
* so it will be identical to the original unrotated one.
|
||||
*/
|
||||
nuclear->progress = (nuclear->progress + 1) % MAX_PROGRESS;
|
||||
|
||||
/* Now we need to tell all listeners that we've changed out contents
|
||||
* so that they can redraw this paintable.
|
||||
*/
|
||||
gdk_paintable_invalidate_contents (GDK_PAINTABLE (nuclear));
|
||||
|
||||
/* We want this timeout function to be called repeatedly,
|
||||
* so we return this value here.
|
||||
* If this was a single-shot timeout, we could also
|
||||
* return G_SOURCE_REMOVE here to get rid of it.
|
||||
*/
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_nuclear_animation_init (GtkNuclearAnimation *nuclear)
|
||||
{
|
||||
/* Add a timer here that constantly updates our animations.
|
||||
* We want to update it often enough to guarantee a smooth animation.
|
||||
*
|
||||
* Ideally, we'd attach to the frame clock, but because we do
|
||||
* not have it available here, we just use a regular timeout
|
||||
* that hopefully triggers often enough to be smooth.
|
||||
*/
|
||||
nuclear->source_id = g_timeout_add (10,
|
||||
gtk_nuclear_animation_step,
|
||||
nuclear);
|
||||
}
|
||||
|
||||
/* And finally, we add the simple constructor we declared in the header. */
|
||||
GdkPaintable *
|
||||
gtk_nuclear_animation_new (void)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_NUCLEAR_ANIMATION, NULL);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_paintable_animated (GtkWidget *do_widget)
|
||||
{
|
||||
GdkPaintable *nuclear;
|
||||
GtkWidget *image;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
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), "Nuclear Animation");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 300, 200);
|
||||
|
||||
nuclear = gtk_nuclear_animation_new ();
|
||||
image = gtk_image_new_from_paintable (nuclear);
|
||||
gtk_container_add (GTK_CONTAINER (window), image);
|
||||
g_object_unref (nuclear);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
312
demos/gtk-demo/paintable_mediastream.c
Normal file
312
demos/gtk-demo/paintable_mediastream.c
Normal file
@@ -0,0 +1,312 @@
|
||||
/* Paintable/A media stream
|
||||
*
|
||||
* GdkPaintable is also used by the GtkMediaStream class.
|
||||
*
|
||||
* This demo code turns the nuclear media_stream into the object
|
||||
* GTK uses for videos. This allows treating the icon like a
|
||||
* regular video, so we can for example attach controls to it.
|
||||
*
|
||||
* After all, what good is an media_stream if one cannot pause
|
||||
* it.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "paintable.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
/* First, add the boilerplate for the object itself.
|
||||
* This part would normally go in the header.
|
||||
*/
|
||||
#define GTK_TYPE_NUCLEAR_MEDIA_STREAM (gtk_nuclear_media_stream_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkNuclearMediaStream, gtk_nuclear_media_stream, GTK, NUCLEAR_MEDIA_STREAM, GtkMediaStream)
|
||||
|
||||
/* Do a full rotation in 5 seconds.
|
||||
*
|
||||
* We do not save steps here but real timestamps.
|
||||
* GtkMediaStream uses microseconds, so we will do so, too.
|
||||
*/
|
||||
#define DURATION (5 * G_USEC_PER_SEC)
|
||||
|
||||
/* Declare the struct. */
|
||||
struct _GtkNuclearMediaStream
|
||||
{
|
||||
/* We now inherit from the media stream object. */
|
||||
GtkMediaStream parent_instance;
|
||||
|
||||
/* This variable stores the progress of our video.
|
||||
*/
|
||||
gint64 progress;
|
||||
|
||||
/* This variable stores the timestamp of the last
|
||||
* time we updated the progress variable when the
|
||||
* video is currently playing.
|
||||
* This is so that we can always accurately compute the
|
||||
* progress we've had, even if the timeout does not
|
||||
* exactly work.
|
||||
*/
|
||||
gint64 last_time;
|
||||
|
||||
/* This variable again holds the ID of the timer that
|
||||
* updates our progress variable. Nothing changes about
|
||||
* how this works compared to the previous example.
|
||||
*/
|
||||
guint source_id;
|
||||
};
|
||||
|
||||
struct _GtkNuclearMediaStreamClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
/* GtkMediaStream is a GdkPaintable. So when we want to display video,
|
||||
* we have to implement the interface, just like in the animation example.
|
||||
*/
|
||||
static void
|
||||
gtk_nuclear_media_stream_snapshot (GdkPaintable *paintable,
|
||||
GdkSnapshot *snapshot,
|
||||
double width,
|
||||
double height)
|
||||
{
|
||||
GtkNuclearMediaStream *nuclear = GTK_NUCLEAR_MEDIA_STREAM (paintable);
|
||||
|
||||
/* We call the function from the previous example here. */
|
||||
gtk_nuclear_snapshot (snapshot,
|
||||
width, height,
|
||||
2 * G_PI * nuclear->progress / DURATION);
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
gtk_nuclear_media_stream_get_current_image (GdkPaintable *paintable)
|
||||
{
|
||||
GtkNuclearMediaStream *nuclear = GTK_NUCLEAR_MEDIA_STREAM (paintable);
|
||||
|
||||
/* Same thing as with the animation */
|
||||
return gtk_nuclear_icon_new (2 * G_PI * nuclear->progress / DURATION);
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
gtk_nuclear_media_stream_get_flags (GdkPaintable *paintable)
|
||||
{
|
||||
/* And same thing as with the animation over here, too. */
|
||||
return GDK_PAINTABLE_STATIC_SIZE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_nuclear_media_stream_paintable_init (GdkPaintableInterface *iface)
|
||||
{
|
||||
iface->snapshot = gtk_nuclear_media_stream_snapshot;
|
||||
iface->get_current_image = gtk_nuclear_media_stream_get_current_image;
|
||||
iface->get_flags = gtk_nuclear_media_stream_get_flags;
|
||||
}
|
||||
|
||||
/* This time, we inherit from GTK_TYPE_MEDIA_STREAM */
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkNuclearMediaStream, gtk_nuclear_media_stream, GTK_TYPE_MEDIA_STREAM,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
|
||||
gtk_nuclear_media_stream_paintable_init))
|
||||
|
||||
static gboolean
|
||||
gtk_nuclear_media_stream_step (gpointer data)
|
||||
{
|
||||
GtkNuclearMediaStream *nuclear = data;
|
||||
gint64 current_time;
|
||||
|
||||
/* Compute the time that has elapsed since the last time we were called
|
||||
* and add it to our current progress.
|
||||
*/
|
||||
current_time = g_source_get_time (g_main_current_source ());
|
||||
nuclear->progress += current_time - nuclear->last_time;
|
||||
|
||||
/* Check if we've ended */
|
||||
if (nuclear->progress > DURATION)
|
||||
{
|
||||
if (gtk_media_stream_get_loop (GTK_MEDIA_STREAM (nuclear)))
|
||||
{
|
||||
/* We're looping. So make the progress loop using modulo */
|
||||
nuclear->progress %= DURATION;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Just make sure we don't overflow */
|
||||
nuclear->progress = DURATION;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update the last time to the current timestamp. */
|
||||
nuclear->last_time = current_time;
|
||||
|
||||
/* Update the timestamp of the media stream */
|
||||
gtk_media_stream_update (GTK_MEDIA_STREAM (nuclear), nuclear->progress);
|
||||
|
||||
/* We also need to invalidate our contents again.
|
||||
* After all, we are a video and not just an audio stream.
|
||||
*/
|
||||
gdk_paintable_invalidate_contents (GDK_PAINTABLE (nuclear));
|
||||
|
||||
/* Now check if we have finished playing and if so,
|
||||
* tell the media stream. The media stream will then
|
||||
* call our pause function to pause the stream.
|
||||
*/
|
||||
if (nuclear->progress >= DURATION)
|
||||
gtk_media_stream_ended (GTK_MEDIA_STREAM (nuclear));
|
||||
|
||||
/* The timeout function is removed by the pause function,
|
||||
* so we can just always return this value.
|
||||
*/
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_nuclear_media_stream_play (GtkMediaStream *stream)
|
||||
{
|
||||
GtkNuclearMediaStream *nuclear = GTK_NUCLEAR_MEDIA_STREAM (stream);
|
||||
|
||||
/* If we're already at the end of the stream, we don't want
|
||||
* to start playing and exit early.
|
||||
*/
|
||||
if (nuclear->progress >= DURATION)
|
||||
return FALSE;
|
||||
|
||||
/* This time, we add the source only when we start playing.
|
||||
*/
|
||||
nuclear->source_id = g_timeout_add (10,
|
||||
gtk_nuclear_media_stream_step,
|
||||
nuclear);
|
||||
|
||||
/* We also want to initialize our time, so that we can
|
||||
* do accurate updates.
|
||||
*/
|
||||
nuclear->last_time = g_get_monotonic_time ();
|
||||
|
||||
/* We successfully started playing, so we return TRUE here. */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_nuclear_media_stream_pause (GtkMediaStream *stream)
|
||||
{
|
||||
GtkNuclearMediaStream *nuclear = GTK_NUCLEAR_MEDIA_STREAM (stream);
|
||||
|
||||
/* This function will be called when a playing stream
|
||||
* gets paused.
|
||||
* So we remove the updating source here and set it
|
||||
* back to 0 so that the finalize function doesn't try
|
||||
* to remove it again.
|
||||
*/
|
||||
g_source_remove (nuclear->source_id);
|
||||
nuclear->source_id = 0;
|
||||
nuclear->last_time = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_nuclear_media_stream_seek (GtkMediaStream *stream,
|
||||
gint64 timestamp)
|
||||
{
|
||||
GtkNuclearMediaStream *nuclear = GTK_NUCLEAR_MEDIA_STREAM (stream);
|
||||
|
||||
/* This is optional functionality for media streams,
|
||||
* but not being able to seek is kinda boring.
|
||||
* And it's trivial to implement, so let's go for it.
|
||||
*/
|
||||
nuclear->progress = timestamp;
|
||||
|
||||
/* Media streams are asynchronous, so seeking can take a while.
|
||||
* We however don't need that functionality, so we can just
|
||||
* report success.
|
||||
*/
|
||||
gtk_media_stream_seek_success (stream);
|
||||
|
||||
/* We also have to update our timestamp and tell the
|
||||
* paintable interface abbout the seek
|
||||
*/
|
||||
gtk_media_stream_update (stream, nuclear->progress);
|
||||
gdk_paintable_invalidate_contents (GDK_PAINTABLE (nuclear));
|
||||
}
|
||||
|
||||
/* Again, we need to implement the finalize function.
|
||||
*/
|
||||
static void
|
||||
gtk_nuclear_media_stream_finalize (GObject *object)
|
||||
{
|
||||
GtkNuclearMediaStream *nuclear = GTK_NUCLEAR_MEDIA_STREAM (object);
|
||||
|
||||
/* This time, we need to check if the source exists before
|
||||
* removing it as it only exists while we are playing.
|
||||
*/
|
||||
if (nuclear->source_id > 0)
|
||||
g_source_remove (nuclear->source_id);
|
||||
|
||||
/* Don't forget to chain up to the parent class' implementation
|
||||
* of the finalize function.
|
||||
*/
|
||||
G_OBJECT_CLASS (gtk_nuclear_media_stream_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/* In the class declaration, we need to implement the media stream */
|
||||
static void
|
||||
gtk_nuclear_media_stream_class_init (GtkNuclearMediaStreamClass *klass)
|
||||
{
|
||||
GtkMediaStreamClass *stream_class = GTK_MEDIA_STREAM_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
stream_class->play = gtk_nuclear_media_stream_play;
|
||||
stream_class->pause = gtk_nuclear_media_stream_pause;
|
||||
stream_class->seek = gtk_nuclear_media_stream_seek;
|
||||
|
||||
gobject_class->finalize = gtk_nuclear_media_stream_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_nuclear_media_stream_init (GtkNuclearMediaStream *nuclear)
|
||||
{
|
||||
/* This time, we don't have to add a timer here, because media
|
||||
* streams start paused.
|
||||
*
|
||||
* However, media streams need to tell GTK once they are intialized,
|
||||
* so we do that here.
|
||||
*/
|
||||
gtk_media_stream_prepared (GTK_MEDIA_STREAM (nuclear),
|
||||
FALSE,
|
||||
TRUE,
|
||||
TRUE,
|
||||
DURATION);
|
||||
}
|
||||
|
||||
/* And finally, we add the simple constructor we declared in the header. */
|
||||
GtkMediaStream *
|
||||
gtk_nuclear_media_stream_new (void)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_NUCLEAR_MEDIA_STREAM, NULL);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_paintable_mediastream (GtkWidget *do_widget)
|
||||
{
|
||||
GtkMediaStream *nuclear;
|
||||
GtkWidget *video;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
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), "Nuclear MediaStream");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 300, 200);
|
||||
|
||||
nuclear = gtk_nuclear_media_stream_new ();
|
||||
gtk_media_stream_set_loop (GTK_MEDIA_STREAM (nuclear), TRUE);
|
||||
|
||||
video = gtk_video_new_for_media_stream (nuclear);
|
||||
gtk_container_add (GTK_CONTAINER (window), video);
|
||||
|
||||
g_object_unref (nuclear);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -43,32 +43,28 @@
|
||||
<object class="GtkWindow" id="window">
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="visible">1</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="primary_icon_name">edit-find</property>
|
||||
<property name="secondary_icon_name">edit-clear</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="primary-icon-name">edit-find</property>
|
||||
<property name="secondary-icon-name">edit-clear</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="max-content-height">100</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="model">liststore1</property>
|
||||
<property name="headers_visible">0</property>
|
||||
<property name="enable_search">0</property>
|
||||
<property name="search_column">2</property>
|
||||
<property name="headers-visible">0</property>
|
||||
<property name="enable-search">0</property>
|
||||
<property name="search-column">2</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||
</child>
|
||||
|
@@ -2,22 +2,19 @@
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.6 -->
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="default_width">300</property>
|
||||
<property name="default_height">300</property>
|
||||
<property name="default-width">300</property>
|
||||
<property name="default-height">300</property>
|
||||
<property name="title">Revealer</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">1</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer0">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
@@ -30,12 +27,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer1">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<property name="transition-type">slide-up</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
@@ -48,12 +43,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer2">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<property name="transition-type">slide-right</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
@@ -66,11 +59,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer3">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
@@ -83,12 +74,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer4">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<property name="transition-type">slide-left</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
@@ -101,12 +90,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer5">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<property name="transition-type">slide-up</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
@@ -119,12 +106,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer6">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<property name="transition-type">slide-right</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
@@ -137,11 +122,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer7">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
@@ -154,12 +137,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer8">
|
||||
<property name="visible">1</property>
|
||||
<property name="transition-duration">2000</property>
|
||||
<property name="transition-type">slide-left</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="icon-name">face-cool-symbolic</property>
|
||||
<property name="icon-size">large</property>
|
||||
</object>
|
||||
|
@@ -23,52 +23,56 @@
|
||||
<property name="title" translatable="yes">Scales</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="visible">1</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="margin">20</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<object class="GtkLabel" id="label_plain">
|
||||
<property name="label">Plain</property>
|
||||
<property name="xalign">0</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="scale_plain"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<object class="GtkScale" id="scale_plain">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-request">200</property>
|
||||
<property name="draw_value">0</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label_plain"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<object class="GtkLabel" id="label_marks">
|
||||
<property name="label">Marks</property>
|
||||
<property name="xalign">0</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="scale_marks"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<object class="GtkScale" id="scale_marks">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-request">200</property>
|
||||
<property name="draw_value">0</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
<property name="hexpand">1</property>
|
||||
<marks>
|
||||
@@ -78,32 +82,39 @@
|
||||
<mark value="3" position="bottom"></mark>
|
||||
<mark value="4" position="bottom"></mark>
|
||||
</marks>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label_marks"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<object class="GtkLabel" id="label_discrete">
|
||||
<property name="label">Discrete</property>
|
||||
<property name="xalign">0</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="scale_discrete"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<object class="GtkScale" id="scale_discrete">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-request">200</property>
|
||||
<property name="round-digits">0</property>
|
||||
<property name="draw_value">0</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment3</property>
|
||||
<property name="hexpand">1</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label_discrete"/>
|
||||
</accessibility>
|
||||
<marks>
|
||||
<mark value="0" position="bottom"></mark>
|
||||
<mark value="1" position="bottom"></mark>
|
||||
@@ -113,8 +124,8 @@
|
||||
</marks>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -1,104 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.17 -->
|
||||
|
||||
<object class="GtkShortcutsWindow" id="shortcuts-boxes">
|
||||
<property name="modal">1</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<property name="section-name">shortcuts</property>
|
||||
<property name="max-height">12</property>
|
||||
|
||||
<!-- Overview shortcuts -->
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Overview</property>
|
||||
<property name="view">overview</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">F1</property>
|
||||
<property name="title" translatable="yes">Help</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Ctrl>n</property>
|
||||
<property name="title" translatable="yes">Create a new box</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Ctrl>f</property>
|
||||
<property name="title" translatable="yes">Search</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Ctrl>k</property>
|
||||
<property name="title" translatable="yes">Keyboard shortcuts</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Ctrl>q</property>
|
||||
<property name="title" translatable="yes">Close Window/Quit Boxes</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Wizard and Properties shortcuts -->
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Box Creation and Properties</property>
|
||||
<property name="view">wizard</property>
|
||||
|
||||
<!-- LTR -->
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="direction">ltr</property>
|
||||
<property name="accelerator"><Alt>Right</property>
|
||||
<property name="title" translatable="yes">Switch to the next page</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="direction">ltr</property>
|
||||
<property name="accelerator"><Alt>Left</property>
|
||||
<property name="title" translatable="yes">Switch to the previous page</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- RTL -->
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="direction">rtl</property>
|
||||
<property name="accelerator"><Alt>Left</property>
|
||||
<property name="title" translatable="yes">Switch to the next page</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="direction">rtl</property>
|
||||
<property name="accelerator"><Alt>Right</property>
|
||||
<property name="title" translatable="yes">Switch to the previous page</property>
|
||||
@@ -106,62 +81,48 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Display shortcuts -->
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Box Display</property>
|
||||
<property name="view">display</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Control_L+Alt_L</property>
|
||||
<property name="title" translatable="yes">Grab/Ungrab keyboard</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- LTR -->
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="direction">ltr</property>
|
||||
<property name="accelerator"><Alt>Left</property>
|
||||
<property name="title" translatable="yes">Back to overview</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- RTL -->
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="direction">rtl</property>
|
||||
<property name="accelerator"><Alt>Right</property>
|
||||
<property name="title" translatable="yes">Back to overview</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Ctrl>q</property>
|
||||
<property name="title" translatable="yes">Close window/Quit Boxes</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">F11</property>
|
||||
<property name="title" translatable="yes">Fullscreen/Restore from fullscreen</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
</interface>
|
||||
|
@@ -1,49 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.17 -->
|
||||
|
||||
<object class="GtkShortcutsWindow" id="shortcuts-builder">
|
||||
<property name="modal">1</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<property name="section-name">editor</property>
|
||||
<property name="title" translatable="yes">Editor Shortcuts</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">General</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Global Search</property>
|
||||
<property name="accelerator"><ctrl>period</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Preferences</property>
|
||||
<property name="accelerator"><ctrl>comma</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Command Bar</property>
|
||||
<property name="accelerator"><ctrl>Return</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Terminal</property>
|
||||
<property name="accelerator"><ctrl><shift>t</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Keyboard Shortcuts</property>
|
||||
<property name="accelerator"><ctrl><shift>question</property>
|
||||
</object>
|
||||
@@ -52,25 +44,21 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Panels</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Toggle left panel</property>
|
||||
<property name="accelerator">F9</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Toggle right panel</property>
|
||||
<property name="accelerator"><shift>F9</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Toggle bottom panel</property>
|
||||
<property name="accelerator"><ctrl>F9</property>
|
||||
</object>
|
||||
@@ -79,18 +67,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Touchpad gestures</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-two-finger-swipe-right</property>
|
||||
<property name="title" translatable="yes">Switch to the next document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-two-finger-swipe-left</property>
|
||||
<property name="title" translatable="yes">Switch to the previous document</property>
|
||||
</object>
|
||||
@@ -99,46 +84,39 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Files</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>n</property>
|
||||
<property name="title" translatable="yes">Create new document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>o</property>
|
||||
<property name="title" translatable="yes">Open a document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>s</property>
|
||||
<property name="title" translatable="yes">Save the document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>w</property>
|
||||
<property name="title" translatable="yes">Close the document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><alt>Page_Down</property>
|
||||
<property name="title" translatable="yes">Switch to the next document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><alt>Page_Up</property>
|
||||
<property name="title" translatable="yes">Switch to the previous document</property>
|
||||
</object>
|
||||
@@ -147,32 +125,27 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Find and replace</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>f</property>
|
||||
<property name="title" translatable="yes">Find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>g</property>
|
||||
<property name="title" translatable="yes">Find the next match</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>g</property>
|
||||
<property name="title" translatable="yes">Find the previous match</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>k</property>
|
||||
<property name="title" translatable="yes">Clear highlight</property>
|
||||
</object>
|
||||
@@ -181,25 +154,21 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Copy and Paste</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>c</property>
|
||||
<property name="title" translatable="yes">Copy selected text to clipboard</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>x</property>
|
||||
<property name="title" translatable="yes">Cut selected text to clipboard</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>v</property>
|
||||
<property name="title" translatable="yes">Paste text from clipboard</property>
|
||||
</object>
|
||||
@@ -208,18 +177,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Undo and Redo</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>z</property>
|
||||
<property name="title" translatable="yes">Undo previous command</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>z</property>
|
||||
<property name="title" translatable="yes">Redo previous command</property>
|
||||
</object>
|
||||
@@ -228,46 +194,39 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Editing</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>a</property>
|
||||
<property name="title" translatable="yes">Increment number at cursor</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>x</property>
|
||||
<property name="title" translatable="yes">Decrement number at cursor</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>j</property>
|
||||
<property name="title" translatable="yes">Join selected lines</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>space</property>
|
||||
<property name="title" translatable="yes">Show completion window</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Insert</property>
|
||||
<property name="title" translatable="yes">Toggle overwrite</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><alt>i</property>
|
||||
<property name="title" translatable="yes">Reindent line</property>
|
||||
</object>
|
||||
@@ -276,74 +235,63 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Navigation</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>n</property>
|
||||
<property name="title" translatable="yes">Move to next error in file</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>p</property>
|
||||
<property name="title" translatable="yes">Move to previous error in file</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><shift><alt>Left</property>
|
||||
<property name="title" translatable="yes">Move to previous edit location</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><shift><alt>Right</property>
|
||||
<property name="title" translatable="yes">Move to next edit location</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>period</property>
|
||||
<property name="title" translatable="yes">Jump to definition of symbol</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt><shift>Up</property>
|
||||
<property name="title" translatable="yes">Move sectionport up within the file</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt><shift>Down</property>
|
||||
<property name="title" translatable="yes">Move sectionport down within the file</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt><shift>End</property>
|
||||
<property name="title" translatable="yes">Move sectionport to end of file</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt><shift>Home</property>
|
||||
<property name="title" translatable="yes">Move sectionport to beginning of file</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>percent</property>
|
||||
<property name="title" translatable="yes">Move to matching bracket</property>
|
||||
</object>
|
||||
@@ -352,18 +300,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Selections</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>a</property>
|
||||
<property name="title" translatable="yes">Select all</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>backslash</property>
|
||||
<property name="title" translatable="yes">Unselect all</property>
|
||||
</object>
|
||||
@@ -374,45 +319,38 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<property name="max-height">16</property>
|
||||
<property name="section-name">terminal</property>
|
||||
<property name="title" translatable="yes">Terminal Shortcuts</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">General</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Global Search</property>
|
||||
<property name="accelerator"><ctrl>period</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Preferences</property>
|
||||
<property name="accelerator"><ctrl>comma</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Command Bar</property>
|
||||
<property name="accelerator"><ctrl>Return</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Terminal</property>
|
||||
<property name="accelerator"><ctrl><shift>t</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Keyboard Shortcuts</property>
|
||||
<property name="accelerator"><ctrl><shift>question</property>
|
||||
</object>
|
||||
@@ -421,18 +359,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Copy and Paste</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>c</property>
|
||||
<property name="title" translatable="yes">Copy selected text to clipboard</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>v</property>
|
||||
<property name="title" translatable="yes">Paste text from clipboard</property>
|
||||
</object>
|
||||
@@ -441,122 +376,98 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Switching</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>1...9</property>
|
||||
<property name="title" translatable="yes">Switch to n-th tab</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">'Special' combinations</property>
|
||||
|
||||
<property name="title" translatable="yes">'Special' combinations</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">t+t</property>
|
||||
<property name="title" translatable="yes">You want tea ?</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><shift><ctrl></property>
|
||||
<property name="title" translatable="yes">Shift Control</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>&<ctrl></property>
|
||||
<property name="title" translatable="yes">Control Control</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Control_L&Control_R</property>
|
||||
<property name="title" translatable="yes">Left and right control</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">All gestures</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-pinch</property>
|
||||
<property name="title" translatable="yes">A stock pinch gesture</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-stretch</property>
|
||||
<property name="title" translatable="yes">A stock stretch gesture</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-rotate-clockwise</property>
|
||||
<property name="title" translatable="yes">A stock rotation gesture</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-rotate-counterclockwise</property>
|
||||
<property name="title" translatable="yes">A stock rotation gesture</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-two-finger-swipe-left</property>
|
||||
<property name="title" translatable="yes">A stock swipe gesture</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-two-finger-swipe-right</property>
|
||||
<property name="title" translatable="yes">A stock swipe gesture</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-swipe-left</property>
|
||||
<property name="title" translatable="yes">A stock swipe gesture</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-swipe-right</property>
|
||||
<property name="title" translatable="yes">A stock swipe gesture</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
</interface>
|
||||
|
@@ -1,42 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.17 -->
|
||||
|
||||
<object class="GtkShortcutsWindow" id="shortcuts-clocks">
|
||||
<property name="modal">1</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<property name="section-name">shortcuts</property>
|
||||
<property name="max-height">10</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">General</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Page_Down</property>
|
||||
<property name="title" translatable="yes">Go to the next section</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Page_Up</property>
|
||||
<property name="title" translatable="yes">Go to the previous section</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Q</property>
|
||||
<property name="title" translatable="yes">Quit</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Right</property>
|
||||
<property name="direction">ltr</property>
|
||||
<property name="title" translatable="yes">Forward</property>
|
||||
@@ -44,7 +37,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Left</property>
|
||||
<property name="direction">ltr</property>
|
||||
<property name="title" translatable="yes">Back</property>
|
||||
@@ -52,7 +44,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Left</property>
|
||||
<property name="direction">rtl</property>
|
||||
<property name="title" translatable="yes">Forward</property>
|
||||
@@ -60,7 +51,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Right</property>
|
||||
<property name="direction">rtl</property>
|
||||
<property name="title" translatable="yes">Back</property>
|
||||
@@ -70,19 +60,16 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="view">world</property>
|
||||
<property name="title" translatable="yes">World Clocks</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>N</property>
|
||||
<property name="title" translatable="yes">Add a world clock</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>S</property>
|
||||
<property name="title" translatable="yes">Select world clocks</property>
|
||||
</object>
|
||||
@@ -91,19 +78,16 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="view">alarm</property>
|
||||
<property name="title" translatable="yes">Alarm</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>N</property>
|
||||
<property name="title" translatable="yes">Add an alarm</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>S</property>
|
||||
<property name="title" translatable="yes">Select alarms</property>
|
||||
</object>
|
||||
@@ -112,26 +96,22 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="view">stopwatch</property>
|
||||
<property name="title" translatable="yes">Stopwatch</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Return space</property>
|
||||
<property name="title" translatable="yes">Start / Stop / Continue</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">L</property>
|
||||
<property name="title" translatable="yes">Lap</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Delete</property>
|
||||
<property name="title" translatable="yes">Reset</property>
|
||||
</object>
|
||||
@@ -140,19 +120,16 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="view">timer</property>
|
||||
<property name="title" translatable="yes">Timer</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Return space</property>
|
||||
<property name="title" translatable="yes">Start / Stop / Pause</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Delete</property>
|
||||
<property name="title" translatable="yes">Reset</property>
|
||||
</object>
|
||||
@@ -162,5 +139,4 @@
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
</interface>
|
||||
|
@@ -1,28 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.17 -->
|
||||
|
||||
<object class="GtkShortcutsWindow" id="shortcuts-gedit">
|
||||
<property name="modal">1</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<property name="section-name">shortcuts</property>
|
||||
<property name="max-height">12</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Touchpad gestures</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-two-finger-swipe-right</property>
|
||||
<property name="title" translatable="yes">Switch to the next document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="shortcut-type">gesture-two-finger-swipe-left</property>
|
||||
<property name="title" translatable="yes">Switch to the previous document</property>
|
||||
</object>
|
||||
@@ -31,46 +26,39 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Documents</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>N</property>
|
||||
<property name="title" translatable="yes">Create new document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>O</property>
|
||||
<property name="title" translatable="yes">Open a document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>S</property>
|
||||
<property name="title" translatable="yes">Save the document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>W</property>
|
||||
<property name="title" translatable="yes">Close the document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><Alt>Page_Down</property>
|
||||
<property name="title" translatable="yes">Switch to the next document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><Alt>Page_Up</property>
|
||||
<property name="title" translatable="yes">Switch to the previous document</property>
|
||||
</object>
|
||||
@@ -79,46 +67,39 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Find and Replace</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>F</property>
|
||||
<property name="title" translatable="yes">Find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>G</property>
|
||||
<property name="title" translatable="yes">Find the next match</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><Shift>G</property>
|
||||
<property name="title" translatable="yes">Find the previous match</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>H</property>
|
||||
<property name="title" translatable="yes">Find and Replace</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><Shift>K</property>
|
||||
<property name="title" translatable="yes">Clear highlight</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>I</property>
|
||||
<property name="title" translatable="yes">Go to line</property>
|
||||
</object>
|
||||
@@ -127,11 +108,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Tools</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><shift>F7</property>
|
||||
<property name="title" translatable="yes">Check spelling</property>
|
||||
</object>
|
||||
@@ -140,25 +119,21 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Miscellaneous</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">F11</property>
|
||||
<property name="title" translatable="yes">Fullscreen on / off</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>P</property>
|
||||
<property name="title" translatable="yes">Print the document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Insert</property>
|
||||
<property name="title" translatable="yes">Toggle insert / overwrite</property>
|
||||
</object>
|
||||
@@ -168,5 +143,4 @@
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
</interface>
|
||||
|
@@ -1,60 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.17 -->
|
||||
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="title" translatable="yes">Shortcuts</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">50</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Builder</property>
|
||||
<signal name="clicked" handler="builder_shortcuts" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">GEdit</property>
|
||||
<signal name="clicked" handler="gedit_shortcuts" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Clocks - All</property>
|
||||
<signal name="clicked" handler="clocks_shortcuts" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Clocks - Stopwatch</property>
|
||||
<signal name="clicked" handler="clocks_shortcuts_stopwatch" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Boxes</property>
|
||||
<signal name="clicked" handler="boxes_shortcuts" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Boxes - Wizard</property>
|
||||
<signal name="clicked" handler="boxes_shortcuts_wizard" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Boxes - Display</property>
|
||||
<signal name="clicked" handler="boxes_shortcuts_display" swapped="1" object="window1"/>
|
||||
</object>
|
||||
|
@@ -3,189 +3,176 @@
|
||||
<object class="GtkAdjustment" id="basic_adjustment">
|
||||
<property name="lower">-10000</property>
|
||||
<property name="upper">10000</property>
|
||||
<property name="step_increment">0.5</property>
|
||||
<property name="page_increment">100</property>
|
||||
<property name="step-increment">0.5</property>
|
||||
<property name="page-increment">100</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="hex_adjustment">
|
||||
<property name="upper">255</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">16</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">16</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="time_adjustment">
|
||||
<property name="upper">1410</property>
|
||||
<property name="step_increment">30</property>
|
||||
<property name="page_increment">60</property>
|
||||
<property name="step-increment">30</property>
|
||||
<property name="page-increment">60</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="month_adjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">12</property>
|
||||
<property name="value">1</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">5</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="title" translatable="yes">Spin Button</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">_Numeric</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="mnemonic_widget">basic_spin</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="mnemonic-widget">basic_spin</property>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="basic_spin">
|
||||
<property name="visible">1</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="width_chars">5</property>
|
||||
<property name="width-chars">5</property>
|
||||
<property name="adjustment">basic_adjustment</property>
|
||||
<property name="climb_rate">1</property>
|
||||
<property name="climb-rate">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="numeric">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="basic_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="width_chars">10</property>
|
||||
<property name="width-chars">10</property>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">_Hexadecimal</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="mnemonic_widget">hex_spin</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="mnemonic-widget">hex_spin</property>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="hex_spin">
|
||||
<property name="visible">1</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="width_chars">4</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"/>
|
||||
<property name="wrap">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="hex_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="width_chars">10</property>
|
||||
<property name="width-chars">10</property>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">_Time</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="mnemonic_widget">time_spin</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="mnemonic-widget">time_spin</property>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="time_spin">
|
||||
<property name="visible">1</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="width_chars">5</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"/>
|
||||
<property name="wrap">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="time_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="width_chars">10</property>
|
||||
<property name="width-chars">10</property>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">_Month</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="mnemonic_widget">month_spin</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="mnemonic-widget">month_spin</property>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="month_spin">
|
||||
<property name="visible">1</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="width_chars">9</property>
|
||||
<property name="width-chars">9</property>
|
||||
<signal name="input" handler="month_spin_input"/>
|
||||
<signal name="output" handler="month_spin_output"/>
|
||||
<property name="adjustment">month_adjustment</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="update_policy">if-valid</property>
|
||||
<property name="update-policy">if-valid</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="month_label">
|
||||
<property name="visible">1</property>
|
||||
<property name="width_chars">10</property>
|
||||
<property name="width-chars">10</property>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -5,26 +5,22 @@
|
||||
<property name="title" translatable="yes">Stack</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkStackSwitcher">
|
||||
<property name="visible">1</property>
|
||||
<property name="stack">stack</property>
|
||||
<property name="halign">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="icon-name">gtk3-demo</property>
|
||||
@@ -37,9 +33,7 @@
|
||||
<child>
|
||||
<object class="GtkCheckButton">
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="draw_indicator">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
@@ -50,7 +44,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner">
|
||||
<property name="visible">1</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active">1</property>
|
||||
@@ -62,8 +55,8 @@
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -5,7 +5,6 @@
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="show-arrow">0</property>
|
||||
<style>
|
||||
@@ -13,11 +12,10 @@
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="homogeneous">1</property>
|
||||
@@ -25,11 +23,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -38,12 +35,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="homogeneous">1</property>
|
||||
@@ -51,11 +47,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
@@ -66,11 +61,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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="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"/>
|
||||
@@ -82,12 +76,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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="use-underline">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -96,12 +89,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="invisible-char">•</property>
|
||||
<property name="placeholder-text" translatable="yes">Search...</property>
|
||||
<property name="secondary-icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
@@ -110,11 +101,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch1">
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="tooltip_text">Switch it</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -123,7 +113,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
@@ -132,17 +121,15 @@
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Hi, I am a button</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</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="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="label" translatable="yes">And I'm another button</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
@@ -151,9 +138,8 @@
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">This is a button party!</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
@@ -163,7 +149,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<style>
|
||||
@@ -171,10 +156,9 @@
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="icon_name">list-add-symbolic</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="homogeneous">1</property>
|
||||
@@ -182,10 +166,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="icon_name">list-add-symbolic</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="homogeneous">1</property>
|
||||
@@ -194,8 +177,8 @@
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use_underline">1</property>
|
||||
<property name="icon_name">list-remove-symbolic</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -204,10 +187,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -216,11 +198,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="homogeneous">1</property>
|
||||
@@ -228,11 +209,10 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="visible">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="use-underline">1</property>
|
||||
<property name="icon-name">go-up-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -243,12 +223,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Plain</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="hexpand">1</property>
|
||||
@@ -257,7 +234,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Destructive</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
@@ -266,7 +242,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Suggested</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
|
@@ -1,795 +0,0 @@
|
||||
/* Tool Palette
|
||||
*
|
||||
* A tool palette widget shows groups of toolbar items as a grid of icons
|
||||
* or a list of names.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static void load_icon_items (GtkToolPalette *palette);
|
||||
static void load_toggle_items (GtkToolPalette *palette);
|
||||
static void load_special_items (GtkToolPalette *palette);
|
||||
|
||||
typedef struct _CanvasItem CanvasItem;
|
||||
|
||||
struct _CanvasItem
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
gdouble x, y;
|
||||
};
|
||||
|
||||
static gboolean drag_data_requested_for_drop = FALSE;
|
||||
static CanvasItem *drop_item = NULL;
|
||||
static GList *canvas_items = NULL;
|
||||
|
||||
/********************************/
|
||||
/* ====== Canvas drawing ====== */
|
||||
/********************************/
|
||||
|
||||
static CanvasItem*
|
||||
canvas_item_new (GtkWidget *widget,
|
||||
GtkToolButton *button,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
CanvasItem *item = NULL;
|
||||
const gchar *icon_name;
|
||||
GdkPixbuf *pixbuf;
|
||||
GtkIconTheme *icon_theme;
|
||||
|
||||
icon_name = gtk_tool_button_get_icon_name (button);
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
|
||||
pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
||||
icon_name,
|
||||
48,
|
||||
GTK_ICON_LOOKUP_GENERIC_FALLBACK,
|
||||
NULL);
|
||||
|
||||
if (pixbuf)
|
||||
{
|
||||
item = g_slice_new0 (CanvasItem);
|
||||
item->pixbuf = pixbuf;
|
||||
item->x = x;
|
||||
item->y = y;
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
static void
|
||||
canvas_item_free (CanvasItem *item)
|
||||
{
|
||||
g_object_unref (item->pixbuf);
|
||||
g_slice_free (CanvasItem, item);
|
||||
}
|
||||
|
||||
static void
|
||||
canvas_item_draw (const CanvasItem *item,
|
||||
cairo_t *cr,
|
||||
gboolean preview)
|
||||
{
|
||||
gdouble cx = gdk_pixbuf_get_width (item->pixbuf);
|
||||
gdouble cy = gdk_pixbuf_get_height (item->pixbuf);
|
||||
|
||||
gdk_cairo_set_source_pixbuf (cr,
|
||||
item->pixbuf,
|
||||
item->x - cx * 0.5,
|
||||
item->y - cy * 0.5);
|
||||
|
||||
if (preview)
|
||||
cairo_paint_with_alpha (cr, 0.6);
|
||||
else
|
||||
cairo_paint (cr);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
canvas_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GList *iter;
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
cairo_paint (cr);
|
||||
|
||||
for (iter = canvas_items; iter; iter = iter->next)
|
||||
canvas_item_draw (iter->data, cr, FALSE);
|
||||
|
||||
if (drop_item)
|
||||
canvas_item_draw (drop_item, cr, TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*****************************/
|
||||
/* ====== Palette DnD ====== */
|
||||
/*****************************/
|
||||
|
||||
static void
|
||||
palette_drop_item (GtkToolItem *drag_item,
|
||||
GtkToolItemGroup *drop_group,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GtkWidget *drag_group = gtk_widget_get_parent (GTK_WIDGET (drag_item));
|
||||
GtkToolItem *drop_item = gtk_tool_item_group_get_drop_item (drop_group, x, y);
|
||||
gint drop_position = -1;
|
||||
|
||||
if (drop_item)
|
||||
drop_position = gtk_tool_item_group_get_item_position (GTK_TOOL_ITEM_GROUP (drop_group), drop_item);
|
||||
|
||||
if (GTK_TOOL_ITEM_GROUP (drag_group) != drop_group)
|
||||
{
|
||||
gboolean homogeneous, expand, fill, new_row;
|
||||
|
||||
g_object_ref (drag_item);
|
||||
gtk_container_child_get (GTK_CONTAINER (drag_group), GTK_WIDGET (drag_item),
|
||||
"homogeneous", &homogeneous,
|
||||
"expand", &expand,
|
||||
"fill", &fill,
|
||||
"new-row", &new_row,
|
||||
NULL);
|
||||
gtk_container_remove (GTK_CONTAINER (drag_group), GTK_WIDGET (drag_item));
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (drop_group),
|
||||
drag_item, drop_position);
|
||||
gtk_container_child_set (GTK_CONTAINER (drop_group), GTK_WIDGET (drag_item),
|
||||
"homogeneous", homogeneous,
|
||||
"expand", expand,
|
||||
"fill", fill,
|
||||
"new-row", new_row,
|
||||
NULL);
|
||||
g_object_unref (drag_item);
|
||||
}
|
||||
else
|
||||
gtk_tool_item_group_set_item_position (GTK_TOOL_ITEM_GROUP (drop_group),
|
||||
drag_item, drop_position);
|
||||
}
|
||||
|
||||
static void
|
||||
palette_drop_group (GtkToolPalette *palette,
|
||||
GtkToolItemGroup *drag_group,
|
||||
GtkToolItemGroup *drop_group)
|
||||
{
|
||||
gint drop_position = -1;
|
||||
|
||||
if (drop_group)
|
||||
drop_position = gtk_tool_palette_get_group_position (palette, drop_group);
|
||||
|
||||
gtk_tool_palette_set_group_position (palette, drag_group, drop_position);
|
||||
}
|
||||
|
||||
static void
|
||||
palette_drag_data_received (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkSelectionData *selection,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GtkToolItemGroup *drop_group = NULL;
|
||||
GtkWidget *drag_palette = gtk_drag_get_source_widget (context);
|
||||
GtkWidget *drag_item = NULL;
|
||||
|
||||
while (drag_palette && !GTK_IS_TOOL_PALETTE (drag_palette))
|
||||
drag_palette = gtk_widget_get_parent (drag_palette);
|
||||
|
||||
if (drag_palette)
|
||||
{
|
||||
drag_item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (drag_palette),
|
||||
selection);
|
||||
drop_group = gtk_tool_palette_get_drop_group (GTK_TOOL_PALETTE (widget),
|
||||
x, y);
|
||||
}
|
||||
|
||||
if (GTK_IS_TOOL_ITEM_GROUP (drag_item))
|
||||
palette_drop_group (GTK_TOOL_PALETTE (drag_palette),
|
||||
GTK_TOOL_ITEM_GROUP (drag_item),
|
||||
drop_group);
|
||||
else if (GTK_IS_TOOL_ITEM (drag_item) && drop_group)
|
||||
{
|
||||
gtk_widget_get_allocation (GTK_WIDGET (drop_group), &allocation);
|
||||
palette_drop_item (GTK_TOOL_ITEM (drag_item),
|
||||
drop_group,
|
||||
x - allocation.x,
|
||||
y - allocation.y);
|
||||
}
|
||||
}
|
||||
|
||||
/********************************/
|
||||
/* ====== Passive Canvas ====== */
|
||||
/********************************/
|
||||
|
||||
static void
|
||||
passive_canvas_drag_data_received (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkSelectionData *selection,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
/* find the tool button, which is the source of this DnD operation */
|
||||
|
||||
GtkWidget *palette = gtk_drag_get_source_widget (context);
|
||||
CanvasItem *canvas_item = NULL;
|
||||
GtkWidget *tool_item = NULL;
|
||||
|
||||
while (palette && !GTK_IS_TOOL_PALETTE (palette))
|
||||
palette = gtk_widget_get_parent (palette);
|
||||
|
||||
if (palette)
|
||||
tool_item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (palette),
|
||||
selection);
|
||||
|
||||
g_assert (NULL == drop_item);
|
||||
|
||||
/* append a new canvas item when a tool button was found */
|
||||
|
||||
if (GTK_IS_TOOL_ITEM (tool_item))
|
||||
canvas_item = canvas_item_new (widget, GTK_TOOL_BUTTON (tool_item), x, y);
|
||||
|
||||
if (canvas_item)
|
||||
{
|
||||
canvas_items = g_list_append (canvas_items, canvas_item);
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************/
|
||||
/* ====== Interactive Canvas ====== */
|
||||
/************************************/
|
||||
|
||||
static gboolean
|
||||
interactive_canvas_drag_motion (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
if (drop_item)
|
||||
{
|
||||
/* already have a drop indicator - just update position */
|
||||
|
||||
drop_item->x = x;
|
||||
drop_item->y = y;
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
gdk_drag_status (context, GDK_ACTION_COPY, time);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* request DnD data for creating a drop indicator */
|
||||
|
||||
GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL);
|
||||
|
||||
if (!target)
|
||||
return FALSE;
|
||||
|
||||
drag_data_requested_for_drop = FALSE;
|
||||
gtk_drag_get_data (widget, context, target, time);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
interactive_canvas_drag_data_received (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkSelectionData *selection,
|
||||
guint time,
|
||||
gpointer data)
|
||||
|
||||
{
|
||||
/* find the tool button which is the source of this DnD operation */
|
||||
|
||||
GtkWidget *palette = gtk_drag_get_source_widget (context);
|
||||
GtkWidget *tool_item = NULL;
|
||||
CanvasItem *item;
|
||||
|
||||
while (palette && !GTK_IS_TOOL_PALETTE (palette))
|
||||
palette = gtk_widget_get_parent (palette);
|
||||
|
||||
if (palette)
|
||||
tool_item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (palette),
|
||||
selection);
|
||||
|
||||
/* create a canvas item when a tool button was found */
|
||||
|
||||
g_assert (NULL == drop_item);
|
||||
|
||||
if (!GTK_IS_TOOL_ITEM (tool_item))
|
||||
return;
|
||||
|
||||
if (drop_item)
|
||||
{
|
||||
canvas_item_free (drop_item);
|
||||
drop_item = NULL;
|
||||
}
|
||||
|
||||
item = canvas_item_new (widget, GTK_TOOL_BUTTON (tool_item), x, y);
|
||||
|
||||
/* Either create a new item or just create a preview item,
|
||||
depending on why the drag data was requested. */
|
||||
if(drag_data_requested_for_drop)
|
||||
{
|
||||
canvas_items = g_list_append (canvas_items, item);
|
||||
drop_item = NULL;
|
||||
|
||||
gtk_drag_finish (context, TRUE, time);
|
||||
} else
|
||||
{
|
||||
drop_item = item;
|
||||
gdk_drag_status (context, GDK_ACTION_COPY, time);
|
||||
}
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
interactive_canvas_drag_drop (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL);
|
||||
|
||||
if (!target)
|
||||
return FALSE;
|
||||
|
||||
drag_data_requested_for_drop = TRUE;
|
||||
gtk_drag_get_data (widget, context, target, time);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
interactive_canvas_drag_leave (gpointer data)
|
||||
{
|
||||
if (drop_item)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (data);
|
||||
|
||||
canvas_item_free (drop_item);
|
||||
drop_item = NULL;
|
||||
|
||||
if (widget)
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_combo_orientation_changed (GtkComboBox *combo_box,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkToolPalette *palette = GTK_TOOL_PALETTE (user_data);
|
||||
GtkScrolledWindow *sw;
|
||||
GtkTreeModel *model = gtk_combo_box_get_model (combo_box);
|
||||
GtkTreeIter iter;
|
||||
gint val = 0;
|
||||
|
||||
sw = GTK_SCROLLED_WINDOW (gtk_widget_get_parent (GTK_WIDGET (palette)));
|
||||
|
||||
if (!gtk_combo_box_get_active_iter (combo_box, &iter))
|
||||
return;
|
||||
|
||||
gtk_tree_model_get (model, &iter, 1, &val, -1);
|
||||
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (palette), val);
|
||||
|
||||
if (val == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_scrolled_window_set_policy (sw, GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
|
||||
else
|
||||
gtk_scrolled_window_set_policy (sw, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
}
|
||||
|
||||
static void
|
||||
on_combo_style_changed (GtkComboBox *combo_box,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkToolPalette *palette = GTK_TOOL_PALETTE (user_data);
|
||||
GtkTreeModel *model = gtk_combo_box_get_model (combo_box);
|
||||
GtkTreeIter iter;
|
||||
gint val = 0;
|
||||
|
||||
if (!gtk_combo_box_get_active_iter (combo_box, &iter))
|
||||
return;
|
||||
|
||||
gtk_tree_model_get (model, &iter, 1, &val, -1);
|
||||
|
||||
if (val == -1)
|
||||
gtk_tool_palette_unset_style (palette);
|
||||
else
|
||||
gtk_tool_palette_set_style (palette, val);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_toolpalette (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *box = NULL;
|
||||
GtkWidget *hbox = NULL;
|
||||
GtkWidget *combo_orientation = NULL;
|
||||
GtkListStore *orientation_model = NULL;
|
||||
GtkWidget *combo_style = NULL;
|
||||
GtkListStore *style_model = NULL;
|
||||
GtkCellRenderer *cell_renderer = NULL;
|
||||
GtkTreeIter iter;
|
||||
GtkWidget *palette = NULL;
|
||||
GtkWidget *palette_scroller = NULL;
|
||||
GtkWidget *notebook = NULL;
|
||||
GtkWidget *contents = NULL;
|
||||
GtkWidget *contents_scroller = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
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), "Tool Palette");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 600);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
/* Add widgets to control the ToolPalette appearance: */
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
|
||||
g_object_set (box, "margin", 6, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
/* Orientation combo box: */
|
||||
orientation_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
|
||||
gtk_list_store_append (orientation_model, &iter);
|
||||
gtk_list_store_set (orientation_model, &iter,
|
||||
0, "Horizontal",
|
||||
1, GTK_ORIENTATION_HORIZONTAL,
|
||||
-1);
|
||||
gtk_list_store_append (orientation_model, &iter);
|
||||
gtk_list_store_set (orientation_model, &iter,
|
||||
0, "Vertical",
|
||||
1, GTK_ORIENTATION_VERTICAL,
|
||||
-1);
|
||||
|
||||
combo_orientation =
|
||||
gtk_combo_box_new_with_model (GTK_TREE_MODEL (orientation_model));
|
||||
cell_renderer = gtk_cell_renderer_text_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_orientation),
|
||||
cell_renderer,
|
||||
TRUE);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_orientation),
|
||||
cell_renderer,
|
||||
"text", 0,
|
||||
NULL);
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_orientation), &iter);
|
||||
gtk_box_pack_start (GTK_BOX (box), combo_orientation);
|
||||
|
||||
/* Style combo box: */
|
||||
style_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
|
||||
gtk_list_store_append (style_model, &iter);
|
||||
gtk_list_store_set (style_model, &iter,
|
||||
0, "Text",
|
||||
1, GTK_TOOLBAR_TEXT,
|
||||
-1);
|
||||
gtk_list_store_append (style_model, &iter);
|
||||
gtk_list_store_set (style_model, &iter,
|
||||
0, "Both",
|
||||
1, GTK_TOOLBAR_BOTH,
|
||||
-1);
|
||||
gtk_list_store_append (style_model, &iter);
|
||||
gtk_list_store_set (style_model, &iter,
|
||||
0, "Both: Horizontal",
|
||||
1, GTK_TOOLBAR_BOTH_HORIZ,
|
||||
-1);
|
||||
gtk_list_store_append (style_model, &iter);
|
||||
gtk_list_store_set (style_model, &iter,
|
||||
0, "Icons",
|
||||
1, GTK_TOOLBAR_ICONS,
|
||||
-1);
|
||||
gtk_list_store_append (style_model, &iter);
|
||||
gtk_list_store_set (style_model, &iter,
|
||||
0, "Default",
|
||||
1, -1, /* A custom meaning for this demo. */
|
||||
-1);
|
||||
combo_style = gtk_combo_box_new_with_model (GTK_TREE_MODEL (style_model));
|
||||
cell_renderer = gtk_cell_renderer_text_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_style),
|
||||
cell_renderer,
|
||||
TRUE);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_style),
|
||||
cell_renderer,
|
||||
"text", 0,
|
||||
NULL);
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_style), &iter);
|
||||
gtk_box_pack_start (GTK_BOX (box), combo_style);
|
||||
|
||||
/* Add hbox */
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
|
||||
gtk_box_pack_start (GTK_BOX (box), hbox);
|
||||
|
||||
/* Add and fill the ToolPalette: */
|
||||
palette = gtk_tool_palette_new ();
|
||||
|
||||
load_icon_items (GTK_TOOL_PALETTE (palette));
|
||||
load_toggle_items (GTK_TOOL_PALETTE (palette));
|
||||
load_special_items (GTK_TOOL_PALETTE (palette));
|
||||
|
||||
palette_scroller = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_set_vexpand (palette_scroller, TRUE);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (palette_scroller),
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
g_object_set (palette_scroller, "margin", 6, NULL);
|
||||
gtk_widget_set_hexpand (palette_scroller, TRUE);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (palette_scroller), palette);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), palette_scroller);
|
||||
|
||||
/* Connect signals: */
|
||||
g_signal_connect (combo_orientation, "changed",
|
||||
G_CALLBACK (on_combo_orientation_changed), palette);
|
||||
g_signal_connect (combo_style, "changed",
|
||||
G_CALLBACK (on_combo_style_changed), palette);
|
||||
|
||||
/* Keep the widgets in sync: */
|
||||
on_combo_orientation_changed (GTK_COMBO_BOX (combo_orientation), palette);
|
||||
|
||||
/* ===== notebook ===== */
|
||||
|
||||
notebook = gtk_notebook_new ();
|
||||
g_object_set (notebook, "margin", 6, NULL);
|
||||
gtk_box_pack_end (GTK_BOX(hbox), notebook);
|
||||
|
||||
/* ===== DnD for tool items ===== */
|
||||
|
||||
g_signal_connect (palette, "drag-data-received",
|
||||
G_CALLBACK (palette_drag_data_received), NULL);
|
||||
|
||||
gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette),
|
||||
palette,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
GTK_TOOL_PALETTE_DRAG_ITEMS |
|
||||
GTK_TOOL_PALETTE_DRAG_GROUPS,
|
||||
GDK_ACTION_MOVE);
|
||||
|
||||
/* ===== passive DnD dest ===== */
|
||||
|
||||
contents = gtk_drawing_area_new ();
|
||||
|
||||
g_object_connect (contents,
|
||||
"draw", canvas_draw, NULL,
|
||||
"drag-data-received", passive_canvas_drag_data_received, NULL,
|
||||
NULL);
|
||||
|
||||
gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette),
|
||||
contents,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
GTK_TOOL_PALETTE_DRAG_ITEMS,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
contents_scroller = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (contents_scroller),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_ALWAYS);
|
||||
gtk_container_add (GTK_CONTAINER (contents_scroller), contents);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
contents_scroller,
|
||||
gtk_label_new ("Passive DnD Mode"));
|
||||
g_object_set (contents_scroller, "margin", 6, NULL);
|
||||
|
||||
/* ===== interactive DnD dest ===== */
|
||||
|
||||
contents = gtk_drawing_area_new ();
|
||||
|
||||
g_object_connect (contents,
|
||||
"draw", canvas_draw, NULL,
|
||||
"drag-motion", interactive_canvas_drag_motion, NULL,
|
||||
"drag-data-received", interactive_canvas_drag_data_received, NULL,
|
||||
"drag-leave", interactive_canvas_drag_leave, contents,
|
||||
"drag-drop", interactive_canvas_drag_drop, NULL,
|
||||
NULL);
|
||||
|
||||
gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette),
|
||||
contents,
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT,
|
||||
GTK_TOOL_PALETTE_DRAG_ITEMS,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
contents_scroller = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (contents_scroller),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_ALWAYS);
|
||||
gtk_container_add (GTK_CONTAINER (contents_scroller), contents);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), contents_scroller,
|
||||
gtk_label_new ("Interactive DnD Mode"));
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
{
|
||||
gtk_widget_show (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
load_icon_items (GtkToolPalette *palette)
|
||||
{
|
||||
GList *contexts;
|
||||
GList *l;
|
||||
GtkIconTheme *icon_theme;
|
||||
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (palette)));
|
||||
|
||||
contexts = gtk_icon_theme_list_contexts (icon_theme);
|
||||
for (l = contexts; l; l = l->next)
|
||||
{
|
||||
gchar *context = l->data;
|
||||
GList *icon_names;
|
||||
GList *ll;
|
||||
const guint max_icons = 10;
|
||||
guint icons_count = 0;
|
||||
|
||||
GtkWidget *group = gtk_tool_item_group_new (context);
|
||||
gtk_container_add (GTK_CONTAINER (palette), group);
|
||||
|
||||
if (g_strcmp0 (context, "Animations") == 0)
|
||||
continue;
|
||||
|
||||
g_message ("Got context '%s'", context);
|
||||
icon_names = gtk_icon_theme_list_icons (icon_theme, context);
|
||||
icon_names = g_list_sort (icon_names, (GCompareFunc) strcmp);
|
||||
|
||||
for (ll = icon_names; ll; ll = ll->next)
|
||||
{
|
||||
GtkToolItem *item;
|
||||
gchar *id = ll->data;
|
||||
|
||||
if (g_str_equal (id, "emblem-desktop"))
|
||||
continue;
|
||||
|
||||
if (g_str_has_suffix (id, "-symbolic"))
|
||||
continue;
|
||||
|
||||
g_message ("Got id '%s'", id);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), id);
|
||||
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item), id);
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
|
||||
/* Prevent us having an insane number of icons: */
|
||||
++icons_count;
|
||||
if(icons_count >= max_icons)
|
||||
break;
|
||||
}
|
||||
|
||||
g_list_free_full (icon_names, g_free);
|
||||
}
|
||||
|
||||
g_list_free_full (contexts, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
load_toggle_items (GtkToolPalette *palette)
|
||||
{
|
||||
GSList *toggle_group = NULL;
|
||||
GtkToolItem *item;
|
||||
GtkWidget *group;
|
||||
char *label;
|
||||
int i;
|
||||
|
||||
group = gtk_tool_item_group_new ("Radio Item");
|
||||
gtk_container_add (GTK_CONTAINER (palette), group);
|
||||
|
||||
for (i = 1; i <= 10; ++i)
|
||||
{
|
||||
label = g_strdup_printf ("#%d", i);
|
||||
item = gtk_radio_tool_button_new (toggle_group);
|
||||
gtk_tool_button_set_label (GTK_TOOL_BUTTON (item), label);
|
||||
g_free (label);
|
||||
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
toggle_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (item));
|
||||
}
|
||||
}
|
||||
|
||||
static GtkToolItem *
|
||||
create_entry_item (const char *text)
|
||||
{
|
||||
GtkToolItem *item;
|
||||
GtkWidget *entry;
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), text);
|
||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), 5);
|
||||
|
||||
item = gtk_tool_item_new ();
|
||||
gtk_container_add (GTK_CONTAINER (item), entry);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
static void
|
||||
load_special_items (GtkToolPalette *palette)
|
||||
{
|
||||
GtkToolItem *item;
|
||||
GtkWidget *group;
|
||||
GtkWidget *label_button;
|
||||
|
||||
group = gtk_tool_item_group_new (NULL);
|
||||
label_button = gtk_button_new_with_label ("Advanced Features");
|
||||
gtk_widget_show (label_button);
|
||||
gtk_tool_item_group_set_label_widget (GTK_TOOL_ITEM_GROUP (group),
|
||||
label_button);
|
||||
gtk_container_add (GTK_CONTAINER (palette), group);
|
||||
|
||||
item = create_entry_item ("homogeneous=FALSE");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item),
|
||||
"homogeneous", FALSE, NULL);
|
||||
|
||||
item = create_entry_item ("homogeneous=FALSE, expand=TRUE");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item),
|
||||
"homogeneous", FALSE, "expand", TRUE,
|
||||
NULL);
|
||||
|
||||
item = create_entry_item ("homogeneous=FALSE, expand=TRUE, fill=FALSE");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item),
|
||||
"homogeneous", FALSE, "expand", TRUE,
|
||||
"fill", FALSE, NULL);
|
||||
|
||||
item = create_entry_item ("homogeneous=FALSE, expand=TRUE, new-row=TRUE");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item),
|
||||
"homogeneous", FALSE, "expand", TRUE,
|
||||
"new-row", TRUE, NULL);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-up");
|
||||
gtk_tool_item_set_tooltip_text (item, "Show on vertical palettes only");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
gtk_tool_item_set_visible_horizontal (item, FALSE);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-next");
|
||||
gtk_tool_item_set_tooltip_text (item, "Show on horizontal palettes only");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
gtk_tool_item_set_visible_vertical (item, FALSE);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "edit-delete");
|
||||
gtk_tool_item_set_tooltip_text (item, "Do not show at all");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
gtk_widget_hide (GTK_WIDGET (item));
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "view-fullscreen");
|
||||
gtk_tool_item_set_tooltip_text (item, "Expanded this item");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item),
|
||||
"homogeneous", FALSE,
|
||||
"expand", TRUE,
|
||||
NULL);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "help-browser");
|
||||
gtk_tool_item_set_tooltip_text (item, "A regular item");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
}
|
96
demos/gtk-demo/video_player.c
Normal file
96
demos/gtk-demo/video_player.c
Normal file
@@ -0,0 +1,96 @@
|
||||
/* Video Player
|
||||
*
|
||||
* This is a simple video player using just GTK widgets.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static void
|
||||
open_dialog_response_cb (GtkWidget *dialog,
|
||||
int response,
|
||||
GtkWidget *video)
|
||||
{
|
||||
gtk_widget_hide (dialog);
|
||||
|
||||
if (response == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
GFile *file;
|
||||
|
||||
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||
gtk_video_set_file (GTK_VIDEO (video), file);
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
open_clicked_cb (GtkWidget *button,
|
||||
GtkWidget *video)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_file_chooser_dialog_new ("Select a video",
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (button)),
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
"_Cancel", GTK_RESPONSE_CANCEL,
|
||||
"_Open", GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (open_dialog_response_cb), video);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
fullscreen_clicked_cb (GtkWidget *button,
|
||||
gpointer unused)
|
||||
{
|
||||
GtkWidget *window = gtk_widget_get_toplevel (button);
|
||||
|
||||
gtk_window_fullscreen (GTK_WINDOW (window));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_video_player (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *title;
|
||||
GtkWidget *video;
|
||||
GtkWidget *open_button;
|
||||
GtkWidget *fullscreen_button;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
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), "Video Player");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
video = gtk_video_new ();
|
||||
gtk_container_add (GTK_CONTAINER (window), video);
|
||||
|
||||
title = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (title), TRUE);
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (title), "Video Player");
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), title);
|
||||
|
||||
open_button = gtk_button_new_with_mnemonic ("_Open");
|
||||
g_signal_connect (open_button, "clicked", G_CALLBACK (open_clicked_cb), video);
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (title), open_button);
|
||||
|
||||
fullscreen_button = gtk_button_new_from_icon_name ("view-fullscreen-symbolic");
|
||||
g_signal_connect (fullscreen_button, "clicked", G_CALLBACK (fullscreen_clicked_cb), NULL);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (title), fullscreen_button);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -1,13 +1,14 @@
|
||||
/* Benchmark/Widgetbowl
|
||||
*
|
||||
* This demo models the fishbowl demos seen on the web in a GTK way.
|
||||
* It's also a neat little tool to see how fast your computer (or
|
||||
* your GTK version) is.
|
||||
* This is a version of the Fishbowl demo that instead shows different
|
||||
* kinds of widgets, which is useful for comparing the rendering performance
|
||||
* of theme specifics.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "gtkfishbowl.h"
|
||||
#include "gtkgears.h"
|
||||
|
||||
const char *const css =
|
||||
".blurred-button {"
|
||||
@@ -80,6 +81,28 @@ create_label (void)
|
||||
return w;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_video (void)
|
||||
{
|
||||
GtkMediaStream *stream = gtk_media_file_new_for_resource ("/images/gtk-logo.webm");
|
||||
GtkWidget *w = gtk_image_new_from_paintable (GDK_PAINTABLE (stream));
|
||||
gtk_media_stream_set_loop (stream, TRUE);
|
||||
gtk_media_stream_play (stream);
|
||||
g_object_unref (stream);
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_gears (void)
|
||||
{
|
||||
GtkWidget *w = gtk_gears_new ();
|
||||
|
||||
gtk_widget_set_size_request (w, 100, 100);
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
GtkWidget * (*create_func) (void);
|
||||
@@ -91,6 +114,8 @@ static const struct {
|
||||
{ "Label" , create_label },
|
||||
{ "Spinner" , create_spinner },
|
||||
{ "Spinbutton", create_spinbutton },
|
||||
{ "Video", create_video },
|
||||
{ "Gears", create_gears },
|
||||
};
|
||||
|
||||
static int selected_widget_type = -1;
|
||||
|
@@ -467,6 +467,7 @@ 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);
|
||||
|
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.8 -->
|
||||
<object class="IconStore" id="store">
|
||||
</object>
|
||||
<object class="IconStore" id="store"/>
|
||||
<object class="GtkTreeModelFilter" id="filter_model">
|
||||
<property name="child_model">store</property>
|
||||
<property name="child-model">store</property>
|
||||
</object>
|
||||
<template class="IconBrowserWindow" parent="GtkApplicationWindow">
|
||||
<property name="title" translatable="yes">Icon Browser</property>
|
||||
@@ -13,26 +12,22 @@
|
||||
<signal name="key-press-event" handler="key_press_event_cb"/>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">Icon Browser</property>
|
||||
<property name="show-title-buttons">True</property>
|
||||
<property name="show-title-buttons">1</property>
|
||||
<child type="title">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="normal_radio">
|
||||
<property name="visible">True</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
<property name="draw-indicator">0</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="symbolic_radio">
|
||||
<property name="visible">True</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
<property name="draw-indicator">0</property>
|
||||
<property name="label" translatable="yes">Symbolic</property>
|
||||
<property name="group">normal_radio</property>
|
||||
<signal name="toggled" handler="symbolic_toggled"/>
|
||||
@@ -42,13 +37,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="search-icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -61,32 +54,24 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="context_list">
|
||||
<property name="visible">True</property>
|
||||
<property name="selection_mode">single</property>
|
||||
<signal name="selected-rows-changed" handler="selected_context_changed"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="content_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkSearchBar" id="searchbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="search-mode-enabled" bind-source="search" bind-property="active" bind-flags="bidirectional"/>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="searchentry">
|
||||
<property name="visible">True</property>
|
||||
<signal name="search-changed" handler="search_text_changed"/>
|
||||
</object>
|
||||
</child>
|
||||
@@ -94,29 +79,24 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="sw">
|
||||
<property name="visible">True</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="expand">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<child>
|
||||
<object class="GtkIconView" id="list">
|
||||
<property name="visible">True</property>
|
||||
<property name="model">filter_model</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="activate-on-single-click">True</property>
|
||||
<property name="activate-on-single-click">1</property>
|
||||
<signal name="item_activated" handler="item_activated"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="cell">
|
||||
<property name="xpad">10</property>
|
||||
<property name="ypad">10</property>
|
||||
<property name="stock-size">6</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="text_cell">
|
||||
<property name="xpad">10</property>
|
||||
<property name="ypad">10</property>
|
||||
<property name="xalign">0.5</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -137,24 +117,25 @@
|
||||
</widgets>
|
||||
</object>
|
||||
<object class="GtkDialog" id="details">
|
||||
<property name="modal">True</property>
|
||||
<property name="modal">1</property>
|
||||
<property name="use-header-bar">1</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="resizable">0</property>
|
||||
<property name="hide-on-close">1</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">10</property>
|
||||
<property name="row-spacing">18</property>
|
||||
<property name="column-spacing">18</property>
|
||||
<property name="halign">center</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label1"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
@@ -163,9 +144,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label2"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
@@ -174,9 +157,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image3">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label3"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
@@ -185,9 +170,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image4">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label4"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">3</property>
|
||||
@@ -196,9 +183,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image5">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label5"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">4</property>
|
||||
@@ -207,25 +196,28 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image6">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label6"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">5</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">16×16</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image1"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
@@ -234,13 +226,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">24×24</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image2"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
@@ -249,13 +243,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">32×32</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image3"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
@@ -264,13 +260,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">48×48</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image4"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">3</property>
|
||||
@@ -279,13 +277,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">64×64</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image5"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">4</property>
|
||||
@@ -294,13 +294,15 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">scalable</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image6"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">5</property>
|
||||
@@ -311,7 +313,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Copy to Clipboard</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
@@ -322,8 +323,7 @@
|
||||
<child>
|
||||
<object class="GtkLabel" id="description">
|
||||
<property name="margin">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="max-width-chars">60</property>
|
||||
<property name="valign">start</property>
|
||||
</object>
|
||||
|
@@ -2,28 +2,23 @@
|
||||
<object class="GtkShortcutsWindow" id="help_overlay">
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title">General</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">F1</property>
|
||||
<property name="title">Show About Dialog</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Primary>q</property>
|
||||
<property name="title">Quit</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Primary>d</property>
|
||||
<property name="title">Switch to dark theme</property>
|
||||
</object>
|
||||
@@ -32,26 +27,22 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title">Traditional</property>
|
||||
<property name="view">page2</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Primary>s</property>
|
||||
<property name="title">Search</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Delete</property>
|
||||
<property name="title">Delete</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Primary>b</property>
|
||||
<property name="title">Set background</property>
|
||||
</object>
|
||||
@@ -60,26 +51,22 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title">Modern</property>
|
||||
<property name="view">page3</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Primary>o</property>
|
||||
<property name="title">Open a file</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Primary>r</property>
|
||||
<property name="title">Start recording</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Primary>l</property>
|
||||
<property name="title">Lock or unlock</property>
|
||||
</object>
|
||||
|
@@ -24,3 +24,6 @@ foreach icon_size : ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256', ]
|
||||
install_data('data/@0@/gtk4-widget-factory-symbolic.symbolic.png'.format(icon_size),
|
||||
install_dir: icons_dir)
|
||||
endforeach
|
||||
|
||||
# appdata
|
||||
install_data('org.gtk.WidgetFactory.appdata.xml', install_dir: gtk_appdatadir)
|
34
demos/widget-factory/org.gtk.WidgetFactory.appdata.xml
Normal file
34
demos/widget-factory/org.gtk.WidgetFactory.appdata.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.gtk.WidgetFactory.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>LGPL-2.0+</project_license>
|
||||
<name>GTK+ Widget Factory</name>
|
||||
<summary>Program to demonstrate GTK+ functions</summary>
|
||||
<description>
|
||||
<p>
|
||||
GTK+ Widget Factory is a showcase of GTK+ widgets. It was
|
||||
originally created to help theme authors test their creations
|
||||
for completeness.
|
||||
</p>
|
||||
</description>
|
||||
<screenshots>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gtk4-widget-factory/gtk-widget-factory1.png</image>
|
||||
<caption>Page 1</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gtk4-widget-factory/gtk-widget-factory2.png</image>
|
||||
<caption>Page 3</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<kudos>
|
||||
<kudo>AppMenu</kudo>
|
||||
<kudo>HiDpiIcon</kudo>
|
||||
<kudo>ModernToolkit</kudo>
|
||||
</kudos>
|
||||
<url type="homepage">https://www.gtk.org</url>
|
||||
<translation type="gettext">gtk-4.0</translation>
|
||||
<update_contact>matthias.clasen_at_gmail.com</update_contact>
|
||||
<developer_name>Matthias Clasen and others</developer_name>
|
||||
</component>
|
@@ -64,7 +64,7 @@ get_idle (gpointer data)
|
||||
GtkApplication *app = gtk_window_get_application (GTK_WINDOW (window));
|
||||
|
||||
gtk_widget_set_sensitive (window, TRUE);
|
||||
gdk_window_set_cursor (gtk_widget_get_window (window), NULL);
|
||||
gdk_surface_set_cursor (gtk_widget_get_surface (window), NULL);
|
||||
g_application_unmark_busy (G_APPLICATION (app));
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
@@ -81,7 +81,7 @@ get_busy (GSimpleAction *action,
|
||||
|
||||
g_application_mark_busy (G_APPLICATION (app));
|
||||
cursor = gdk_cursor_new_from_name ("wait", NULL);
|
||||
gdk_window_set_cursor (gtk_widget_get_window (window), cursor);
|
||||
gdk_surface_set_cursor (gtk_widget_get_surface (window), cursor);
|
||||
g_object_unref (cursor);
|
||||
g_timeout_add (5000, get_idle, window);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -439,41 +439,91 @@ Public headers should never be included directly:
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
All headers should have inclusion guards (for internal usage)
|
||||
and C++ guards:
|
||||
Private headers should include the public header first, if one exists:
|
||||
|
||||
#ifndef __GTK_FOO_PRIVATE_H__
|
||||
#define __GTK_FOO_PRIVATE_H__
|
||||
|
||||
#include "gtkfoo.h"
|
||||
|
||||
...
|
||||
|
||||
#endif /* __GTK_FOO_PRIVATE_H__ */
|
||||
|
||||
All headers should have inclusion guards:
|
||||
|
||||
#ifndef __GTK_FOO_H__
|
||||
#define __GTK_FOO_H__
|
||||
|
||||
#include <gtk/gtk-bar.h>
|
||||
...
|
||||
|
||||
#endif /* __GTK_FOO_H__ */
|
||||
|
||||
You can also use the "once" pragma instead of the classic pre-processor guard:
|
||||
|
||||
#pragma once
|
||||
|
||||
Additionally, public headers should use C++ guards around their declarations:
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_foo_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkWidget * gtk_foo_new (void);
|
||||
|
||||
...
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_FOO_H__ */
|
||||
|
||||
+ Includes
|
||||
|
||||
GTK+ source files should never include the global gtk.h header, but
|
||||
instead include the individual headers that are needed. Every file must
|
||||
include config.h first, then its own header, then other GTK+ headers
|
||||
that it needs, then system and third-party headers that it needs.
|
||||
GTK+ source files must never include the global gtk.h header; instead, it
|
||||
should include the individual headers that are needed.
|
||||
|
||||
Every source file must include config.h first, followed by the header matching
|
||||
the source file, either the public installed header, or the private header, if
|
||||
it exists.
|
||||
|
||||
/* valid */
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkfoo.h"
|
||||
|
||||
#include "gtkwidget.h"
|
||||
Source files should then include project headers, in alphabetical order,
|
||||
starting from headers in the current directory; then headers in
|
||||
sub-directories; and, finally, in paths relative to the top-level
|
||||
directory:
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkfooprivate.h"
|
||||
|
||||
#include "gtkbutton.h"
|
||||
#include "gtkwidget.h"
|
||||
|
||||
...
|
||||
#include "a11y/gtkwidgetaccessible.h"
|
||||
|
||||
#include "gdk/gdkwindowprivate.h"
|
||||
|
||||
Finally, source files should include the system headers last:
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkbarprivate.h"
|
||||
|
||||
#include "gtkcontainerprivate.h"
|
||||
|
||||
#include "a11y/gtkcontaineraccessible.h"
|
||||
#include "a11y/gtkwidgetaccessible.h"
|
||||
|
||||
#include "gdk/gdkwindowprivate.h"
|
||||
|
||||
#include <graphene.h>
|
||||
#include <string.h>
|
||||
|
||||
Cyclic dependencies should be avoided if at all possible; for instance, you
|
||||
could use additional headers to break cycles.
|
||||
|
||||
+ GObject
|
||||
|
||||
@@ -484,7 +534,6 @@ Typedef declarations should be placed at the beginning of the file:
|
||||
|
||||
typedef struct _GtkFoo GtkFoo;
|
||||
typedef struct _GtkFooClass GtkFooClass;
|
||||
typedef struct _GtkFooPrivate GtkFooPrivate;
|
||||
|
||||
This includes enumeration types:
|
||||
|
||||
@@ -499,26 +548,21 @@ And callback types:
|
||||
typedef void (* GtkCallback) (GtkWidget *widget,
|
||||
gpointer user_data);
|
||||
|
||||
Instance structures should only contain the parent type, and optionally a
|
||||
pointer to a private data structure, and they should be annotated as
|
||||
"private" using the gtk-doc trigraph:
|
||||
Instance structures should only contain the parent type:
|
||||
|
||||
struct _GtkFoo
|
||||
{
|
||||
/*< private >*/
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GtkFooPrivate *priv;
|
||||
};
|
||||
|
||||
The private data pointer is optional and should be omitted in newly
|
||||
written classes.
|
||||
You should use the G_DECLARE_DERIVABLE_TYPE() and G_DECLARE_FINAL_TYPE()
|
||||
macros in newly written headers.
|
||||
|
||||
Always use the G_DEFINE_TYPE(), G_DEFINE_TYPE_WITH_PRIVATE(), and
|
||||
G_DEFINE_TYPE_WITH_CODE() macros, or their abstract variants
|
||||
G_DEFINE_ABSTRACT_TYPE(), G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(), and
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE(); also, use the similar macros for
|
||||
defining interfaces and boxed types.
|
||||
Inside your source file, always use the G_DEFINE_TYPE(),
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(), and G_DEFINE_TYPE_WITH_CODE() macros, or their
|
||||
abstract variants G_DEFINE_ABSTRACT_TYPE(),
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(), and G_DEFINE_ABSTRACT_TYPE_WITH_CODE();
|
||||
also, use the similar macros for defining interfaces, quarks, and boxed types.
|
||||
|
||||
All the properties should be stored inside the private data structure, which
|
||||
is defined inside the source file - or, if needed, inside a private header
|
||||
@@ -526,14 +570,14 @@ file; the private header filename must end with "private.h" and must not be
|
||||
installed.
|
||||
|
||||
The private data structure should only be accessed internally either using the
|
||||
pointer inside the instance structure, if one is available, or the generated
|
||||
pointer inside the instance structure, for legacy code, or the generated
|
||||
instance private data getter function for your type. You should never use the
|
||||
G_TYPE_INSTANCE_GET_PRIVATE() macro or the g_type_instance_get_private()
|
||||
function.
|
||||
|
||||
Interface types should always have the dummy typedef for cast purposes:
|
||||
|
||||
typedef struct _GtkFoo GtkFoo;
|
||||
typedef struct _GtkFoo GtkFoo;
|
||||
|
||||
The interface structure should have "Interface" postfixed to the dummy typedef:
|
||||
|
||||
@@ -564,19 +608,16 @@ Inline functions are usually preferable to private macros.
|
||||
|
||||
Public macros should not be used unless they evaluate to a constant.
|
||||
|
||||
+ Public API
|
||||
+ Symbol visibility
|
||||
|
||||
Avoid exporting variables as public API, since this is cumbersome on some
|
||||
Any symbol that is not explicitly annotated using a GDK_AVAILABLE_IN_*
|
||||
macro is considered internal, and not exported in the shared library.
|
||||
|
||||
Never export variables as public API, since this is cumbersome on some
|
||||
platforms. It is always preferable to add getters and setters instead.
|
||||
|
||||
All public functions must be listed in the gtk.symbols file.
|
||||
|
||||
+ Private API
|
||||
|
||||
Non-exported functions that are needed in more than one source file
|
||||
should be named "_gtk_...", and declared in a private header file.
|
||||
|
||||
Underscore-prefixed functions are never exported.
|
||||
should be declared in a private header file.
|
||||
|
||||
Non-exported functions that are only needed in one source file
|
||||
should be declared static.
|
||||
@@ -638,4 +679,4 @@ of tabs, etc.
|
||||
|
||||
It is ok to update the style of a code block or function when you
|
||||
are touching it anyway, but sweeping whitespace changes obscure the
|
||||
git history and should be avoided.
|
||||
source revision history, and should be avoided.
|
||||
|
@@ -26,13 +26,13 @@ Refer to the file widget_system.txt which covers widget flags and the
|
||||
resulting invariants in a detailed way.
|
||||
|
||||
|
||||
GdkWindow pointers may be NULL in GdkEvents
|
||||
GdkSurface pointers may be NULL in GdkEvents
|
||||
-------------------------------------------
|
||||
|
||||
The notification nature of the signal mechanism might cause events to
|
||||
be emitted that have their GdkWindow pointer set to NULL.
|
||||
be emitted that have their GdkSurface pointer set to NULL.
|
||||
This is due to the fact that certain events need to be emitted after the
|
||||
real GdkWindow of a widget is not any longer pertinent.
|
||||
real GdkSurface of a widget is not any longer pertinent.
|
||||
It's up to the signal handling function (application) to check for the
|
||||
window field of the event structure to be != NULL, if it is going to
|
||||
perform any operations through Gdk calls on it.
|
||||
@@ -43,7 +43,7 @@ GDK_SELECTION_CLEAR GtkWidget::selection_clear_event
|
||||
GDK_FOCUS_CHANGE GtkWidget::focus_in_event
|
||||
GtkWidget::focus_out_event
|
||||
|
||||
Events that are assured to have a valid GdkEvent.any.window field are
|
||||
Events that are assured to have a valid GdkEvent.any.surface field are
|
||||
|
||||
GDK_EXPOSE GtkWidget::expose_event
|
||||
|
||||
@@ -51,10 +51,10 @@ GDK_EXPOSE GtkWidget::expose_event
|
||||
Writing Gdk functions
|
||||
---------------------
|
||||
|
||||
When writing Gdk functions that operate on GdkWindow structures in any
|
||||
meaningful sense, that is casting to a GdkWindowPrivate structure for
|
||||
access to fields other then GdkWindow.user_data, the programmer is
|
||||
recommended to check for the GdkWindowPrivate.destroyed field to be ==
|
||||
FALSE, especially if the GdkWindowPrivate.xwindow field is used.
|
||||
When writing Gdk functions that operate on GdkSurface structures in any
|
||||
meaningful sense, that is casting to a GdkSurfacePrivate structure for
|
||||
access to fields other then GdkSurface.user_data, the programmer is
|
||||
recommended to check for the GdkSurfacePrivate.destroyed field to be ==
|
||||
FALSE, especially if the GdkSurfacePrivate.xwindow field is used.
|
||||
Silent abortion of the Gdk function is the correct behaviour if this
|
||||
condition isn't met.
|
||||
|
@@ -81,19 +81,19 @@ GdkAtom gdk_drag_get_selection (GdkDragContext *context);
|
||||
|
||||
/* Source side */
|
||||
|
||||
GdkDragContext * gdk_drag_begin (GdkWindow *window,
|
||||
GdkDragContext * gdk_drag_begin (GdkSurface *window,
|
||||
GList *targets,
|
||||
GdkDragAction actions);
|
||||
gboolean gdk_drag_get_protocol (guint32 xid,
|
||||
GdkDragProtocol *protocol);
|
||||
void gdk_drag_find_window (GdkDragContext *context,
|
||||
GdkWindow *drag_window,
|
||||
GdkSurface *drag_surface,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkWindow **dest_window,
|
||||
GdkSurface **dest_surface,
|
||||
GdkDragProtocol *protocol);
|
||||
gboolean gdk_drag_motion (GdkDragContext *context,
|
||||
GdkWindow *dest_window,
|
||||
GdkSurface *dest_surface,
|
||||
GdkDragProtocol protocol,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
|
@@ -45,7 +45,6 @@
|
||||
<xi:include href="xml/gdkcontentserializer.xml" />
|
||||
<xi:include href="xml/gdkcontentdeserializer.xml" />
|
||||
<xi:include href="xml/properties.xml" />
|
||||
<xi:include href="xml/threads.xml" />
|
||||
<xi:include href="xml/gdkapplaunchcontext.xml" />
|
||||
<xi:include href="xml/pixbufs.xml" />
|
||||
<xi:include href="xml/pango_interaction.xml" />
|
||||
@@ -62,54 +61,6 @@
|
||||
<title>Index of deprecated symbols</title>
|
||||
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-0" role="3.0">
|
||||
<title>Index of new symbols in 3.0</title>
|
||||
<xi:include href="xml/api-index-3.0.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-2" role="3.2">
|
||||
<title>Index of new symbols in 3.2</title>
|
||||
<xi:include href="xml/api-index-3.2.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-4" role="3.4">
|
||||
<title>Index of new symbols in 3.4</title>
|
||||
<xi:include href="xml/api-index-3.4.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-6" role="3.6">
|
||||
<title>Index of new symbols in 3.6</title>
|
||||
<xi:include href="xml/api-index-3.6.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-8" role="3.8">
|
||||
<title>Index of new symbols in 3.8</title>
|
||||
<xi:include href="xml/api-index-3.8.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-10" role="3.10">
|
||||
<title>Index of new symbols in 3.10</title>
|
||||
<xi:include href="xml/api-index-3.10.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-12" role="3.12">
|
||||
<title>Index of new symbols in 3.12</title>
|
||||
<xi:include href="xml/api-index-3.12.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-14" role="3.14">
|
||||
<title>Index of new symbols in 3.14</title>
|
||||
<xi:include href="xml/api-index-3.14.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-16" role="3.16">
|
||||
<title>Index of new symbols in 3.16</title>
|
||||
<xi:include href="xml/api-index-3.16.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-18" role="3.18">
|
||||
<title>Index of new symbols in 3.18</title>
|
||||
<xi:include href="xml/api-index-3.18.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-20" role="3.20">
|
||||
<title>Index of new symbols in 3.20</title>
|
||||
<xi:include href="xml/api-index-3.20.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-22" role="3.22">
|
||||
<title>Index of new symbols in 3.22</title>
|
||||
<xi:include href="xml/api-index-3.22.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
@@ -12,21 +12,7 @@ GDK_WINDOWING_QUARTZ
|
||||
GDK_WINDOWING_WAYLAND
|
||||
|
||||
<SUBSECTION>
|
||||
GDK_VERSION_3_0
|
||||
GDK_VERSION_3_2
|
||||
GDK_VERSION_3_4
|
||||
GDK_VERSION_3_6
|
||||
GDK_VERSION_3_8
|
||||
GDK_VERSION_3_10
|
||||
GDK_VERSION_3_12
|
||||
GDK_VERSION_3_14
|
||||
GDK_VERSION_3_16
|
||||
GDK_VERSION_3_18
|
||||
GDK_VERSION_3_20
|
||||
GDK_VERSION_3_22
|
||||
GDK_VERSION_3_90
|
||||
GDK_VERSION_3_92
|
||||
GDK_VERSION_3_94
|
||||
GDK_VERSION_4_0
|
||||
GDK_VERSION_MIN_REQUIRED
|
||||
GDK_VERSION_MAX_ALLOWED
|
||||
GDK_DISABLE_DEPRECATION_WARNINGS
|
||||
@@ -61,57 +47,21 @@ gdk_scroll_direction_get_type
|
||||
gdk_setting_action_get_type
|
||||
gdk_status_get_type
|
||||
gdk_visibility_state_get_type
|
||||
gdk_window_attributes_type_get_type
|
||||
gdk_window_edge_get_type
|
||||
gdk_window_hints_get_type
|
||||
gdk_window_state_get_type
|
||||
gdk_window_type_get_type
|
||||
gdk_window_type_hint_get_type
|
||||
gdk_surface_attributes_type_get_type
|
||||
gdk_surface_edge_get_type
|
||||
gdk_surface_hints_get_type
|
||||
gdk_surface_state_get_type
|
||||
gdk_surface_type_get_type
|
||||
gdk_surface_type_hint_get_type
|
||||
gdk_wm_decoration_get_type
|
||||
gdk_wm_function_get_type
|
||||
GDK_AVAILABLE_IN_3_0
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GDK_AVAILABLE_IN_3_12
|
||||
GDK_AVAILABLE_IN_3_14
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GDK_AVAILABLE_IN_3_18
|
||||
GDK_AVAILABLE_IN_3_2
|
||||
GDK_AVAILABLE_IN_3_20
|
||||
GDK_AVAILABLE_IN_3_22
|
||||
GDK_AVAILABLE_IN_3_4
|
||||
GDK_AVAILABLE_IN_3_6
|
||||
GDK_AVAILABLE_IN_3_8
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
GDK_AVAILABLE_IN_3_92
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
GDK_AVAILABLE_IN_4_0
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_UNAVAILABLE
|
||||
GDK_DEPRECATED
|
||||
GDK_DEPRECATED_FOR
|
||||
GDK_DEPRECATED_IN_3_0
|
||||
GDK_DEPRECATED_IN_3_0_FOR
|
||||
GDK_DEPRECATED_IN_3_10
|
||||
GDK_DEPRECATED_IN_3_10_FOR
|
||||
GDK_DEPRECATED_IN_3_12
|
||||
GDK_DEPRECATED_IN_3_12_FOR
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GDK_DEPRECATED_IN_3_14_FOR
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_DEPRECATED_IN_3_16_FOR
|
||||
GDK_DEPRECATED_IN_3_18
|
||||
GDK_DEPRECATED_IN_3_18_FOR
|
||||
GDK_DEPRECATED_IN_3_2
|
||||
GDK_DEPRECATED_IN_3_20
|
||||
GDK_DEPRECATED_IN_3_20_FOR
|
||||
GDK_DEPRECATED_IN_3_22
|
||||
GDK_DEPRECATED_IN_3_22_FOR
|
||||
GDK_DEPRECATED_IN_3_2_FOR
|
||||
GDK_DEPRECATED_IN_3_4
|
||||
GDK_DEPRECATED_IN_3_4_FOR
|
||||
GDK_DEPRECATED_IN_3_6
|
||||
GDK_DEPRECATED_IN_3_6_FOR
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GDK_DEPRECATED_IN_3_8_FOR
|
||||
GDK_DEPRECATED_IN_4_0
|
||||
GDK_DEPRECATED_IN_4_0_FOR
|
||||
GDK_VERSION_CUR_STABLE
|
||||
GDK_VERSION_PREV_STABLE
|
||||
</SECTION>
|
||||
@@ -146,7 +96,7 @@ gdk_display_get_n_monitors
|
||||
gdk_display_get_monitor
|
||||
gdk_display_get_primary_monitor
|
||||
gdk_display_get_monitor_at_point
|
||||
gdk_display_get_monitor_at_window
|
||||
gdk_display_get_monitor_at_surface
|
||||
gdk_display_get_clipboard
|
||||
gdk_display_get_primary_clipboard
|
||||
gdk_display_get_setting
|
||||
@@ -219,191 +169,175 @@ gdk_rgba_get_type
|
||||
<SECTION>
|
||||
<TITLE>Windows</TITLE>
|
||||
<FILE>windows</FILE>
|
||||
GdkWindow
|
||||
GdkWindowType
|
||||
GdkWindowClass
|
||||
GdkWindowHints
|
||||
GdkSurface
|
||||
GdkSurfaceType
|
||||
GdkSurfaceClass
|
||||
GdkSurfaceHints
|
||||
GdkGeometry
|
||||
GdkGravity
|
||||
GdkAnchorHints
|
||||
GdkWindowEdge
|
||||
GdkWindowTypeHint
|
||||
GdkWindowState
|
||||
gdk_window_new_toplevel
|
||||
gdk_window_new_popup
|
||||
gdk_window_new_temp
|
||||
gdk_window_new_child
|
||||
gdk_window_destroy
|
||||
gdk_window_get_window_type
|
||||
gdk_window_get_display
|
||||
gdk_window_show
|
||||
gdk_window_show_unraised
|
||||
gdk_window_hide
|
||||
gdk_window_is_destroyed
|
||||
gdk_window_is_visible
|
||||
gdk_window_is_viewable
|
||||
gdk_window_is_input_only
|
||||
gdk_window_is_shaped
|
||||
gdk_window_get_state
|
||||
gdk_window_withdraw
|
||||
gdk_window_iconify
|
||||
gdk_window_deiconify
|
||||
gdk_window_stick
|
||||
gdk_window_unstick
|
||||
gdk_window_maximize
|
||||
gdk_window_unmaximize
|
||||
gdk_window_fullscreen
|
||||
gdk_window_fullscreen_on_monitor
|
||||
gdk_window_unfullscreen
|
||||
GdkSurfaceEdge
|
||||
GdkSurfaceTypeHint
|
||||
GdkSurfaceState
|
||||
gdk_surface_new_toplevel
|
||||
gdk_surface_new_popup
|
||||
gdk_surface_new_temp
|
||||
gdk_surface_new_child
|
||||
gdk_surface_destroy
|
||||
gdk_surface_get_surface_type
|
||||
gdk_surface_get_display
|
||||
gdk_surface_show
|
||||
gdk_surface_show_unraised
|
||||
gdk_surface_hide
|
||||
gdk_surface_is_destroyed
|
||||
gdk_surface_is_visible
|
||||
gdk_surface_is_viewable
|
||||
gdk_surface_is_input_only
|
||||
gdk_surface_get_state
|
||||
gdk_surface_withdraw
|
||||
gdk_surface_iconify
|
||||
gdk_surface_deiconify
|
||||
gdk_surface_stick
|
||||
gdk_surface_unstick
|
||||
gdk_surface_maximize
|
||||
gdk_surface_unmaximize
|
||||
gdk_surface_fullscreen
|
||||
gdk_surface_fullscreen_on_monitor
|
||||
gdk_surface_unfullscreen
|
||||
GdkFullscreenMode
|
||||
gdk_window_get_fullscreen_mode
|
||||
gdk_window_set_fullscreen_mode
|
||||
gdk_window_set_keep_above
|
||||
gdk_window_set_keep_below
|
||||
gdk_window_set_opacity
|
||||
gdk_window_set_pass_through
|
||||
gdk_window_get_pass_through
|
||||
gdk_window_move
|
||||
gdk_window_resize
|
||||
gdk_window_move_resize
|
||||
gdk_window_scroll
|
||||
gdk_window_move_region
|
||||
gdk_window_has_native
|
||||
gdk_window_raise
|
||||
gdk_window_lower
|
||||
gdk_window_restack
|
||||
gdk_window_focus
|
||||
gdk_window_register_dnd
|
||||
gdk_window_begin_resize_drag
|
||||
gdk_window_begin_resize_drag_for_device
|
||||
gdk_window_begin_move_drag
|
||||
gdk_window_begin_move_drag_for_device
|
||||
gdk_window_show_window_menu
|
||||
gdk_window_constrain_size
|
||||
gdk_window_beep
|
||||
gdk_window_get_scale_factor
|
||||
gdk_window_set_opaque_region
|
||||
gdk_window_create_gl_context
|
||||
gdk_window_create_vulkan_context
|
||||
gdk_surface_get_fullscreen_mode
|
||||
gdk_surface_set_fullscreen_mode
|
||||
gdk_surface_set_keep_above
|
||||
gdk_surface_set_keep_below
|
||||
gdk_surface_set_opacity
|
||||
gdk_surface_set_pass_through
|
||||
gdk_surface_get_pass_through
|
||||
gdk_surface_move
|
||||
gdk_surface_resize
|
||||
gdk_surface_move_resize
|
||||
gdk_surface_has_native
|
||||
gdk_surface_raise
|
||||
gdk_surface_lower
|
||||
gdk_surface_restack
|
||||
gdk_surface_focus
|
||||
gdk_surface_register_dnd
|
||||
gdk_surface_begin_resize_drag
|
||||
gdk_surface_begin_resize_drag_for_device
|
||||
gdk_surface_begin_move_drag
|
||||
gdk_surface_begin_move_drag_for_device
|
||||
gdk_surface_show_window_menu
|
||||
gdk_surface_constrain_size
|
||||
gdk_surface_beep
|
||||
gdk_surface_get_scale_factor
|
||||
gdk_surface_set_opaque_region
|
||||
gdk_surface_create_gl_context
|
||||
gdk_surface_create_vulkan_context
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_window_get_clip_region
|
||||
gdk_window_begin_draw_frame
|
||||
gdk_window_end_draw_frame
|
||||
gdk_window_get_visible_region
|
||||
gdk_surface_begin_draw_frame
|
||||
gdk_surface_end_draw_frame
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_window_invalidate_rect
|
||||
gdk_window_invalidate_region
|
||||
GdkWindowChildFunc
|
||||
gdk_window_invalidate_maybe_recurse
|
||||
gdk_window_get_update_area
|
||||
gdk_window_freeze_updates
|
||||
gdk_window_thaw_updates
|
||||
gdk_window_get_frame_clock
|
||||
gdk_surface_invalidate_rect
|
||||
gdk_surface_invalidate_region
|
||||
gdk_surface_freeze_updates
|
||||
gdk_surface_thaw_updates
|
||||
gdk_surface_get_frame_clock
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_window_set_user_data
|
||||
gdk_window_set_accept_focus
|
||||
gdk_window_get_accept_focus
|
||||
gdk_window_set_focus_on_map
|
||||
gdk_window_get_focus_on_map
|
||||
gdk_window_add_filter
|
||||
gdk_window_remove_filter
|
||||
GdkFilterFunc
|
||||
GdkFilterReturn
|
||||
GdkXEvent
|
||||
gdk_window_shape_combine_region
|
||||
gdk_window_set_child_shapes
|
||||
gdk_window_merge_child_shapes
|
||||
gdk_window_input_shape_combine_region
|
||||
gdk_window_set_child_input_shapes
|
||||
gdk_window_merge_child_input_shapes
|
||||
gdk_window_set_title
|
||||
gdk_surface_set_user_data
|
||||
gdk_surface_set_accept_focus
|
||||
gdk_surface_get_accept_focus
|
||||
gdk_surface_set_focus_on_map
|
||||
gdk_surface_get_focus_on_map
|
||||
gdk_surface_input_shape_combine_region
|
||||
gdk_surface_set_child_input_shapes
|
||||
gdk_surface_merge_child_input_shapes
|
||||
gdk_surface_set_title
|
||||
GDK_PARENT_RELATIVE
|
||||
gdk_window_set_cursor
|
||||
gdk_window_get_cursor
|
||||
gdk_window_get_user_data
|
||||
gdk_window_get_geometry
|
||||
gdk_window_set_geometry_hints
|
||||
gdk_window_get_width
|
||||
gdk_window_get_height
|
||||
gdk_window_set_icon_list
|
||||
gdk_window_set_modal_hint
|
||||
gdk_window_get_modal_hint
|
||||
gdk_window_set_type_hint
|
||||
gdk_window_get_type_hint
|
||||
gdk_window_set_shadow_width
|
||||
gdk_window_set_skip_taskbar_hint
|
||||
gdk_window_set_skip_pager_hint
|
||||
gdk_window_set_urgency_hint
|
||||
gdk_window_get_position
|
||||
gdk_window_get_root_origin
|
||||
gdk_window_get_frame_extents
|
||||
gdk_window_get_origin
|
||||
gdk_window_get_root_coords
|
||||
gdk_window_get_device_position
|
||||
gdk_window_get_device_position_double
|
||||
gdk_surface_set_cursor
|
||||
gdk_surface_get_cursor
|
||||
gdk_surface_get_user_data
|
||||
gdk_surface_get_geometry
|
||||
gdk_surface_set_geometry_hints
|
||||
gdk_surface_get_width
|
||||
gdk_surface_get_height
|
||||
gdk_surface_set_icon_list
|
||||
gdk_surface_set_modal_hint
|
||||
gdk_surface_get_modal_hint
|
||||
gdk_surface_set_type_hint
|
||||
gdk_surface_get_type_hint
|
||||
gdk_surface_set_shadow_width
|
||||
gdk_surface_set_skip_taskbar_hint
|
||||
gdk_surface_set_skip_pager_hint
|
||||
gdk_surface_set_urgency_hint
|
||||
gdk_surface_get_position
|
||||
gdk_surface_get_root_origin
|
||||
gdk_surface_get_frame_extents
|
||||
gdk_surface_get_origin
|
||||
gdk_surface_get_root_coords
|
||||
gdk_surface_get_device_position
|
||||
gdk_surface_get_device_position_double
|
||||
GdkModifierType
|
||||
GdkModifierIntent
|
||||
gdk_window_get_parent
|
||||
gdk_window_get_toplevel
|
||||
gdk_window_get_children
|
||||
gdk_window_get_children_with_user_data
|
||||
gdk_window_peek_children
|
||||
gdk_window_get_events
|
||||
gdk_window_set_events
|
||||
gdk_window_set_icon_name
|
||||
gdk_window_set_transient_for
|
||||
gdk_window_set_role
|
||||
gdk_window_set_startup_id
|
||||
gdk_window_set_group
|
||||
gdk_window_get_group
|
||||
gdk_window_set_decorations
|
||||
gdk_window_get_decorations
|
||||
gdk_surface_get_parent
|
||||
gdk_surface_get_toplevel
|
||||
gdk_surface_get_children
|
||||
gdk_surface_get_children_with_user_data
|
||||
gdk_surface_peek_children
|
||||
gdk_surface_get_events
|
||||
gdk_surface_set_events
|
||||
gdk_surface_set_icon_name
|
||||
gdk_surface_set_transient_for
|
||||
gdk_surface_set_role
|
||||
gdk_surface_set_startup_id
|
||||
gdk_surface_set_group
|
||||
gdk_surface_get_group
|
||||
gdk_surface_set_decorations
|
||||
gdk_surface_get_decorations
|
||||
GdkWMDecoration
|
||||
gdk_window_set_functions
|
||||
gdk_surface_set_functions
|
||||
GdkWMFunction
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_window_get_support_multidevice
|
||||
gdk_window_set_support_multidevice
|
||||
gdk_window_get_device_cursor
|
||||
gdk_window_set_device_cursor
|
||||
gdk_window_get_device_events
|
||||
gdk_window_set_device_events
|
||||
gdk_surface_get_support_multidevice
|
||||
gdk_surface_set_support_multidevice
|
||||
gdk_surface_get_device_cursor
|
||||
gdk_surface_set_device_cursor
|
||||
gdk_surface_get_device_events
|
||||
gdk_surface_set_device_events
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_window_coords_from_parent
|
||||
gdk_window_coords_to_parent
|
||||
gdk_surface_coords_from_parent
|
||||
gdk_surface_coords_to_parent
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_WINDOW
|
||||
GDK_WINDOW_GET_CLASS
|
||||
GDK_TYPE_WINDOW
|
||||
GDK_IS_WINDOW
|
||||
GDK_WINDOW_CLASS
|
||||
GDK_IS_WINDOW_CLASS
|
||||
GDK_SURFACE
|
||||
GDK_SURFACE_GET_CLASS
|
||||
GDK_TYPE_SURFACE
|
||||
GDK_IS_SURFACE
|
||||
GDK_SURFACE_CLASS
|
||||
GDK_IS_SURFACE_CLASS
|
||||
GDK_TYPE_FILTER_RETURN
|
||||
GDK_TYPE_GRAVITY
|
||||
GDK_TYPE_MODIFIER_TYPE
|
||||
GDK_TYPE_WINDOW_ATTRIBUTES_TYPE
|
||||
GDK_TYPE_WINDOW_EDGE
|
||||
GDK_TYPE_WINDOW_HINTS
|
||||
GDK_TYPE_WINDOW_TYPE
|
||||
GDK_TYPE_WINDOW_TYPE_HINT
|
||||
GDK_TYPE_SURFACE_ATTRIBUTES_TYPE
|
||||
GDK_TYPE_SURFACE_EDGE
|
||||
GDK_TYPE_SURFACE_HINTS
|
||||
GDK_TYPE_SURFACE_TYPE
|
||||
GDK_TYPE_SURFACE_TYPE_HINT
|
||||
GDK_TYPE_WM_DECORATION
|
||||
GDK_TYPE_WM_FUNCTION
|
||||
GDK_TYPE_WINDOW_STATE
|
||||
GDK_TYPE_SURFACE_STATE
|
||||
|
||||
<SUBSECTION Private>
|
||||
gdk_window_get_type
|
||||
gdk_window_window_class_get_type
|
||||
GdkWindowClass
|
||||
GdkWindowImpl
|
||||
GdkWindowImplClass
|
||||
GdkWindowRedirect
|
||||
gdk_window_impl_get_type
|
||||
gdk_surface_get_type
|
||||
gdk_surface_window_class_get_type
|
||||
GdkSurfaceClass
|
||||
GdkSurfaceImpl
|
||||
GdkSurfaceImplClass
|
||||
GdkSurfaceRedirect
|
||||
gdk_surface_impl_get_type
|
||||
gdk_fullscreen_mode_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -438,11 +372,16 @@ gdk_content_formats_union_deserialize_mime_types
|
||||
<SUBSECTION>
|
||||
GdkContentFormatsBuilder
|
||||
gdk_content_formats_builder_new
|
||||
gdk_content_formats_builder_free
|
||||
gdk_content_formats_builder_free_to_formats
|
||||
gdk_content_formats_builder_add_formats
|
||||
gdk_content_formats_builder_add_gtype
|
||||
gdk_content_formats_builder_add_mime_type
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_content_formats_builder_ref
|
||||
gdk_content_formats_builder_unref
|
||||
gdk_content_formats_builder_to_formats
|
||||
|
||||
<SUBSECTION Private>
|
||||
GDK_TYPE_FILE_LIST
|
||||
gdk_file_list_get_type
|
||||
@@ -467,8 +406,8 @@ gdk_pango_layout_line_get_clip_region
|
||||
<SECTION>
|
||||
<TITLE>Cairo Interaction</TITLE>
|
||||
<FILE>cairo_interaction</FILE>
|
||||
gdk_window_create_similar_surface
|
||||
gdk_window_create_similar_image_surface
|
||||
gdk_surface_create_similar_surface
|
||||
gdk_surface_create_similar_image_surface
|
||||
gdk_cairo_get_clip_rectangle
|
||||
gdk_cairo_get_drawing_context
|
||||
gdk_cairo_set_source_rgba
|
||||
@@ -497,22 +436,6 @@ gdk_rectangle_contains_point
|
||||
gdk_rectangle_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Threads</TITLE>
|
||||
<FILE>threads</FILE>
|
||||
GDK_THREADS_ENTER
|
||||
GDK_THREADS_LEAVE
|
||||
gdk_threads_init
|
||||
gdk_threads_enter
|
||||
gdk_threads_leave
|
||||
gdk_threads_add_idle
|
||||
gdk_threads_add_idle_full
|
||||
gdk_threads_add_timeout
|
||||
gdk_threads_add_timeout_full
|
||||
gdk_threads_add_timeout_seconds
|
||||
gdk_threads_add_timeout_seconds_full
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Keyboard Handling</TITLE>
|
||||
<FILE>keys</FILE>
|
||||
@@ -602,15 +525,15 @@ gdk_device_ungrab
|
||||
gdk_device_get_state
|
||||
gdk_device_get_position
|
||||
gdk_device_get_position_double
|
||||
gdk_device_get_window_at_position
|
||||
gdk_device_get_window_at_position_double
|
||||
gdk_device_get_surface_at_position
|
||||
gdk_device_get_surface_at_position_double
|
||||
gdk_device_get_history
|
||||
gdk_device_free_history
|
||||
GdkTimeCoord
|
||||
gdk_device_get_axis
|
||||
gdk_device_list_axes
|
||||
gdk_device_get_axis_value
|
||||
gdk_device_get_last_event_window
|
||||
gdk_device_get_last_event_surface
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_device_tool_get_serial
|
||||
@@ -723,7 +646,7 @@ gdk_event_get_scroll_deltas
|
||||
gdk_event_is_scroll_stop_event
|
||||
gdk_event_get_state
|
||||
gdk_event_get_time
|
||||
gdk_event_get_window
|
||||
gdk_event_get_surface
|
||||
gdk_event_get_event_type
|
||||
GdkEventSequence
|
||||
gdk_event_get_event_sequence
|
||||
@@ -739,7 +662,7 @@ gdk_event_get_crossing_mode
|
||||
gdk_event_get_drag_context
|
||||
gdk_event_get_focus_in
|
||||
gdk_event_get_grab_window
|
||||
gdk_event_get_history
|
||||
gdk_event_get_motion_history
|
||||
gdk_event_get_key_group
|
||||
gdk_event_get_key_is_modifier
|
||||
gdk_event_get_pad_axis_value
|
||||
@@ -780,17 +703,36 @@ GDK_IS_EVENT
|
||||
gdk_event_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Paintable</TITLE>
|
||||
<FILE>paintable</FILE>
|
||||
GdkPaintable
|
||||
gdk_paintable_snapshot
|
||||
gdk_paintable_get_current_image
|
||||
gdk_paintable_get_flags
|
||||
gdk_paintable_get_intrinsic_width
|
||||
gdk_paintable_get_intrinsic_height
|
||||
gdk_paintable_get_intrinsic_aspect_ratio
|
||||
gdk_paintable_compute_concrete_size
|
||||
gdk_paintable_invalidate_contents
|
||||
gdk_paintable_invalidate_size
|
||||
<SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Textures</TITLE>
|
||||
<FILE>textures</FILE>
|
||||
GdkTexture
|
||||
gdk_texture_new_for_data
|
||||
gdk_texture_new_for_pixbuf
|
||||
gdk_texture_new_from_resource
|
||||
gdk_texture_new_from_file
|
||||
gdk_texture_get_width
|
||||
gdk_texture_get_height
|
||||
gdk_texture_download
|
||||
GdkMemoryFormat
|
||||
GDK_MEMORY_FORMAT_DEFAULT
|
||||
gdk_memory_texture_new
|
||||
gdk_gl_texture_new
|
||||
gdk_gl_texture_release
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GdkTextureClass
|
||||
@@ -798,6 +740,16 @@ gdk_texture_get_type
|
||||
GDK_TYPE_TEXTURE
|
||||
GDK_IS_TEXTURE
|
||||
GDK_TEXTURE
|
||||
GdkGLTextureClass
|
||||
gdk_gl_texture_get_type
|
||||
GDK_TYPE_GL_TEXTURE
|
||||
GDK_IS_GL_TEXTURE
|
||||
GDK_GL_TEXTURE
|
||||
GdkMemoryTextureClass
|
||||
gdk_memory_texture_get_type
|
||||
GDK_TYPE_MEMORY_TEXTURE
|
||||
GDK_IS_MEMORY_TEXTURE
|
||||
GDK_MEMORY_TEXTURE
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -841,9 +793,9 @@ gdk_drag_context_get_suggested_action
|
||||
gdk_drag_context_get_selected_action
|
||||
gdk_drag_context_get_formats
|
||||
gdk_drag_context_get_device
|
||||
gdk_drag_context_get_source_window
|
||||
gdk_drag_context_get_dest_window
|
||||
gdk_drag_context_get_drag_window
|
||||
gdk_drag_context_get_source_surface
|
||||
gdk_drag_context_get_dest_surface
|
||||
gdk_drag_context_get_drag_surface
|
||||
gdk_drag_context_set_hotspot
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -865,7 +817,7 @@ gdk_drag_context_get_type
|
||||
<INCLUDE>gdk/gdkx.h</INCLUDE>
|
||||
<TITLE>X Window System Interaction</TITLE>
|
||||
<FILE>x_interaction</FILE>
|
||||
GDK_WINDOW_XID
|
||||
GDK_SURFACE_XID
|
||||
GDK_DISPLAY_XDISPLAY
|
||||
GDK_POINTER_TO_XID
|
||||
GDK_XID_TO_POINTER
|
||||
@@ -890,7 +842,7 @@ gdk_x11_display_error_trap_push
|
||||
gdk_x11_display_error_trap_pop
|
||||
gdk_x11_display_error_trap_pop_ignored
|
||||
gdk_x11_display_set_cursor_theme
|
||||
gdk_x11_display_set_window_scale
|
||||
gdk_x11_display_set_surface_scale
|
||||
gdk_x11_display_get_glx_version
|
||||
gdk_x11_register_standard_event_type
|
||||
gdk_x11_screen_get_screen_number
|
||||
@@ -901,17 +853,16 @@ gdk_x11_screen_lookup_visual
|
||||
gdk_x11_screen_supports_net_wm_hint
|
||||
gdk_x11_screen_get_number_of_desktops
|
||||
gdk_x11_screen_get_current_desktop
|
||||
gdk_x11_window_foreign_new_for_display
|
||||
gdk_x11_window_lookup_for_display
|
||||
gdk_x11_window_get_xid
|
||||
gdk_x11_window_set_theme_variant
|
||||
gdk_x11_window_set_user_time
|
||||
gdk_x11_window_move_to_current_desktop
|
||||
gdk_x11_window_move_to_desktop
|
||||
gdk_x11_window_get_desktop
|
||||
gdk_x11_window_set_utf8_property
|
||||
gdk_x11_window_set_frame_extents
|
||||
gdk_x11_window_set_frame_sync_enabled
|
||||
gdk_x11_surface_foreign_new_for_display
|
||||
gdk_x11_surface_lookup_for_display
|
||||
gdk_x11_surface_get_xid
|
||||
gdk_x11_surface_set_theme_variant
|
||||
gdk_x11_surface_set_user_time
|
||||
gdk_x11_surface_move_to_current_desktop
|
||||
gdk_x11_surface_move_to_desktop
|
||||
gdk_x11_surface_get_desktop
|
||||
gdk_x11_surface_set_utf8_property
|
||||
gdk_x11_surface_set_frame_sync_enabled
|
||||
gdk_x11_keymap_get_group_for_state
|
||||
gdk_x11_keymap_key_is_modifier
|
||||
gdk_x11_visual_get_xvisual
|
||||
@@ -1004,12 +955,12 @@ GDK_X11_VISUAL_CLASS
|
||||
GDK_IS_X11_VISUAL
|
||||
GDK_IS_X11_VISUAL_CLASS
|
||||
GDK_X11_VISUAL_GET_CLASS
|
||||
GDK_TYPE_X11_WINDOW
|
||||
GDK_X11_WINDOW
|
||||
GDK_X11_WINDOW_CLASS
|
||||
GDK_IS_X11_WINDOW
|
||||
GDK_IS_X11_WINDOW_CLASS
|
||||
GDK_X11_WINDOW_GET_CLASS
|
||||
GDK_TYPE_X11_SURFACE
|
||||
GDK_X11_SURFACE
|
||||
GDK_X11_SURFACE_CLASS
|
||||
GDK_IS_X11_SURFACE
|
||||
GDK_IS_X11_SURFACE_CLASS
|
||||
GDK_X11_SURFACE_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gdk_x11_app_launch_context_get_type
|
||||
@@ -1026,8 +977,8 @@ gdk_x11_drag_context_get_type
|
||||
gdk_x11_keymap_get_type
|
||||
gdk_x11_screen_get_type
|
||||
gdk_x11_visual_get_type
|
||||
gdk_x11_window_get_type
|
||||
gdk_window_impl_x11_get_type
|
||||
gdk_x11_surface_get_type
|
||||
gdk_surface_impl_x11_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -1040,13 +991,14 @@ gdk_wayland_device_get_wl_pointer
|
||||
gdk_wayland_device_get_wl_seat
|
||||
gdk_wayland_display_get_wl_compositor
|
||||
gdk_wayland_display_get_wl_display
|
||||
gdk_wayland_window_new_subsurface
|
||||
gdk_wayland_window_get_wl_surface
|
||||
gdk_wayland_window_set_use_custom_surface
|
||||
GdkWaylandWindowExported
|
||||
gdk_wayland_window_export_handle
|
||||
gdk_wayland_window_unexport_handle
|
||||
gdk_wayland_window_set_transient_for_exported
|
||||
gdk_wayland_display_query_registry
|
||||
gdk_wayland_surface_new_subsurface
|
||||
gdk_wayland_surface_get_wl_surface
|
||||
gdk_wayland_surface_set_use_custom_surface
|
||||
GdkWaylandSurfaceExported
|
||||
gdk_wayland_surface_export_handle
|
||||
gdk_wayland_surface_unexport_handle
|
||||
gdk_wayland_surface_set_transient_for_exported
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_TYPE_WAYLAND_DEVICE
|
||||
@@ -1067,18 +1019,18 @@ GDK_WAYLAND_DISPLAY_MANAGER_CLASS
|
||||
GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS
|
||||
GDK_IS_WAYLAND_DISPLAY_MANAGER
|
||||
GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS
|
||||
GDK_TYPE_WAYLAND_WINDOW
|
||||
GDK_WAYLAND_WINDOW
|
||||
GDK_WAYLAND_WINDOW_CLASS
|
||||
GDK_WAYLAND_WINDOW_GET_CLASS
|
||||
GDK_IS_WAYLAND_WINDOW
|
||||
GDK_IS_WAYLAND_WINDOW_CLASS
|
||||
GDK_TYPE_WAYLAND_SURFACE
|
||||
GDK_WAYLAND_SURFACE
|
||||
GDK_WAYLAND_SURFACE_CLASS
|
||||
GDK_WAYLAND_SURFACE_GET_CLASS
|
||||
GDK_IS_WAYLAND_SURFACE
|
||||
GDK_IS_WAYLAND_SURFACE_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gdk_wayland_device_get_type
|
||||
gdk_wayland_display_get_type
|
||||
gdk_wayland_display_manager_get_type
|
||||
gdk_wayland_window_get_type
|
||||
gdk_wayland_surface_get_type
|
||||
|
||||
</SECTION>
|
||||
|
||||
@@ -1153,7 +1105,7 @@ gdk_frame_timings_get_type
|
||||
<FILE>gdkdrawcontext</FILE>
|
||||
GdkDrawContext
|
||||
gdk_draw_context_get_display
|
||||
gdk_draw_context_get_window
|
||||
gdk_draw_context_get_surface
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_DRAW_CONTEXT
|
||||
@@ -1169,7 +1121,7 @@ gdk_draw_context_get_type
|
||||
<FILE>gdkglcontext</FILE>
|
||||
GdkGLContext
|
||||
gdk_gl_context_get_display
|
||||
gdk_gl_context_get_window
|
||||
gdk_gl_context_get_surface
|
||||
gdk_gl_context_get_shared_context
|
||||
gdk_gl_context_get_version
|
||||
|
||||
@@ -1234,7 +1186,7 @@ GDK_IS_MONITOR
|
||||
<SECTION>
|
||||
<FILE>gdkdrawingcontext</FILE>
|
||||
GdkDrawingContext
|
||||
gdk_drawing_context_get_window
|
||||
gdk_drawing_context_get_surface
|
||||
gdk_drawing_context_get_clip
|
||||
gdk_drawing_context_get_cairo_context
|
||||
gdk_drawing_context_is_valid
|
||||
|
@@ -11,7 +11,7 @@ gdk_gl_context_get_type
|
||||
gdk_keymap_get_type
|
||||
gdk_monitor_get_type
|
||||
gdk_seat_get_type
|
||||
gdk_window_get_type
|
||||
gdk_surface_get_type
|
||||
gdk_content_serializer_get_type
|
||||
gdk_content_deserializer_get_type
|
||||
gdk_clipboard_get_type
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<SECTION>
|
||||
<FILE>GskRenderer</FILE>
|
||||
gsk_renderer_new_for_window
|
||||
gsk_renderer_get_window
|
||||
gsk_renderer_new_for_surface
|
||||
gsk_renderer_get_surface
|
||||
gsk_renderer_get_display
|
||||
gsk_renderer_realize
|
||||
gsk_renderer_unrealize
|
||||
|
@@ -293,17 +293,6 @@ How to compile GTK+ itself
|
||||
<cmdsynopsis>
|
||||
<command>meson</command>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Ddisable-modules=true</arg>
|
||||
<arg choice="plain">-Ddisable-modules=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Dwith-included-immodules=MODULE1,MODULE2,...</arg>
|
||||
<arg choice="plain">-Dwith-included-immodules=all</arg>
|
||||
<arg choice="plain">-Dwith-included-immodules=none</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Ddocumentation=true</arg>
|
||||
<arg choice="plain">-Ddocumentation=false</arg>
|
||||
@@ -315,75 +304,59 @@ How to compile GTK+ itself
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-cups-print-backend=yes</arg>
|
||||
<arg choice="plain">-Denable-cups-print-backend=no</arg>
|
||||
<arg choice="plain">-Denable-cups-print-backend=auto</arg>
|
||||
<arg choice="plain">-Dprint-backends=all</arg>
|
||||
<arg choice="plain">-Dprint-backends=none</arg>
|
||||
<arg choice="plain">-Dprint-backends=cups,lpr,...</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-papi-print-backend=yes</arg>
|
||||
<arg choice="plain">-Denable-papi-print-backend=no</arg>
|
||||
<arg choice="plain">-Denable-papi-print-backend=auto</arg>
|
||||
<arg choice="plain">-Dcolord=yes</arg>
|
||||
<arg choice="plain">-Dcolord=no</arg>
|
||||
<arg choice="plain">-Dcolord=auto</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-cloudprint-print-backend=yes</arg>
|
||||
<arg choice="plain">-Denable-cloudprint-print-backend=no</arg>
|
||||
<arg choice="plain">-Denable-cloudprint-print-backend=auto</arg>
|
||||
<arg choice="plain">-Dvulkan=yes</arg>
|
||||
<arg choice="plain">-Dvulkan=no</arg>
|
||||
<arg choice="plain">-Dvulkan=auto</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-test-print-backend=yes</arg>
|
||||
<arg choice="plain">-Denable-test-print-backend=no</arg>
|
||||
<arg choice="plain">-Denable-test-print-backend=auto</arg>
|
||||
<arg choice="plain">-Dx11-backend=true</arg>
|
||||
<arg choice="plain">-Dx11-backend=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-colord=yes</arg>
|
||||
<arg choice="plain">-Denable-colord=no</arg>
|
||||
<arg choice="plain">-Denable-colord=auto</arg>
|
||||
<arg choice="plain">-Dcloudproviders=true</arg>
|
||||
<arg choice="plain">-Dcloudproviders=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-vulkan=yes</arg>
|
||||
<arg choice="plain">-Denable-vulkan=no</arg>
|
||||
<arg choice="plain">-Denable-vulkan=auto</arg>
|
||||
<arg choice="plain">-Dxinerama=yes</arg>
|
||||
<arg choice="plain">-Dxinerama=no</arg>
|
||||
<arg choice="plain">-Dxinerama=auto</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-x11-backend=true</arg>
|
||||
<arg choice="plain">-Denable-x11-backend=false</arg>
|
||||
<arg choice="plain">-Dwin32-backend=true</arg>
|
||||
<arg choice="plain">-Dwin32-backend=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-xinerama=true</arg>
|
||||
<arg choice="plain">-Denable-xinerama=false</arg>
|
||||
<arg choice="plain">-Dquartz-backend=true</arg>
|
||||
<arg choice="plain">-Dquartz-backend=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-win32-backend=true</arg>
|
||||
<arg choice="plain">-Denable-win32-backend=false</arg>
|
||||
<arg choice="plain">-Dbroadway-backend=true</arg>
|
||||
<arg choice="plain">-Dbroadway-backend=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-quartz-backend=true</arg>
|
||||
<arg choice="plain">-Denable-quartz-backend=false</arg>
|
||||
<arg choice="plain">-Dwayland-backend=true</arg>
|
||||
<arg choice="plain">-Dwayland-backend=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-broadway-backend=true</arg>
|
||||
<arg choice="plain">-Denable-broadway-backend=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-wayland-backend=true</arg>
|
||||
<arg choice="plain">-Denable-wayland-backend=false</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">-Denable-mir-backend=true</arg>
|
||||
<arg choice="plain">-Denable-mir-backend=false</arg>
|
||||
</group>
|
||||
<group>
|
||||
<arg choice="plain">-Dintrospection=true</arg>
|
||||
<arg choice="plain">-Dintrospection=false</arg>
|
||||
@@ -392,33 +365,7 @@ How to compile GTK+ itself
|
||||
</para>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>disable-modules</systemitem></title>
|
||||
|
||||
<para>
|
||||
Normally GTK+ will try to build the input method modules
|
||||
as little shared libraries that are loaded on demand.
|
||||
The <systemitem>disable-modules</systemitem> option
|
||||
indicates that they should all be built statically
|
||||
into the GTK+ library instead. This is useful for
|
||||
people who need to produce statically-linked binaries.
|
||||
If <systemitem>disable-modules</systemitem> is not specified,
|
||||
then the <command>configure</command> script will try to
|
||||
auto-detect whether shared modules work on your system.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>with-included-immodules</systemitem></title>
|
||||
|
||||
<para>
|
||||
This option allows you to specify which input method modules you
|
||||
want to include directly into the GTK+ shared library, as opposed
|
||||
to building them as loadable modules.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>enable-xinerama</systemitem></title>
|
||||
<title><systemitem>xinerama</systemitem></title>
|
||||
|
||||
<para>
|
||||
By default GTK+ will try to link against the Xinerama libraries
|
||||
@@ -428,8 +375,8 @@ How to compile GTK+ itself
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>enable-documentation</systemitem> and
|
||||
<systemitem>enable-man-pages</systemitem></title>
|
||||
<title><systemitem>documentation</systemitem> and
|
||||
<systemitem>man-pages</systemitem></title>
|
||||
|
||||
<para>
|
||||
The <application>gtk-doc</application> package is
|
||||
@@ -440,38 +387,33 @@ How to compile GTK+ itself
|
||||
<application>gtk-doc</application> installed and
|
||||
are modifying GTK+, you may want to enable
|
||||
<application>gtk-doc</application> support by passing
|
||||
in <systemitem>enable-documentation</systemitem>.
|
||||
in <systemitem>documentation</systemitem>.
|
||||
</para>
|
||||
<para>
|
||||
Additionally, some tools provided by GTK+ have their own
|
||||
manual pages generated using a similar set of dependencies;
|
||||
if you have <application>xsltproc</application> then you
|
||||
can generate manual pages by passing <systemitem>enable-man-pages</systemitem>
|
||||
can generate manual pages by passing <systemitem>man-pages</systemitem>
|
||||
when configuring the build.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>enable-cups-print-backend</systemitem>,
|
||||
<systemitem>enable-papi-print-backend</systemitem>,
|
||||
<systemitem>enable-cloudprint-print-backend</systemitem>, and
|
||||
<systemitem>enable-test-print-backend</systemitem></title>
|
||||
<title><systemitem>print-backends</systemitem></title>
|
||||
|
||||
<para>
|
||||
By default, GTK+ will try to build various print backends if
|
||||
their dependencies are found. These options can be used to
|
||||
explicitly control whether each print backend should be built
|
||||
or not.
|
||||
their dependencies are found. This option can be used to
|
||||
explicitly control which print backends should be built.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>enable-x11-backend</systemitem>,
|
||||
<systemitem>enable-win32-backend</systemitem>,
|
||||
<systemitem>enable-quartz-backend</systemitem>,
|
||||
<systemitem>enable-broadway-backend</systemitem>,
|
||||
<systemitem>enable-wayland-backend</systemitem>, and
|
||||
<systemitem>enable-mir-backend</systemitem></title>
|
||||
<title><systemitem>x11-backend</systemitem>,
|
||||
<systemitem>win32-backend</systemitem>,
|
||||
<systemitem>quartz-backend</systemitem>,
|
||||
<systemitem>broadway-backend</systemitem> and
|
||||
<systemitem>wayland-backend</systemitem></title>
|
||||
|
||||
<para>
|
||||
Enable specific backends for GDK. If none of these options
|
||||
@@ -496,8 +438,9 @@ How to compile GTK+ itself
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>build-tests</systemitem>
|
||||
<systemitem>demos</systemitem></title>
|
||||
<title><systemitem>build-tests</systemitem>,
|
||||
<systemitem>install-tests</systemitem>,
|
||||
<systemitem>demos</systemitem></title>
|
||||
|
||||
<para>
|
||||
By default, GTK+ will build quite a few tests and demos.
|
||||
|
@@ -90,7 +90,7 @@
|
||||
<link linkend="GdkEvent"><structname>GdkEvent</structname></link>
|
||||
structures and sends them on to the GTK layer. In turn, the GTK layer
|
||||
finds the widget that corresponds to a particular
|
||||
<classname>GdkWindow</classname> and emits the corresponding event
|
||||
<classname>GdkSurface</classname> and emits the corresponding event
|
||||
signals on that widget.
|
||||
</para>
|
||||
|
||||
@@ -207,17 +207,17 @@
|
||||
|
||||
<para>
|
||||
Normally, there is only a single cairo context which is used in
|
||||
the entire repaint, rather than one per GdkWindow. This means you
|
||||
the entire repaint, rather than one per GdkSurface. This means you
|
||||
have to respect (and not reset) existing clip and transformations
|
||||
set on it.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Most widgets, including those that create their own GdkWindows have
|
||||
Most widgets, including those that create their own GdkSurfaces have
|
||||
a transparent background, so they draw on top of whatever widgets
|
||||
are below them. This was not the case in GTK+ 2 where the theme set
|
||||
the background of most widgets to the default background color. (In
|
||||
fact, transparent GdkWindows used to be impossible.)
|
||||
fact, transparent GdkSurfaces used to be impossible.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -263,10 +263,10 @@
|
||||
<para>
|
||||
Two basic functions in GDK form the core of the double-buffering
|
||||
mechanism: <link
|
||||
linkend="gdk_window_begin_paint_region"><function>gdk_window_begin_paint_region()</function></link>
|
||||
linkend="gdk_surface_begin_paint_region"><function>gdk_surface_begin_paint_region()</function></link>
|
||||
and <link
|
||||
linkend="gdk_window_end_paint"><function>gdk_window_end_paint()</function></link>.
|
||||
The first function tells a <classname>GdkWindow</classname> to
|
||||
linkend="gdk_surface_end_paint"><function>gdk_surface_end_paint()</function></link>.
|
||||
The first function tells a <classname>GdkSurface</classname> to
|
||||
create a temporary off-screen buffer for drawing. All
|
||||
subsequent drawing operations to this window get automatically
|
||||
redirected to that buffer. The second function actually paints
|
||||
@@ -278,16 +278,16 @@
|
||||
|
||||
<para>
|
||||
It would be inconvenient for all widgets to call
|
||||
<function>gdk_window_begin_paint_region()</function> and
|
||||
<function>gdk_window_end_paint()</function> at the beginning
|
||||
<function>gdk_surface_begin_paint_region()</function> and
|
||||
<function>gdk_surface_end_paint()</function> at the beginning
|
||||
and end of their draw handlers.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To make this easier, GTK+ normally calls
|
||||
<function>gdk_window_begin_paint_region()</function>
|
||||
<function>gdk_surface_begin_paint_region()</function>
|
||||
before emitting the #GtkWidget::draw signal, and
|
||||
then it calls <function>gdk_window_end_paint()</function>
|
||||
then it calls <function>gdk_surface_end_paint()</function>
|
||||
after the signal has been emitted. This is convenient for
|
||||
most widgets, as they do not need to worry about creating
|
||||
their own temporary drawing buffers or about calling those
|
||||
@@ -335,8 +335,8 @@ my_widget_init (MyWidget *widget)
|
||||
<para>
|
||||
Even if you turn off double buffering on a widget, you
|
||||
can still call
|
||||
<function>gdk_window_begin_paint_region()</function> and
|
||||
<function>gdk_window_end_paint()</function> by hand to use
|
||||
<function>gdk_surface_begin_paint_region()</function> and
|
||||
<function>gdk_surface_end_paint()</function> by hand to use
|
||||
temporary drawing buffers.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
@@ -137,7 +137,7 @@
|
||||
<para>
|
||||
This is the step in a <glossterm
|
||||
linkend="widget">widget's</glossterm> life cycle where it
|
||||
actually shows the GdkWindows it created when it was
|
||||
actually shows the GdkSurfaces it created when it was
|
||||
<glossterm linkend="realization">realized</glossterm>. When a
|
||||
widget is mapped, it must turn on its
|
||||
%GTK_MAPPED <link linkend="GtkWidgetFlags">flag</link>.
|
||||
@@ -146,7 +146,7 @@
|
||||
<para>
|
||||
Note that due to the asynchronous nature of the X window
|
||||
system, a widget's window may not appear on the screen
|
||||
immediatly after one calls gdk_window_show():
|
||||
immediatly after one calls gdk_surface_show():
|
||||
you must wait for the corresponding map <glossterm
|
||||
linkend="event">event</glossterm> to be received. You can do
|
||||
this with the <link
|
||||
@@ -193,10 +193,10 @@
|
||||
<glossterm>no-window widget</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A widget that does not have a GdkWindow of its own on which to
|
||||
A widget that does not have a GdkSurface of its own on which to
|
||||
draw its contents, but rather shares its <glossterm
|
||||
linkend="parent">parent's</glossterm>. This can be tested with
|
||||
the gtk_widget_get_has_window() function.
|
||||
the gtk_widget_get_has_surface() function.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
@@ -218,20 +218,20 @@
|
||||
<para>
|
||||
This is the step in a <glossterm
|
||||
linkend="widget">widget's</glossterm> life cycle where it
|
||||
creates its own GdkWindow, or otherwise associates itself with
|
||||
creates its own GdkSurface, or otherwise associates itself with
|
||||
its <glossterm linkend="parent">parent's</glossterm>
|
||||
GdkWindow. If the widget has its own window, then it must
|
||||
GdkSurface. If the widget has its own window, then it must
|
||||
also attach a <glossterm linkend="style">style</glossterm> to
|
||||
it. A widget becomes unrealized by destroying its associated
|
||||
GdkWindow. When a widget is realized, it must turn on its
|
||||
GdkSurface. When a widget is realized, it must turn on its
|
||||
%GTK_REALIZED <link linkend="GtkWidgetFlags">flag</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Widgets that don't own the GdkWindow on which they draw are
|
||||
Widgets that don't own the GdkSurface on which they draw are
|
||||
called <glossterm linkend="no-window">no-window widgets</glossterm>.
|
||||
This can be tested with the gtk_widget_get_has_window() function. Normally,
|
||||
these widgets draw on their parent's GdkWindow.
|
||||
This can be tested with the gtk_widget_get_has_surface() function. Normally,
|
||||
these widgets draw on their parent's GdkSurface.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@@ -183,8 +183,6 @@
|
||||
<xi:include href="xml/gtktoolshell.xml" />
|
||||
<xi:include href="xml/gtktoolbar.xml" />
|
||||
<xi:include href="xml/gtktoolitem.xml" />
|
||||
<xi:include href="xml/gtktoolpalette.xml" />
|
||||
<xi:include href="xml/gtktoolitemgroup.xml" />
|
||||
<xi:include href="xml/gtkseparatortoolitem.xml" />
|
||||
<xi:include href="xml/gtktoolbutton.xml" />
|
||||
<xi:include href="xml/gtkmenutoolbutton.xml" />
|
||||
@@ -210,7 +208,6 @@
|
||||
<xi:include href="xml/gtkfontbutton.xml" />
|
||||
<xi:include href="xml/gtkfontchooserwidget.xml" />
|
||||
<xi:include href="xml/gtkfontchooserdialog.xml" />
|
||||
<xi:include href="xml/gtkplacessidebar.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="Ornaments">
|
||||
@@ -276,11 +273,6 @@
|
||||
<chapter id="RecentDocuments">
|
||||
<title>Recently Used Documents</title>
|
||||
<xi:include href="xml/gtkrecentmanager.xml" />
|
||||
<xi:include href="xml/gtkrecentchooser.xml" />
|
||||
<xi:include href="xml/gtkrecentchooserdialog.xml" />
|
||||
<xi:include href="xml/gtkrecentchoosermenu.xml" />
|
||||
<xi:include href="xml/gtkrecentchooserwidget.xml" />
|
||||
<xi:include href="xml/gtkrecentfilter.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="ApplicationChoosing">
|
||||
@@ -359,7 +351,6 @@
|
||||
<xi:include href="gtk4-demo-application.xml" />
|
||||
<xi:include href="gtk4-widget-factory.xml" />
|
||||
<xi:include href="gtk4-icon-browser.xml" />
|
||||
<xi:include href="gtk4-query-immodules.xml" />
|
||||
<xi:include href="gtk4-update-icon-cache.xml" />
|
||||
<xi:include href="gtk4-encode-symbolic-svg.xml" />
|
||||
<xi:include href="gtk4-builder-tool.xml" />
|
||||
@@ -391,58 +382,6 @@
|
||||
<title>Index of deprecated symbols</title>
|
||||
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-0" role="3.0">
|
||||
<title>Index of new symbols in 3.0</title>
|
||||
<xi:include href="xml/api-index-3.0.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-2" role="3.2">
|
||||
<title>Index of new symbols in 3.2</title>
|
||||
<xi:include href="xml/api-index-3.2.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-4" role="3.4">
|
||||
<title>Index of new symbols in 3.4</title>
|
||||
<xi:include href="xml/api-index-3.4.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-6" role="3.6">
|
||||
<title>Index of new symbols in 3.6</title>
|
||||
<xi:include href="xml/api-index-3.6.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-8" role="3.8">
|
||||
<title>Index of new symbols in 3.8</title>
|
||||
<xi:include href="xml/api-index-3.8.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-10" role="3.10">
|
||||
<title>Index of new symbols in 3.10</title>
|
||||
<xi:include href="xml/api-index-3.10.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-12" role="3.12">
|
||||
<title>Index of new symbols in 3.12</title>
|
||||
<xi:include href="xml/api-index-3.12.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-14" role="3.14">
|
||||
<title>Index of new symbols in 3.14</title>
|
||||
<xi:include href="xml/api-index-3.14.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-16" role="3.16">
|
||||
<title>Index of new symbols in 3.16</title>
|
||||
<xi:include href="xml/api-index-3.16.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-18" role="3.18">
|
||||
<title>Index of new symbols in 3.18</title>
|
||||
<xi:include href="xml/api-index-3.18.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-20" role="3.20">
|
||||
<title>Index of new symbols in 3.20</title>
|
||||
<xi:include href="xml/api-index-3.20.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-22" role="3.22">
|
||||
<title>Index of new symbols in 3.22</title>
|
||||
<xi:include href="xml/api-index-3.22.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-90" role="3.90">
|
||||
<title>Index of new symbols in 3.90</title>
|
||||
<xi:include href="xml/api-index-3.90.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
@@ -1,96 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk4-query-immodules">
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-query-immodules</title>
|
||||
<productname>GTK+</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Matthias</firstname>
|
||||
<surname>Clasen</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk4-query-immodules</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="manual">User Commands</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk4-query-immodules</refname>
|
||||
<refpurpose>Input method module registration utility</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>gtk4-query-immodules</command>
|
||||
<arg choice="opt">--update-cache</arg>
|
||||
<arg choice="opt" rep="repeat">MODULE</arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>gtk4-query-immodules</command> collects information about loadable
|
||||
input method modules for GTK+ and writes it to the default cache file
|
||||
location, or to <filename>stdout</filename>.
|
||||
</para>
|
||||
<para>
|
||||
If called without arguments, it looks for modules in the GTK+ input method
|
||||
module path.
|
||||
</para>
|
||||
<para>
|
||||
If called with arguments, it looks for the specified modules. The arguments
|
||||
may be absolute or relative paths.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normally, the output of <command>gtk4-query-immodules</command> is written
|
||||
to <filename><replaceable>libdir</replaceable>/gtk-4.0/4.0.0/immodules.cache</filename>,
|
||||
where GTK+ looks for it by default. If it is written to some other location,
|
||||
the <envar>GTK_IM_MODULE_FILE</envar> environment variable can be set to point
|
||||
GTK+ at the file.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Options</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>--update-cache</term>
|
||||
<listitem><para>Write the output to the default cache location instead of
|
||||
<filename>stdout</filename></para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><filename><replaceable>libdir</replaceable>/gtk-4.0/4.0.0/immodules.cache</filename></term>
|
||||
<listitem><para>The default im cache file used by GTK+ applications</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Environment</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><link linkend="gtk-path"><envar>GTK_PATH</envar></link></term>
|
||||
<listitem><para>Prepends directories to the input method module path</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><link linkend="gtk-im-module-file"><envar>GTK_IM_MODULE_FILE</envar></link></term>
|
||||
<listitem><para>Specifies an alternative im module cache for GTK+
|
||||
applications</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
@@ -902,8 +902,6 @@ gtk_entry_set_attributes
|
||||
gtk_entry_get_attributes
|
||||
gtk_entry_set_completion
|
||||
gtk_entry_get_completion
|
||||
gtk_entry_set_cursor_hadjustment
|
||||
gtk_entry_get_cursor_hadjustment
|
||||
gtk_entry_set_progress_fraction
|
||||
gtk_entry_get_progress_fraction
|
||||
gtk_entry_set_progress_pulse_step
|
||||
@@ -914,11 +912,11 @@ gtk_entry_reset_im_context
|
||||
gtk_entry_set_tabs
|
||||
gtk_entry_get_tabs
|
||||
GtkEntryIconPosition
|
||||
gtk_entry_set_icon_from_texture
|
||||
gtk_entry_set_icon_from_paintable
|
||||
gtk_entry_set_icon_from_icon_name
|
||||
gtk_entry_set_icon_from_gicon
|
||||
gtk_entry_get_icon_storage_type
|
||||
gtk_entry_get_icon_texture
|
||||
gtk_entry_get_icon_paintable
|
||||
gtk_entry_get_icon_name
|
||||
gtk_entry_get_icon_gicon
|
||||
gtk_entry_set_icon_activatable
|
||||
@@ -1046,8 +1044,6 @@ gtk_expander_set_use_markup
|
||||
gtk_expander_get_use_markup
|
||||
gtk_expander_set_label_widget
|
||||
gtk_expander_get_label_widget
|
||||
gtk_expander_set_label_fill
|
||||
gtk_expander_get_label_fill
|
||||
gtk_expander_set_resize_toplevel
|
||||
gtk_expander_get_resize_toplevel
|
||||
<SUBSECTION Standard>
|
||||
@@ -1487,7 +1483,6 @@ GtkIconViewPrivate
|
||||
<TITLE>GtkImage</TITLE>
|
||||
GtkImage
|
||||
GtkImageType
|
||||
gtk_image_get_surface
|
||||
gtk_image_get_texture
|
||||
gtk_image_get_icon_name
|
||||
gtk_image_get_gicon
|
||||
@@ -1497,14 +1492,12 @@ gtk_image_new_from_pixbuf
|
||||
gtk_image_new_from_icon_name
|
||||
gtk_image_new_from_gicon
|
||||
gtk_image_new_from_resource
|
||||
gtk_image_new_from_surface
|
||||
gtk_image_new_from_texture
|
||||
gtk_image_set_from_file
|
||||
gtk_image_set_from_pixbuf
|
||||
gtk_image_set_from_icon_name
|
||||
gtk_image_set_from_gicon
|
||||
gtk_image_set_from_resource
|
||||
gtk_image_set_from_surface
|
||||
gtk_image_set_from_texture
|
||||
gtk_image_clear
|
||||
gtk_image_new
|
||||
@@ -1512,6 +1505,10 @@ gtk_image_set_pixel_size
|
||||
gtk_image_get_pixel_size
|
||||
gtk_image_set_icon_size
|
||||
gtk_image_get_icon_size
|
||||
gtk_image_set_keep_aspect_ratio
|
||||
gtk_image_get_keep_aspect_ratio
|
||||
gtk_image_set_can_shrink
|
||||
gtk_image_get_can_shrink
|
||||
<SUBSECTION Standard>
|
||||
GTK_IMAGE
|
||||
GTK_IS_IMAGE
|
||||
@@ -1533,7 +1530,6 @@ GtkImageGIconData
|
||||
<TITLE>GtkIMContext</TITLE>
|
||||
GtkIMContext
|
||||
GtkIMContextClass
|
||||
GtkIMContextInfo
|
||||
gtk_im_context_get_preedit_string
|
||||
gtk_im_context_filter_keypress
|
||||
gtk_im_context_focus_in
|
||||
@@ -2179,143 +2175,6 @@ gtk_range_get_type
|
||||
GtkRangePrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkrecentchooser</FILE>
|
||||
<TITLE>GtkRecentChooser</TITLE>
|
||||
GtkRecentChooser
|
||||
GtkRecentChooserIface
|
||||
GTK_RECENT_CHOOSER_ERROR
|
||||
GtkRecentChooserError
|
||||
gtk_recent_chooser_set_show_private
|
||||
gtk_recent_chooser_get_show_private
|
||||
gtk_recent_chooser_set_show_not_found
|
||||
gtk_recent_chooser_get_show_not_found
|
||||
gtk_recent_chooser_set_show_icons
|
||||
gtk_recent_chooser_get_show_icons
|
||||
gtk_recent_chooser_set_select_multiple
|
||||
gtk_recent_chooser_get_select_multiple
|
||||
gtk_recent_chooser_set_local_only
|
||||
gtk_recent_chooser_get_local_only
|
||||
gtk_recent_chooser_set_limit
|
||||
gtk_recent_chooser_get_limit
|
||||
gtk_recent_chooser_set_show_tips
|
||||
gtk_recent_chooser_get_show_tips
|
||||
GtkRecentSortType
|
||||
gtk_recent_chooser_set_sort_type
|
||||
gtk_recent_chooser_get_sort_type
|
||||
GtkRecentSortFunc
|
||||
gtk_recent_chooser_set_sort_func
|
||||
gtk_recent_chooser_set_current_uri
|
||||
gtk_recent_chooser_get_current_uri
|
||||
gtk_recent_chooser_get_current_item
|
||||
gtk_recent_chooser_select_uri
|
||||
gtk_recent_chooser_unselect_uri
|
||||
gtk_recent_chooser_select_all
|
||||
gtk_recent_chooser_unselect_all
|
||||
gtk_recent_chooser_get_items
|
||||
gtk_recent_chooser_get_uris
|
||||
gtk_recent_chooser_add_filter
|
||||
gtk_recent_chooser_remove_filter
|
||||
gtk_recent_chooser_list_filters
|
||||
gtk_recent_chooser_set_filter
|
||||
gtk_recent_chooser_get_filter
|
||||
<SUBSECTION Standard>
|
||||
GTK_RECENT_CHOOSER
|
||||
GTK_IS_RECENT_CHOOSER
|
||||
GTK_TYPE_RECENT_CHOOSER
|
||||
GTK_RECENT_CHOOSER_GET_IFACE
|
||||
<SUBSECTION Private>
|
||||
gtk_recent_chooser_get_type
|
||||
gtk_recent_chooser_error_quark
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkrecentchooserdialog</FILE>
|
||||
<TITLE>GtkRecentChooserDialog</TITLE>
|
||||
GtkRecentChooserDialog
|
||||
gtk_recent_chooser_dialog_new
|
||||
gtk_recent_chooser_dialog_new_for_manager
|
||||
<SUBSECTION Standard>
|
||||
GTK_RECENT_CHOOSER_DIALOG
|
||||
GTK_IS_RECENT_CHOOSER_DIALOG
|
||||
GTK_TYPE_RECENT_CHOOSER_DIALOG
|
||||
GTK_RECENT_CHOOSER_DIALOG_CLASS
|
||||
GTK_IS_RECENT_CHOOSER_DIALOG_CLASS
|
||||
GTK_RECENT_CHOOSER_DIALOG_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_recent_chooser_dialog_get_type
|
||||
GtkRecentChooserDialogPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkrecentchoosermenu</FILE>
|
||||
<TITLE>GtkRecentChooserMenu</TITLE>
|
||||
GtkRecentChooserMenu
|
||||
gtk_recent_chooser_menu_new
|
||||
gtk_recent_chooser_menu_new_for_manager
|
||||
gtk_recent_chooser_menu_get_show_numbers
|
||||
gtk_recent_chooser_menu_set_show_numbers
|
||||
<SUBSECTION Standard>
|
||||
GTK_RECENT_CHOOSER_MENU
|
||||
GTK_IS_RECENT_CHOOSER_MENU
|
||||
GTK_TYPE_RECENT_CHOOSER_MENU
|
||||
GTK_RECENT_CHOOSER_MENU_CLASS
|
||||
GTK_IS_RECENT_CHOOSER_MENU_CLASS
|
||||
GTK_RECENT_CHOOSER_MENU_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_recent_chooser_menu_get_type
|
||||
GtkRecentChooserMenuPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkrecentchooserwidget</FILE>
|
||||
<TITLE>GtkRecentChooserWidget</TITLE>
|
||||
GtkRecentChooserWidget
|
||||
gtk_recent_chooser_widget_new
|
||||
gtk_recent_chooser_widget_new_for_manager
|
||||
<SUBSECTION Standard>
|
||||
GTK_RECENT_CHOOSER_WIDGET
|
||||
GTK_IS_RECENT_CHOOSER_WIDGET
|
||||
GTK_TYPE_RECENT_CHOOSER_WIDGET
|
||||
GTK_RECENT_CHOOSER_WIDGET_CLASS
|
||||
GTK_IS_RECENT_CHOOSER_WIDGET_CLASS
|
||||
GTK_RECENT_CHOOSER_WIDGET_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_recent_chooser_widget_get_type
|
||||
GtkRecentChooserWidgetPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkrecentfilter</FILE>
|
||||
<TITLE>GtkRecentFilter</TITLE>
|
||||
GtkRecentFilter
|
||||
GtkRecentFilterInfo
|
||||
GtkRecentFilterFlags
|
||||
GtkRecentFilterFunc
|
||||
gtk_recent_filter_new
|
||||
gtk_recent_filter_get_name
|
||||
gtk_recent_filter_set_name
|
||||
gtk_recent_filter_add_mime_type
|
||||
gtk_recent_filter_add_pattern
|
||||
gtk_recent_filter_add_pixbuf_formats
|
||||
gtk_recent_filter_add_application
|
||||
gtk_recent_filter_add_group
|
||||
gtk_recent_filter_add_age
|
||||
gtk_recent_filter_add_custom
|
||||
gtk_recent_filter_get_needed
|
||||
gtk_recent_filter_filter
|
||||
<SUBSECTION Standard>
|
||||
GTK_RECENT_FILTER
|
||||
GTK_IS_RECENT_FILTER
|
||||
GTK_TYPE_RECENT_FILTER
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_recent_filter_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkrecentmanager</FILE>
|
||||
<TITLE>GtkRecentManager</TITLE>
|
||||
@@ -3048,7 +2907,7 @@ gtk_text_view_get_line_at_y
|
||||
gtk_text_view_get_line_yrange
|
||||
gtk_text_view_get_iter_at_location
|
||||
gtk_text_view_get_iter_at_position
|
||||
gtk_text_view_buffer_to_window_coords
|
||||
gtk_text_view_buffer_to_surface_coords
|
||||
gtk_text_view_window_to_buffer_coords
|
||||
gtk_text_view_set_border_window_size
|
||||
gtk_text_view_get_border_window_size
|
||||
@@ -3364,78 +3223,6 @@ gtk_toggle_tool_button_get_type
|
||||
GtkToggleToolButtonPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktoolitemgroup</FILE>
|
||||
<TITLE>GtkToolItemGroup</TITLE>
|
||||
GtkToolItemGroup
|
||||
GtkToolItemGroupClass
|
||||
gtk_tool_item_group_get_collapsed
|
||||
gtk_tool_item_group_get_drop_item
|
||||
gtk_tool_item_group_get_ellipsize
|
||||
gtk_tool_item_group_get_item_position
|
||||
gtk_tool_item_group_get_n_items
|
||||
gtk_tool_item_group_get_label
|
||||
gtk_tool_item_group_get_label_widget
|
||||
gtk_tool_item_group_get_nth_item
|
||||
gtk_tool_item_group_get_header_relief
|
||||
gtk_tool_item_group_insert
|
||||
gtk_tool_item_group_new
|
||||
gtk_tool_item_group_set_collapsed
|
||||
gtk_tool_item_group_set_ellipsize
|
||||
gtk_tool_item_group_set_item_position
|
||||
gtk_tool_item_group_set_label
|
||||
gtk_tool_item_group_set_label_widget
|
||||
gtk_tool_item_group_set_header_relief
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TOOL_ITEM_GROUP
|
||||
GTK_IS_TOOL_ITEM_GROUP
|
||||
GTK_TYPE_TOOL_ITEM_GROUP
|
||||
GTK_TOOL_ITEM_GROUP_CLASS
|
||||
GTK_IS_TOOL_ITEM_GROUP_CLASS
|
||||
GTK_TOOL_ITEM_GROUP_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkToolItemGroupPrivate
|
||||
gtk_tool_item_group_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktoolpalette</FILE>
|
||||
<TITLE>GtkToolPalette</TITLE>
|
||||
GtkToolPalette
|
||||
GtkToolPaletteClass
|
||||
gtk_tool_palette_new
|
||||
gtk_tool_palette_get_exclusive
|
||||
gtk_tool_palette_set_exclusive
|
||||
gtk_tool_palette_get_expand
|
||||
gtk_tool_palette_set_expand
|
||||
gtk_tool_palette_get_group_position
|
||||
gtk_tool_palette_set_group_position
|
||||
gtk_tool_palette_get_style
|
||||
gtk_tool_palette_set_style
|
||||
gtk_tool_palette_unset_style
|
||||
gtk_tool_palette_add_drag_dest
|
||||
gtk_tool_palette_get_drag_item
|
||||
gtk_tool_palette_get_drag_target_group
|
||||
gtk_tool_palette_get_drag_target_item
|
||||
gtk_tool_palette_get_drop_group
|
||||
gtk_tool_palette_get_drop_item
|
||||
GtkToolPaletteDragTargets
|
||||
gtk_tool_palette_set_drag_source
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TOOL_PALETTE
|
||||
GTK_IS_TOOL_PALETTE
|
||||
GTK_TYPE_TOOL_PALETTE
|
||||
GTK_TOOL_PALETTE_CLASS
|
||||
GTK_IS_TOOL_PALETTE_CLASS
|
||||
GTK_TOOL_PALETTE_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_tool_palette_get_type
|
||||
GtkToolPalettePrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktooltip</FILE>
|
||||
<TITLE>GtkTooltip</TITLE>
|
||||
@@ -4380,6 +4167,15 @@ gtk_volume_button_get_type
|
||||
<FILE>gtksnapshot</FILE>
|
||||
<TITLE>GtkSnapshot</TITLE>
|
||||
GtkSnapshot
|
||||
gtk_snapshot_new
|
||||
gtk_snapshot_ref
|
||||
gtk_snapshot_unref
|
||||
gtk_snapshot_to_node
|
||||
gtk_snapshot_to_paintable
|
||||
gtk_snapshot_free_to_node
|
||||
gtk_snapshot_free_to_paintable
|
||||
gtk_snapshot_get_renderer
|
||||
gtk_snapshot_get_record_names
|
||||
gtk_snapshot_push
|
||||
gtk_snapshot_push_transform
|
||||
gtk_snapshot_push_opacity
|
||||
@@ -4396,6 +4192,7 @@ gtk_snapshot_append_node
|
||||
gtk_snapshot_append_cairo
|
||||
gtk_snapshot_append_texture
|
||||
gtk_snapshot_append_color
|
||||
gtk_snapshot_append_layout
|
||||
gtk_snapshot_clips_rect
|
||||
gtk_snapshot_render_background
|
||||
gtk_snapshot_render_frame
|
||||
@@ -4418,7 +4215,6 @@ gtk_widget_in_destruction
|
||||
gtk_widget_destroyed
|
||||
gtk_widget_unparent
|
||||
gtk_widget_show
|
||||
gtk_widget_show_now
|
||||
gtk_widget_hide
|
||||
gtk_widget_map
|
||||
gtk_widget_unmap
|
||||
@@ -4450,8 +4246,8 @@ gtk_widget_set_name
|
||||
gtk_widget_get_name
|
||||
gtk_widget_set_sensitive
|
||||
gtk_widget_set_parent
|
||||
gtk_widget_set_parent_window
|
||||
gtk_widget_get_parent_window
|
||||
gtk_widget_set_parent_surface
|
||||
gtk_widget_get_parent_surface
|
||||
gtk_widget_get_toplevel
|
||||
gtk_widget_get_ancestor
|
||||
gtk_widget_is_ancestor
|
||||
@@ -4461,7 +4257,6 @@ GtkTextDirection
|
||||
gtk_widget_get_direction
|
||||
gtk_widget_set_default_direction
|
||||
gtk_widget_get_default_direction
|
||||
gtk_widget_shape_combine_region
|
||||
gtk_widget_input_shape_combine_region
|
||||
gtk_widget_create_pango_context
|
||||
gtk_widget_get_pango_context
|
||||
@@ -4507,9 +4302,9 @@ gtk_widget_set_tooltip_window
|
||||
gtk_widget_get_has_tooltip
|
||||
gtk_widget_set_has_tooltip
|
||||
gtk_widget_trigger_tooltip_query
|
||||
gtk_widget_get_window
|
||||
gtk_widget_register_window
|
||||
gtk_widget_unregister_window
|
||||
gtk_widget_get_surface
|
||||
gtk_widget_register_surface
|
||||
gtk_widget_unregister_surface
|
||||
gtk_widget_get_allocated_width
|
||||
gtk_widget_get_allocated_height
|
||||
gtk_widget_get_allocation
|
||||
@@ -4526,8 +4321,8 @@ gtk_widget_get_can_focus
|
||||
gtk_widget_set_can_focus
|
||||
gtk_widget_get_focus_on_click
|
||||
gtk_widget_set_focus_on_click
|
||||
gtk_widget_get_has_window
|
||||
gtk_widget_set_has_window
|
||||
gtk_widget_get_has_surface
|
||||
gtk_widget_set_has_surface
|
||||
gtk_widget_get_sensitive
|
||||
gtk_widget_is_sensitive
|
||||
gtk_widget_get_visible
|
||||
@@ -4542,7 +4337,7 @@ gtk_widget_has_visible_focus
|
||||
gtk_widget_has_grab
|
||||
gtk_widget_is_drawable
|
||||
gtk_widget_is_toplevel
|
||||
gtk_widget_set_window
|
||||
gtk_widget_set_surface
|
||||
gtk_widget_set_receives_default
|
||||
gtk_widget_get_receives_default
|
||||
gtk_widget_set_support_multidevice
|
||||
@@ -4810,9 +4605,6 @@ gtk_main_iteration
|
||||
gtk_main_iteration_do
|
||||
gtk_main_do_event
|
||||
|
||||
GtkModuleInitFunc
|
||||
GtkModuleDisplayInitFunc
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_grab_add
|
||||
gtk_grab_get_current
|
||||
@@ -5150,8 +4942,6 @@ gtk_selection_data_set_text
|
||||
gtk_selection_data_get_text
|
||||
gtk_selection_data_set_pixbuf
|
||||
gtk_selection_data_get_pixbuf
|
||||
gtk_selection_data_set_surface
|
||||
gtk_selection_data_get_surface
|
||||
gtk_selection_data_set_texture
|
||||
gtk_selection_data_get_texture
|
||||
gtk_selection_data_set_uris
|
||||
@@ -5203,16 +4993,15 @@ gtk_drag_unhighlight
|
||||
gtk_drag_begin_with_coordinates
|
||||
gtk_drag_cancel
|
||||
gtk_drag_set_icon_widget
|
||||
gtk_drag_set_icon_surface
|
||||
gtk_drag_set_icon_texture
|
||||
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_surface
|
||||
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
|
||||
@@ -5292,7 +5081,6 @@ gtk_icon_theme_lookup_by_gicon
|
||||
gtk_icon_theme_lookup_by_gicon_for_scale
|
||||
gtk_icon_theme_load_icon
|
||||
gtk_icon_theme_load_icon_for_scale
|
||||
gtk_icon_theme_load_surface
|
||||
gtk_icon_theme_list_contexts
|
||||
gtk_icon_theme_list_icons
|
||||
gtk_icon_theme_get_icon_sizes
|
||||
@@ -5303,7 +5091,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_surface
|
||||
gtk_icon_info_load_texture
|
||||
gtk_icon_info_load_icon_async
|
||||
gtk_icon_info_load_icon_finish
|
||||
@@ -6185,6 +5972,8 @@ gtk_overlay_add_overlay
|
||||
gtk_overlay_reorder_overlay
|
||||
gtk_overlay_get_overlay_pass_through
|
||||
gtk_overlay_set_overlay_pass_through
|
||||
gtk_overlay_get_measure_overlay
|
||||
gtk_overlay_set_measure_overlay
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_OVERLAY
|
||||
|
@@ -127,10 +127,6 @@ gtk_radio_button_get_type
|
||||
gtk_radio_menu_item_get_type
|
||||
gtk_radio_tool_button_get_type
|
||||
gtk_range_get_type
|
||||
gtk_recent_chooser_get_type
|
||||
gtk_recent_chooser_dialog_get_type
|
||||
gtk_recent_chooser_menu_get_type
|
||||
gtk_recent_chooser_widget_get_type
|
||||
gtk_recent_manager_get_type
|
||||
gtk_revealer_get_type
|
||||
gtk_scale_button_get_type
|
||||
@@ -150,6 +146,7 @@ gtk_shortcuts_section_get_type
|
||||
gtk_shortcuts_group_get_type
|
||||
gtk_shortcuts_shortcut_get_type
|
||||
gtk_size_group_get_type
|
||||
gtk_snapshot_get_type
|
||||
gtk_spin_button_get_type
|
||||
gtk_spinner_get_type
|
||||
gtk_stack_get_type
|
||||
@@ -172,8 +169,6 @@ gtk_toggle_tool_button_get_type
|
||||
gtk_toolbar_get_type
|
||||
gtk_tool_button_get_type
|
||||
gtk_tool_item_get_type
|
||||
gtk_tool_item_group_get_type
|
||||
gtk_tool_palette_get_type
|
||||
gtk_tree_drag_dest_get_type
|
||||
gtk_tree_drag_source_get_type
|
||||
gtk_tree_model_filter_get_type
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
@@ -91,7 +91,7 @@
|
||||
<title>Event propagation</title>
|
||||
|
||||
<para>
|
||||
For widgets which have a #GdkWindow set, events are received from the
|
||||
For widgets which have a #GdkSurface set, events are received from the
|
||||
windowing system and passed to gtk_main_do_event(). See its documentation
|
||||
for details of what it does: compression of enter/leave events,
|
||||
identification of the widget receiving the event, pushing the event onto a
|
||||
@@ -101,11 +101,11 @@
|
||||
|
||||
<para>
|
||||
When a GDK backend produces an input event, it is tied to a #GdkDevice and
|
||||
a #GdkWindow, which in turn represents a windowing system surface in the
|
||||
a #GdkSurface, which in turn represents a windowing system surface in the
|
||||
backend. If a widget has grabbed the current input device, or all input
|
||||
devices, the event is propagated to that #GtkWidget. Otherwise, it is
|
||||
propagated to the the #GtkWidget which called gtk_widget_register_window()
|
||||
on the #GdkWindow receiving the event.
|
||||
propagated to the the #GtkWidget which called gtk_widget_register_surface()
|
||||
on the #GdkSurface receiving the event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -113,7 +113,7 @@
|
||||
specific input device (gtk_device_grab_add()), is sent events in
|
||||
preference to a global grab (gtk_grab_add()). Input grabs only have effect
|
||||
within the #GtkWindowGroup containing the #GtkWidget which registered the
|
||||
event’s #GdkWindow. If this #GtkWidget is a child of the grab widget, the
|
||||
event’s #GdkSurface. If this #GtkWidget is a child of the grab widget, the
|
||||
event is propagated to the child — this is the basis for propagating
|
||||
events within modal dialogs.
|
||||
</para>
|
||||
@@ -186,15 +186,15 @@
|
||||
Each widget instance has a basic event mask and another per input device,
|
||||
which determine the types of input event it receives. Each event mask set
|
||||
on a widget is added to the corresponding (basic or per-device) event mask
|
||||
for the widget’s #GdkWindow, and all child #GdkWindows.
|
||||
for the widget’s #GdkSurface, and all child #GdkSurfaces.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering events against event masks happens inside #GdkWindow, which
|
||||
Filtering events against event masks happens inside #GdkSurface, which
|
||||
exposes event masks to the windowing system to reduce the number of events
|
||||
GDK receives from it. On receiving an event, it is filtered against the
|
||||
#GdkWindow’s mask for the input device, if set. Otherwise, it is filtered
|
||||
against the #GdkWindow’s basic event mask.
|
||||
#GdkSurface’s mask for the input device, if set. Otherwise, it is filtered
|
||||
against the #GdkSurface’s basic event mask.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@@ -112,7 +112,6 @@ images = [
|
||||
'images/printdialog.png',
|
||||
'images/progressbar.png',
|
||||
'images/radio-group.png',
|
||||
'images/recentchooserdialog.png',
|
||||
'images/right-center.png',
|
||||
'images/right-end.png',
|
||||
'images/right-start.png',
|
||||
@@ -133,7 +132,6 @@ images = [
|
||||
'images/switch.png',
|
||||
'images/toggle-button.png',
|
||||
'images/toolbar.png',
|
||||
'images/toolpalette.png',
|
||||
'images/tree-view-coordinates.png',
|
||||
'images/up-center.png',
|
||||
'images/up-end.png',
|
||||
@@ -160,7 +158,6 @@ content_files = [
|
||||
'gtk4-encode-symbolic-svg.xml',
|
||||
'gtk4-icon-browser.xml',
|
||||
'gtk4-launch.xml',
|
||||
'gtk4-query-immodules.xml',
|
||||
'gtk4-query-settings.xml',
|
||||
'gtk4-update-icon-cache.xml',
|
||||
'gtk4-widget-factory.xml',
|
||||
@@ -263,7 +260,6 @@ if get_option('man-pages') and xsltproc.found()
|
||||
[ 'gtk4-encode-symbolic-svg', '1', ],
|
||||
[ 'gtk4-icon-browser', '1', ],
|
||||
[ 'gtk4-launch', '1', ],
|
||||
[ 'gtk4-query-immodules', '1', ],
|
||||
[ 'gtk4-query-settings', '1', ],
|
||||
[ 'gtk4-update-icon-cache', '1', ],
|
||||
[ 'gtk4-widget-factory', '1', ],
|
||||
|
@@ -52,6 +52,21 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Enable diagnostic warnings</title>
|
||||
<para>
|
||||
Deprecations of properties and signals cannot be caught at compile
|
||||
time, as both properties and signals are installed and used after
|
||||
types have been instantiated. In order to catch deprecations and
|
||||
changes in the run time components, you should use the
|
||||
<envar>G_ENABLE_DIAGNOSTIC</envar> environment variable when
|
||||
running your application, e.g.:
|
||||
<programlisting>
|
||||
G_ENABLE_DIAGNOSTIC=1 ./your-app
|
||||
</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Do not use widget style properties</title>
|
||||
<para>
|
||||
@@ -64,13 +79,13 @@
|
||||
<title>Review your window creation flags</title>
|
||||
<para>
|
||||
GTK+ 4 removes the GDK_WA_CURSOR flag. Instead, just use
|
||||
gdk_window_set_cursor() to set a cursor on the window after
|
||||
gdk_surface_set_cursor() to set a cursor on the window after
|
||||
creating it.
|
||||
</para>
|
||||
<para>
|
||||
GTK+ 4 also removes the GDK_WA_VISUAL flag, and always uses
|
||||
an RGBA visual for windows. To prepare your code for this,
|
||||
use gdk_window_set_visual (gdk_screen_get_rgba_visual ()) after
|
||||
use gdk_surface_set_visual (gdk_screen_get_rgba_visual ()) after
|
||||
creating your window.
|
||||
</para>
|
||||
<para>
|
||||
@@ -135,13 +150,25 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_window()</title>
|
||||
<title>Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_surface()</title>
|
||||
<para>
|
||||
These functions are not supported in GTK+ 4. Instead, either use backend-specific
|
||||
APIs, or render your widgets using gtk_widget_render().
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using GtkButton's image-related API</title>
|
||||
<para>
|
||||
The functions and properties related to automatically add a GtkImage
|
||||
to a GtkButton, and using a GtkSetting to control its visibility, are
|
||||
not supported in GTK+ 4. Instead, you can just pack a GtkImage inside
|
||||
a GtkButton, and control its visibility like you would for any other
|
||||
widget. If you only want to add a named icon to a GtkButton, you can
|
||||
use gtk_button_set_icon_name().
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -167,7 +194,7 @@
|
||||
<title>Stop using the root window</title>
|
||||
<para>
|
||||
The root window is an X11-centric concept that is no longer exposed in the
|
||||
backend-neutral GDK API. gdk_window_get_parent() will return %NULL for toplevel
|
||||
backend-neutral GDK API. gdk_surface_get_parent() will return %NULL for toplevel
|
||||
windows. If you need to interact with the X11 root window, you can use
|
||||
gdk_x11_display_get_xrootwindow() to get its XID.
|
||||
</para>
|
||||
@@ -190,12 +217,12 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Adapt to GdkWindow API changes</title>
|
||||
<title>Adapt to GdkSurface API changes</title>
|
||||
<para>
|
||||
The gdk_window_new() function has been replaced by a number of more
|
||||
specialized constructors: gdk_window_new_toplevel(), gdk_window_new_popup(),
|
||||
gdk_window_new_temp(), gdk_window_new_child(), gdk_window_new_input(),
|
||||
gdk_wayland_window_new_subsurface(). Use the appropriate ones to create
|
||||
The gdk_surface_new() function has been replaced by a number of more
|
||||
specialized constructors: gdk_surface_new_toplevel(), gdk_surface_new_popup(),
|
||||
gdk_surface_new_temp(), gdk_surface_new_child(), gdk_surface_new_input(),
|
||||
gdk_wayland_surface_new_subsurface(). Use the appropriate ones to create
|
||||
your windows.
|
||||
</para>
|
||||
<para>
|
||||
@@ -203,7 +230,7 @@
|
||||
complicating the code and could not be supported across backends.
|
||||
</para>
|
||||
<para>
|
||||
gdk_window_reparent() is no longer available.
|
||||
gdk_surface_reparent() is no longer available.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -217,7 +244,7 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using gdk_window_set_event_compression</title>
|
||||
<title>Stop using gdk_surface_set_event_compression</title>
|
||||
<para>
|
||||
Event compression is now always enabled. If you need to see the uncoalesced
|
||||
motion history, use gdk_event_get_motion_history().
|
||||
@@ -340,7 +367,7 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using APIs to query GdkWindows</title>
|
||||
<title>Stop using APIs to query GdkSurfaces</title>
|
||||
<para>
|
||||
A number of APIs for querying special-purpose windows have been removed,
|
||||
since these windows are no longer publically available:
|
||||
|
@@ -391,14 +391,14 @@ This comes up when using bitfields; in C you can write the following
|
||||
code:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
gdk_window_set_events (gdk_window,
|
||||
gdk_surface_set_events (gdk_surface,
|
||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
while in C++ you must write:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
gdk_window_set_events (gdk_window,
|
||||
gdk_surface_set_events (gdk_surface,
|
||||
(GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
@@ -122,36 +122,13 @@ additional environment variables.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GTK3_MODULES</envar></title>
|
||||
|
||||
<para>
|
||||
A list of modules to load. Note that GTK+ also allows to specify modules to load via a commandline option (<option>--gtk-module</option>) and with the <literal>gtk-modules</literal> setting.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GTK_MODULES</envar></title>
|
||||
|
||||
<para>
|
||||
A list of modules to load in addition to the ones in the <envar>GTK3_MODULES</envar> variable.
|
||||
</para>
|
||||
<warning>
|
||||
Note that this environment variable is read by GTK+ 2.x too,
|
||||
which may not have the same set of modules available for loading.
|
||||
Use <envar>GTK3_MODULES</envar> for modules that are only compatible
|
||||
with GTK+ 3.
|
||||
</warning>
|
||||
</formalpara>
|
||||
|
||||
<formalpara id="gtk-path">
|
||||
<title><envar>GTK_PATH</envar></title>
|
||||
|
||||
<para>
|
||||
Specifies a list of directories to search when GTK+ is looking for
|
||||
dynamically loaded objects such as the modules specified by
|
||||
<envar>GTK_MODULES</envar>, theme engines, input method
|
||||
modules, file system backends and print backends. If the path to
|
||||
dynamically loaded objects such as input method
|
||||
modules and print backends. If the path to
|
||||
the dynamically loaded object is given as an absolute path name,
|
||||
then GTK+ loads it directly.
|
||||
Otherwise, GTK+ goes in turn through the directories in <envar>GTK_PATH</envar>,
|
||||
@@ -206,27 +183,6 @@ additional environment variables.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara id="gtk-im-module-file">
|
||||
<title><envar>GTK_IM_MODULE_FILE</envar></title>
|
||||
|
||||
<para>
|
||||
Specifies the file listing the IM modules to load. This environment
|
||||
variable the default value
|
||||
<filename><replaceable>libdir</replaceable>/gtk-4.0/4.0.0/immodules.cache</filename>
|
||||
(<replaceable>libdir</replaceable> has the same meaning here as explained for <envar>GTK_PATH</envar>).
|
||||
</para>
|
||||
<para>
|
||||
The <filename>immodules.cache</filename> file is generated by the
|
||||
<command>gtk-query-immodules-3.0</command> utility.
|
||||
</para>
|
||||
<warning>
|
||||
Note that this environment variable is read by GTK+ 2.x too, which
|
||||
makes it unsuitable for setting it system-wide (or session-wide),
|
||||
since doing so will cause either GTK+ 2.x applications or GTK+ 3
|
||||
applications to see the wrong list of IM modules.
|
||||
</warning>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GTK_EXE_PREFIX</envar></title>
|
||||
|
||||
|
@@ -168,9 +168,6 @@
|
||||
<link linkend="GtkToolbar">
|
||||
<inlinegraphic fileref="toolbar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkToolPalette">
|
||||
<inlinegraphic fileref="toolpalette.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkPlacesSidebar">
|
||||
<inlinegraphic fileref="placessidebar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
@@ -198,9 +195,6 @@
|
||||
<link linkend="GtkFileChooserDialog">
|
||||
<inlinegraphic fileref="filechooser.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkRecentChooserDialog">
|
||||
<inlinegraphic fileref="recentchooserdialog.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkFontChooserDialog">
|
||||
<inlinegraphic fileref="fontchooser.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
|
@@ -211,20 +211,20 @@ static GList *toplevels;
|
||||
static guint shot_id;
|
||||
|
||||
static gboolean
|
||||
window_is_csd (GdkWindow *window)
|
||||
window_is_csd (GdkSurface *window)
|
||||
{
|
||||
gboolean set;
|
||||
GdkWMDecoration decorations = 0;
|
||||
|
||||
/* FIXME: is this accurate? */
|
||||
set = gdk_window_get_decorations (window, &decorations);
|
||||
set = gdk_surface_get_decorations (window, &decorations);
|
||||
return (set && (decorations == 0));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
shoot_one (WidgetInfo *info)
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkSurface *window;
|
||||
XID id;
|
||||
GdkPixbuf *screenshot = NULL;
|
||||
DecorationType decor = DECOR_FRAME;
|
||||
@@ -235,8 +235,8 @@ shoot_one (WidgetInfo *info)
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
window = gtk_widget_get_window (info->window);
|
||||
id = gdk_x11_window_get_xid (window);
|
||||
window = gtk_widget_get_surface (info->window);
|
||||
id = gdk_x11_surface_get_xid (window);
|
||||
if (window_is_csd (window))
|
||||
decor = (info->include_decorations) ? DECOR_NONE : DECOR_WINDOW_FRAME;
|
||||
screenshot = take_window_shot (id, decor);
|
||||
|
@@ -448,25 +448,6 @@ create_action_bar (void)
|
||||
return info;
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_recent_chooser_dialog (void)
|
||||
{
|
||||
WidgetInfo *info;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_recent_chooser_dialog_new ("Recent Chooser Dialog",
|
||||
NULL,
|
||||
"Cancel", GTK_RESPONSE_CANCEL,
|
||||
"Open", GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
gtk_window_set_default_size (GTK_WINDOW (widget), 505, 305);
|
||||
|
||||
info = new_widget_info ("recentchooserdialog", widget, ASIS);
|
||||
info->include_decorations = TRUE;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_text_view (void)
|
||||
{
|
||||
@@ -819,40 +800,6 @@ create_toolbar (void)
|
||||
return new_widget_info ("toolbar", widget, SMALL);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_toolpalette (void)
|
||||
{
|
||||
GtkWidget *widget, *group;
|
||||
GtkToolItem *item;
|
||||
|
||||
widget = gtk_tool_palette_new ();
|
||||
group = gtk_tool_item_group_new ("Tools");
|
||||
gtk_container_add (GTK_CONTAINER (widget), group);
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "help-about");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "document-new");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "folder");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
|
||||
group = gtk_tool_item_group_new ("More tools");
|
||||
gtk_container_add (GTK_CONTAINER (widget), group);
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "edit-cut");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "edit-find");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "document-properties");
|
||||
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
|
||||
|
||||
return new_widget_info ("toolpalette", widget, MEDIUM);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_menubar (void)
|
||||
{
|
||||
@@ -1474,7 +1421,6 @@ get_all_widgets (void)
|
||||
retval = g_list_prepend (retval, create_headerbar ());
|
||||
retval = g_list_prepend (retval, create_stack ());
|
||||
retval = g_list_prepend (retval, create_stack_switcher ());
|
||||
retval = g_list_prepend (retval, create_toolpalette ());
|
||||
retval = g_list_prepend (retval, create_spinner ());
|
||||
retval = g_list_prepend (retval, create_about_dialog ());
|
||||
retval = g_list_prepend (retval, create_accel_label ());
|
||||
@@ -1511,7 +1457,6 @@ get_all_widgets (void)
|
||||
retval = g_list_prepend (retval, create_window ());
|
||||
retval = g_list_prepend (retval, create_filesel ());
|
||||
retval = g_list_prepend (retval, create_assistant ());
|
||||
retval = g_list_prepend (retval, create_recent_chooser_dialog ());
|
||||
retval = g_list_prepend (retval, create_page_setup_dialog ());
|
||||
retval = g_list_prepend (retval, create_print_dialog ());
|
||||
retval = g_list_prepend (retval, create_volume_button ());
|
||||
|
@@ -62,23 +62,23 @@ GtkWidget, public flags:
|
||||
GTK_TOPLEVEL:
|
||||
Widgets without a real parent, as there are GtkWindows and
|
||||
GtkMenus have this flag set throughout their lifetime.
|
||||
Toplevel widgets always contain their own GdkWindow.
|
||||
Toplevel widgets always contain their own GdkSurface.
|
||||
|
||||
GTK_NO_WINDOW:
|
||||
This flag is indicative for a widget that does not provide
|
||||
its own GdkWindow. Visible action (e.g. drawing) is performed
|
||||
on the parent's GdkWindow.
|
||||
its own GdkSurface. Visible action (e.g. drawing) is performed
|
||||
on the parent's GdkSurface.
|
||||
|
||||
GTK_REALIZED:
|
||||
Set by gtk_widget_realize, unset by gtk_widget_unrealize.
|
||||
Relies on ((widget->parent && widget->parent->window)
|
||||
|| GTK_WIDGET_TOPLEVEL (widget));
|
||||
Means: widget has an associated GdkWindow (XWindow).
|
||||
Means: widget has an associated GdkSurface (XWindow).
|
||||
|
||||
GTK_MAPPED:
|
||||
Set by gtk_widget_map, unset by gtk_widget_unmap.
|
||||
May only be set if GTK_WIDGET_REALIZED (widget).
|
||||
Means: gdk_window_show() has been called on the widgets window(s).
|
||||
Means: gdk_surface_show() has been called on the widgets window(s).
|
||||
|
||||
GTK_VISIBLE:
|
||||
Set by gtk_widget_show.
|
||||
@@ -329,7 +329,7 @@ Adding to a container
|
||||
|
||||
When a widget is added to a container, the container:
|
||||
|
||||
1) calls gtk_widget_set_parent_window (widget, window) if
|
||||
1) calls gtk_widget_set_parent_surface (widget, window) if
|
||||
the widget is being added to something other than container->window
|
||||
2) calls gtk_widget_set_parent (widget, container)
|
||||
|
||||
@@ -364,7 +364,7 @@ When a widget receives the "realize" signal it should:
|
||||
|
||||
1) set the realized flag
|
||||
2) set widget->window
|
||||
widget->window = gtk_widget_get_parent_window (widget);
|
||||
widget->window = gtk_widget_get_parent_surface (widget);
|
||||
g_object_ref (widget->window);
|
||||
3) attach the widget's style
|
||||
|
||||
@@ -374,7 +374,7 @@ When a widget receives the "realize" signal it should:
|
||||
|
||||
1) set the REALIZED flag
|
||||
2) create windows with the parent obtained from
|
||||
gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_get_parent_surface (widget);
|
||||
3) attach the widget's style
|
||||
4) set the background color for the new window based on the style
|
||||
|
||||
@@ -382,7 +382,7 @@ The Map signal
|
||||
--------------
|
||||
|
||||
1) Set the MAPPED flag
|
||||
2) If the widget has any windows, gdk_window_show those windows
|
||||
2) If the widget has any windows, gdk_surface_show those windows
|
||||
3) call gtk_widget_map for all child widgets that are
|
||||
VISIBLE, CHILD_VISIBLE and !MAPPED. (A widget will only
|
||||
be !CHILD_VISIBLE if the container set it that way, so
|
||||
@@ -395,7 +395,7 @@ The Unmap signal
|
||||
|
||||
When a widget receives the unmap signal, it must:
|
||||
|
||||
1) If the widget has a window, gdk_window_hide that window,
|
||||
1) If the widget has a window, gdk_surface_hide that window,
|
||||
2) If the widget does not have a window, unmap all child widgets
|
||||
3) Do any other functions related to taking the widget offscreen
|
||||
(for instance, removing popup windows...)
|
||||
@@ -409,8 +409,8 @@ When a widget receives the unrealize signal, it must
|
||||
|
||||
1) For any windows other than widget->window do:
|
||||
|
||||
gdk_window_set_user_data (window, NULL);
|
||||
gdk_window_destroy (window);
|
||||
gdk_surface_set_user_data (window, NULL);
|
||||
gdk_surface_destroy (window);
|
||||
|
||||
2) Call the parent's unrealize handler
|
||||
|
||||
|
@@ -30,9 +30,9 @@ size_allocate_cb (GtkWidget *widget,
|
||||
surface = NULL;
|
||||
}
|
||||
|
||||
if (gtk_widget_get_window (widget))
|
||||
if (gtk_widget_get_surface (widget))
|
||||
{
|
||||
surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
|
||||
surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget),
|
||||
CAIRO_CONTENT_COLOR,
|
||||
gtk_widget_get_width (widget),
|
||||
gtk_widget_get_height (widget));
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#define __GDKBROADWAY_H_INSIDE__
|
||||
|
||||
#include <gdk/broadway/gdkbroadwaydisplay.h>
|
||||
#include <gdk/broadway/gdkbroadwaywindow.h>
|
||||
#include <gdk/broadway/gdkbroadwaysurface.h>
|
||||
#include <gdk/broadway/gdkbroadwaycursor.h>
|
||||
#include <gdk/broadway/gdkbroadwaymonitor.h>
|
||||
|
||||
|
@@ -43,9 +43,9 @@ typedef struct _GdkBroadwayDisplayClass GdkBroadwayDisplayClass;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_broadway_display_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_12
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_broadway_display_show_keyboard (GdkBroadwayDisplay *display);
|
||||
GDK_AVAILABLE_IN_3_12
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_broadway_display_hide_keyboard (GdkBroadwayDisplay *display);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -37,7 +37,7 @@ G_BEGIN_DECLS
|
||||
typedef struct _GdkBroadwayMonitor GdkBroadwayMonitor;
|
||||
typedef struct _GdkBroadwayMonitorClass GdkBroadwayMonitorClass;
|
||||
|
||||
GDK_AVAILABLE_IN_3_22
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_broadway_monitor_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -22,33 +22,33 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_BROADWAY_WINDOW_H__
|
||||
#define __GDK_BROADWAY_WINDOW_H__
|
||||
#ifndef __GDK_BROADWAY_SURFACE_H__
|
||||
#define __GDK_BROADWAY_SURFACE_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_BROADWAY_WINDOW (gdk_broadway_window_get_type ())
|
||||
#define GDK_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindow))
|
||||
#define GDK_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass))
|
||||
#define GDK_IS_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_WINDOW))
|
||||
#define GDK_IS_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_WINDOW))
|
||||
#define GDK_BROADWAY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass))
|
||||
#define GDK_TYPE_BROADWAY_SURFACE (gdk_broadway_surface_get_type ())
|
||||
#define GDK_BROADWAY_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurface))
|
||||
#define GDK_BROADWAY_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurfaceClass))
|
||||
#define GDK_IS_BROADWAY_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_SURFACE))
|
||||
#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
|
||||
typedef struct _GdkBroadwayWindow GdkBroadwayWindow;
|
||||
typedef struct _GdkBroadwaySurface GdkBroadwaySurface;
|
||||
#else
|
||||
typedef GdkWindow GdkBroadwayWindow;
|
||||
typedef GdkSurface GdkBroadwaySurface;
|
||||
#endif
|
||||
typedef struct _GdkBroadwayWindowClass GdkBroadwayWindowClass;
|
||||
typedef struct _GdkBroadwaySurfaceClass GdkBroadwaySurfaceClass;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_broadway_window_get_type (void);
|
||||
GType gdk_broadway_surface_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
guint32 gdk_broadway_get_last_seen_time (GdkWindow *window);
|
||||
guint32 gdk_broadway_get_last_seen_time (GdkSurface *surface);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_BROADWAY_WINDOW_H__ */
|
||||
#endif /* __GDK_BROADWAY_SURFACE_H__ */
|
@@ -20,50 +20,50 @@
|
||||
|
||||
#include "gdkdevice-broadway.h"
|
||||
|
||||
#include "gdkwindow.h"
|
||||
#include "gdksurface.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
|
||||
static gboolean gdk_broadway_device_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events);
|
||||
GdkSurface *surface,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events);
|
||||
static void gdk_broadway_device_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask);
|
||||
static void gdk_broadway_device_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor);
|
||||
GdkSurface *surface,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask);
|
||||
static void gdk_broadway_device_set_surface_cursor (GdkDevice *device,
|
||||
GdkSurface *surface,
|
||||
GdkCursor *cursor);
|
||||
static void gdk_broadway_device_warp (GdkDevice *device,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static void gdk_broadway_device_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **child_window,
|
||||
GdkSurface *surface,
|
||||
GdkSurface **child_surface,
|
||||
gdouble *root_x,
|
||||
gdouble *root_y,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask);
|
||||
static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_);
|
||||
GdkSurface *surface,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkSurface *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_);
|
||||
static void gdk_broadway_device_ungrab (GdkDevice *device,
|
||||
guint32 time_);
|
||||
static GdkWindow * gdk_broadway_device_window_at_position (GdkDevice *device,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel);
|
||||
static void gdk_broadway_device_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask);
|
||||
guint32 time_);
|
||||
static GdkSurface * gdk_broadway_device_surface_at_position (GdkDevice *device,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel);
|
||||
static void gdk_broadway_device_select_surface_events (GdkDevice *device,
|
||||
GdkSurface *surface,
|
||||
GdkEventMask event_mask);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GdkBroadwayDevice, gdk_broadway_device, GDK_TYPE_DEVICE)
|
||||
@@ -75,13 +75,13 @@ gdk_broadway_device_class_init (GdkBroadwayDeviceClass *klass)
|
||||
|
||||
device_class->get_history = gdk_broadway_device_get_history;
|
||||
device_class->get_state = gdk_broadway_device_get_state;
|
||||
device_class->set_window_cursor = gdk_broadway_device_set_window_cursor;
|
||||
device_class->set_surface_cursor = gdk_broadway_device_set_surface_cursor;
|
||||
device_class->warp = gdk_broadway_device_warp;
|
||||
device_class->query_state = gdk_broadway_device_query_state;
|
||||
device_class->grab = gdk_broadway_device_grab;
|
||||
device_class->ungrab = gdk_broadway_device_ungrab;
|
||||
device_class->window_at_position = gdk_broadway_device_window_at_position;
|
||||
device_class->select_window_events = gdk_broadway_device_select_window_events;
|
||||
device_class->surface_at_position = gdk_broadway_device_surface_at_position;
|
||||
device_class->select_surface_events = gdk_broadway_device_select_surface_events;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -97,24 +97,24 @@ gdk_broadway_device_init (GdkBroadwayDevice *device_core)
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_device_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events)
|
||||
GdkSurface *surface,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_device_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask)
|
||||
GdkSurface *surface,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
gdouble x, y;
|
||||
|
||||
gdk_window_get_device_position_double (window, device, &x, &y, mask);
|
||||
gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
|
||||
|
||||
if (axes)
|
||||
{
|
||||
@@ -124,28 +124,28 @@ gdk_broadway_device_get_state (GdkDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_device_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
gdk_broadway_device_set_surface_cursor (GdkDevice *device,
|
||||
GdkSurface *surface,
|
||||
GdkCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_device_warp (GdkDevice *device,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_device_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **child_window,
|
||||
gdouble *root_x,
|
||||
gdouble *root_y,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask)
|
||||
GdkSurface *surface,
|
||||
GdkSurface **child_surface,
|
||||
gdouble *root_x,
|
||||
gdouble *root_y,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
@@ -160,10 +160,10 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
|
||||
_gdk_broadway_server_query_mouse (broadway_display->server,
|
||||
&mouse_toplevel_id,
|
||||
&device_root_x,
|
||||
&device_root_y,
|
||||
&mask32);
|
||||
&mouse_toplevel_id,
|
||||
&device_root_x,
|
||||
&device_root_y,
|
||||
&mask32);
|
||||
|
||||
if (root_x)
|
||||
*root_x = device_root_x;
|
||||
@@ -175,25 +175,25 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
*win_y = device_root_y;
|
||||
if (mask)
|
||||
*mask = mask32;
|
||||
if (child_window)
|
||||
if (child_surface)
|
||||
{
|
||||
GdkWindow *mouse_toplevel;
|
||||
GdkSurface *mouse_toplevel;
|
||||
|
||||
mouse_toplevel = g_hash_table_lookup (broadway_display->id_ht, GUINT_TO_POINTER (mouse_toplevel_id));
|
||||
if (window == NULL)
|
||||
*child_window = mouse_toplevel;
|
||||
if (surface == NULL)
|
||||
*child_surface = mouse_toplevel;
|
||||
else
|
||||
*child_window = NULL;
|
||||
*child_surface = NULL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_window_grab_check_unmap (GdkWindow *window,
|
||||
gulong serial)
|
||||
_gdk_broadway_surface_grab_check_unmap (GdkSurface *surface,
|
||||
gulong serial)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||
GdkSeat *seat;
|
||||
GList *devices, *d;
|
||||
|
||||
@@ -203,18 +203,18 @@ _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
|
||||
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
|
||||
devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
|
||||
|
||||
/* End all grabs on the newly hidden window */
|
||||
/* End all grabs on the newly hidden surface */
|
||||
for (d = devices; d; d = d->next)
|
||||
_gdk_display_end_device_grab (display, d->data, serial, window, TRUE);
|
||||
_gdk_display_end_device_grab (display, d->data, serial, surface, TRUE);
|
||||
|
||||
g_list_free (devices);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_gdk_broadway_window_grab_check_destroy (GdkWindow *window)
|
||||
_gdk_broadway_surface_grab_check_destroy (GdkSurface *surface)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||
GdkSeat *seat;
|
||||
GdkDeviceGrabInfo *grab;
|
||||
GList *devices, *d;
|
||||
@@ -227,14 +227,14 @@ _gdk_broadway_window_grab_check_destroy (GdkWindow *window)
|
||||
|
||||
for (d = devices; d; d = d->next)
|
||||
{
|
||||
/* Make sure there is no lasting grab in this native window */
|
||||
/* Make sure there is no lasting grab in this native surface */
|
||||
grab = _gdk_display_get_last_device_grab (display, d->data);
|
||||
|
||||
if (grab && grab->native_window == window)
|
||||
{
|
||||
grab->serial_end = grab->serial_start;
|
||||
grab->implicit_ungrab = TRUE;
|
||||
}
|
||||
if (grab && grab->native_surface == surface)
|
||||
{
|
||||
grab->serial_end = grab->serial_start;
|
||||
grab->implicit_ungrab = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -244,12 +244,12 @@ _gdk_broadway_window_grab_check_destroy (GdkWindow *window)
|
||||
|
||||
static GdkGrabStatus
|
||||
gdk_broadway_device_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_)
|
||||
GdkSurface *surface,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkSurface *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
@@ -266,10 +266,10 @@ gdk_broadway_device_grab (GdkDevice *device,
|
||||
{
|
||||
/* Device is a pointer */
|
||||
return _gdk_broadway_server_grab_pointer (broadway_display->server,
|
||||
GDK_WINDOW_IMPL_BROADWAY (window->impl)->id,
|
||||
owner_events,
|
||||
event_mask,
|
||||
time_);
|
||||
GDK_SURFACE_IMPL_BROADWAY (surface->impl)->id,
|
||||
owner_events,
|
||||
event_mask,
|
||||
time_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ gdk_broadway_device_grab (GdkDevice *device,
|
||||
|
||||
static void
|
||||
gdk_broadway_device_ungrab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
guint32 time_)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
@@ -300,34 +300,34 @@ gdk_broadway_device_ungrab (GdkDevice *device,
|
||||
serial = _gdk_broadway_server_ungrab_pointer (broadway_display->server, time_);
|
||||
|
||||
if (serial != 0)
|
||||
{
|
||||
grab = _gdk_display_get_last_device_grab (display, device);
|
||||
if (grab &&
|
||||
(time_ == GDK_CURRENT_TIME ||
|
||||
grab->time == GDK_CURRENT_TIME ||
|
||||
!TIME_IS_LATER (grab->time, time_)))
|
||||
grab->serial_end = serial;
|
||||
}
|
||||
{
|
||||
grab = _gdk_display_get_last_device_grab (display, device);
|
||||
if (grab &&
|
||||
(time_ == GDK_CURRENT_TIME ||
|
||||
grab->time == GDK_CURRENT_TIME ||
|
||||
!TIME_IS_LATER (grab->time, time_)))
|
||||
grab->serial_end = serial;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_broadway_device_window_at_position (GdkDevice *device,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel)
|
||||
static GdkSurface *
|
||||
gdk_broadway_device_surface_at_position (GdkDevice *device,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel)
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkSurface *surface;
|
||||
|
||||
gdk_broadway_device_query_state (device, NULL, &window, NULL, NULL, win_x, win_y, mask);
|
||||
gdk_broadway_device_query_state (device, NULL, &surface, NULL, NULL, win_x, win_y, mask);
|
||||
|
||||
return window;
|
||||
return surface;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_device_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask)
|
||||
gdk_broadway_device_select_surface_events (GdkDevice *device,
|
||||
GdkSurface *surface,
|
||||
GdkEventMask event_mask)
|
||||
{
|
||||
}
|
||||
|
@@ -181,10 +181,10 @@ _gdk_broadway_display_size_changed (GdkDisplay *display,
|
||||
toplevels = broadway_display->toplevels;
|
||||
for (l = toplevels; l != NULL; l = l->next)
|
||||
{
|
||||
GdkWindowImplBroadway *toplevel_impl = l->data;
|
||||
GdkSurfaceImplBroadway *toplevel_impl = l->data;
|
||||
|
||||
if (toplevel_impl->maximized)
|
||||
gdk_window_move_resize (toplevel_impl->wrapper, 0, 0, msg->width, msg->height);
|
||||
gdk_surface_move_resize (toplevel_impl->wrapper, 0, 0, msg->width, msg->height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ gdk_broadway_display_has_pending (GdkDisplay *display)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
static GdkSurface *
|
||||
gdk_broadway_display_get_default_group (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
@@ -520,7 +520,7 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
object_class->dispose = gdk_broadway_display_dispose;
|
||||
object_class->finalize = gdk_broadway_display_finalize;
|
||||
|
||||
display_class->window_type = GDK_TYPE_BROADWAY_WINDOW;
|
||||
display_class->surface_type = GDK_TYPE_BROADWAY_SURFACE;
|
||||
|
||||
display_class->get_name = gdk_broadway_display_get_name;
|
||||
display_class->beep = gdk_broadway_display_beep;
|
||||
@@ -534,7 +534,7 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
|
||||
display_class->get_next_serial = gdk_broadway_display_get_next_serial;
|
||||
display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete;
|
||||
display_class->create_window_impl = _gdk_broadway_display_create_window_impl;
|
||||
display_class->create_surface_impl = _gdk_broadway_display_create_surface_impl;
|
||||
display_class->get_keymap = _gdk_broadway_display_get_keymap;
|
||||
display_class->text_property_to_utf8_list = _gdk_broadway_display_text_property_to_utf8_list;
|
||||
display_class->utf8_to_string_target = _gdk_broadway_display_utf8_to_string_target;
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkkeys.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdksurface.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkbroadway-server.h"
|
||||
#include "gdkmonitorprivate.h"
|
||||
|
@@ -84,63 +84,36 @@ gdk_broadway_drag_context_finalize (GObject *object)
|
||||
/* Drag Contexts */
|
||||
|
||||
GdkDragContext *
|
||||
_gdk_broadway_window_drag_begin (GdkWindow *window,
|
||||
GdkDevice *device,
|
||||
GdkContentProvider *content,
|
||||
GdkDragAction actions,
|
||||
gint dx,
|
||||
gint dy)
|
||||
_gdk_broadway_surface_drag_begin (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkContentProvider *content,
|
||||
GdkDragAction actions,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
GdkDragContext *new_context;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_WINDOW_IS_BROADWAY (window), NULL);
|
||||
g_return_val_if_fail (surface != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_SURFACE_IS_BROADWAY (surface), NULL);
|
||||
|
||||
new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG_CONTEXT,
|
||||
"display", gdk_window_get_display (window),
|
||||
"display", gdk_surface_get_display (surface),
|
||||
"content", content,
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
return new_context;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_broadway_drag_context_find_window (GdkDragContext *context,
|
||||
GdkWindow *drag_window,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkDragProtocol *protocol)
|
||||
{
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_drag_context_drag_motion (GdkDragContext *context,
|
||||
GdkWindow *dest_window,
|
||||
GdkDragProtocol protocol,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkDragAction suggested_action,
|
||||
GdkDragAction possible_actions,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_val_if_fail (context != NULL, FALSE);
|
||||
g_return_val_if_fail (dest_window == NULL || GDK_WINDOW_IS_BROADWAY (dest_window), FALSE);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_context_drag_drop (GdkDragContext *context,
|
||||
guint32 time)
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_context_drag_abort (GdkDragContext *context,
|
||||
guint32 time)
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
@@ -149,30 +122,30 @@ gdk_broadway_drag_context_drag_abort (GdkDragContext *context,
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_context_drag_status (GdkDragContext *context,
|
||||
GdkDragAction action,
|
||||
guint32 time)
|
||||
GdkDragAction action,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_context_drop_reply (GdkDragContext *context,
|
||||
gboolean ok,
|
||||
guint32 time)
|
||||
gboolean ok,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_context_drop_finish (GdkDragContext *context,
|
||||
gboolean success,
|
||||
guint32 time)
|
||||
gboolean success,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_window_register_dnd (GdkWindow *window)
|
||||
_gdk_broadway_surface_register_dnd (GdkSurface *surface)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -197,9 +170,7 @@ gdk_broadway_drag_context_class_init (GdkBroadwayDragContextClass *klass)
|
||||
|
||||
object_class->finalize = gdk_broadway_drag_context_finalize;
|
||||
|
||||
context_class->find_window = gdk_broadway_drag_context_find_window;
|
||||
context_class->drag_status = gdk_broadway_drag_context_drag_status;
|
||||
context_class->drag_motion = gdk_broadway_drag_context_drag_motion;
|
||||
context_class->drag_abort = gdk_broadway_drag_context_drag_abort;
|
||||
context_class->drag_drop = gdk_broadway_drag_context_drag_drop;
|
||||
context_class->drop_reply = gdk_broadway_drag_context_drop_reply;
|
||||
|
@@ -60,14 +60,10 @@ gdk_event_source_prepare (GSource *source,
|
||||
GdkDisplay *display = ((GdkEventSource*) source)->display;
|
||||
gboolean retval;
|
||||
|
||||
gdk_threads_enter ();
|
||||
|
||||
*timeout = -1;
|
||||
|
||||
retval = (_gdk_event_queue_find_first (display) != NULL);
|
||||
|
||||
gdk_threads_leave ();
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -77,16 +73,12 @@ gdk_event_source_check (GSource *source)
|
||||
GdkEventSource *event_source = (GdkEventSource*) source;
|
||||
gboolean retval;
|
||||
|
||||
gdk_threads_enter ();
|
||||
|
||||
if (event_source->display->event_pause_count > 0 ||
|
||||
event_source->event_poll_fd.revents & G_IO_IN)
|
||||
retval = (_gdk_event_queue_find_first (event_source->display) != NULL);
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
gdk_threads_leave ();
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -96,7 +88,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
GdkDisplay *display;
|
||||
GdkBroadwayDisplay *display_broadway;
|
||||
GdkSeat *seat;
|
||||
GdkWindow *window;
|
||||
GdkSurface *surface;
|
||||
GdkEvent *event = NULL;
|
||||
GList *node;
|
||||
GSList *list, *d;
|
||||
@@ -121,11 +113,11 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
|
||||
switch (message->base.type) {
|
||||
case BROADWAY_EVENT_ENTER:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_new (GDK_ENTER_NOTIFY);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->crossing.time = message->base.time;
|
||||
event->crossing.x = message->pointer.win_x;
|
||||
event->crossing.y = message->pointer.win_y;
|
||||
@@ -141,11 +133,11 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
}
|
||||
break;
|
||||
case BROADWAY_EVENT_LEAVE:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_new (GDK_LEAVE_NOTIFY);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->crossing.time = message->base.time;
|
||||
event->crossing.x = message->pointer.win_x;
|
||||
event->crossing.y = message->pointer.win_y;
|
||||
@@ -164,11 +156,11 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (_gdk_broadway_moveresize_handle_event (display, message))
|
||||
break;
|
||||
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_new (GDK_MOTION_NOTIFY);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->motion.time = message->base.time;
|
||||
event->motion.x = message->pointer.win_x;
|
||||
event->motion.y = message->pointer.win_y;
|
||||
@@ -188,11 +180,11 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
_gdk_broadway_moveresize_handle_event (display, message))
|
||||
break;
|
||||
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_new (message->base.type == 'b' ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->button.time = message->base.time;
|
||||
event->button.x = message->pointer.win_x;
|
||||
event->button.y = message->pointer.win_y;
|
||||
@@ -208,11 +200,11 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
|
||||
break;
|
||||
case BROADWAY_EVENT_SCROLL:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_new (GDK_SCROLL);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->scroll.time = message->base.time;
|
||||
event->scroll.x = message->pointer.win_x;
|
||||
event->scroll.y = message->pointer.win_y;
|
||||
@@ -227,8 +219,8 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
|
||||
break;
|
||||
case BROADWAY_EVENT_TOUCH:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->touch.event_surface_id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->touch.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
GdkEventType event_type = 0;
|
||||
|
||||
@@ -251,7 +243,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
break;
|
||||
|
||||
event = gdk_event_new (event_type);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->touch.sequence = GUINT_TO_POINTER(message->touch.sequence_id);
|
||||
event->touch.emulating_pointer = message->touch.is_emulated;
|
||||
event->touch.time = message->base.time;
|
||||
@@ -282,12 +274,12 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
break;
|
||||
case BROADWAY_EVENT_KEY_PRESS:
|
||||
case BROADWAY_EVENT_KEY_RELEASE:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht,
|
||||
GINT_TO_POINTER (message->key.surface_id));
|
||||
if (window)
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_new (message->base.type == 'k' ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->key.time = message->base.time;
|
||||
event->key.keyval = message->key.key;
|
||||
event->key.state = message->key.state;
|
||||
@@ -307,14 +299,14 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
break;
|
||||
|
||||
case BROADWAY_EVENT_CONFIGURE_NOTIFY:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->configure_notify.id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->configure_notify.id));
|
||||
if (surface)
|
||||
{
|
||||
window->x = message->configure_notify.x;
|
||||
window->y = message->configure_notify.y;
|
||||
surface->x = message->configure_notify.x;
|
||||
surface->y = message->configure_notify.y;
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->configure.x = message->configure_notify.x;
|
||||
event->configure.y = message->configure_notify.y;
|
||||
event->configure.width = message->configure_notify.width;
|
||||
@@ -323,20 +315,20 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
|
||||
if (window->resize_count >= 1)
|
||||
if (surface->resize_count >= 1)
|
||||
{
|
||||
window->resize_count -= 1;
|
||||
surface->resize_count -= 1;
|
||||
|
||||
if (window->resize_count == 0)
|
||||
_gdk_broadway_moveresize_configure_done (display, window);
|
||||
if (surface->resize_count == 0)
|
||||
_gdk_broadway_moveresize_configure_done (display, surface);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BROADWAY_EVENT_ROUNDTRIP_NOTIFY:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->roundtrip_notify.id));
|
||||
if (window)
|
||||
_gdk_broadway_roundtrip_notify (window, message->roundtrip_notify.tag, message->roundtrip_notify.local);
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->roundtrip_notify.id));
|
||||
if (surface)
|
||||
_gdk_broadway_roundtrip_notify (surface, message->roundtrip_notify.tag, message->roundtrip_notify.local);
|
||||
break;
|
||||
|
||||
case BROADWAY_EVENT_SCREEN_SIZE_CHANGED:
|
||||
@@ -344,21 +336,21 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
break;
|
||||
|
||||
case BROADWAY_EVENT_FOCUS:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.old_id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.old_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->focus_change.in = FALSE;
|
||||
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
}
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.new_id));
|
||||
if (window)
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.new_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->focus_change.in = TRUE;
|
||||
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
@@ -385,8 +377,6 @@ gdk_event_source_dispatch (GSource *source,
|
||||
GdkDisplay *display = ((GdkEventSource*) source)->display;
|
||||
GdkEvent *event;
|
||||
|
||||
gdk_threads_enter ();
|
||||
|
||||
event = gdk_display_get_event (display);
|
||||
|
||||
if (event)
|
||||
@@ -396,8 +386,6 @@ gdk_event_source_dispatch (GSource *source,
|
||||
gdk_event_free (event);
|
||||
}
|
||||
|
||||
gdk_threads_leave ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -31,53 +31,51 @@
|
||||
|
||||
#include <gdk/gdkcursor.h>
|
||||
#include <gdk/gdkinternals.h>
|
||||
#include "gdkwindow-broadway.h"
|
||||
#include "gdksurface-broadway.h"
|
||||
#include "gdkdisplay-broadway.h"
|
||||
|
||||
#include "gdkbroadwaycursor.h"
|
||||
#include "gdkbroadwaywindow.h"
|
||||
|
||||
void _gdk_broadway_resync_windows (void);
|
||||
#include "gdkbroadwaysurface.h"
|
||||
|
||||
guint32 gdk_broadway_display_ensure_texture (GdkDisplay *display,
|
||||
GdkTexture *texture);
|
||||
GdkTexture *texture);
|
||||
|
||||
void gdk_broadway_window_set_nodes (GdkWindow *window,
|
||||
GArray *nodes,
|
||||
GPtrArray *node_textures);
|
||||
void gdk_broadway_surface_set_nodes (GdkSurface *surface,
|
||||
GArray *nodes,
|
||||
GPtrArray *node_textures);
|
||||
|
||||
void _gdk_broadway_window_register_dnd (GdkWindow *window);
|
||||
GdkDragContext * _gdk_broadway_window_drag_begin (GdkWindow *window,
|
||||
GdkDevice *device,
|
||||
GdkContentProvider *content,
|
||||
GdkDragAction actions,
|
||||
gint dx,
|
||||
gint dy);
|
||||
void _gdk_broadway_window_translate (GdkWindow *window,
|
||||
cairo_region_t *area,
|
||||
gint dx,
|
||||
gint dy);
|
||||
gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
|
||||
BroadwayInputMsg *msg);
|
||||
gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
|
||||
GdkWindow *window);
|
||||
void _gdk_broadway_roundtrip_notify (GdkWindow *window,
|
||||
guint32 tag,
|
||||
gboolean local_reply);
|
||||
void _gdk_broadway_window_grab_check_destroy (GdkWindow *window);
|
||||
void _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
|
||||
gulong serial);
|
||||
void _gdk_broadway_surface_register_dnd (GdkSurface *surface);
|
||||
GdkDragContext * _gdk_broadway_surface_drag_begin (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkContentProvider *content,
|
||||
GdkDragAction actions,
|
||||
gint dx,
|
||||
gint dy);
|
||||
void _gdk_broadway_surface_translate (GdkSurface *surface,
|
||||
cairo_region_t *area,
|
||||
gint dx,
|
||||
gint dy);
|
||||
gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
|
||||
BroadwayInputMsg *msg);
|
||||
gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
|
||||
GdkSurface *surface);
|
||||
void _gdk_broadway_roundtrip_notify (GdkSurface *surface,
|
||||
guint32 tag,
|
||||
gboolean local_reply);
|
||||
void _gdk_broadway_surface_grab_check_destroy (GdkSurface *surface);
|
||||
void _gdk_broadway_surface_grab_check_unmap (GdkSurface *surface,
|
||||
gulong serial);
|
||||
|
||||
void _gdk_keymap_keys_changed (GdkDisplay *display);
|
||||
gint _gdk_broadway_get_group_for_state (GdkDisplay *display,
|
||||
GdkModifierType state);
|
||||
GdkModifierType state);
|
||||
void _gdk_keymap_add_virtual_modifiers_compat (GdkKeymap *keymap,
|
||||
GdkModifierType *modifiers);
|
||||
gboolean _gdk_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
guint keycode);
|
||||
guint keycode);
|
||||
|
||||
void _gdk_broadway_display_size_changed (GdkDisplay *display,
|
||||
BroadwayInputScreenResizeNotify *msg);
|
||||
BroadwayInputScreenResizeNotify *msg);
|
||||
|
||||
void _gdk_broadway_events_got_input (BroadwayInputMsg *message);
|
||||
|
||||
@@ -86,7 +84,7 @@ void _gdk_broadway_display_init_dnd (GdkDisplay *display);
|
||||
GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
|
||||
void _gdk_broadway_display_queue_events (GdkDisplay *display);
|
||||
GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name);
|
||||
const gchar *name);
|
||||
GdkCursor *_gdk_broadway_display_get_cursor_for_texture (GdkDisplay *display,
|
||||
GdkTexture *texture,
|
||||
int x,
|
||||
@@ -94,37 +92,37 @@ GdkCursor *_gdk_broadway_display_get_cursor_for_texture (GdkDisplay *display,
|
||||
gboolean _gdk_broadway_display_supports_cursor_alpha (GdkDisplay *display);
|
||||
gboolean _gdk_broadway_display_supports_cursor_color (GdkDisplay *display);
|
||||
void _gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height);
|
||||
guint *width,
|
||||
guint *height);
|
||||
void _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height);
|
||||
void _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
GdkWindow *real_parent,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes);
|
||||
guint *width,
|
||||
guint *height);
|
||||
void _gdk_broadway_display_create_surface_impl (GdkDisplay *display,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *real_parent,
|
||||
GdkEventMask event_mask,
|
||||
GdkSurfaceAttr *attributes);
|
||||
gint _gdk_broadway_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list);
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list);
|
||||
gchar *_gdk_broadway_display_utf8_to_string_target (GdkDisplay *display,
|
||||
const gchar *str);
|
||||
const gchar *str);
|
||||
GdkKeymap* _gdk_broadway_display_get_keymap (GdkDisplay *display);
|
||||
void _gdk_broadway_display_consume_all_input (GdkDisplay *display);
|
||||
BroadwayInputMsg * _gdk_broadway_display_block_for_input (GdkDisplay *display,
|
||||
char op,
|
||||
guint32 serial,
|
||||
gboolean remove);
|
||||
char op,
|
||||
guint32 serial,
|
||||
gboolean remove);
|
||||
|
||||
/* Window methods - testing */
|
||||
void _gdk_broadway_window_resize_surface (GdkWindow *window);
|
||||
/* Surface methods - testing */
|
||||
void _gdk_broadway_surface_resize_surface (GdkSurface *surface);
|
||||
|
||||
void _gdk_broadway_cursor_update_theme (GdkCursor *cursor);
|
||||
void _gdk_broadway_cursor_display_finalize (GdkDisplay *display);
|
||||
|
||||
#define GDK_WINDOW_IS_BROADWAY(win) (GDK_IS_WINDOW_IMPL_BROADWAY (((GdkWindow *)win)->impl))
|
||||
#define GDK_SURFACE_IS_BROADWAY(win) (GDK_IS_SURFACE_IMPL_BROADWAY (((GdkSurface *)win)->impl))
|
||||
|
||||
#endif /* __GDK_PRIVATE_BROADWAY_H__ */
|
||||
|
1419
gdk/broadway/gdksurface-broadway.c
Normal file
1419
gdk/broadway/gdksurface-broadway.c
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user