Compare commits
786 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4217fccbc9 | ||
|
|
086e885c02 | ||
|
|
b737bfec24 | ||
|
|
570fd6c185 | ||
|
|
151e74c12d | ||
|
|
09408aca1e | ||
|
|
103346c780 | ||
|
|
ed9b598e9b | ||
|
|
927d8e84dc | ||
|
|
9c307fedc9 | ||
|
|
27130ab6b1 | ||
|
|
0f18e90734 | ||
|
|
be8ff8e56a | ||
|
|
6e92757ed0 | ||
|
|
d2df0aa7ca | ||
|
|
db4b1e62fe | ||
|
|
68e31e19fe | ||
|
|
9cbcd541d9 | ||
|
|
3d9f024deb | ||
|
|
2252876614 | ||
|
|
2d873f3449 | ||
|
|
adeca58af7 | ||
|
|
ee184e895a | ||
|
|
2f91f31b1a | ||
|
|
6f7e6f68be | ||
|
|
7802bbd9c5 | ||
|
|
1bb0c94767 | ||
|
|
1062be1115 | ||
|
|
2954c9c09b | ||
|
|
f9bf9295c5 | ||
|
|
d041ff409a | ||
|
|
efaaa3a4a8 | ||
|
|
385798c89f | ||
|
|
d597d5beca | ||
|
|
32e7d5ae59 | ||
|
|
cc03e3319c | ||
|
|
5efed59da1 | ||
|
|
5174ad9001 | ||
|
|
732e313a7a | ||
|
|
77c5cef932 | ||
|
|
21216fc8b1 | ||
|
|
932ed7cd51 | ||
|
|
e9d65c9d51 | ||
|
|
ee6f29ae19 | ||
|
|
5d3c596a84 | ||
|
|
c6c56f387a | ||
|
|
8069712a0e | ||
|
|
f971d4e4f6 | ||
|
|
bf7e5d48a3 | ||
|
|
201918c501 | ||
|
|
afb1132f7a | ||
|
|
9270638f38 | ||
|
|
ae8fe51669 | ||
|
|
122d72f5da | ||
|
|
2e6c86310f | ||
|
|
259fc130fd | ||
|
|
996a4f3d82 | ||
|
|
d732df385f | ||
|
|
165684fb7a | ||
|
|
6fc72c423d | ||
|
|
171448e4c4 | ||
|
|
5ff8f6824d | ||
|
|
9a75337b5f | ||
|
|
cc74421272 | ||
|
|
17b5ee4067 | ||
|
|
43c10fd785 | ||
|
|
d74502e81f | ||
|
|
8cd76cdd08 | ||
|
|
62cdbb85aa | ||
|
|
105d954946 | ||
|
|
abfd4ddcf6 | ||
|
|
ae71ac49f2 | ||
|
|
f9ed596de9 | ||
|
|
8de39d8d46 | ||
|
|
456b5e50b5 | ||
|
|
6bdcac4c45 | ||
|
|
7b2f3a0887 | ||
|
|
e1e5cd881e | ||
|
|
b28868cf72 | ||
|
|
78ba188814 | ||
|
|
ffd944f1c1 | ||
|
|
df0f5569d1 | ||
|
|
c8dc2dee78 | ||
|
|
f323633883 | ||
|
|
272f43cae7 | ||
|
|
527d64e68b | ||
|
|
c986d6ce78 | ||
|
|
ee679931ab | ||
|
|
fb54abb087 | ||
|
|
946cc8ae4d | ||
|
|
e6db3b556e | ||
|
|
80881406ef | ||
|
|
588c93ff36 | ||
|
|
290a31c614 | ||
|
|
ac41eb4fac | ||
|
|
06efce6fa2 | ||
|
|
45fb396343 | ||
|
|
c7b96d8579 | ||
|
|
08bf5c4d8c | ||
|
|
4784d35ec4 | ||
|
|
95e80ef6f8 | ||
|
|
53d253d1f0 | ||
|
|
5be441699b | ||
|
|
ccea7799c4 | ||
|
|
755bda4bf5 | ||
|
|
ed36e29ec4 | ||
|
|
3a40225872 | ||
|
|
9753499a77 | ||
|
|
3894d1923c | ||
|
|
7963f68929 | ||
|
|
2baadce9c6 | ||
|
|
f65d46ff2f | ||
|
|
28cc8dc745 | ||
|
|
b6b03e261a | ||
|
|
3824f7a44c | ||
|
|
2aec572a2f | ||
|
|
b52654b03d | ||
|
|
c9dadf92fe | ||
|
|
83d22b4df9 | ||
|
|
2edbbe716d | ||
|
|
d563b943ed | ||
|
|
ac12895430 | ||
|
|
fbd9092755 | ||
|
|
f39d0ede70 | ||
|
|
1d54e38818 | ||
|
|
260c2b7477 | ||
|
|
398aeb31b3 | ||
|
|
846bd99cdd | ||
|
|
ebca729cd1 | ||
|
|
1597e2e6b8 | ||
|
|
24be2232b5 | ||
|
|
56d509b09b | ||
|
|
287e2250e0 | ||
|
|
a696ac14f0 | ||
|
|
0c83e6f52a | ||
|
|
9b3af5878f | ||
|
|
862a1c36ef | ||
|
|
b77c6b1b97 | ||
|
|
59861241ad | ||
|
|
1e8b89a5ce | ||
|
|
7cea667a3e | ||
|
|
293b53bb00 | ||
|
|
739fdecc09 | ||
|
|
390414e635 | ||
|
|
e1da396e5d | ||
|
|
992ff9818c | ||
|
|
6d75d452aa | ||
|
|
c7dd439d4f | ||
|
|
a7f06d2ae6 | ||
|
|
f72db440b5 | ||
|
|
732671f639 | ||
|
|
d4c7fcd050 | ||
|
|
318c784b3e | ||
|
|
80df4f3b1c | ||
|
|
047c6210ad | ||
|
|
a455c3cc49 | ||
|
|
99a0b320a3 | ||
|
|
df2c1c4d5d | ||
|
|
2eab2d79b7 | ||
|
|
b83f8bd825 | ||
|
|
9f5eb8f021 | ||
|
|
e3d64fb0e2 | ||
|
|
1a9d78c58d | ||
|
|
64c6869708 | ||
|
|
afd8697baa | ||
|
|
b652f840f2 | ||
|
|
349fbb1eac | ||
|
|
3399395234 | ||
|
|
f52e9bffd6 | ||
|
|
7be4d69868 | ||
|
|
36f02f4041 | ||
|
|
08d649de2f | ||
|
|
0235e4c7a1 | ||
|
|
de00a55751 | ||
|
|
ba6fd13d38 | ||
|
|
2ecd3b033d | ||
|
|
db7732ee6c | ||
|
|
9b9aa14ef7 | ||
|
|
bff9f190aa | ||
|
|
867dcd3d67 | ||
|
|
cb25f48bf6 | ||
|
|
76a37d542e | ||
|
|
c30f74e506 | ||
|
|
1768f3e5dd | ||
|
|
28fde2f320 | ||
|
|
511d7c3304 | ||
|
|
885b5bbe30 | ||
|
|
289a8e824d | ||
|
|
524ccf6d42 | ||
|
|
eaa77f6918 | ||
|
|
2984dcdbe5 | ||
|
|
111a84bd1c | ||
|
|
32c4bcbd3e | ||
|
|
31252c1fe4 | ||
|
|
dd09993f37 | ||
|
|
c0727abccc | ||
|
|
9a27dca38f | ||
|
|
ca3c79e997 | ||
|
|
1d24014a8b | ||
|
|
9da241b2d0 | ||
|
|
fef7d65685 | ||
|
|
0230fff141 | ||
|
|
da5cbcaf86 | ||
|
|
0707a2fa0e | ||
|
|
d370d130fb | ||
|
|
c96df5a350 | ||
|
|
41e863a0f0 | ||
|
|
9bc2bbf782 | ||
|
|
586cdb63e4 | ||
|
|
2506683cc3 | ||
|
|
bcfa4eec25 | ||
|
|
59674ba8f4 | ||
|
|
e497363d60 | ||
|
|
e166747170 | ||
|
|
79ab6c8963 | ||
|
|
2d5b801a28 | ||
|
|
beb19b389b | ||
|
|
539caa897a | ||
|
|
a816ccd496 | ||
|
|
3a2f5634ee | ||
|
|
4cee145764 | ||
|
|
14289cfb3e | ||
|
|
9c45420bd8 | ||
|
|
b4c6fb6334 | ||
|
|
686fec77cb | ||
|
|
f5051cca83 | ||
|
|
6f748c31ca | ||
|
|
56583717fe | ||
|
|
1d93297a3a | ||
|
|
7c63374093 | ||
|
|
0a39d7d91e | ||
|
|
139ed7409f | ||
|
|
e995c0d1bf | ||
|
|
9ec5b3f9a1 | ||
|
|
223209ecaa | ||
|
|
8d6b19533f | ||
|
|
17b65d3c8a | ||
|
|
847a79c5f9 | ||
|
|
24db6d5518 | ||
|
|
00544e9090 | ||
|
|
3d3591e873 | ||
|
|
49b6be4e06 | ||
|
|
557f5d5c7c | ||
|
|
bcddf68858 | ||
|
|
75105f94f0 | ||
|
|
f671cd6296 | ||
|
|
9b5fa0860f | ||
|
|
390dd37656 | ||
|
|
88a5959b22 | ||
|
|
27164484cd | ||
|
|
6f478db2fa | ||
|
|
d5d28a5062 | ||
|
|
4e930ada32 | ||
|
|
c7672699e9 | ||
|
|
855c4dc0ce | ||
|
|
70e7b4c848 | ||
|
|
b4b23580a6 | ||
|
|
b4e61b759b | ||
|
|
f5f6ad9981 | ||
|
|
2e272106ef | ||
|
|
2d013a739a | ||
|
|
a24aee6bb2 | ||
|
|
225c10bc5a | ||
|
|
7372ddd2a1 | ||
|
|
465647e964 | ||
|
|
7b2cdabc2e | ||
|
|
c7be8fd398 | ||
|
|
6675b9639c | ||
|
|
49cd3c8232 | ||
|
|
25b610ef5e | ||
|
|
de239ca31b | ||
|
|
5dfbeb978f | ||
|
|
e98b096ca8 | ||
|
|
399d2c1389 | ||
|
|
59a901e285 | ||
|
|
8d58b64c28 | ||
|
|
0df9b59dfc | ||
|
|
17a221dba9 | ||
|
|
e6f9c49c22 | ||
|
|
11096885ae | ||
|
|
838c9a0d98 | ||
|
|
c5905b13b9 | ||
|
|
d2881d901b | ||
|
|
7ef7873b23 | ||
|
|
10ea4d81e6 | ||
|
|
2026efb981 | ||
|
|
e41cadd835 | ||
|
|
0ddb5d729c | ||
|
|
bb3ae47477 | ||
|
|
a744a67f42 | ||
|
|
c93d66c8a7 | ||
|
|
a7ef117b4a | ||
|
|
f0609a5142 | ||
|
|
d89bd0040c | ||
|
|
fec8a1ee7f | ||
|
|
98730f71f9 | ||
|
|
b756fd42a0 | ||
|
|
4d889ccc42 | ||
|
|
5f8e054a9d | ||
|
|
fe13fb841b | ||
|
|
1349b0f72d | ||
|
|
b974ced51b | ||
|
|
c9faea04c5 | ||
|
|
171d4305f4 | ||
|
|
d96cbb3b59 | ||
|
|
e944525596 | ||
|
|
49881eebbb | ||
|
|
8615a52ca3 | ||
|
|
7ad203732f | ||
|
|
93f8966bd9 | ||
|
|
181e58e402 | ||
|
|
63f59dde3a | ||
|
|
b2d40afdf5 | ||
|
|
f82341d1d3 | ||
|
|
80013436d0 | ||
|
|
52858f709c | ||
|
|
d65ccf96ee | ||
|
|
3b45be94e8 | ||
|
|
b4344861a0 | ||
|
|
a52ff2f66e | ||
|
|
073a9c9cd5 | ||
|
|
622a930c5a | ||
|
|
2f8938cf23 | ||
|
|
1cc35cdc6d | ||
|
|
9e2cdce58e | ||
|
|
94ec6b4418 | ||
|
|
c352093bde | ||
|
|
ac4da770e1 | ||
|
|
5ced234144 | ||
|
|
9ec2804775 | ||
|
|
f8eac08a0a | ||
|
|
af36220bca | ||
|
|
8e3b499699 | ||
|
|
968780d8da | ||
|
|
4fc6880d83 | ||
|
|
51971d56bc | ||
|
|
c7f5f10853 | ||
|
|
61c46d911f | ||
|
|
19222a6364 | ||
|
|
7479133753 | ||
|
|
0282714d86 | ||
|
|
586240d2f8 | ||
|
|
e99e282b5a | ||
|
|
52f5a78c6d | ||
|
|
01d76b7701 | ||
|
|
59d12be94f | ||
|
|
9b18deee1f | ||
|
|
7385784ded | ||
|
|
6950116678 | ||
|
|
247e62390b | ||
|
|
ec567e5fad | ||
|
|
6b23c44056 | ||
|
|
f6d0b9e9a9 | ||
|
|
70775e1985 | ||
|
|
8ecc51ad8a | ||
|
|
4938aa9c6b | ||
|
|
1f3328c096 | ||
|
|
6e7ad732fc | ||
|
|
cbf5b49cb8 | ||
|
|
b3725a455d | ||
|
|
9c545ac2e8 | ||
|
|
b87715973f | ||
|
|
064f4db012 | ||
|
|
45da8bf045 | ||
|
|
91bc414360 | ||
|
|
e2190d7a01 | ||
|
|
7fbbf850c3 | ||
|
|
1fb172011c | ||
|
|
4691049f9e | ||
|
|
40c8d8bcf4 | ||
|
|
08b5de7836 | ||
|
|
6ac3ec0b53 | ||
|
|
2b7eaaf86e | ||
|
|
08494f86a0 | ||
|
|
768e6a4579 | ||
|
|
ce9a5a3fec | ||
|
|
17bc7aaefd | ||
|
|
71bd1c7e2c | ||
|
|
b92573e42e | ||
|
|
76c66ef2ed | ||
|
|
5751d4f66e | ||
|
|
b2f3b67494 | ||
|
|
a994f4edfb | ||
|
|
79321c0d8a | ||
|
|
48c93fb347 | ||
|
|
163f7e75bf | ||
|
|
bb78a39103 | ||
|
|
05ef31362d | ||
|
|
a4f69408ac | ||
|
|
e31a936e3e | ||
|
|
32c0c6fee0 | ||
|
|
238cdd5e37 | ||
|
|
3569d373a2 | ||
|
|
0019eb7bf9 | ||
|
|
209c5c37f3 | ||
|
|
18de5e6547 | ||
|
|
d2fe45ab57 | ||
|
|
65b55938ca | ||
|
|
4cae9bdd05 | ||
|
|
3ccfcf5b9f | ||
|
|
da679f3866 | ||
|
|
1feaa6f301 | ||
|
|
22c83e5ea7 | ||
|
|
eaebc2cb4b | ||
|
|
d070e4c742 | ||
|
|
c55fcd35fe | ||
|
|
13e22e2030 | ||
|
|
0796d7b6ff | ||
|
|
2e52e9964b | ||
|
|
a4e0de1839 | ||
|
|
0910eaf6fe | ||
|
|
7c4bf742e8 | ||
|
|
66d25c4a06 | ||
|
|
c2aff4ab6e | ||
|
|
bc77408e3c | ||
|
|
c91076f64c | ||
|
|
4f0ab5656b | ||
|
|
9ba4bed117 | ||
|
|
fc838cefbf | ||
|
|
d87041bfe3 | ||
|
|
8a0d02c548 | ||
|
|
f126157bfa | ||
|
|
6ed479e71c | ||
|
|
5611cf2096 | ||
|
|
2a3f1a49de | ||
|
|
a764e343c7 | ||
|
|
af86bc58b9 | ||
|
|
94c5d691df | ||
|
|
a0eb0e2346 | ||
|
|
3d205a2037 | ||
|
|
3b10269a12 | ||
|
|
6ccef21d49 | ||
|
|
53028ff3bb | ||
|
|
ff85f6ce3f | ||
|
|
0507a4d39a | ||
|
|
7cee6c5cc6 | ||
|
|
ab3084b714 | ||
|
|
00f4c070f4 | ||
|
|
668df30b60 | ||
|
|
3ce3593ebf | ||
|
|
45210d5835 | ||
|
|
f96f69996a | ||
|
|
6855e1eec3 | ||
|
|
c951740cf9 | ||
|
|
5840c931b3 | ||
|
|
b08015371b | ||
|
|
b3a5d86d5d | ||
|
|
b618256a4c | ||
|
|
6a0290145d | ||
|
|
f74067dda2 | ||
|
|
979a4c1b08 | ||
|
|
7fa9089196 | ||
|
|
ff0aabe576 | ||
|
|
f13157f4bb | ||
|
|
aa81262f11 | ||
|
|
56c9eac16e | ||
|
|
a70b478a5c | ||
|
|
40f2af665d | ||
|
|
0ab48fcc42 | ||
|
|
9e50fe0aeb | ||
|
|
e86cad1006 | ||
|
|
1b578ef33a | ||
|
|
02774f9fd5 | ||
|
|
d582e71ba8 | ||
|
|
f986730c14 | ||
|
|
0c903156ef | ||
|
|
b06908ad52 | ||
|
|
913e10fe3b | ||
|
|
b0b38c106d | ||
|
|
aba2de3443 | ||
|
|
761c781168 | ||
|
|
b85fc8045c | ||
|
|
eddaf01676 | ||
|
|
acd72ffabe | ||
|
|
e7a2fc2d01 | ||
|
|
ec07987a90 | ||
|
|
c73ab94d3f | ||
|
|
3222de2f91 | ||
|
|
2b6376248d | ||
|
|
c060d93e3d | ||
|
|
8726c6d5d2 | ||
|
|
1402e22862 | ||
|
|
5a0ad907b4 | ||
|
|
25308477e7 | ||
|
|
44d3b71678 | ||
|
|
1ffcdfcc32 | ||
|
|
ae63b21c61 | ||
|
|
967ba60303 | ||
|
|
ee857cd261 | ||
|
|
fb581a1084 | ||
|
|
77c982ed3f | ||
|
|
486b56e179 | ||
|
|
f07677c105 | ||
|
|
851d784f6d | ||
|
|
178d9bd84c | ||
|
|
09daf9b916 | ||
|
|
415ab252f4 | ||
|
|
fa48b42ef1 | ||
|
|
85ad434290 | ||
|
|
cff1694c99 | ||
|
|
3a671994d4 | ||
|
|
4fc98ae345 | ||
|
|
00f9f1cc6b | ||
|
|
cc780116a2 | ||
|
|
4a7da1e143 | ||
|
|
b8005f4de9 | ||
|
|
8b4863f0c4 | ||
|
|
09bb109f01 | ||
|
|
668d5d8665 | ||
|
|
b397dd04c4 | ||
|
|
5091ae5e04 | ||
|
|
c85e32d56e | ||
|
|
50c848a992 | ||
|
|
7624418ddf | ||
|
|
e1100813e6 | ||
|
|
11960fa916 | ||
|
|
359fc25aad | ||
|
|
3d88899072 | ||
|
|
e160befdf8 | ||
|
|
8c32f403fb | ||
|
|
a0a1ea10a8 | ||
|
|
7233281d05 | ||
|
|
eb995ce453 | ||
|
|
e43ec48e83 | ||
|
|
4162fccaa2 | ||
|
|
bf22ac8337 | ||
|
|
5a907cc094 | ||
|
|
c473afbdc9 | ||
|
|
b3043e429b | ||
|
|
f4510c93b7 | ||
|
|
0cf63ec892 | ||
|
|
0a4879b9ac | ||
|
|
da559c08f9 | ||
|
|
e1081bc471 | ||
|
|
86a41b108e | ||
|
|
1b171e812e | ||
|
|
295b8aab0c | ||
|
|
0c4a42e629 | ||
|
|
a414faa997 | ||
|
|
36fcd7327c | ||
|
|
1500626d44 | ||
|
|
978c364847 | ||
|
|
26cc941a9e | ||
|
|
0550ba4208 | ||
|
|
0d57d21192 | ||
|
|
f8961facb2 | ||
|
|
a5d6fe4124 | ||
|
|
0080224fdb | ||
|
|
b187773053 | ||
|
|
2b31a35792 | ||
|
|
305ecc4e82 | ||
|
|
5a6264ef5d | ||
|
|
bb53f893e2 | ||
|
|
5889905d1d | ||
|
|
00327eb509 | ||
|
|
a9930ba302 | ||
|
|
b3abfaf9ee | ||
|
|
ff87c6516b | ||
|
|
2c5ea0dd45 | ||
|
|
61012f3efe | ||
|
|
a34a0224e4 | ||
|
|
6ae521bb32 | ||
|
|
f3110e4103 | ||
|
|
ac497c6e8f | ||
|
|
eeb7bff0bb | ||
|
|
99a6495d6c | ||
|
|
933ee3af56 | ||
|
|
8d7a235a04 | ||
|
|
1bf02fd773 | ||
|
|
d066e7541e | ||
|
|
ccc0eafbc3 | ||
|
|
390a42fa60 | ||
|
|
f52a59d414 | ||
|
|
c372f95a41 | ||
|
|
ec112a772b | ||
|
|
59679daeae | ||
|
|
c115c479dc | ||
|
|
022724aa69 | ||
|
|
015bf99816 | ||
|
|
973060deb5 | ||
|
|
d825249b42 | ||
|
|
9141eeb60e | ||
|
|
b876e036b2 | ||
|
|
6886f479fe | ||
|
|
c82ad2c129 | ||
|
|
ce31df3238 | ||
|
|
f9503ac189 | ||
|
|
8a52ace8de | ||
|
|
278fa902e2 | ||
|
|
879956e2f5 | ||
|
|
c72a8a538c | ||
|
|
b9f710217f | ||
|
|
295ac9135f | ||
|
|
b763bb0594 | ||
|
|
9e96461aa5 | ||
|
|
4dee1646a1 | ||
|
|
5666522ab3 | ||
|
|
60195ab021 | ||
|
|
03f5d5a5e4 | ||
|
|
50187ae86d | ||
|
|
ab919deeef | ||
|
|
6bf55142ee | ||
|
|
843475bd2e | ||
|
|
3b4bf963f6 | ||
|
|
2d35053d97 | ||
|
|
4ad887f4bf | ||
|
|
601c49ef39 | ||
|
|
2d9081d117 | ||
|
|
cc45e828df | ||
|
|
01d1cdc76c | ||
|
|
b87034a985 | ||
|
|
1d3cc65e89 | ||
|
|
5a3b28aaf1 | ||
|
|
395125bcfb | ||
|
|
4b8b3b431b | ||
|
|
6aaa6c337b | ||
|
|
f7497daee9 | ||
|
|
4c091db6c2 | ||
|
|
ba56f11702 | ||
|
|
42a895e85e | ||
|
|
3425f7fe5a | ||
|
|
fa90052299 | ||
|
|
22e6f37c9c | ||
|
|
8f50148a34 | ||
|
|
614556180a | ||
|
|
87480d7d1c | ||
|
|
1116914ea0 | ||
|
|
808bfe0a98 | ||
|
|
9209c4ea41 | ||
|
|
0b06b1e3f7 | ||
|
|
24e6bda264 | ||
|
|
93c3b90f6a | ||
|
|
89f635fee1 | ||
|
|
7eecb16404 | ||
|
|
98ee594f73 | ||
|
|
0a64a4f3c0 | ||
|
|
85c5f6058a | ||
|
|
bee39d2251 | ||
|
|
16b250f9bb | ||
|
|
5eacc92ba7 | ||
|
|
6a3904cf0c | ||
|
|
c2afa674e2 | ||
|
|
901bc2957d | ||
|
|
737e598a17 | ||
|
|
9a84c3e0f5 | ||
|
|
38d46aacae | ||
|
|
584cfff90a | ||
|
|
e843d94405 | ||
|
|
9abf990656 | ||
|
|
5ac5f6f81a | ||
|
|
8e0abb4bac | ||
|
|
4f19be1c82 | ||
|
|
05de5b02cb | ||
|
|
345140008e | ||
|
|
7e5b216511 | ||
|
|
7c2e3a812a | ||
|
|
54f9263f19 | ||
|
|
a8b1e81816 | ||
|
|
9e2eb5d2f6 | ||
|
|
7d4066de41 | ||
|
|
6b6af59b9b | ||
|
|
cb19fd50cb | ||
|
|
948afc68f6 | ||
|
|
f1cfd23cd2 | ||
|
|
e2320678ae | ||
|
|
6b82ad48f6 | ||
|
|
4ba2c9ad87 | ||
|
|
d053db289e | ||
|
|
cc511268a0 | ||
|
|
5837c1c710 | ||
|
|
b15193943a | ||
|
|
edec64cda3 | ||
|
|
473ab791ff | ||
|
|
7281419341 | ||
|
|
3e81653bd3 | ||
|
|
2820c342f6 | ||
|
|
8f3bd8ef0c | ||
|
|
9c49144cbe | ||
|
|
4b173fcde9 | ||
|
|
6f07d5e761 | ||
|
|
64f26db038 | ||
|
|
93ae728cc6 | ||
|
|
e82d471c55 | ||
|
|
6aec79cbaa | ||
|
|
88d166d8cc | ||
|
|
8c361fd7e2 | ||
|
|
a71ff33266 | ||
|
|
eacfad7ed6 | ||
|
|
31d3be96e4 | ||
|
|
4a531ec6ab | ||
|
|
f780370499 | ||
|
|
404e2753c4 | ||
|
|
48a41b0119 | ||
|
|
5f977deb4f | ||
|
|
6276b9cda0 | ||
|
|
bece876f8e | ||
|
|
3575df8ee2 | ||
|
|
f1ec76a9c1 | ||
|
|
65dadd37fc | ||
|
|
561ff51abb | ||
|
|
7ff3ef3e68 | ||
|
|
a1f8ffce4e | ||
|
|
ff256956b2 | ||
|
|
d86d406c99 | ||
|
|
71f5eec2e0 | ||
|
|
4f1780c782 | ||
|
|
34c29d8d3c | ||
|
|
3fc21b4f3f | ||
|
|
63104944a3 | ||
|
|
3a05d9b5a0 | ||
|
|
c160ba0696 | ||
|
|
f2cfe9ed74 | ||
|
|
0367f785ef | ||
|
|
1c8b77637a | ||
|
|
4188069db9 | ||
|
|
c6eb926e4a | ||
|
|
99b17488dd | ||
|
|
f211031a9f | ||
|
|
e31e88582f | ||
|
|
a385ca1bb7 | ||
|
|
59c04d5184 | ||
|
|
696129d83c | ||
|
|
9cbf764bcd | ||
|
|
e9ddff907f | ||
|
|
066646c96d | ||
|
|
86eefc7609 | ||
|
|
1d64175c4b | ||
|
|
d270c5524f | ||
|
|
4ac57d4d4c | ||
|
|
7c51e60b86 | ||
|
|
de4427304c | ||
|
|
76b674f3b6 | ||
|
|
f029a2230d | ||
|
|
5f1fb0e4fc | ||
|
|
201134b9df | ||
|
|
f07ac793fe | ||
|
|
3f4df0644c | ||
|
|
ea983404ec | ||
|
|
1543890569 | ||
|
|
2dd07f346a | ||
|
|
f717d98458 | ||
|
|
1aee4f0384 | ||
|
|
8e8a94bc23 | ||
|
|
f3d95d05eb | ||
|
|
00834786be | ||
|
|
27cf0fa34c | ||
|
|
9e85fcbe7c | ||
|
|
a1e4ba0dd4 | ||
|
|
1442299b48 | ||
|
|
46b10f1d92 | ||
|
|
aa1b7fab9c | ||
|
|
488ea44a59 | ||
|
|
c42e54e949 | ||
|
|
ffff7b055b | ||
|
|
c0650057c1 | ||
|
|
11d70f1ac3 | ||
|
|
9cbf04c1d2 | ||
|
|
8cb444147c | ||
|
|
daad650a9c | ||
|
|
5fc8cf4331 | ||
|
|
542c824c71 | ||
|
|
8fc920144b | ||
|
|
c235747847 | ||
|
|
95fad690d2 | ||
|
|
b6551c84c9 | ||
|
|
aa0811d320 | ||
|
|
f4dee9b682 | ||
|
|
9668962da1 | ||
|
|
b3c28e14fe | ||
|
|
8f9c8120b9 | ||
|
|
a0ecb44b41 | ||
|
|
3bf12c44e2 | ||
|
|
354536d464 | ||
|
|
500c8d82fc | ||
|
|
82a5edceca | ||
|
|
ad180c4335 | ||
|
|
2e71fbacbf | ||
|
|
7e5ac3a58d | ||
|
|
3a9bf0fe1d | ||
|
|
d879a13600 | ||
|
|
bd31310c40 | ||
|
|
3fcb892831 | ||
|
|
ba06066158 | ||
|
|
728bce2cf8 | ||
|
|
610f7e8f70 | ||
|
|
8836a0d6ce |
@@ -1,7 +1,7 @@
|
||||
## Makefile.am for GTK+
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SRC_SUBDIRS = util gdk gtk libgail-util modules demos tests testsuite examples
|
||||
SRC_SUBDIRS = gdk gtk libgail-util modules demos tests testsuite examples
|
||||
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
@@ -21,7 +21,8 @@ EXTRA_DIST += \
|
||||
gtk-zip.sh.in \
|
||||
sanitize-la.sh \
|
||||
po/README.translators \
|
||||
po/po2tbl.sed.in
|
||||
po/po2tbl.sed.in \
|
||||
make-pot
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
|
||||
|
||||
464
NEWS
464
NEWS
@@ -1,3 +1,467 @@
|
||||
Overview of changes in GTK+ 3.16.3
|
||||
==================================
|
||||
|
||||
* Bug fixes:
|
||||
737175 most horizontal sliders are inverted when scrolled with mouse...
|
||||
746916 File chooser search does not work over remote network shares
|
||||
746925 [HighContrast] Backdrop active (sensitive) GtkSwitch should l...
|
||||
747634 gdk_set_program_class() breaks --class
|
||||
747805 Split Headerbar unmaximize
|
||||
747808 window: fix initial shadow width for maximized/fullscreen win...
|
||||
748013 Adwaita: keyboard navigation outline on first/last button in ...
|
||||
748014 W32: Tilting mousewheel left/right does not scroll horizontally
|
||||
748061 GtkMessageDialog: Minor documentation update
|
||||
748341 GdkOffscreenWindow should not segfault on gdk_window_beep()
|
||||
748346 build: Avoid xgettext crash on MSYS2
|
||||
748500 GtkSearchEntry docs incorrectly link to themselves
|
||||
748615 GtkWindow: Get the correct shadow width even before window is...
|
||||
748640 Documentation misses out example source files when not buildi...
|
||||
748782 fontchooser should reload list of families/styles on theme ch...
|
||||
748783 Remove PANGO_ENABLE_BACKEND from gtksettings.c
|
||||
748992 GtkFontChooserWidget: Remove unused struct field
|
||||
749009 notify test fails without a session bus
|
||||
749012 GtkStack: Don't emit notify::visible-child during destruction
|
||||
749021 GtkStackSwitcher: Don't emit notify::visible-child when setti...
|
||||
|
||||
|
||||
* Translation updates:
|
||||
Brazilian Portuguese
|
||||
Czech
|
||||
Danish
|
||||
French
|
||||
Icelandic
|
||||
Occitan
|
||||
Russian
|
||||
Slovenian
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of changes in GTK+ 3.16.2
|
||||
==================================
|
||||
|
||||
* Bug fixes:
|
||||
746706 Serious accessible event spewage from Gtk+ table cells
|
||||
747288 [HighContrast] Insensitive backdrop ListBoxRow have an...
|
||||
747471 [wayland] gdk_screen_get_monitor_geometry() returns in...
|
||||
747539 popover: Remove signal handlers in dispose
|
||||
747608 Scrollbar hiding / unhiding does not work with a stylus
|
||||
747689 [HighContrast] Selected ListBoxRow’s Label is white on...
|
||||
Avoid a crash in GtkApplication
|
||||
Avoid a crash with GtkTreeview rubberbanding
|
||||
GtkApplication: Prevent more crashes around shutdown
|
||||
Prevent tab close button size changes
|
||||
|
||||
* Translation updates:
|
||||
Icelandic
|
||||
Swedish
|
||||
|
||||
|
||||
Overview of changes in GTK+ 3.16.1
|
||||
==================================
|
||||
|
||||
* Improve client-side decorations without a compositor
|
||||
|
||||
* Bug fixes:
|
||||
132197 Horizontal Scrolling Using Modifier Key and Scroll Wheel
|
||||
402168 Add underline-color and strikethrough-color to GtkTextTag properties
|
||||
613833 Unnecessary queue_resize() for GtkImage
|
||||
671362 Fixes for GtkRadioMenuItem
|
||||
734741 GtkScale's fill-level starts at the very left if show-fill-level is set
|
||||
737175 most horizontal sliders are inverted when scrolled with mouse wheel
|
||||
746222 Improve CSD windows without a compositor
|
||||
746253 has-tooltip property interferes with event-compression
|
||||
746301 Opening "Sound" panel generates pixman error
|
||||
746391 inspector: Make it easier to cut'n'paste advice message
|
||||
746468 gtkcairoblur is slow
|
||||
746586 critical warnings in a11y if focus widget is destroyed
|
||||
746602 Invalid writes through dangling weak pointers in DND code cause crashes
|
||||
746688 GtkProgressBar doesn't respect its style properties
|
||||
746712 Range ignores the "inverted" property
|
||||
746746 gtk3-demo 'OpenGL Area' crashes on systems with old OpenGL version
|
||||
746784 GtkBooleanCellAccessible emits state-changed:checked signals instead...
|
||||
746817 GtkRadioButton keynav uses wrong succession
|
||||
746821 W32: Maximized window is obscured by the taskbar
|
||||
746862 popover clears shadow of underlying widgets
|
||||
746893 gtk_list_box_bind_model is not introspectable
|
||||
746904 make it possible to disable libcanberra
|
||||
746961 new scroll bar "hides" after click+drag+release while mouse is still...
|
||||
747096 small cleanup in textbuffer clipoard handling
|
||||
747133 overshoot animation is stopped on libinput-managed touchpads
|
||||
747305 x11/gl: Use after free in glx_pixmap_get()
|
||||
747406 Fix indicator proximity checks
|
||||
747407 Make indicators pop out when needed
|
||||
|
||||
* GtkListBox
|
||||
- There has been a minor API break on the return value of the
|
||||
GtkListBoxCreateWidgetFunc callback. Previously, we would leak a
|
||||
full reference returned by this callback and now we free it.
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Catalan
|
||||
Czech
|
||||
Galician
|
||||
Greek
|
||||
Hebrew
|
||||
Hungarian
|
||||
Italian
|
||||
Korean
|
||||
Lithuanian
|
||||
Polish
|
||||
Russian
|
||||
Slovak
|
||||
Slovenian
|
||||
Spanish
|
||||
Tajik
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.16.0
|
||||
==================================
|
||||
|
||||
* Theming: Fixes for the HighContrast theme
|
||||
|
||||
* Wayland: Fix Clipboard handling
|
||||
|
||||
* Bug fixes:
|
||||
746148 Overlay controls unusable in HighContrast
|
||||
746149 “Close tab” buttons change the tab high on hover when using...
|
||||
746188 insensitive ModelButtons are not drawn insensitive
|
||||
746358 insensitive active backdrop GtkSwitches should probably loo...
|
||||
746368 the “selected color” mark is always black, even for black
|
||||
746369 “no date selection” (white on white)
|
||||
746370 GtkExpander doesn't show it is expanded when using HighCont...
|
||||
746386 clipboard crash when other client becomes the selection owner
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Bosnian
|
||||
Bulgarian
|
||||
Chinese (Taiwan)
|
||||
Hungarian
|
||||
Indonesian
|
||||
Japanese
|
||||
Norwegian bokmål
|
||||
Serbian
|
||||
Swedish
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.12
|
||||
===================================
|
||||
|
||||
* GtkMenuButton:
|
||||
- Improve accessible names
|
||||
|
||||
* GtkCellRendererPixbuf:
|
||||
- Always follow state changes, the ::follow-state property
|
||||
is now ignored. This is necessary to make HighContrast
|
||||
and symbolic icons remain visible e.g. in selected rows.
|
||||
|
||||
* GtkEntry:
|
||||
- Rework the size allocation code to be less arcane. This
|
||||
changed the semantics of the get_frame_size() vfunc. GtkEntry
|
||||
subclasses that override this vfunc may need adjustment.
|
||||
|
||||
* Wayland:
|
||||
- Support hi-dpi cursors
|
||||
|
||||
* Bugs fixed:
|
||||
745829 crash when double-clicking close button while popover...
|
||||
746141 wayland: Support HiDPI pointer cursors
|
||||
746192 Insensitive backdrop ToolButtons are not drawn correctly
|
||||
746201 Sidebar icons are black on black in HighContrast theme
|
||||
746202 use insensitive color for unfocused selected items
|
||||
746205 gemfile: needs add source rubygems.org
|
||||
746282 pixman warnings after recent changes
|
||||
746301 Opening "Sound" panel generates pixman error
|
||||
|
||||
* Translation updates:
|
||||
Bosnian
|
||||
Bulgarian
|
||||
Catalan
|
||||
Danish
|
||||
Punjabi
|
||||
Slovenian
|
||||
Swedish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.11
|
||||
===================================
|
||||
|
||||
* Go back to requiring GTK_FRAME_EXTENTS support for CSD,
|
||||
to fix shadow problems in KDE.
|
||||
|
||||
* Bug fixes:
|
||||
535929 Fix warnings from xReply test in configure.in
|
||||
577862 FileFilter name not set
|
||||
669008 Kerberos authentication popup
|
||||
712760 Clang static analysis fixes
|
||||
739070 Undefined reference to get_xkb() when building with --disable-xkb
|
||||
744288 gdk_gl_context_set_required_version() handles version requests...
|
||||
744589 nautilus bookmarks changing places randomly
|
||||
745065 GtkPrintOperation dialog creation fails when GTK is locally loaded
|
||||
745463 Search suggestions are not shown in Clocks / Weather
|
||||
745479 Tracker search in file chooser causes a crash
|
||||
745562 gedit titlebar is no longer draggable
|
||||
745578 sincos is not portable
|
||||
745622 Selected text not highlighted in GtkInfoBar
|
||||
745721 wayland: Add support for gtk_window_set_modal
|
||||
745918 add padding to textview in CSS section of GtkInspector
|
||||
745969 CSD windows cannot be moved immediately after being resized
|
||||
746013 Invalid write of size 8
|
||||
Print dialog: Fix icons in HighContrast
|
||||
Fix selected menu items in HighContrast
|
||||
App chooser: Fix icons in HighContrast
|
||||
|
||||
* Translation updates:
|
||||
French
|
||||
Galician
|
||||
Kazakh
|
||||
Korean
|
||||
Lithuanian
|
||||
Polish
|
||||
Slovak
|
||||
Swedish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.10
|
||||
===================================
|
||||
|
||||
* GtkFileChooser:
|
||||
- Don't start search too eagerly
|
||||
- Use fts with tracker
|
||||
- Make tracker queries more similar to nautilus
|
||||
|
||||
GtkWindow:
|
||||
- Improve window dragging on header bars
|
||||
|
||||
* Printing:
|
||||
- Make avahi-browsed printers work
|
||||
- Set printer state correctly
|
||||
|
||||
* Wayland
|
||||
- Exit cleanly if the compositor goes away
|
||||
- Don't ignore early maximization/fullscreening
|
||||
- Make subsurface popovers work under Weston
|
||||
|
||||
* GL
|
||||
- Port GdkGears example to modern OpenGL
|
||||
|
||||
* Bugs fixed:
|
||||
741511 Critical message: NULL is passed to g_object_unref() in spi_...
|
||||
743323 avahi-discovered CUPS printers don't work
|
||||
743427 subsurface-using popovers don't work on Weston
|
||||
744879 Another core dump when clicking the Back button
|
||||
745225 eventcontroller: Don't crash if the widget is destroyed first
|
||||
745263 The Open button in the new file chooser is too low/thin
|
||||
745289 wayland: do not use g_error() on connection errors
|
||||
745303 Wayland: Initial setup window is not maximised
|
||||
745344 overlay scrollbar fail
|
||||
745400 fix a couple of issues in gdkglcontext-win32
|
||||
703610 Problems with UC-Logic WA60 tablet
|
||||
729366 Changes to folder name are not shown when creating new fol...
|
||||
745315 Overshoot deceleration causes WebKitGTK1 web view to jump ...
|
||||
|
||||
* Translation updates
|
||||
Afrikaans
|
||||
Czech
|
||||
French
|
||||
Greek
|
||||
Hebrew
|
||||
Hungarian
|
||||
Kazakh
|
||||
Lithuanian
|
||||
Polish
|
||||
Slovak
|
||||
Spanish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.9
|
||||
==================================
|
||||
|
||||
* GtkScrolledWindow
|
||||
- Avoid 'jumping' when zoom scrolling kicks in
|
||||
- Make zoom scrolling less easy to trigger
|
||||
- Make steppers use smooth autoscrolling
|
||||
|
||||
* Input methods can now be turned off entirely, which
|
||||
can be useful to free up the Ctrl-Shift-u shortcut
|
||||
|
||||
* Add some DND support to gtk3-icon-browser
|
||||
|
||||
* Bugs fixed:
|
||||
696505 Segfault on Windows x64: gtkstatusicon.c tries to put 64-bit...
|
||||
744942 quartz: Avoid segfaulting when calling gdk_window_ensure_native
|
||||
744991 Fix loading of GResource SVGs
|
||||
745052 Icon theme code assumes directories with mtime 0 don't exist
|
||||
745076 Various DPI and OpenGL related fixes in the Wayland backend
|
||||
Fix crash and miscalculation in css bitmask manipulation
|
||||
Fix a crash due to too large surfaces
|
||||
|
||||
* Translation updates
|
||||
Chinese (Taiwan)
|
||||
Hebrew
|
||||
Hungarian
|
||||
Galician
|
||||
Greek
|
||||
Slovak
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.8
|
||||
==================================
|
||||
|
||||
* CSS
|
||||
- Support animated font weight changes
|
||||
|
||||
* GtkScrolledWindow:
|
||||
- Ensure indicators appear in the correct place
|
||||
|
||||
* Wayland:
|
||||
- DND fixes
|
||||
|
||||
* GtkPopover:
|
||||
- has a map/unmap animation now
|
||||
|
||||
* Bugs fixed:
|
||||
743647 image-missing is missing from libgtk's resources
|
||||
744054 Clarify documentation for event propagation a...
|
||||
744683 Tooltips should have ATK_ROLE_TOOL_TIP (like ...
|
||||
|
||||
* Translation updates
|
||||
Galician
|
||||
Hebrew
|
||||
Hungarian
|
||||
Italian
|
||||
Norwegian bokmål
|
||||
Punjabi
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.7
|
||||
==================================
|
||||
|
||||
* GtkListBox now supports models with gtk_list_box_bind_model
|
||||
|
||||
* GtkNotebook has a new function to support tab dnd
|
||||
|
||||
* GtkSidebar was renamed to GtkStackSidebar to better convey what it does
|
||||
|
||||
* GtkFileChooser now has a location column for search
|
||||
|
||||
* GdkGLProfile has been removed
|
||||
|
||||
* Bugs
|
||||
695945 implement minimize / maximize functionality
|
||||
708320 listbox: Update the cursor row when the row's child gets focus
|
||||
741946 OpenGL context should allow for GL attribute selection
|
||||
743350 main: Make gtk_get_option_group() available to bindings
|
||||
744148 gtk: x: fix compilation without x11 backend
|
||||
744172 Wayland: Clients won't work on compositors that support wl_seat < 4
|
||||
744204 File chooser in gedit try to open directory instead of navigatin...
|
||||
744394 GtkGLArea documentation does not reflect changes in the api
|
||||
744400 Add specific CSS class for the close/minimize/maximize button
|
||||
744407 Can't support core 3.2 gl context on llvmpipe
|
||||
744455 wayland: Update to xdg-shell unstable v5
|
||||
|
||||
* Translation updates:
|
||||
Hungarian
|
||||
Norwegian bokmål
|
||||
Slovenian
|
||||
Spanish
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.5
|
||||
==================================
|
||||
|
||||
* GTK+ types now support the GLib g_autoptr() facility for
|
||||
automatic cleanup of automatic variables. GTK+ itself does
|
||||
not use g_autoptr() internally.
|
||||
|
||||
* GtkSearchEntry has gained ::next-match, ::previous-match
|
||||
and ::stop-search signals and a gtk_search_entry_handle_event()
|
||||
function, which help in providing a richer search experience
|
||||
and make search entries usable outside of GtkSearchBar.
|
||||
|
||||
* GtkFileChooser:
|
||||
- The search has been reintegrated in the UI, there is now
|
||||
a toggle button on the header bar to go to search mode,
|
||||
in addition to the Alt-S shortcut.
|
||||
- The file chooser button now accepts files by drag-and-drop properly.
|
||||
|
||||
* GtkScrolledWindow has gained a new ::edge-reached signal, which
|
||||
triggers when the edge of the scrollable area is reached.
|
||||
|
||||
* CSS:
|
||||
- Performance improvements
|
||||
|
||||
* OpenGL:
|
||||
- It is now possible to specify the required GL version, as well
|
||||
as some other options (debug, forward compatible) when creating
|
||||
a GdkGLContext
|
||||
- Support for the OpenGL legacy profile has been dropped. Most examples
|
||||
have been updated, with the exception of gdkgears, which will be fixed
|
||||
in the next snapshot
|
||||
- Use shader version 1.50
|
||||
|
||||
* Mir backend: Many improvements
|
||||
|
||||
* Bugs fixed:
|
||||
712752 GtkClipboard: add _get_default and _get_primary
|
||||
725164 [crash] update_current_folder_get_info_cb at gtkfilechooserwidget.c
|
||||
732051 Crash can result if a child widget is destroyed while its tab is...
|
||||
735316 Default font antialiasing results in wrong behavior on OS X
|
||||
740336 Wrong (white) background colour in notes grid
|
||||
740613 XConvertSelection crashes Gtk+ apps
|
||||
742636 Freeze if window closed while resume-events pending
|
||||
742953 GdkGLContext will not create a core context
|
||||
743146 Crash in gdk_gl_texture_from_surface() when a GtkGLArea is packe...
|
||||
743193 Fix transfer annotation for tree_model parameter of gtk_tree_get...
|
||||
743229 clipboard: support selection notification on wayland
|
||||
743257 Popover not dismissed on clicking the header bar
|
||||
743286 Mention that the path returned by gtk_tree_row_reference_get_pat...
|
||||
743330 Wintab initialization glitches
|
||||
743341 GtkImage does not correctly reflect icon theme changes.
|
||||
743393 DND icons don't work in the inspector
|
||||
743422 valgrind: Conditional jump or move depends on uninitialised valu...
|
||||
743451 Drag and drop on GtkFileChooserButton doesn't work
|
||||
743592 crash on link click in about dialogue
|
||||
743593 GtkWidget's va_marshaller for "event-after" signal is incorrect
|
||||
743633 gdkscreen-wayland: Don't leak wl_output objects
|
||||
743638 getting-started: Update example-0.c to use GtkApplication
|
||||
743647 image-missing is missing from libgtk's resources
|
||||
743659 All folders hidden after returning from search mode in GtkFileCh...
|
||||
743660 Pressing Ctrl should not start a search in the file chooser
|
||||
743680 getting-started: update Basics section to correspond to example-...
|
||||
613833 Unnecessary queue_resize() for GtkImage
|
||||
741946 OpenGL context should allow for GL attribute selection
|
||||
742566 Bitfield structure members used for booleans
|
||||
742848 scrolledwindow: should emit edge-overshot when scrollbar reaches end
|
||||
743395 Regression in gnome-terminal starting with gtk commit 27285f1 ' ...
|
||||
743640 add __attribute__((cleanup)) support
|
||||
743770 Memory leak in plugman example
|
||||
743894 don't trigger interactive overlay scrollbar when drag-selecting
|
||||
743917 Gtk modules must be compatible with both gtk 2 and 3
|
||||
743975 Better deprecation information for GtkStatusIcon
|
||||
744203 gdkgl shaders use depricated GLSL version
|
||||
744212 gdk_gl_context_set_required_version() interprets requests for 4...
|
||||
|
||||
* Translation updates:
|
||||
Hebrew
|
||||
Hungarian
|
||||
Icelandic
|
||||
Lithuanian
|
||||
Norwegian bokmål
|
||||
Russian
|
||||
Slovak
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.4
|
||||
==================================
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ Even better are git-formatted patches. (Use git format-patch)
|
||||
Release notes for 3.16
|
||||
======================
|
||||
|
||||
* GTK+ now includes an OpenGL rendering widget. To support GL on various
|
||||
platforms, GTK+ uses libepoxy.
|
||||
* GTK+ now includes an OpenGL rendering widget. To support GL on
|
||||
various platforms, GTK+ uses libepoxy.
|
||||
|
||||
* GTK+ no longer uses gtk-update-icon-cache during its build. The
|
||||
--enable-gtk2-dependency configure option has been removed.
|
||||
@@ -99,6 +99,11 @@ Release notes for 3.16
|
||||
has non-scrolling parts similar to treeview headers, there is no need
|
||||
to implement this vfunc.
|
||||
|
||||
* The GtkSearchEntry widget has gained a number of new signals that
|
||||
are emitted when certain key sequences are seen. In particular, it
|
||||
now handles the Escape key and emits ::stop-search. Applications that
|
||||
expect to handle Escape themselves will need to be updated.
|
||||
|
||||
Release notes for 3.14
|
||||
======================
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ EXTRA_DIST += \
|
||||
gtk3-icon-browser.vcxproj.filters \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
install.vcxproj \
|
||||
gtk-install.vcxproj \
|
||||
broadwayd.vcxproj \
|
||||
broadwayd.vcxproj.filters \
|
||||
gdk-broadway.vcxproj \
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -113,6 +114,7 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -135,6 +137,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -158,6 +161,7 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -169,6 +170,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -188,6 +190,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -209,6 +212,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -233,6 +237,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -255,6 +260,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -274,6 +280,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -295,6 +302,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -22,7 +22,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-encode-symbolic-svg", "
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcxproj", "{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-install", "gtk-install.vcxproj", "{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -156,22 +156,22 @@ Global
|
||||
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|Win32.Build.0 = Release|Win32
|
||||
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.ActiveCfg = Release|x64
|
||||
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.Build.0 = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.Build.0 = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.Build.0 = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.Build.0 = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
||||
@@ -11,26 +11,69 @@
|
||||
<GtkDoInstallBin>
|
||||
mkdir $(CopyDir)\bin
|
||||
mkdir $(CopyDir)\lib
|
||||
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN
|
||||
copy "$(BinDir)\*.dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\*-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\*.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\gailutil-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\gtk3-demo.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo-application.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo-application.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-icon-browser.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-icon-browser.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-encode-symbolic-svg.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-encode-symbolic-svg.pdb" $(CopyDir)\bin
|
||||
goto DONE_BIN
|
||||
|
||||
:DO_BROADWAY_BIN
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\broadwayd.exe" $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
copy "$(BinDir)\broadwayd.pdb" $(CopyDir)\bin
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_RELEASE
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG
|
||||
:DO_BROADWAY_RELEASE
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
|
||||
|
||||
goto DONE_BIN
|
||||
|
||||
:DO_BROADWAY_DEBUG
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
|
||||
|
||||
:DONE_BIN
|
||||
</GtkDoInstallBin>
|
||||
<GtkDoInstall>
|
||||
@@ -43,6 +86,7 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated
|
||||
copy ..\..\..\gdk\win32\gdkwin32.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk
|
||||
copy ..\..\..\gdk\gdk.h $(CopyDir)\include\gtk-3.0\gdk\gdk.h
|
||||
copy ..\..\..\gdk\gdk-autocleanup.h $(CopyDir)\include\gtk-3.0\gdk\gdk-autocleanup.h
|
||||
copy ..\..\..\gdk\gdkapplaunchcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkapplaunchcontext.h
|
||||
copy ..\..\..\gdk\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.h
|
||||
copy ..\..\..\gdk\gdkcursor.h $(CopyDir)\include\gtk-3.0\gdk\gdkcursor.h
|
||||
@@ -86,7 +130,9 @@ copy ..\..\..\gdk\win32\gdkwin32misc.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkw
|
||||
copy ..\..\..\gdk\win32\gdkwin32screen.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32screen.h
|
||||
copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32window.h
|
||||
copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-3.0\gtk\gtk.h
|
||||
copy ..\..\..\gtk\gtk-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtk-autocleanups.h
|
||||
copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-3.0\gtk\gtkx.h
|
||||
copy ..\..\..\gtk\gtkx-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtkx-autocleanups.h
|
||||
copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-3.0\gtk\gtk-a11y.h
|
||||
copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h
|
||||
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h
|
||||
@@ -246,7 +292,7 @@ copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-3.0\gtk\gtksepar
|
||||
copy ..\..\..\gtk\gtkseparatortoolitem.h $(CopyDir)\include\gtk-3.0\gtk\gtkseparatortoolitem.h
|
||||
copy ..\..\..\gtk\gtksettings.h $(CopyDir)\include\gtk-3.0\gtk\gtksettings.h
|
||||
copy ..\..\..\gtk\gtkshow.h $(CopyDir)\include\gtk-3.0\gtk\gtkshow.h
|
||||
copy ..\..\..\gtk\gtksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtksidebar.h
|
||||
copy ..\..\..\gtk\gtkstacksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtkstacksidebar.h
|
||||
copy ..\..\..\gtk\gtksizegroup.h $(CopyDir)\include\gtk-3.0\gtk\gtksizegroup.h
|
||||
copy ..\..\..\gtk\gtksizerequest.h $(CopyDir)\include\gtk-3.0\gtk\gtksizerequest.h
|
||||
copy ..\..\..\gtk\gtksocket.h $(CopyDir)\include\gtk-3.0\gtk\gtksocket.h
|
||||
@@ -297,6 +343,7 @@ copy ..\..\..\gtk\gtkwindowgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkwindowgroup
|
||||
copy ..\..\..\gtk\gtktextlayout.h $(CopyDir)\include\gtk-3.0\gtk\gtktextlayout.h
|
||||
copy ..\..\..\gtk\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.h
|
||||
copy ..\..\..\gtk\gtkversion.h $(CopyDir)\include\gtk-3.0\gtk\gtkversion.h
|
||||
copy ..\..\..\gtk\a11y\gtk-a11y-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtk-a11y-autocleanups.h
|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkarrowaccessible.h
|
||||
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbooleancellaccessible.h
|
||||
copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbuttonaccessible.h
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}</ProjectGuid>
|
||||
<RootNamespace>install</RootNamespace>
|
||||
<ProjectGuid>{2093D218-190E-4194-9421-3BA7CBF33B15}</ProjectGuid>
|
||||
<RootNamespace>gtkinstall</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
@@ -219,4 +219,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -89,6 +89,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -108,6 +109,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -132,6 +134,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -151,6 +154,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -161,6 +161,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\main.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\resources.c" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\main.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\resources.c"><Filter>Sources</Filter></ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -20,7 +20,7 @@ EXTRA_DIST += \
|
||||
gtk3-icon-browser.vcxproj.filters \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
install.vcxproj \
|
||||
gtk-install.vcxproj \
|
||||
broadwayd.vcxproj \
|
||||
broadwayd.vcxproj.filters \
|
||||
gdk-broadway.vcxproj \
|
||||
|
||||
@@ -20,7 +20,7 @@ EXTRA_DIST += \
|
||||
gtk3-icon-browser.vcxproj.filters \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
install.vcxproj \
|
||||
gtk-install.vcxproj \
|
||||
broadwayd.vcxproj \
|
||||
broadwayd.vcxproj.filters \
|
||||
gdk-broadway.vcxproj \
|
||||
|
||||
@@ -14,7 +14,7 @@ EXTRA_DIST += \
|
||||
gtk3-demo-application.vcproj \
|
||||
gtk3-icon-browser.vcproj \
|
||||
gailutil.vcproj \
|
||||
install.vcproj \
|
||||
gtk-install.vcproj \
|
||||
broadwayd.vcproj \
|
||||
gdk-broadway.vcproj \
|
||||
gtk-build-defines.vsprops \
|
||||
|
||||
@@ -57,7 +57,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcproj
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-install", "gtk-install.vcproj", "{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}
|
||||
@@ -161,22 +161,22 @@ Global
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|Win32.Build.0 = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.ActiveCfg = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.Build.0 = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.Build.0 = Debug|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.Build.0 = Release|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.Build.0 = Release|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
|
||||
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0"
|
||||
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES"
|
||||
ForcedIncludeFiles="msvc_recommended_pragmas.h"
|
||||
AdditionalOptions="/MP"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="install"
|
||||
ProjectGUID="{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
|
||||
RootNamespace="install"
|
||||
Name="gtk-install"
|
||||
ProjectGUID="{2093D218-190E-4194-9421-3BA7CBF33B15}"
|
||||
RootNamespace="gtkinstall"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
@@ -10,26 +10,63 @@
|
||||
Value="
|
||||
mkdir $(CopyDir)\bin

|
||||
mkdir $(CopyDir)\lib

|
||||
|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
|
||||
if "$(ConfigurationName)" == "Release_Broadway" goto DO_BROADWAY_BIN

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" goto DO_BROADWAY_BIN

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
goto DONE_BIN

|
||||
|
||||
:DO_BROADWAY_BIN

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.exe $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.pdb $(CopyDir)\bin

|
||||
|
||||
if "$(ConfigurationName)" == "Release_Broadway" goto DO_BROADWAY_RELEASE

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG

|
||||
:DO_BROADWAY_RELEASE

|
||||
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
goto DONE_BIN

|
||||
|
||||
:DO_BROADWAY_DEBUG

|
||||
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
:DONE_BIN

|
||||
"
|
||||
/>
|
||||
@@ -45,6 +82,7 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gdk\win32\gdkwin32.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk

|
||||
copy ..\..\..\gdk\gdk.h $(CopyDir)\include\gtk-3.0\gdk\gdk.h

|
||||
copy ..\..\..\gdk\gdk-autocleanup.h $(CopyDir)\include\gtk-3.0\gdk\gdk-autocleanup.h

|
||||
copy ..\..\..\gdk\gdkapplaunchcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkapplaunchcontext.h

|
||||
copy ..\..\..\gdk\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.h

|
||||
copy ..\..\..\gdk\gdkcursor.h $(CopyDir)\include\gtk-3.0\gdk\gdkcursor.h

|
||||
@@ -88,7 +126,9 @@ copy ..\..\..\gdk\win32\gdkwin32misc.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkw
|
||||
copy ..\..\..\gdk\win32\gdkwin32screen.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32screen.h

|
||||
copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32window.h

|
||||
copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-3.0\gtk\gtk.h

|
||||
copy ..\..\..\gtk\gtk-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtk-autocleanups.h

|
||||
copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-3.0\gtk\gtkx.h

|
||||
copy ..\..\..\gtk\gtkx-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtkx-autocleanups.h

|
||||
copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-3.0\gtk\gtk-a11y.h

|
||||
copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h

|
||||
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h

|
||||
@@ -248,7 +288,7 @@ copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-3.0\gtk\gtksepar
|
||||
copy ..\..\..\gtk\gtkseparatortoolitem.h $(CopyDir)\include\gtk-3.0\gtk\gtkseparatortoolitem.h

|
||||
copy ..\..\..\gtk\gtksettings.h $(CopyDir)\include\gtk-3.0\gtk\gtksettings.h

|
||||
copy ..\..\..\gtk\gtkshow.h $(CopyDir)\include\gtk-3.0\gtk\gtkshow.h

|
||||
copy ..\..\..\gtk\gtksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtksidebar.h

|
||||
copy ..\..\..\gtk\gtkstacksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtkstacksidebar.h

|
||||
copy ..\..\..\gtk\gtksizegroup.h $(CopyDir)\include\gtk-3.0\gtk\gtksizegroup.h

|
||||
copy ..\..\..\gtk\gtksizerequest.h $(CopyDir)\include\gtk-3.0\gtk\gtksizerequest.h

|
||||
copy ..\..\..\gtk\gtksocket.h $(CopyDir)\include\gtk-3.0\gtk\gtksocket.h

|
||||
@@ -299,6 +339,7 @@ copy ..\..\..\gtk\gtkwindowgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkwindowgroup
|
||||
copy ..\..\..\gtk\gtktextlayout.h $(CopyDir)\include\gtk-3.0\gtk\gtktextlayout.h

|
||||
copy ..\..\..\gtk\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.h

|
||||
copy ..\..\..\gtk\gtkversion.h $(CopyDir)\include\gtk-3.0\gtk\gtkversion.h

|
||||
copy ..\..\..\gtk\a11y\gtk-a11y-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtk-a11y-autocleanups.h

|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkarrowaccessible.h

|
||||
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbooleancellaccessible.h

|
||||
copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbuttonaccessible.h

|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
>
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserapp.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserwin.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconstore.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\main.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\resources.c" />
|
||||
</Filter>
|
||||
|
||||
@@ -141,6 +141,9 @@
|
||||
#define HAVE_ROUND 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if sincos() is available */
|
||||
/* #undef HAVE_SINCOS */
|
||||
|
||||
/* Have the sockaddr_un.sun_len member */
|
||||
/* #undef HAVE_SOCKADDR_UN_SUN_LEN */
|
||||
|
||||
|
||||
83
configure.ac
83
configure.ac
@@ -9,9 +9,9 @@
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [15])
|
||||
m4_define([gtk_micro_version], [4])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_minor_version], [16])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_interface_age], [3])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -41,14 +41,14 @@ AC_CANONICAL_HOST
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.43.0])
|
||||
m4_define([glib_required_version], [2.43.4])
|
||||
m4_define([pango_required_version], [1.36.7])
|
||||
m4_define([atk_required_version], [2.15.1])
|
||||
m4_define([cairo_required_version], [1.14.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.30.0])
|
||||
m4_define([introspection_required_version], [1.39.0])
|
||||
m4_define([wayland_required_version], [1.5.91])
|
||||
m4_define([mirclient_required_version], [0.9.0])
|
||||
m4_define([mirclient_required_version], [0.11.0])
|
||||
m4_define([epoxy_required_version], [1.0])
|
||||
GLIB_REQUIRED_VERSION=glib_required_version
|
||||
PANGO_REQUIRED_VERSION=pango_required_version
|
||||
@@ -147,7 +147,6 @@ AC_PROG_MKDIR_P
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
|
||||
GETTEXT_PACKAGE=gtk30
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
|
||||
@@ -349,8 +348,7 @@ backend_immodules=
|
||||
have_gio_unix=no
|
||||
GDK_BACKENDS=
|
||||
GDK_EXTRA_LIBS=
|
||||
# expoxy.pc has Cflags: -I${includedir}, but pkg-config swallows that :-(
|
||||
GDK_EXTRA_CFLAGS="-I${prefix}/include"
|
||||
GDK_EXTRA_CFLAGS=
|
||||
GDK_WINDOWING=
|
||||
PANGO_PACKAGES="pango pangocairo"
|
||||
|
||||
@@ -475,6 +473,7 @@ if test "$enable_mir_backend" = "yes"; then
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_MIR"
|
||||
MIR_PACKAGES="$MIR_DEPENDENCIES"
|
||||
have_gio_unix=yes
|
||||
|
||||
AM_CONDITIONAL(USE_MIR, true)
|
||||
else
|
||||
@@ -666,6 +665,15 @@ fi
|
||||
# i18n stuff
|
||||
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
AC_MSG_CHECKING([whether xgettext supports ui files])
|
||||
if $ac_cv_path_XGETTEXT --output=- --color=no --language=Glade $srcdir/gtk/ui/gtkfilechooserwidget.ui > /dev/null 2>&1; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([GNU gettext 0.18.3 or newer is required])
|
||||
fi
|
||||
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_CONFIG_COMMANDS([po-properties],
|
||||
[[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
@@ -818,7 +826,7 @@ AC_TYPE_UID_T
|
||||
|
||||
# Check for round(), rint(), isnan(), isinf() and nearbyint()
|
||||
AC_CHECK_LIB(m,round,,)
|
||||
AC_CHECK_FUNCS(round rint nearbyint)
|
||||
AC_CHECK_FUNCS(round rint nearbyint sincos)
|
||||
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
|
||||
|
||||
# Checks for gdkspawn
|
||||
@@ -1023,22 +1031,16 @@ if test "x$enable_x11_backend" = xyes; then
|
||||
AC_CHECK_FUNC(XextFindDisplay, :,
|
||||
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
|
||||
|
||||
# Check for xReply
|
||||
# Check if <X11/extensions/XIproto.h> is needed for xReply.
|
||||
|
||||
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_RESULT([unknown])
|
||||
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
|
||||
AC_CHECK_TYPE([xReply], ,
|
||||
[AC_CHECK_TYPE([xReply],
|
||||
[AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_ERROR([xReply type unavailable. X11 is too old])],
|
||||
[[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]])],
|
||||
[[#include <X11/Xlibint.h>]])
|
||||
|
||||
# Check for XKB support.
|
||||
|
||||
@@ -1658,12 +1660,35 @@ AM_CONDITIONAL(HAVE_COLORD, test "x$have_colord" = "xyes")
|
||||
# Check for libcanberra (only used in examples)
|
||||
##################################################
|
||||
|
||||
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra-gtk3,
|
||||
have_libcanberra=yes, have_libcanberra=no)
|
||||
if test "$have_libcanberra" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBCANBERRA, 1, [define if we have libcanberra])
|
||||
AC_ARG_ENABLE(libcanberra,
|
||||
[AS_HELP_STRING([--enable-libcanberra],
|
||||
[enable libcanberra support in examples [default=auto]])],
|
||||
[enable_libcanberra="$enableval"],
|
||||
[enable_libcanberra=auto])
|
||||
|
||||
AC_MSG_CHECKING([whether to use libcanberra])
|
||||
if test "$enable_libcanberra" != "no"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
have_libcanberra=no
|
||||
if test "$enable_libcanberra" != "no"; then
|
||||
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra-gtk3,
|
||||
have_libcanberra=yes, have_libcanberra=no)
|
||||
if test "$enable_libcanberra" = "yes"; then
|
||||
if test "$have_libcanberra" = "no"; then
|
||||
AC_MSG_ERROR([--enable-libcanberra specified, but not available])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$have_libcanberra" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBCANBERRA, 1, [define if we have libcanberra])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LIBCANBERRA, test "x$have_libcanberra" = "xyes")
|
||||
|
||||
##################################################
|
||||
# Checks for gtk-doc and docbook-tools
|
||||
##################################################
|
||||
@@ -1906,7 +1931,6 @@ gtk/makefile.msc
|
||||
gtk/gtkversion.h
|
||||
gtk/gtk-win32.rc
|
||||
gtk/libgtk3.manifest
|
||||
util/Makefile
|
||||
libgail-util/Makefile
|
||||
modules/Makefile
|
||||
modules/input/Makefile
|
||||
@@ -1937,6 +1961,7 @@ echo " Print backends: $PRINT_BACKENDS"
|
||||
echo " Dynamic modules: $build_dynamic_modules"
|
||||
echo " Included immodules: $included_immodules"
|
||||
echo " colord support: $have_colord"
|
||||
echo " libcanberra support: $have_libcanberra"
|
||||
echo " Introspection: $found_introspection"
|
||||
echo " Debugging: $enable_debug"
|
||||
echo " Documentation: $enable_gtk_doc"
|
||||
|
||||
@@ -136,6 +136,8 @@ RESOURCES = \
|
||||
brick2.png \
|
||||
background.jpg \
|
||||
floppybuddy.gif \
|
||||
glarea-fragment.glsl \
|
||||
glarea-vertex.glsl \
|
||||
gnome-applets.png \
|
||||
gnome-calendar.png \
|
||||
gnome-foot.png \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* Demonstrates migrating a window between different displays.
|
||||
* A display is a mouse and keyboard with some number of
|
||||
* associated monitors. The neat thing about having multiple
|
||||
* associated monitors. The neat thing about having multiple
|
||||
* displays is that they can be on a completely separate
|
||||
* computers, as long as there is a network connection to the
|
||||
* computer where the application is running.
|
||||
@@ -26,9 +26,6 @@
|
||||
* - Using GtkDialog
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
#undef GDK_DISABLE_DEPRECATED
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
@@ -140,4 +140,8 @@
|
||||
<gresource prefix="/popover">
|
||||
<file>popover.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/glarea">
|
||||
<file>glarea-fragment.glsl</file>
|
||||
<file>glarea-vertex.glsl</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
9
demos/gtk-demo/glarea-fragment.glsl
Normal file
9
demos/gtk-demo/glarea-fragment.glsl
Normal file
@@ -0,0 +1,9 @@
|
||||
#version 330
|
||||
|
||||
out vec4 outputColor;
|
||||
|
||||
void main() {
|
||||
float lerpVal = gl_FragCoord.y / 500.0f;
|
||||
|
||||
outputColor = mix(vec4(1.0f, 0.85f, 0.35f, 1.0f), vec4(0.2f, 0.2f, 0.2f, 1.0f), lerpVal);
|
||||
}
|
||||
8
demos/gtk-demo/glarea-vertex.glsl
Normal file
8
demos/gtk-demo/glarea-vertex.glsl
Normal file
@@ -0,0 +1,8 @@
|
||||
#version 330
|
||||
|
||||
layout(location = 0) in vec4 position;
|
||||
uniform mat4 mvp;
|
||||
|
||||
void main() {
|
||||
gl_Position = mvp * position;
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
* GtkGLArea is a widget that allows custom drawing using OpenGL calls.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
@@ -23,35 +24,270 @@ enum {
|
||||
static float rotation_angles[N_AXIS] = { 0.0 };
|
||||
|
||||
/* The object we are drawing */
|
||||
static const GLfloat vertex_data[] = {
|
||||
0.f, 0.5f, 0.f, 1.f,
|
||||
0.5f, -0.366f, 0.f, 1.f,
|
||||
-0.5f, -0.366f, 0.f, 1.f,
|
||||
};
|
||||
|
||||
/* Initialize the GL buffers */
|
||||
static void
|
||||
init_buffers (GLuint *vao_out,
|
||||
GLuint *buffer_out)
|
||||
{
|
||||
GLuint vao, buffer;
|
||||
|
||||
/* We only use one VAO, so we always keep it bound */
|
||||
glGenVertexArrays (1, &vao);
|
||||
glBindVertexArray (vao);
|
||||
|
||||
/* This is the buffer that holds the vertices */
|
||||
glGenBuffers (1, &buffer);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, buffer);
|
||||
glBufferData (GL_ARRAY_BUFFER, sizeof (vertex_data), vertex_data, GL_STATIC_DRAW);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
|
||||
if (vao_out != NULL)
|
||||
*vao_out = vao;
|
||||
|
||||
if (buffer_out != NULL)
|
||||
*buffer_out = buffer;
|
||||
}
|
||||
|
||||
/* Create and compile a shader */
|
||||
static GLuint
|
||||
create_shader (int type,
|
||||
const char *src)
|
||||
{
|
||||
GLuint shader;
|
||||
int status;
|
||||
|
||||
shader = glCreateShader (type);
|
||||
glShaderSource (shader, 1, &src, NULL);
|
||||
glCompileShader (shader);
|
||||
|
||||
glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
|
||||
if (status == GL_FALSE)
|
||||
{
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetShaderiv (shader, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc (log_len + 1);
|
||||
glGetShaderInfoLog (shader, log_len, NULL, buffer);
|
||||
|
||||
g_warning ("Compile failure in %s shader:\n%s\n",
|
||||
type == GL_VERTEX_SHADER ? "vertex" : "fragment",
|
||||
buffer);
|
||||
|
||||
g_free (buffer);
|
||||
|
||||
glDeleteShader (shader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
/* Initialize the shaders and link them into a program */
|
||||
static void
|
||||
init_shaders (GLuint *program_out,
|
||||
GLuint *mvp_out)
|
||||
{
|
||||
GLuint vertex, fragment;
|
||||
GLuint program = 0;
|
||||
GLuint mvp = 0;
|
||||
int status;
|
||||
GBytes *source;
|
||||
|
||||
source = g_resources_lookup_data ("/glarea/glarea-vertex.glsl", 0, NULL);
|
||||
vertex = create_shader (GL_VERTEX_SHADER, g_bytes_get_data (source, NULL));
|
||||
g_bytes_unref (source);
|
||||
|
||||
if (vertex == 0)
|
||||
{
|
||||
*program_out = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
source = g_resources_lookup_data ("/glarea/glarea-fragment.glsl", 0, NULL);
|
||||
fragment = create_shader (GL_FRAGMENT_SHADER, g_bytes_get_data (source, NULL));
|
||||
g_bytes_unref (source);
|
||||
|
||||
if (fragment == 0)
|
||||
{
|
||||
glDeleteShader (vertex);
|
||||
*program_out = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
program = glCreateProgram ();
|
||||
glAttachShader (program, vertex);
|
||||
glAttachShader (program, fragment);
|
||||
|
||||
glLinkProgram (program);
|
||||
|
||||
glGetProgramiv (program, GL_LINK_STATUS, &status);
|
||||
if (status == GL_FALSE)
|
||||
{
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetProgramiv (program, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc (log_len + 1);
|
||||
glGetProgramInfoLog (program, log_len, NULL, buffer);
|
||||
|
||||
g_warning ("Linking failure:\n%s\n", buffer);
|
||||
|
||||
g_free (buffer);
|
||||
|
||||
glDeleteProgram (program);
|
||||
program = 0;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Get the location of the "mvp" uniform */
|
||||
mvp = glGetUniformLocation (program, "mvp");
|
||||
|
||||
glDetachShader (program, vertex);
|
||||
glDetachShader (program, fragment);
|
||||
|
||||
out:
|
||||
glDeleteShader (vertex);
|
||||
glDeleteShader (fragment);
|
||||
|
||||
if (program_out != NULL)
|
||||
*program_out = program;
|
||||
|
||||
if (mvp_out != NULL)
|
||||
*mvp_out = mvp;
|
||||
}
|
||||
|
||||
static void
|
||||
compute_mvp (float *res,
|
||||
float phi,
|
||||
float theta,
|
||||
float psi)
|
||||
{
|
||||
float x = phi * (G_PI / 180.f);
|
||||
float y = theta * (G_PI / 180.f);
|
||||
float z = psi * (G_PI / 180.f);
|
||||
float c1 = cosf (x), s1 = sinf (x);
|
||||
float c2 = cosf (y), s2 = sinf (y);
|
||||
float c3 = cosf (z), s3 = sinf (z);
|
||||
float c3c2 = c3 * c2;
|
||||
float s3c1 = s3 * c1;
|
||||
float c3s2s1 = c3 * s2 * s1;
|
||||
float s3s1 = s3 * s1;
|
||||
float c3s2c1 = c3 * s2 * c1;
|
||||
float s3c2 = s3 * c2;
|
||||
float c3c1 = c3 * c1;
|
||||
float s3s2s1 = s3 * s2 * s1;
|
||||
float c3s1 = c3 * s1;
|
||||
float s3s2c1 = s3 * s2 * c1;
|
||||
float c2s1 = c2 * s1;
|
||||
float c2c1 = c2 * c1;
|
||||
|
||||
/* initialize to the identity matrix */
|
||||
res[0] = 1.f; res[4] = 0.f; res[8] = 0.f; res[12] = 0.f;
|
||||
res[1] = 0.f; res[5] = 1.f; res[9] = 0.f; res[13] = 0.f;
|
||||
res[2] = 0.f; res[6] = 0.f; res[10] = 1.f; res[14] = 0.f;
|
||||
res[3] = 0.f; res[7] = 0.f; res[11] = 0.f; res[15] = 1.f;
|
||||
|
||||
/* apply all three rotations using the three matrices:
|
||||
*
|
||||
* ⎡ c3 s3 0 ⎤ ⎡ c2 0 -s2 ⎤ ⎡ 1 0 0 ⎤
|
||||
* ⎢ -s3 c3 0 ⎥ ⎢ 0 1 0 ⎥ ⎢ 0 c1 s1 ⎥
|
||||
* ⎣ 0 0 1 ⎦ ⎣ s2 0 c2 ⎦ ⎣ 0 -s1 c1 ⎦
|
||||
*/
|
||||
res[0] = c3c2; res[4] = s3c1 + c3s2s1; res[8] = s3s1 - c3s2c1; res[12] = 0.f;
|
||||
res[1] = -s3c2; res[5] = c3c1 - s3s2s1; res[9] = c3s1 + s3s2c1; res[13] = 0.f;
|
||||
res[2] = s2; res[6] = -c2s1; res[10] = c2c1; res[14] = 0.f;
|
||||
res[3] = 0.f; res[7] = 0.f; res[11] = 0.f; res[15] = 1.f;
|
||||
}
|
||||
|
||||
static GLuint position_buffer;
|
||||
static GLuint program;
|
||||
static GLuint mvp_location;
|
||||
|
||||
/* We need to set up our state when we realize the GtkGLArea widget */
|
||||
static void
|
||||
realize (GtkWidget *widget)
|
||||
{
|
||||
gtk_gl_area_make_current (GTK_GL_AREA (widget));
|
||||
|
||||
if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL)
|
||||
return;
|
||||
|
||||
init_buffers (&position_buffer, NULL);
|
||||
init_shaders (&program, &mvp_location);
|
||||
}
|
||||
|
||||
/* We should tear down the state when unrealizing */
|
||||
static void
|
||||
unrealize (GtkWidget *widget)
|
||||
{
|
||||
gtk_gl_area_make_current (GTK_GL_AREA (widget));
|
||||
|
||||
if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL)
|
||||
return;
|
||||
|
||||
glDeleteBuffers (1, &position_buffer);
|
||||
glDeleteProgram (program);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_triangle (void)
|
||||
{
|
||||
glColor3f (1.0f, 0.85f, 0.35f);
|
||||
glBegin (GL_TRIANGLES);
|
||||
{
|
||||
glVertex3f ( 0.0, 0.6, 0.0);
|
||||
glVertex3f (-0.2, -0.3, 0.0);
|
||||
glVertex3f ( 0.2, -0.3, 0.0);
|
||||
}
|
||||
glEnd ();
|
||||
float mvp[16];
|
||||
|
||||
/* Compute the model view projection matrix using the
|
||||
* rotation angles specified through the GtkRange widgets
|
||||
*/
|
||||
compute_mvp (mvp,
|
||||
rotation_angles[X_AXIS],
|
||||
rotation_angles[Y_AXIS],
|
||||
rotation_angles[Z_AXIS]);
|
||||
|
||||
/* Use our shaders */
|
||||
glUseProgram (program);
|
||||
|
||||
/* Update the "mvp" matrix we use in the shader */
|
||||
glUniformMatrix4fv (mvp_location, 1, GL_FALSE, &mvp[0]);
|
||||
|
||||
/* Use the vertices in our buffer */
|
||||
glBindBuffer (GL_ARRAY_BUFFER, position_buffer);
|
||||
glEnableVertexAttribArray (0);
|
||||
glVertexAttribPointer (0, 4, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
/* Draw the three vertices as a triangle */
|
||||
glDrawArrays (GL_TRIANGLES, 0, 3);
|
||||
|
||||
/* We finished using the buffers and program */
|
||||
glDisableVertexAttribArray (0);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
glUseProgram (0);
|
||||
}
|
||||
|
||||
/* The main rendering callback */
|
||||
static gboolean
|
||||
render (GtkGLArea *area,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
if (gtk_gl_area_get_error (area) != NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Clear the viewport */
|
||||
glClearColor (0.5, 0.5, 0.5, 1.0);
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glLoadIdentity ();
|
||||
glRotatef (rotation_angles[X_AXIS], 1, 0, 0);
|
||||
glRotatef (rotation_angles[Y_AXIS], 0, 1, 0);
|
||||
glRotatef (rotation_angles[Z_AXIS], 0, 0, 1);
|
||||
|
||||
/* Draw our object */
|
||||
draw_triangle ();
|
||||
|
||||
/* Flush the contents of the pipeline */
|
||||
glFlush ();
|
||||
|
||||
return TRUE;
|
||||
@@ -138,7 +374,7 @@ create_glarea_window (GtkWidget *do_widget)
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkGLArea - Golden Triangle");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
@@ -151,7 +387,13 @@ create_glarea_window (GtkWidget *do_widget)
|
||||
gtk_widget_set_vexpand (gl_area, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), gl_area);
|
||||
|
||||
/* the main "draw" call for GtkGLArea */
|
||||
/* We need to initialize and free GL resources, so we use
|
||||
* the realize and unrealize signals on the widget
|
||||
*/
|
||||
g_signal_connect (gl_area, "realize", G_CALLBACK (realize), NULL);
|
||||
g_signal_connect (gl_area, "unrealize", G_CALLBACK (unrealize), NULL);
|
||||
|
||||
/* The main "draw" call for GtkGLArea */
|
||||
g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
|
||||
|
||||
controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
|
||||
@@ -218,7 +218,6 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* column for symbolic icon */
|
||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
g_object_set (G_OBJECT (renderer), "follow-state", TRUE, NULL);
|
||||
column = gtk_tree_view_column_new_with_attributes ("Symbolic icon",
|
||||
renderer,
|
||||
"icon-name",
|
||||
|
||||
@@ -543,7 +543,7 @@ add_data_tab (const gchar *demoname)
|
||||
* not an image. Let's try something else then.
|
||||
*/
|
||||
g_object_ref_sink (widget);
|
||||
gtk_widget_destroy (widget);
|
||||
g_object_unref (widget);
|
||||
|
||||
bytes = g_resources_lookup_data (resource_name, 0, NULL);
|
||||
g_assert (bytes);
|
||||
|
||||
@@ -42,6 +42,34 @@ window_key_press_event_cb (GtkWidget *widget,
|
||||
return gtk_search_bar_handle_event (bar, event);
|
||||
}
|
||||
|
||||
static void
|
||||
search_changed (GtkSearchEntry *entry,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gtk_label_set_text (label, "search-changed");
|
||||
}
|
||||
|
||||
static void
|
||||
next_match (GtkSearchEntry *entry,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gtk_label_set_text (label, "next-match");
|
||||
}
|
||||
|
||||
static void
|
||||
previous_match (GtkSearchEntry *entry,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gtk_label_set_text (label, "previous-match");
|
||||
}
|
||||
|
||||
static void
|
||||
stop_search (GtkSearchEntry *entry,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gtk_label_set_text (label, "stop-search");
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_search_entry2 (GtkWidget *do_widget)
|
||||
{
|
||||
@@ -99,6 +127,8 @@ do_search_entry2 (GtkWidget *do_widget)
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
|
||||
|
||||
label = gtk_label_new ("Result:");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
||||
gtk_widget_set_margin_start (label, 6);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
|
||||
label = gtk_label_new ("");
|
||||
@@ -108,6 +138,27 @@ do_search_entry2 (GtkWidget *do_widget)
|
||||
G_CALLBACK (search_changed_cb), label);
|
||||
g_signal_connect (entry, "changed",
|
||||
G_CALLBACK (changed_cb), label);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
|
||||
|
||||
label = gtk_label_new ("Signal:");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
||||
gtk_widget_set_margin_start (label, 6);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
|
||||
label = gtk_label_new ("");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
|
||||
g_signal_connect (entry, "search-changed",
|
||||
G_CALLBACK (search_changed), label);
|
||||
g_signal_connect (entry, "next-match",
|
||||
G_CALLBACK (next_match), label);
|
||||
g_signal_connect (entry, "previous-match",
|
||||
G_CALLBACK (previous_match), label);
|
||||
g_signal_connect (entry, "stop-search",
|
||||
G_CALLBACK (stop_search), label);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* Sidebar
|
||||
/* Stack Sidebar
|
||||
*
|
||||
* GtkSidebar provides an automatic sidebar widget to control navigation
|
||||
* of a GtkStack object. This widget automatically updates it content
|
||||
* based on what is presently available in the GtkStack object, and
|
||||
* using the "title" child property to set the display labels.
|
||||
* GtkStackSidebar provides an automatic sidebar widget to control
|
||||
* navigation of a GtkStack object. This widget automatically updates it
|
||||
* content based on what is presently available in the GtkStack object,
|
||||
* and using the "title" child property to set the display labels.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
@@ -21,7 +21,7 @@ do_sidebar (GtkWidget *do_widget)
|
||||
GtkWidget *header;
|
||||
const gchar* pages[] = {
|
||||
"Welcome to GTK+",
|
||||
"GtkSidebar Widget",
|
||||
"GtkStackSidebar Widget",
|
||||
"Automatic navigation",
|
||||
"Consistent appearance",
|
||||
"Scrolling",
|
||||
@@ -43,18 +43,18 @@ do_sidebar (GtkWidget *do_widget)
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW(window), header);
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Sidebar demo");
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Stack Sidebar demo");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
sidebar = gtk_sidebar_new ();
|
||||
sidebar = gtk_stack_sidebar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0);
|
||||
|
||||
stack = gtk_stack_new ();
|
||||
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
|
||||
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
|
||||
/* Separator between sidebar and stack */
|
||||
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
|
||||
@@ -20,6 +20,7 @@ gtk3_icon_browser_SOURCES = \
|
||||
main.c \
|
||||
iconbrowserapp.c iconbrowserapp.h \
|
||||
iconbrowserwin.c iconbrowserwin.h \
|
||||
iconstore.c iconstore.h \
|
||||
resources.c
|
||||
|
||||
BUILT_SOURCES = \
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <string.h>
|
||||
#include "iconbrowserapp.h"
|
||||
#include "iconbrowserwin.h"
|
||||
#include "iconstore.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
typedef struct
|
||||
@@ -42,13 +43,6 @@ struct _IconBrowserWindowClass
|
||||
GtkApplicationWindowClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
NAME_COLUMN,
|
||||
SYMBOLIC_NAME_COLUMN,
|
||||
DESCRIPTION_COLUMN,
|
||||
CONTEXT_COLUMN
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static void
|
||||
@@ -64,16 +58,31 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
gtk_tree_model_filter_refilter (win->filter_model);
|
||||
}
|
||||
|
||||
static void
|
||||
set_image (GtkWidget *image, const gchar *name, gint size)
|
||||
static GdkPixbuf *
|
||||
get_icon (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
|
||||
GtkIconInfo *info;
|
||||
GtkStyleContext *context;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
context = gtk_widget_get_style_context (image);
|
||||
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, size, 0);
|
||||
pixbuf = gtk_icon_info_load_symbolic_for_context (info, context, NULL, NULL);
|
||||
g_object_unref (info);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
static void
|
||||
selection_changed (GtkIconView *icon_view, IconBrowserWindow *win)
|
||||
set_image (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
|
||||
pixbuf = get_icon (image, name, size);
|
||||
gtk_drag_source_set_icon_pixbuf (gtk_widget_get_parent (image), pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -87,14 +96,14 @@ item_activated (GtkIconView *icon_view, GtkTreePath *path, IconBrowserWindow *wi
|
||||
gtk_tree_model_get_iter (GTK_TREE_MODEL (win->filter_model), &iter, path);
|
||||
|
||||
if (win->symbolic)
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = NAME_COLUMN;
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (win->filter_model), &iter,
|
||||
column, &name,
|
||||
DESCRIPTION_COLUMN, &description,
|
||||
ICON_STORE_DESCRIPTION_COLUMN, &description,
|
||||
-1);
|
||||
|
||||
|
||||
if (name == NULL || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name))
|
||||
{
|
||||
g_free (description);
|
||||
@@ -146,10 +155,10 @@ add_icon (IconBrowserWindow *win,
|
||||
symbolic_name = NULL;
|
||||
}
|
||||
gtk_list_store_insert_with_values (win->store, NULL, -1,
|
||||
NAME_COLUMN, regular_name,
|
||||
SYMBOLIC_NAME_COLUMN, symbolic_name,
|
||||
DESCRIPTION_COLUMN, description,
|
||||
CONTEXT_COLUMN, context,
|
||||
ICON_STORE_NAME_COLUMN, regular_name,
|
||||
ICON_STORE_SYMBOLIC_NAME_COLUMN, symbolic_name,
|
||||
ICON_STORE_DESCRIPTION_COLUMN, description,
|
||||
ICON_STORE_CONTEXT_COLUMN, context,
|
||||
-1);
|
||||
}
|
||||
|
||||
@@ -702,13 +711,13 @@ icon_visible_func (GtkTreeModel *model,
|
||||
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
|
||||
|
||||
if (win->symbolic)
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = NAME_COLUMN;
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
|
||||
gtk_tree_model_get (model, iter,
|
||||
column, &name,
|
||||
CONTEXT_COLUMN, &context,
|
||||
ICON_STORE_CONTEXT_COLUMN, &context,
|
||||
-1);
|
||||
if (!name)
|
||||
visible = FALSE;
|
||||
@@ -731,9 +740,11 @@ symbolic_toggled (GtkToggleButton *toggle, IconBrowserWindow *win)
|
||||
win->symbolic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
|
||||
|
||||
if (win->symbolic)
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = NAME_COLUMN;
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
|
||||
icon_store_set_text_column (ICON_STORE (win->store), column);
|
||||
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->cell, "icon-name", column, NULL);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->text_cell, "text", column, NULL);
|
||||
@@ -749,17 +760,72 @@ search_mode_toggled (GObject *searchbar, GParamSpec *pspec, IconBrowserWindow *w
|
||||
gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list));
|
||||
}
|
||||
|
||||
static void
|
||||
get_image_data (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
GtkSelectionData *selection,
|
||||
guint target_info,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *image;
|
||||
const gchar *name;
|
||||
gint size;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
image = gtk_bin_get_child (GTK_BIN (widget));
|
||||
|
||||
gtk_image_get_icon_name (GTK_IMAGE (image), &name, NULL);
|
||||
size = gtk_image_get_pixel_size (GTK_IMAGE (image));
|
||||
|
||||
pixbuf = get_icon (image, name, size);
|
||||
gtk_selection_data_set_pixbuf (selection, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_image_dnd (GtkWidget *image)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
|
||||
parent = gtk_widget_get_parent (image);
|
||||
gtk_drag_source_set (parent, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
|
||||
gtk_drag_source_add_image_targets (parent);
|
||||
g_signal_connect (parent, "drag-data-get", G_CALLBACK (get_image_data), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
icon_browser_window_init (IconBrowserWindow *win)
|
||||
{
|
||||
GtkTargetList *list;
|
||||
GtkTargetEntry *targets;
|
||||
gint n_targets;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
|
||||
list = gtk_target_list_new (NULL, 0);
|
||||
gtk_target_list_add_text_targets (list, 0);
|
||||
targets = gtk_target_table_new_from_list (list, &n_targets);
|
||||
gtk_target_list_unref (list);
|
||||
|
||||
gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (win->list),
|
||||
GDK_BUTTON1_MASK,
|
||||
targets, n_targets,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
gtk_target_table_free (targets, n_targets);
|
||||
|
||||
setup_image_dnd (win->image1);
|
||||
setup_image_dnd (win->image2);
|
||||
setup_image_dnd (win->image3);
|
||||
setup_image_dnd (win->image4);
|
||||
setup_image_dnd (win->image5);
|
||||
|
||||
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
|
||||
|
||||
gtk_tree_model_filter_set_visible_func (win->filter_model, icon_visible_func, win, NULL);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (win->details), GTK_WINDOW (win));
|
||||
|
||||
|
||||
g_signal_connect (win->searchbar, "notify::search-mode-enabled",
|
||||
G_CALLBACK (search_mode_toggled), win);
|
||||
|
||||
@@ -771,6 +837,8 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
static void
|
||||
icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
{
|
||||
g_type_ensure (ICON_STORE_TYPE);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
|
||||
"/org/gtk/iconbrowser/window.ui");
|
||||
|
||||
@@ -794,7 +862,6 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), search_text_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selection_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selected_context_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), symbolic_toggled);
|
||||
|
||||
91
demos/icon-browser/iconstore.c
Normal file
91
demos/icon-browser/iconstore.c
Normal file
@@ -0,0 +1,91 @@
|
||||
#include "iconstore.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
struct _IconStore
|
||||
{
|
||||
GtkListStore parent;
|
||||
|
||||
gint text_column;
|
||||
};
|
||||
|
||||
struct _IconStoreClass
|
||||
{
|
||||
GtkListStoreClass parent_class;
|
||||
};
|
||||
|
||||
static void icon_store_drag_source_init (GtkTreeDragSourceIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (IconStore, icon_store, GTK_TYPE_LIST_STORE,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
|
||||
icon_store_drag_source_init))
|
||||
|
||||
|
||||
static void
|
||||
icon_store_init (IconStore *store)
|
||||
{
|
||||
GType types[4] = { G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING };
|
||||
|
||||
gtk_list_store_set_column_types (GTK_LIST_STORE (store), 4, types);
|
||||
|
||||
store->text_column = ICON_STORE_NAME_COLUMN;
|
||||
}
|
||||
|
||||
static void
|
||||
icon_store_class_init (IconStoreClass *class)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
row_draggable (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_data_delete (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path))
|
||||
return gtk_list_store_remove (GTK_LIST_STORE (drag_source), &iter);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_data_get (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path,
|
||||
GtkSelectionData *selection)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gchar *text;
|
||||
|
||||
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path))
|
||||
return FALSE;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (drag_source), &iter,
|
||||
ICON_STORE (drag_source)->text_column, &text,
|
||||
-1);
|
||||
|
||||
gtk_selection_data_set_text (selection, text, -1);
|
||||
|
||||
g_free (text);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
icon_store_drag_source_init (GtkTreeDragSourceIface *iface)
|
||||
{
|
||||
iface->row_draggable = row_draggable;
|
||||
iface->drag_data_delete = drag_data_delete;
|
||||
iface->drag_data_get = drag_data_get;
|
||||
}
|
||||
|
||||
void
|
||||
icon_store_set_text_column (IconStore *store, gint text_column)
|
||||
{
|
||||
store->text_column = text_column;
|
||||
}
|
||||
26
demos/icon-browser/iconstore.h
Normal file
26
demos/icon-browser/iconstore.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef __ICON_STORE_H
|
||||
#define __ICON_STORE_H
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
#define ICON_STORE_TYPE (icon_store_get_type ())
|
||||
#define ICON_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ICON_STORE_TYPE, IconStore))
|
||||
|
||||
|
||||
typedef struct _IconStore IconStore;
|
||||
typedef struct _IconStoreClass IconStoreClass;
|
||||
|
||||
enum {
|
||||
ICON_STORE_NAME_COLUMN,
|
||||
ICON_STORE_SYMBOLIC_NAME_COLUMN,
|
||||
ICON_STORE_DESCRIPTION_COLUMN,
|
||||
ICON_STORE_CONTEXT_COLUMN
|
||||
};
|
||||
|
||||
GType icon_store_get_type (void);
|
||||
|
||||
void icon_store_set_text_column (IconStore *store,
|
||||
gint column);
|
||||
|
||||
#endif /* __ICON_STORE_H */
|
||||
@@ -1,13 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.8 -->
|
||||
<object class="GtkListStore" id="store">
|
||||
<columns>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
<object class="IconStore" id="store">
|
||||
</object>
|
||||
<object class="GtkTreeModelFilter" id="filter_model">
|
||||
<property name="child_model">store</property>
|
||||
@@ -108,7 +102,8 @@
|
||||
<object class="GtkIconView" id="list">
|
||||
<property name="visible">True</property>
|
||||
<property name="model">filter_model</property>
|
||||
<signal name="selection_changed" handler="selection_changed"/>
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="activate-on-single-click">True</property>
|
||||
<signal name="item_activated" handler="item_activated"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="cell">
|
||||
@@ -156,12 +151,17 @@
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
@@ -169,12 +169,17 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
@@ -182,12 +187,17 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image3">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image3">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
@@ -195,12 +205,17 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image4">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image4">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">3</property>
|
||||
@@ -208,12 +223,17 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image5">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image5">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">4</property>
|
||||
|
||||
@@ -62,6 +62,7 @@ uninstall-update-icon-cache:
|
||||
|
||||
EXTRA_DIST += \
|
||||
widget-factory.ui \
|
||||
widget-factory.css \
|
||||
menus.ui \
|
||||
widget-factory.gresource.xml \
|
||||
data/source.svg \
|
||||
|
||||
@@ -1157,7 +1157,7 @@ activate (GApplication *app)
|
||||
g_type_ensure (my_text_view_get_type ());
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px; }", -1, NULL);
|
||||
gtk_css_provider_load_from_resource (provider, "/org/gtk/WidgetFactory/widget-factory.css");
|
||||
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||
@@ -1336,6 +1336,7 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkApplication *app;
|
||||
GAction *action;
|
||||
static GActionEntry app_entries[] = {
|
||||
{ "about", activate_about, NULL, NULL, NULL },
|
||||
{ "quit", activate_quit, NULL, NULL, NULL },
|
||||
@@ -1353,6 +1354,8 @@ main (int argc, char *argv[])
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "wine");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
|
||||
|
||||
9
demos/widget-factory/widget-factory.css
Normal file
9
demos/widget-factory/widget-factory.css
Normal file
@@ -0,0 +1,9 @@
|
||||
.circular-button {
|
||||
border-radius: 20px;
|
||||
outline-radius: 20px;
|
||||
}
|
||||
|
||||
.small-button {
|
||||
padding: 0;
|
||||
outline-width: 0;
|
||||
}
|
||||
@@ -3,6 +3,9 @@
|
||||
<gresource prefix="/org/gtk/WidgetFactory">
|
||||
<file preprocess="xml-stripblanks">widget-factory.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory">
|
||||
<file>widget-factory.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory/gtk">
|
||||
<file preprocess="xml-stripblanks">menus.ui</file>
|
||||
</gresource>
|
||||
|
||||
@@ -1060,6 +1060,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<object class="GtkFileChooserButton" id="filechooserbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="local_only">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -1570,9 +1571,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="title" translatable="yes">Icon</property>
|
||||
<property name="reorderable">True</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1">
|
||||
<property name="follow_state">true</property>
|
||||
</object>
|
||||
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
|
||||
<attributes>
|
||||
<attribute name="icon_name">1</attribute>
|
||||
</attributes>
|
||||
@@ -2895,6 +2894,15 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Search for it</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="label" translatable="yes">Insert</property>
|
||||
<property name="icon-name">insert-image</property>
|
||||
<property name="tooltip-text" translatable="yes">Insert something</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3073,9 +3081,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="selection_mode">multiple</property>
|
||||
<property name="model">iconsmodel</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="iconviewcell">
|
||||
<property name="follow-state">True</property>
|
||||
</object>
|
||||
<object class="GtkCellRendererPixbuf" id="iconviewcell"/>
|
||||
<attributes>
|
||||
<attribute name="icon-name">0</attribute>
|
||||
</attributes>
|
||||
@@ -3400,7 +3406,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkSidebar">
|
||||
<object class="GtkStackSidebar">
|
||||
<property name="visible">True</property>
|
||||
<property name="stack">sidebar_stack</property>
|
||||
</object>
|
||||
@@ -3621,6 +3627,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<property name="icon-size">1</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton1">
|
||||
@@ -3860,11 +3867,41 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="height-request">120</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-expand">True</property>
|
||||
<property name="tab-fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<style>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3872,11 +3909,41 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-expand">True</property>
|
||||
<property name="tab-fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<style>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -28,6 +28,7 @@ IGNORE_HFILES= \
|
||||
gdkprivate.h \
|
||||
gdk*private.h \
|
||||
keyname-table.h \
|
||||
wayland/xdg-shell-client-protocol.h \
|
||||
win32 \
|
||||
x11 \
|
||||
quartz
|
||||
|
||||
@@ -1288,12 +1288,25 @@ gdk_frame_get_type
|
||||
<SECTION>
|
||||
<FILE>gdkglcontext</FILE>
|
||||
GdkGLContext
|
||||
gdk_gl_context_get_display
|
||||
gdk_gl_context_get_window
|
||||
gdk_gl_context_make_current
|
||||
gdk_gl_context_clear_current
|
||||
gdk_gl_context_get_current
|
||||
GdkGLProfile
|
||||
gdk_gl_context_get_shared_context
|
||||
gdk_gl_context_get_version
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_gl_context_set_required_version
|
||||
gdk_gl_context_get_required_version
|
||||
gdk_gl_context_set_debug_enabled
|
||||
gdk_gl_context_get_debug_enabled
|
||||
gdk_gl_context_set_forward_compatible
|
||||
gdk_gl_context_get_forward_compatible
|
||||
|
||||
<SUBSECTION>
|
||||
GdkGLError
|
||||
gdk_gl_context_realize
|
||||
gdk_gl_context_make_current
|
||||
gdk_gl_context_get_current
|
||||
gdk_gl_context_clear_current
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_GL_CONTEXT
|
||||
|
||||
@@ -19,85 +19,217 @@ HFILE_GLOB=$(top_srcdir)/gtk/*.h
|
||||
CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||
|
||||
# Header files to ignore when scanning
|
||||
IGNORE_HFILES= \
|
||||
IGNORE_HFILES = \
|
||||
inspector \
|
||||
a11y \
|
||||
gtkaccelgroupprivate.h \
|
||||
gtkaccelmapprivate.h \
|
||||
gtkadjustmentprivate.h \
|
||||
gtkallocatedbitmaskprivate.h \
|
||||
gtkappchooserprivate.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbindingsprivate.h \
|
||||
gtkbitmaskprivate.h \
|
||||
gtkboxprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkbuttonprivate.h \
|
||||
gtkcairoblurprivate.h \
|
||||
gtkcellareaboxcontextprivate.h \
|
||||
gtkclipboardprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkcomboboxprivate.h \
|
||||
gtkcontainerprivate.h \
|
||||
gtkcssanimatedstyleprivate.h \
|
||||
gtkcssanimationprivate.h \
|
||||
gtkcssarrayvalueprivate.h \
|
||||
gtkcssbgsizevalueprivate.h \
|
||||
gtkcssbordervalueprivate.h \
|
||||
gtkcsscolorvalueprivate.h \
|
||||
gtkcsscornervalueprivate.h \
|
||||
gtkcsscustompropertyprivate.h \
|
||||
gtkcsseasevalueprivate.h \
|
||||
gtkcssenginevalueprivate.h \
|
||||
gtkcssenumvalueprivate.h \
|
||||
gtkcssiconthemevalueprivate.h \
|
||||
gtkcssimagebuiltinprivate.h \
|
||||
gtkcssimagecrossfadeprivate.h \
|
||||
gtkcssimagegradientprivate.h \
|
||||
gtkcssimageiconthemeprivate.h \
|
||||
gtkcssimagelinearprivate.h \
|
||||
gtkcssimageprivate.h \
|
||||
gtkcssimagescaledprivate.h \
|
||||
gtkcssimagesurfaceprivate.h \
|
||||
gtkcssimageurlprivate.h \
|
||||
gtkcssimagevalueprivate.h \
|
||||
gtkcssimagewin32private.h \
|
||||
gtkcssinheritvalueprivate.h \
|
||||
gtkcssinitialvalueprivate.h \
|
||||
gtkcsskeyframesprivate.h \
|
||||
gtkcsslookupprivate.h \
|
||||
gtkcssmatcherprivate.h \
|
||||
gtkcssnodedeclarationprivate.h \
|
||||
gtkcssnumbervalueprivate.h \
|
||||
gtkcssparserprivate.h \
|
||||
gtkcsspositionvalueprivate.h \
|
||||
gtkcssproviderprivate.h \
|
||||
gtkcssrepeatvalueprivate.h \
|
||||
gtkcssrgbavalueprivate.h \
|
||||
gtkcsssectionprivate.h \
|
||||
gtkcssselectorprivate.h \
|
||||
gtkcssshadowsvalueprivate.h \
|
||||
gtkcssshadowvalueprivate.h \
|
||||
gtkcssshorthandpropertyprivate.h\
|
||||
gtkcssstaticstyleprivate.h \
|
||||
gtkcssstringvalueprivate.h \
|
||||
gtkcssstylefuncsprivate.h \
|
||||
gtkcssstyleprivate.h \
|
||||
gtkcssstylepropertyprivate.h \
|
||||
gtkcsstransformvalueprivate.h \
|
||||
gtkcsstransitionprivate.h \
|
||||
gtkcsstypedvalueprivate.h \
|
||||
gtkcsstypesprivate.h \
|
||||
gtkcssunsetvalueprivate.h \
|
||||
gtkcssvalueprivate.h \
|
||||
gtkdialogprivate.h \
|
||||
gtkentryprivate.h \
|
||||
gtkeventcontrollerprivate.h \
|
||||
gtkfilechooserprivate.h \
|
||||
gtkfontchooserprivate.h \
|
||||
gtkgesturedragprivate.h \
|
||||
gtkgesturelongpressprivate.h \
|
||||
gtkgesturemultipressprivate.h \
|
||||
gtkgesturepanprivate.h \
|
||||
gtkgestureprivate.h \
|
||||
gtkgesturerotateprivate.h \
|
||||
gtkgesturesingleprivate.h \
|
||||
gtkgestureswipeprivate.h \
|
||||
gtkgesturezoomprivate.h \
|
||||
gtkheaderbarprivate.h \
|
||||
gtkhslaprivate.h \
|
||||
gtkiconhelperprivate.h \
|
||||
gtkiconviewprivate.h \
|
||||
gtkimageprivate.h \
|
||||
gtkimmoduleprivate.h \
|
||||
gtklabelprivate.h \
|
||||
gtklockbuttonprivate.h \
|
||||
gtkmagnifierprivate.h \
|
||||
gtkmenubuttonprivate.h \
|
||||
gtkmenuitemprivate.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmenushellprivate.h \
|
||||
gtkmodulesprivate.h \
|
||||
gtkmountoperationprivate.h \
|
||||
gtkorientableprivate.h \
|
||||
gtkpixelcacheprivate.h \
|
||||
gtkpopoverprivate.h \
|
||||
gtkprinter-private.h \
|
||||
gtkprintoperation-private.h \
|
||||
gtkprivate.h \
|
||||
gtkrangeprivate.h \
|
||||
gtkrecentchooserprivate.h \
|
||||
gtkrenderbackgroundprivate.h \
|
||||
gtkrenderborderprivate.h \
|
||||
gtkrendericonprivate.h \
|
||||
gtkrenderprivate.h \
|
||||
gtkroundedboxprivate.h \
|
||||
gtkscaleprivate.h \
|
||||
gtksearchentryprivate.h \
|
||||
gtkselectionprivate.h \
|
||||
gtksettingsprivate.h \
|
||||
gtksizegroup-private.h \
|
||||
gtksizerequestcacheprivate.h \
|
||||
gtksocketprivate.h \
|
||||
gtkstyleanimationprivate.h \
|
||||
gtkstylecascadeprivate.h \
|
||||
gtkstylecontextprivate.h \
|
||||
gtkstylepropertyprivate.h \
|
||||
gtkstyleproviderprivate.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextmarkprivate.h \
|
||||
gtktexttagprivate.h \
|
||||
gtktogglebuttonprivate.h \
|
||||
gtktoolbarprivate.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktooltipprivate.h \
|
||||
gtktreeprivate.h \
|
||||
gtkwidgetprivate.h \
|
||||
gtkwin32themeprivate.h \
|
||||
gtkwindowprivate.h \
|
||||
fnmatch.h \
|
||||
gtkactionmuxer.h \
|
||||
gtkactionobserver.h \
|
||||
gtkactionobservable.h \
|
||||
gtk9slice.h \
|
||||
gtkanimationdescription.h \
|
||||
gtkbitmaskprivateimpl.h \
|
||||
gtkbookmarksmanager.h \
|
||||
gtkdbusgenerated.c \
|
||||
gtkdbusgenerated.h \
|
||||
gtkdebug.h \
|
||||
gtkactionhelper.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkdndcursors.h \
|
||||
gtkentryprivate.h \
|
||||
gtkfilechooserdefault.h \
|
||||
gtkfilechooserembed.h \
|
||||
gtkfilechooserentry.h \
|
||||
gtkfilechooserprivate.h \
|
||||
gtkfilechoosersettings.h \
|
||||
gtkfilechooserutils.h \
|
||||
gtkfilesystem.h \
|
||||
gtkfilesystemmodel.h \
|
||||
gtkfilesystemunix.h \
|
||||
gtkfilesystemwin32.h \
|
||||
gtkfontchooserutils.h \
|
||||
gtkiconcache.h \
|
||||
gtkiconcachevalidator.h \
|
||||
gtkiconthemeparser.h \
|
||||
gtkintl.h \
|
||||
gtkkeyhash.h \
|
||||
gtkkineticscrolling.h \
|
||||
gtkmarshal.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmnemonichash.h \
|
||||
gtkmenutracker.h \
|
||||
gtkmenutrackeritem.h \
|
||||
gtkmenusectionbox.h \
|
||||
gtkmodelmenu.h \
|
||||
gtkmodelmenuitem.h \
|
||||
gtkmodifierstyle.h \
|
||||
gtkpathbar.h \
|
||||
gtkplugprivate.h \
|
||||
gtkprintbackend.h \
|
||||
gtkprinteroption.h \
|
||||
gtkprinteroptionset.h \
|
||||
gtkprinteroptionwidget.h \
|
||||
gtkprinter-private.h \
|
||||
gtkprint-win32.h \
|
||||
gtkprintutils.h \
|
||||
gtkprintoperation-private.h \
|
||||
gtkprivate.h \
|
||||
gtkprivatetypebuiltins.h \
|
||||
gtkquery.h \
|
||||
gtkrbtree.h \
|
||||
gtkrecentchooserdefault.h \
|
||||
gtkrecentchooserutils.h \
|
||||
gtkrecentchooserprivate.h \
|
||||
gtksearchengine.h \
|
||||
gtksearchenginebeagle.h \
|
||||
gtksearchenginetracker.h \
|
||||
gtksearchenginesimple.h \
|
||||
gtksearchenginequartz.h \
|
||||
gtksequence.h \
|
||||
gtksocketprivate.h \
|
||||
gtktextbtree.h \
|
||||
gtktextbufferserializ.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktextbufferserialize.h \
|
||||
gtktextdisplay.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextlayout.h \
|
||||
gtktextmarkprivate.h \
|
||||
gtktextsegment.h \
|
||||
gtktexttagprivate.h \
|
||||
gtktexttypes.h \
|
||||
gtktextutil.h \
|
||||
gtktimeline.h \
|
||||
gtkthemes.h \
|
||||
gtktrashmonitor.h \
|
||||
gtktrayicon.h \
|
||||
gtktreedatalist.h \
|
||||
gtktreeprivate.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktreemenu.h \
|
||||
gtktypebuiltins.h \
|
||||
gtkxembed.h \
|
||||
gtkwin32embed.h \
|
||||
@@ -129,6 +261,8 @@ GTKDOC_LIBS = \
|
||||
# Extra options to supply to gtkdoc-mkdb
|
||||
MKDB_OPTIONS=--output-format=xml --name-space=gtk
|
||||
|
||||
MKHTML_OPTIONS="--path=\"$(abs_srcdir):$(top_srcdir)/examples\""
|
||||
|
||||
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
|
||||
content_files = \
|
||||
version.xml \
|
||||
@@ -172,6 +306,7 @@ expand_content_files = \
|
||||
drawing-model.xml \
|
||||
getting_started.xml \
|
||||
glossary.xml \
|
||||
input-handling.xml \
|
||||
migrating-2to3.xml \
|
||||
migrating-checklist.sgml \
|
||||
migrating-unique-GtkApplication.xml \
|
||||
|
||||
@@ -5,6 +5,21 @@
|
||||
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<title>Getting Started with GTK+</title>
|
||||
|
||||
<para>GTK+ is a <ulink url="http://en.wikipedia.org/wiki/Widget_toolkit">
|
||||
widget toolkit</ulink>. Each user interface created by
|
||||
GTK+ consists of widgets. This is implemented in C using
|
||||
<link linkend="gobject">GObject</link>, an object-oriented framework for C.
|
||||
Widgets are organized in a hierachy. The window widget is the main container.
|
||||
The user interface is then built by adding buttons, drop-down menus, input
|
||||
fields, and other widgets to the window.
|
||||
If you are creating complex user interfaces it is recommended to
|
||||
use #GtkBuilder and its GTK-specific markup description language, instead of
|
||||
assembling the interface manually. You can also use a visual user interface
|
||||
editor, like <ulink url="https://glade.gnome.org/">Glade</ulink>.</para>
|
||||
|
||||
<para>GTK+ is event-driven. The toolkit listens for events such as
|
||||
a click on a button, and passes the event to your application.</para>
|
||||
|
||||
<para>This chapter contains some tutorial information to get you
|
||||
started with GTK+ programming. It assumes that you have GTK+, its
|
||||
dependencies and a C compiler installed and ready to use. If you
|
||||
@@ -15,8 +30,8 @@
|
||||
<section>
|
||||
<title>Basics</title>
|
||||
|
||||
<para>To begin our introduction to GTK, we'll start with the simplest
|
||||
program possible. This program will create an empty 200 × 200 pixel
|
||||
<para>To begin our introduction to GTK, we'll start with a simple
|
||||
signal-based Gtk application. This program will create an empty 200 × 200 pixel
|
||||
window.</para>
|
||||
|
||||
<informalfigure>
|
||||
@@ -28,7 +43,7 @@
|
||||
</informalfigure>
|
||||
|
||||
<informalexample>
|
||||
<para>Create a new file with the following content named example-0.c.</para>
|
||||
<para>Create a new file with the following content named <filename>example-0.c.</filename></para>
|
||||
<programlisting><xi:include href="../../../../examples/window-default.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</informalexample>
|
||||
|
||||
@@ -52,45 +67,66 @@
|
||||
by third party code. The compiler will abort with an error if any other
|
||||
header is directly included.</para></warning>
|
||||
|
||||
<para>We then proceed into the <function>main</function>() function of the
|
||||
application, and we declare a <varname>window</varname> variable as a pointer
|
||||
of type #GtkWidget.</para>
|
||||
<para>In a GTK+ application, the purpose of the main() function is to
|
||||
create a #GtkApplication object and run it. In this example a
|
||||
#GtkApplication pointer named <varname>app</varname> is called and then
|
||||
initialized using gtk_application_new().</para>
|
||||
|
||||
<para>The following line will call gtk_init(), which
|
||||
is the initialization function for GTK+; this function will set up GTK+,
|
||||
the type system, the connection to the windowing environment, etc. The
|
||||
gtk_init() takes as arguments the pointers to the command line arguments
|
||||
<para>When creating a #GtkApplication
|
||||
you need to pick an application identifier (a name)
|
||||
and input to gtk_application_new() as parameter.
|
||||
For this example <varname>org.gtk.example</varname> is used
|
||||
but for choosing an identifier for your application see
|
||||
<ulink url="https://wiki.gnome.org/HowDoI/ChooseApplicationID">this guide</ulink>.
|
||||
Lastly gtk_application_new() takes a GApplicationFlags as input for your
|
||||
application, if your application would have special needs.
|
||||
</para>
|
||||
|
||||
<para>Next the
|
||||
<ulink url="https://wiki.gnome.org/HowDoI/GtkApplication">activate signal</ulink>
|
||||
is connected to the activate() function above the main() functions.
|
||||
The <varname>activate</varname> signal will be sent
|
||||
when your application is launched with
|
||||
g_application_run() on the line below.
|
||||
The gtk_application_run() also takes as arguments the pointers to the command line arguments
|
||||
counter and string array; this allows GTK+ to parse specific command line
|
||||
arguments that control the behavior of GTK+ itself. The parsed arguments
|
||||
will be removed from the array, leaving the unrecognized ones for your
|
||||
application to parse.</para>
|
||||
application to parse.
|
||||
</para>
|
||||
|
||||
<note><para>For more information on which command line arguments GTK+
|
||||
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
|
||||
Applications</link> section in this reference.</para></note>
|
||||
<para>Within g_application_run the activate() signal is sent and
|
||||
we then proceed into the <function>activate</function>() function of the
|
||||
application. Inside the activate() function we want to construct
|
||||
our GTK window, so that a window is shown when the application
|
||||
is launched. The call to gtk_application_window_new() will
|
||||
create a new #GtkWindow and store it inside the
|
||||
<varname>window</varname> pointer. The window will have a frame,
|
||||
a title bar, and window controls depending on the platform.</para>
|
||||
|
||||
<para>The call to gtk_window_new() will create a new #GtkWindow and store
|
||||
it inside the <varname>window</varname> variable. The type of the window
|
||||
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
|
||||
by the windowing system: it will have a frame, a title bar and window
|
||||
controls, depending on the platform.</para>
|
||||
<para>A window title is set using gtk_window_set_title(). This function
|
||||
takes a GtkWindow* pointer and a string as input. As our
|
||||
<varname>window</varname> pointer is a GtkWidget pointer, we need to cast it
|
||||
to GtkWindow*.
|
||||
But instead of casting <varname>window</varname> via
|
||||
<varname>(GtkWindow*)</varname>,
|
||||
<varname>window</varname> can be cast using the macro
|
||||
<varname>GTK_WINDOW()</varname>.
|
||||
<varname>GTK_WINDOW()</varname> will check if the
|
||||
pointer is an instance of the GtkWindow class, before casting, and emit a
|
||||
warning if the check fails. More information about this convention
|
||||
can be found
|
||||
<ulink url="https://developer.gnome.org/gobject/stable/gtype-conventions.html">
|
||||
here</ulink>.</para>
|
||||
|
||||
<para>In order to terminate the application when the #GtkWindow is
|
||||
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
|
||||
function. This function will terminate the GTK+ main loop started by calling
|
||||
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
|
||||
destroyed, either by explicitly calling gtk_widget_destroy() or when the
|
||||
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
|
||||
the Close window control button is clicked.</para>
|
||||
<para>Finally the window size is set using gtk_window_set_default_size and
|
||||
the window is then shown by GTK via gtk_widget_show_all().</para>
|
||||
|
||||
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
|
||||
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
|
||||
can be displayed. All this work is done after the main loop has been
|
||||
started.</para>
|
||||
|
||||
<para>The last line of interest is the call to gtk_main(). This function will
|
||||
start the GTK+ main loop and will block the control flow of the
|
||||
main() until the gtk_main_quit() function is called.</para>
|
||||
<para>When you exit the window, by for example pressing the X,
|
||||
the g_application_run() in the main loop returns with a number
|
||||
which is saved inside an integer named "status". Afterwards, the
|
||||
#GtkApplication object is freed from memory with g_object_unref().
|
||||
Finally the status integer is returned and the GTK application exits.</para>
|
||||
|
||||
<para>While the program is running, GTK+ is receiving
|
||||
<firstterm>events</firstterm>. These are typically input events caused by
|
||||
@@ -129,13 +165,53 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<para>As seen above, example-1.c builds further upon example-0.c by adding a
|
||||
button to our window, with the label "Hello World". Two new GtkWidget pointers
|
||||
are declared to accomplish this, <varname>button</varname> and
|
||||
<varname>button_box</varname>. The button_box variable is created to store a
|
||||
#GtkButtonBox which is GTK+'s way of controlling the size and layout of buttons.
|
||||
The #GtkButtonBox is created and assigned to gtk_button_box_new() which takes a
|
||||
#GtkOrientation enum as parameter. The buttons which this box will contain can
|
||||
either be stored horizontally or vertically but this does not matter in this
|
||||
particular case as we are dealing with only one button. After initializing
|
||||
button_box with horizontal orientation, the code adds the button_box widget to the
|
||||
window widget using gtk_container_add().</para>
|
||||
|
||||
<para>Next the <varname>button</varname> variable is initialized in similar manner.
|
||||
gtk_button_new_with_label() is called which returns a GtkButton to be stored inside
|
||||
<varname>button</varname>. Afterwards <varname>button</varname> is added to
|
||||
our <varname>button_box</varname>.
|
||||
Using g_signal_connect the button is connected to a function in our app called
|
||||
print_hello(), so that when the button is clicked, GTK will call this function.
|
||||
As the print_hello() function does not use any data as input, NULL is passed
|
||||
to it. print_hello() calls g_print() with the string "Hello World"
|
||||
which will print Hello World in a terminal if the GTK application was started
|
||||
from one.</para>
|
||||
|
||||
<para>After connecting print_hello(), another signal is connected to the "clicked" state
|
||||
of the button using g_signal_connect_swapped(). This functions is similar to
|
||||
a g_signal_connect() with the difference lying in how the callback function is
|
||||
treated. g_signal_connect_swapped() allow you to specify what the callback
|
||||
function should take as parameter by letting you pass it as data. In this case
|
||||
the function being called back is gtk_widget_destroy() and the <varname>window</varname>
|
||||
pointer is passed to it. This has the effect that when the button is clicked,
|
||||
the whole GTK window is destroyed. In contrast if a normal g_signal_connect() were used
|
||||
to connect the "clicked" signal with gtk_widget_destroy(), then the <varname>button</varname>
|
||||
itself would have been destroyed, not the window.
|
||||
More information about creating buttons can be found
|
||||
<ulink url="https://wiki.gnome.org/HowDoI/Buttons">here</ulink>.
|
||||
</para>
|
||||
|
||||
<para>The rest of the code in example-1.c is identical to example-0.c. Next
|
||||
section will elaborate further on how to add several GtkWidgets to your GTK
|
||||
application.</para>
|
||||
|
||||
<section>
|
||||
<title>Packing</title>
|
||||
|
||||
<para>When creating an application, you'll want to put more than one widget
|
||||
inside a window. Our first helloworld example only used one widget so we
|
||||
could simply use a gtk_container_add() call to "pack" the widget into the
|
||||
window. But when you want to put more than one widget into a window, it
|
||||
inside a window.
|
||||
When you want to put more than one widget into a window, it
|
||||
it becomes important to control how each widget is positioned and sized.
|
||||
This is where packing comes in.</para>
|
||||
|
||||
@@ -167,51 +243,6 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Drawing</title>
|
||||
|
||||
<para>Many widgets, like buttons, do all their drawing themselves. You
|
||||
just tell them the label you want to see, and they figure out what font
|
||||
to use, draw the button outline and focus rectangle, etc. Sometimes, it
|
||||
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
|
||||
might be the right widget to use. It offers a canvas on which you can
|
||||
draw by connecting to the #GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
<para>The following example shows a ::draw signal handler. It is a bit
|
||||
more complicated than the previous examples, since it also demonstrates
|
||||
input event handling by means of ::button-press and ::motion-notify
|
||||
handlers.</para>
|
||||
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="drawing.png" format="PNG"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</informalfigure>
|
||||
|
||||
<example id="gtk-getting-started-drawing">
|
||||
<title>Drawing in response to input</title>
|
||||
<para>Create a new file with the following content named example-3.c.</para>
|
||||
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o example-3 example-3.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Building user interfaces</title>
|
||||
|
||||
@@ -1006,4 +1037,50 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
here.</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Custom Drawing</title>
|
||||
|
||||
<para>Many widgets, like buttons, do all their drawing themselves. You
|
||||
just tell them the label you want to see, and they figure out what font
|
||||
to use, draw the button outline and focus rectangle, etc. Sometimes, it
|
||||
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
|
||||
might be the right widget to use. It offers a canvas on which you can
|
||||
draw by connecting to the #GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
<para>The following example shows a ::draw signal handler. It is a bit
|
||||
more complicated than the previous examples, since it also demonstrates
|
||||
input event handling by means of ::button-press and ::motion-notify
|
||||
handlers.</para>
|
||||
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="drawing.png" format="PNG"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</informalfigure>
|
||||
|
||||
<example id="gtk-getting-started-drawing">
|
||||
<title>Drawing in response to input</title>
|
||||
<para>Create a new file with the following content named example-3.c.</para>
|
||||
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o example-3 example-3.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<xi:include href="resources.sgml" />
|
||||
<xi:include href="xml/question_index.sgml" />
|
||||
<xi:include href="drawing-model.xml" />
|
||||
<xi:include href="input-handling.xml" />
|
||||
<xi:include href="xml/input-handling.xml" />
|
||||
</part>
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<xi:include href="xml/gtkflowbox.xml" />
|
||||
<xi:include href="xml/gtkstack.xml" />
|
||||
<xi:include href="xml/gtkstackswitcher.xml" />
|
||||
<xi:include href="xml/gtksidebar.xml" />
|
||||
<xi:include href="xml/gtkstacksidebar.xml" />
|
||||
<xi:include href="xml/gtkactionbar.xml" />
|
||||
<xi:include href="xml/gtkheaderbar.xml" />
|
||||
<xi:include href="xml/gtkoverlay.xml" />
|
||||
|
||||
@@ -329,6 +329,7 @@ GTK_ADJUSTMENT_CLASS
|
||||
GTK_IS_ADJUSTMENT_CLASS
|
||||
GTK_ADJUSTMENT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkAdjustmentPrivate
|
||||
gtk_adjustment_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -550,12 +551,13 @@ gtk_list_box_set_header_func
|
||||
gtk_list_box_set_sort_func
|
||||
gtk_list_box_drag_highlight_row
|
||||
gtk_list_box_drag_unhighlight_row
|
||||
GtkListBoxCreateWidgetFunc
|
||||
gtk_list_box_bind_model
|
||||
|
||||
gtk_list_box_row_new
|
||||
gtk_list_box_row_changed
|
||||
gtk_list_box_row_is_selected
|
||||
gtk_list_box_row_get_header
|
||||
gtk_list_box_row_get_type
|
||||
gtk_list_box_row_set_header
|
||||
gtk_list_box_row_get_index
|
||||
gtk_list_box_row_set_activatable
|
||||
@@ -564,6 +566,12 @@ gtk_list_box_row_set_selectable
|
||||
gtk_list_box_row_get_selectable
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_LIST_BOX
|
||||
GTK_LIST_BOX_CLASS
|
||||
GTK_LIST_BOX_GET_CLASS
|
||||
GTK_LIST_BOX_ROW
|
||||
GTK_LIST_BOX_ROW_CLASS
|
||||
GTK_LIST_BOX_ROW_GET_CLASS
|
||||
GTK_IS_LIST_BOX
|
||||
GTK_IS_LIST_BOX_CLASS
|
||||
GTK_IS_LIST_BOX_ROW
|
||||
@@ -1118,6 +1126,7 @@ gtk_editable_get_type
|
||||
<FILE>gtkentry</FILE>
|
||||
<TITLE>GtkEntry</TITLE>
|
||||
GtkEntry
|
||||
GtkEntryClass
|
||||
gtk_entry_new
|
||||
gtk_entry_new_with_buffer
|
||||
gtk_entry_get_buffer
|
||||
@@ -1206,6 +1215,8 @@ GTK_ENTRY_CLASS
|
||||
GTK_IS_ENTRY_CLASS
|
||||
GTK_ENTRY_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_TEXT_HANDLE_POSITION
|
||||
GTK_TYPE_TEXT_HANDLE_MODE
|
||||
GtkEntryPrivate
|
||||
gtk_entry_get_type
|
||||
</SECTION>
|
||||
@@ -1302,6 +1313,7 @@ GTK_EVENT_BOX_CLASS
|
||||
GTK_IS_EVENT_BOX_CLASS
|
||||
GTK_EVENT_BOX_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkEventBoxPrivate
|
||||
gtk_event_box_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -1633,6 +1645,7 @@ GTK_IS_FONT_CHOOSER_IFACE
|
||||
GTK_FONT_CHOOSER_GET_IFACE
|
||||
|
||||
<SUBSECTION Private>
|
||||
GTK_FONT_CHOOSER_DELEGATE_QUARK
|
||||
gtk_font_chooser_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2235,6 +2248,7 @@ GTK_MENU_CLASS
|
||||
GTK_IS_MENU_CLASS
|
||||
GTK_MENU_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuPrivate
|
||||
gtk_menu_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2287,7 +2301,7 @@ GTK_IS_MENU_BUTTON
|
||||
GTK_IS_MENU_BUTTON_CLASS
|
||||
GTK_MENU_BUTTON_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuButtonrPrivate
|
||||
GtkMenuButtonPrivate
|
||||
gtk_menu_button_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2324,6 +2338,7 @@ GTK_MENU_ITEM_CLASS
|
||||
GTK_IS_MENU_ITEM_CLASS
|
||||
GTK_MENU_ITEM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuItemPrivate
|
||||
gtk_menu_item_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2390,6 +2405,7 @@ GTK_MENU_SHELL_CLASS
|
||||
GTK_IS_MENU_SHELL_CLASS
|
||||
GTK_MENU_SHELL_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuShellPrivate
|
||||
gtk_menu_shell_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2483,6 +2499,7 @@ gtk_notebook_prepend_page_menu
|
||||
gtk_notebook_insert_page
|
||||
gtk_notebook_insert_page_menu
|
||||
gtk_notebook_remove_page
|
||||
gtk_notebook_detach_tab
|
||||
gtk_notebook_page_num
|
||||
gtk_notebook_next_page
|
||||
gtk_notebook_prev_page
|
||||
@@ -2557,6 +2574,7 @@ GTK_IS_NUMERABLE_ICON_CLASS
|
||||
GTK_NUMERABLE_ICON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkNumerableIconPrivate
|
||||
gtk_numerable_icon_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -3198,6 +3216,7 @@ gtk_search_bar_get_type
|
||||
<TITLE>GtkSearchEntry</TITLE>
|
||||
GtkSearchEntry
|
||||
gtk_search_entry_new
|
||||
gtk_search_entry_handle_event
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_SEARCH_ENTRY
|
||||
GTK_SEARCH_ENTRY
|
||||
@@ -3272,6 +3291,7 @@ GTK_SETTINGS_CLASS
|
||||
GTK_SETTINGS_GET_CLASS
|
||||
GTK_TYPE_SETTINGS
|
||||
<SUBSECTION Private>
|
||||
GtkSettingsPrivate
|
||||
gtk_settings_get_type
|
||||
GtkSettingsPropertyValue
|
||||
</SECTION>
|
||||
@@ -3317,6 +3337,7 @@ GTK_SOCKET_CLASS
|
||||
GTK_IS_SOCKET_CLASS
|
||||
GTK_SOCKET_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkSocketPrivate
|
||||
gtk_socket_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4371,6 +4392,7 @@ gtk_tree_model_row_inserted
|
||||
gtk_tree_model_row_has_child_toggled
|
||||
gtk_tree_model_row_deleted
|
||||
gtk_tree_model_rows_reordered
|
||||
gtk_tree_model_rows_reordered_with_length
|
||||
<SUBSECTION Standard>
|
||||
GTK_TREE_MODEL
|
||||
GTK_IS_TREE_MODEL
|
||||
@@ -4407,6 +4429,7 @@ GTK_TREE_MODEL_SORT_CLASS
|
||||
GTK_IS_TREE_MODEL_SORT_CLASS
|
||||
GTK_TREE_MODEL_SORT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeModelSortPrivate
|
||||
gtk_tree_model_sort_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4474,6 +4497,7 @@ GTK_TREE_SELECTION_CLASS
|
||||
GTK_TREE_SELECTION_GET_CLASS
|
||||
GTK_IS_TREE_SELECTION_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeSelectionPrivate
|
||||
gtk_tree_selection_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4564,6 +4588,7 @@ GTK_TREE_STORE_CLASS
|
||||
GTK_IS_TREE_STORE_CLASS
|
||||
GTK_TREE_STORE_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeStorePrivate
|
||||
gtk_tree_store_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4634,6 +4659,7 @@ GTK_TREE_VIEW_COLUMN_CLASS
|
||||
GTK_IS_TREE_VIEW_COLUMN_CLASS
|
||||
GTK_TREE_VIEW_COLUMN_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeViewColumnPrivate
|
||||
gtk_tree_view_column_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4849,6 +4875,7 @@ gtk_cell_area_get_current_path_string
|
||||
gtk_cell_area_apply_attributes
|
||||
gtk_cell_area_attribute_connect
|
||||
gtk_cell_area_attribute_disconnect
|
||||
gtk_cell_area_attribute_get_column
|
||||
gtk_cell_area_class_install_cell_property
|
||||
gtk_cell_area_class_find_cell_property
|
||||
gtk_cell_area_class_list_cell_properties
|
||||
@@ -4986,6 +5013,7 @@ GTK_IS_CELL_RENDERER_CLASS
|
||||
GTK_CELL_RENDERER_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkCellRendererPrivate
|
||||
GtkCellRendererClassPrivate
|
||||
gtk_cell_renderer_get_type
|
||||
gtk_cell_renderer_mode_get_type
|
||||
gtk_cell_renderer_state_get_type
|
||||
@@ -5624,6 +5652,7 @@ GTK_IS_WIDGET_CLASS
|
||||
GTK_WIDGET_GET_CLASS
|
||||
GTK_TYPE_REQUISITION
|
||||
<SUBSECTION Private>
|
||||
GtkWidgetClassPrivate
|
||||
GtkWidgetPrivate
|
||||
gtk_widget_get_type
|
||||
gtk_requisition_get_type
|
||||
@@ -5791,6 +5820,7 @@ GTK_WINDOW_GROUP
|
||||
GTK_WINDOW_GROUP_CLASS
|
||||
GTK_WINDOW_GROUP_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkWindowGroupPrivate
|
||||
gtk_window_group_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -5859,6 +5889,11 @@ gtk_get_micro_version
|
||||
gtk_get_binary_age
|
||||
gtk_get_interface_age
|
||||
gtk_check_version
|
||||
gtk_major_version
|
||||
gtk_minor_version
|
||||
gtk_micro_version
|
||||
gtk_binary_age
|
||||
gtk_interface_age
|
||||
|
||||
<SUBSECTION>
|
||||
GTK_MAJOR_VERSION
|
||||
@@ -5966,6 +6001,7 @@ GTK_STYLE_PROPERTIES
|
||||
GTK_STYLE_PROPERTIES_CLASS
|
||||
GTK_STYLE_PROPERTIES_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkStylePropertiesPrivate
|
||||
gtk_style_properties_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -5993,6 +6029,7 @@ GTK_STYLE_CLASS_BUTTON
|
||||
GTK_STYLE_CLASS_CALENDAR
|
||||
GTK_STYLE_CLASS_CELL
|
||||
GTK_STYLE_CLASS_COMBOBOX_ENTRY
|
||||
GTK_STYLE_CLASS_CONTEXT_MENU
|
||||
GTK_STYLE_CLASS_CHECK
|
||||
GTK_STYLE_CLASS_CSD
|
||||
GTK_STYLE_CLASS_CURSOR_HANDLE
|
||||
@@ -6033,12 +6070,14 @@ GTK_STYLE_CLASS_OVERSHOOT
|
||||
GTK_STYLE_CLASS_PANE_SEPARATOR
|
||||
GTK_STYLE_CLASS_PAPER
|
||||
GTK_STYLE_CLASS_POPUP
|
||||
GTK_STYLE_CLASS_POPOVER
|
||||
GTK_STYLE_CLASS_PRIMARY_TOOLBAR
|
||||
GTK_STYLE_CLASS_PROGRESSBAR
|
||||
GTK_STYLE_CLASS_PULSE
|
||||
GTK_STYLE_CLASS_QUESTION
|
||||
GTK_STYLE_CLASS_RADIO
|
||||
GTK_STYLE_CLASS_RAISED
|
||||
GTK_STYLE_CLASS_READ_ONLY
|
||||
GTK_STYLE_CLASS_RIGHT
|
||||
GTK_STYLE_CLASS_RUBBERBAND
|
||||
GTK_STYLE_CLASS_SCALE
|
||||
@@ -6058,6 +6097,7 @@ GTK_STYLE_CLASS_TITLE
|
||||
GTK_STYLE_CLASS_TITLEBAR
|
||||
GTK_STYLE_CLASS_TOOLBAR
|
||||
GTK_STYLE_CLASS_TOOLTIP
|
||||
GTK_STYLE_CLASS_TOUCH_SELECTION
|
||||
GTK_STYLE_CLASS_TOP
|
||||
GTK_STYLE_CLASS_TROUGH
|
||||
GTK_STYLE_CLASS_UNDERSHOOT
|
||||
@@ -6166,6 +6206,7 @@ GTK_IS_STYLE_CONTEXT_CLASS
|
||||
GTK_TYPE_BORDER
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkStyleContextPrivate
|
||||
gtk_style_context_get_type
|
||||
gtk_border_get_type
|
||||
</SECTION>
|
||||
@@ -6204,6 +6245,8 @@ GTK_CSS_PROVIDER_GET_CLASS
|
||||
GTK_IS_CSS_PROVIDER
|
||||
GTK_IS_CSS_PROVIDER_CLASS
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_CSS_SECTION
|
||||
GtkCssProviderPrivate
|
||||
gtk_css_provider_get_type
|
||||
gtk_css_provider_error_quark
|
||||
gtk_css_section_get_type
|
||||
@@ -6475,6 +6518,7 @@ GtkClipboardClearFunc
|
||||
gtk_clipboard_get
|
||||
gtk_clipboard_get_for_display
|
||||
gtk_clipboard_get_display
|
||||
gtk_clipboard_get_default
|
||||
gtk_clipboard_set_with_data
|
||||
gtk_clipboard_set_with_owner
|
||||
gtk_clipboard_get_owner
|
||||
@@ -6534,6 +6578,7 @@ gtk_drag_unhighlight
|
||||
<SUBSECTION Source Side>
|
||||
gtk_drag_begin
|
||||
gtk_drag_begin_with_coordinates
|
||||
gtk_drag_cancel
|
||||
gtk_drag_set_icon_widget
|
||||
gtk_drag_set_icon_pixbuf
|
||||
gtk_drag_set_icon_stock
|
||||
@@ -6715,6 +6760,8 @@ GTK_STOCK_ZOOM_100
|
||||
GTK_STOCK_ZOOM_FIT
|
||||
GTK_STOCK_ZOOM_IN
|
||||
GTK_STOCK_ZOOM_OUT
|
||||
<SUBSECTION Private>
|
||||
GtkStock
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -6776,6 +6823,7 @@ gtk_icon_info_get_attach_points
|
||||
gtk_icon_info_get_display_name
|
||||
gtk_icon_info_is_symbolic
|
||||
<SUBSECTION Standard>
|
||||
GtkIconInfoClass
|
||||
GTK_ICON_THEME
|
||||
GTK_IS_ICON_THEME
|
||||
GTK_TYPE_ICON_THEME
|
||||
@@ -6785,6 +6833,11 @@ GTK_IS_ICON_THEME_CLASS
|
||||
GTK_ICON_THEME_GET_CLASS
|
||||
gtk_icon_info_get_type
|
||||
GTK_TYPE_ICON_INFO
|
||||
GTK_ICON_INFO
|
||||
GTK_ICON_INFO_CLASS
|
||||
GTK_ICON_INFO_GET_CLASS
|
||||
GTK_IS_ICON_INFO
|
||||
GTK_IS_ICON_INFO_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkIconThemePrivate
|
||||
gtk_icon_theme_error_quark
|
||||
@@ -7149,6 +7202,7 @@ gtk_print_settings_get_type
|
||||
<TITLE>GtkPaperSize</TITLE>
|
||||
GtkPaperSize
|
||||
GtkUnit
|
||||
GTK_UNIT_PIXEL
|
||||
GTK_PAPER_NAME_A3
|
||||
GTK_PAPER_NAME_A4
|
||||
GTK_PAPER_NAME_A5
|
||||
@@ -7803,6 +7857,7 @@ GTK_IS_ACTION_BAR_CLASS
|
||||
GTK_ACTION_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkActionBarPrivate
|
||||
gtk_action_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7835,6 +7890,7 @@ GTK_IS_HEADER_BAR_CLASS
|
||||
GTK_HEADER_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkHeaderBarPrivate
|
||||
gtk_header_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7863,6 +7919,14 @@ GtkStackTransitionType
|
||||
gtk_stack_set_transition_type
|
||||
gtk_stack_get_transition_type
|
||||
gtk_stack_get_transition_running
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK
|
||||
GTK_IS_STACK
|
||||
GTK_IS_STACK_CLASS
|
||||
GTK_STACK
|
||||
GTK_STACK_CLASS
|
||||
GTK_STACK_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_stack_get_type
|
||||
</SECTION>
|
||||
@@ -7874,6 +7938,14 @@ GtkStackSwitcher
|
||||
gtk_stack_switcher_new
|
||||
gtk_stack_switcher_set_stack
|
||||
gtk_stack_switcher_get_stack
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK_SWITCHER
|
||||
GTK_IS_STACK_SWITCHER
|
||||
GTK_IS_STACK_SWITCHER_CLASS
|
||||
GTK_STACK_SWITCHER
|
||||
GTK_STACK_SWITCHER_CLASS
|
||||
GTK_STACK_SWITCHER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_stack_switcher_get_type
|
||||
</SECTION>
|
||||
@@ -7892,6 +7964,15 @@ gtk_revealer_set_transition_duration
|
||||
GtkRevealerTransitionType
|
||||
gtk_revealer_get_transition_type
|
||||
gtk_revealer_set_transition_type
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_REVEALER
|
||||
GTK_IS_REVEALER
|
||||
GTK_IS_REVEALER_CLASS
|
||||
GTK_REVEALER
|
||||
GTK_REVEALER_CLASS
|
||||
GTK_REVEALER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_revealer_get_type
|
||||
</SECTION>
|
||||
@@ -7943,6 +8024,24 @@ gtk_flow_box_child_new
|
||||
gtk_flow_box_child_get_index
|
||||
gtk_flow_box_child_is_selected
|
||||
gtk_flow_box_child_changed
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkFlowBoxChildClass
|
||||
GTK_TYPE_FLOW_BOX
|
||||
GTK_TYPE_FLOW_BOX_CHILD
|
||||
GTK_FLOW_BOX
|
||||
GTK_FLOW_BOX_CLASS
|
||||
GTK_FLOW_BOX_GET_CLASS
|
||||
GTK_IS_FLOW_BOX
|
||||
GTK_IS_FLOW_BOX_CLASS
|
||||
GTK_FLOW_BOX_CHILD
|
||||
GTK_FLOW_BOX_CHILD_CLASS
|
||||
GTK_FLOW_BOX_CHILD_GET_CLASS
|
||||
GTK_IS_FLOW_BOX_CHILD
|
||||
GTK_IS_FLOW_BOX_CHILD_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_flow_box_get_type
|
||||
gtk_flow_box_child_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -7960,7 +8059,20 @@ gtk_popover_set_position
|
||||
gtk_popover_get_position
|
||||
gtk_popover_set_modal
|
||||
gtk_popover_get_modal
|
||||
gtk_popover_set_transitions_enabled
|
||||
gtk_popover_get_transitions_enabled
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER
|
||||
GTK_IS_POPOVER
|
||||
GTK_IS_POPOVER_CLASS
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER
|
||||
GTK_POPOVER_CLASS
|
||||
GTK_POPOVER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkPopoverPrivate
|
||||
gtk_popover_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7970,6 +8082,15 @@ gtk_popover_get_type
|
||||
GtkPopoverMenu
|
||||
gtk_popover_menu_new
|
||||
gtk_popover_menu_open_submenu
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU
|
||||
GTK_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_popover_menu_get_type
|
||||
</SECTION>
|
||||
@@ -7980,6 +8101,12 @@ gtk_popover_menu_get_type
|
||||
GtkModelButton
|
||||
GtkButtonRole
|
||||
gtk_model_button_new
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_MODEL_BUTTON
|
||||
GTK_MODEL_BUTTON
|
||||
GTK_IS_MODEL_BUTTON
|
||||
<SUBSECTION Private>
|
||||
gtk_model_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -7999,6 +8126,7 @@ GTK_EVENT_CONTROLLER
|
||||
GTK_EVENT_CONTROLLER_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER
|
||||
GTK_EVENT_CONTROLLER_GET_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkEventControllerPriv
|
||||
@@ -8208,24 +8336,24 @@ gtk_gesture_zoom_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtksidebar</FILE>
|
||||
GtkSidebar
|
||||
GtkSidebarClass
|
||||
gtk_sidebar_new
|
||||
gtk_sidebar_set_stack
|
||||
gtk_sidebar_get_stack
|
||||
<FILE>gtkstacksidebar</FILE>
|
||||
GtkStackSidebar
|
||||
GtkStackSidebarClass
|
||||
gtk_stack_sidebar_new
|
||||
gtk_stack_sidebar_set_stack
|
||||
gtk_stack_sidebar_get_stack
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_SIDEBAR
|
||||
GTK_SIDEBAR
|
||||
GTK_SIDEBAR_CLASS
|
||||
GTK_IS_SIDEBAR
|
||||
GTK_IS_SIDEBAR_CLASS
|
||||
GTK_SIDEBAR_GET_CLASS
|
||||
GTK_TYPE_STACK_SIDEBAR
|
||||
GTK_STACK_SIDEBAR
|
||||
GTK_STACK_SIDEBAR_CLASS
|
||||
GTK_IS_STACK_SIDEBAR
|
||||
GTK_IS_STACK_SIDEBAR_CLASS
|
||||
GTK_STACK_SIDEBAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkSidebarPrivate
|
||||
gtk_sidebar_get_type
|
||||
GtkStackSidebarPrivate
|
||||
gtk_stack_sidebar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -8236,10 +8364,9 @@ gtk_gl_area_new
|
||||
gtk_gl_area_get_context
|
||||
gtk_gl_area_make_current
|
||||
gtk_gl_area_queue_render
|
||||
gtk_gl_area_attach_buffers
|
||||
gtk_gl_area_set_error
|
||||
gtk_gl_area_get_error
|
||||
gtk_gl_area_set_profile
|
||||
gtk_gl_area_get_profile
|
||||
<SUBSECTION>
|
||||
gtk_gl_area_set_has_alpha
|
||||
gtk_gl_area_get_has_alpha
|
||||
@@ -8249,10 +8376,13 @@ gtk_gl_area_set_has_stencil_buffer
|
||||
gtk_gl_area_get_has_stencil_buffer
|
||||
gtk_gl_area_set_auto_render
|
||||
gtk_gl_area_get_auto_render
|
||||
gtk_gl_area_get_required_version
|
||||
gtk_gl_area_set_required_version
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_GL_AREA
|
||||
GTK_GL_AREA
|
||||
GTK_GL_AREA_CLASS
|
||||
GTK_GL_AREA_GET_CLASS
|
||||
GTK_IS_GL_AREA
|
||||
GTK_IS_GL_AREA_CLASS
|
||||
<SUBSECTION Private>
|
||||
|
||||
@@ -173,7 +173,7 @@ gtk_separator_get_type
|
||||
gtk_separator_menu_item_get_type
|
||||
gtk_separator_tool_item_get_type
|
||||
gtk_settings_get_type
|
||||
gtk_sidebar_get_type
|
||||
gtk_stack_sidebar_get_type
|
||||
gtk_size_group_get_type
|
||||
@ENABLE_ON_X11@gtk_socket_get_type
|
||||
gtk_spin_button_get_type
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
]>
|
||||
<refentry id="chap-input-handling">
|
||||
<refmeta>
|
||||
<refentrytitle>The GTK+ Input Handling Model</refentrytitle>
|
||||
<refentrytitle>The GTK+ Input and Event Handling Model</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>The GTK+ Input Handling Model</refname>
|
||||
<refname>The GTK+ Input and Event Handling Model</refname>
|
||||
<refpurpose>
|
||||
GTK+ input handling in detail
|
||||
GTK+ input and event handling in detail
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
|
||||
<refsect1 id="input-overview">
|
||||
<title>Overview of GTK+ input handling</title>
|
||||
<title>Overview of GTK+ input and event handling</title>
|
||||
|
||||
<para>
|
||||
This chapter describes in detail how GTK+ handles input. If you are interested
|
||||
@@ -64,20 +64,20 @@
|
||||
GDK translates these raw windowing system events into #GdkEvents.
|
||||
Typical input events are:
|
||||
<simplelist>
|
||||
<member>GdkEventButton</member>
|
||||
<member>GdkEventMotion</member>
|
||||
<member>GdkEventCrossing</member>
|
||||
<member>GdkEventKey</member>
|
||||
<member>GdkEventFocus</member>
|
||||
<member>GdkEventTouch</member>
|
||||
<member>#GdkEventButton</member>
|
||||
<member>#GdkEventMotion</member>
|
||||
<member>#GdkEventCrossing</member>
|
||||
<member>#GdkEventKey</member>
|
||||
<member>#GdkEventFocus</member>
|
||||
<member>#GdkEventTouch</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
<para>
|
||||
Additionally, GDK/GTK synthesizes other signals to let know whether
|
||||
grabs (system-wide or in-app) are taking input away:
|
||||
<simplelist>
|
||||
<member>GdkEventGrabBroken</member>
|
||||
<member>GtkWidget::grab-notify</member>
|
||||
<member>#GdkEventGrabBroken</member>
|
||||
<member>#GtkWidget::grab-notify</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -87,80 +87,167 @@
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<refsect2 id="event-propagation">
|
||||
<title>Event propagation</title>
|
||||
|
||||
<para>
|
||||
When GTK+ receives an event, it determines the target widget that
|
||||
it is directed to. Unless grabs are involved, this is done by finding
|
||||
the widget to which the window of the event belongs.
|
||||
For widgets which have a #GdkWindow 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
|
||||
stack for gtk_get_current_event(), and propagating the event to the
|
||||
widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The event is then propagated from the toplevel window down to the
|
||||
target widget. In this phase, which is known as the “capture” phase,
|
||||
gestures that are attached with GTK_PHASE_CAPTURE get a chance
|
||||
to react to the event.
|
||||
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
|
||||
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.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Grabs are implemented for each input device, and globally. A grab for a
|
||||
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 is propagated to the child — this is the basis for propagating
|
||||
events within modal dialogs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
An event is propagated to a widget using gtk_propagate_event().
|
||||
Propagation differs between event types: key events (%GDK_KEY_PRESS,
|
||||
%GDK_KEY_RELEASE) are delivered to the top-level #GtkWindow; other events
|
||||
are propagated down and up the widget hierarchy in three phases (see
|
||||
#GtkPropagationPhase).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For key events, the top-level window’s default #GtkWindow::key-press-event
|
||||
and #GtkWindow::key-release-event signal handlers handle mnemonics and
|
||||
accelerators first. Other key presses are then passed to
|
||||
gtk_window_propagate_key_event() which propagates the event upwards from
|
||||
the window’s current focus widget (gtk_window_get_focus()) to the
|
||||
top-level.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For other events, in the first phase (the “capture” phase) the event is
|
||||
delivered to each widget from the top-most (for example, the top-level
|
||||
#GtkWindow or grab widget) down to the target #GtkWidget.
|
||||
<link linkend="event-controllers-and-gestures">Gestures</link> that are
|
||||
attached with %GTK_PHASE_CAPTURE get a chance to react to the event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
After the “capture” phase, the widget that was intended to be the
|
||||
destination of the event will let run gestures attached to it with
|
||||
GTK_PHASE_TARGET. This is known as the “target” phase, and does only
|
||||
happen on that widget.
|
||||
destination of the event will run gestures attached to it with
|
||||
%GTK_PHASE_TARGET. This is known as the “target” phase, and only
|
||||
happens on that widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Next, the appropriate event signal is emitted for the event in question,
|
||||
e.g. “motion-notify-event”. Handling these signals was the primary
|
||||
way to handle input in GTK+ widgets before gestures were introduced.
|
||||
The signals are emitted from the target widget up to the toplevel,
|
||||
until a signal handler indicates that it has handled the event, by
|
||||
returning GDK_EVENT_STOP.
|
||||
Next, the #GtkWidget::event signal is emitted, then the appropriate signal
|
||||
for the event in question, for example #GtkWidget::motion-notify-event.
|
||||
Handling these signals was the primary way to handle input in GTK+ widgets
|
||||
before gestures were introduced. If the widget is realized, the
|
||||
#GtkWidget::event-after signal is emitted. The signals are emitted from
|
||||
the target widget up to the top-level, as part of the “bubble” phase.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The default handlers for the event signals send the event
|
||||
to gestures that are attached with GTK_PHASE_BUBBLE. Therefore,
|
||||
to gestures that are attached with %GTK_PHASE_BUBBLE. Therefore,
|
||||
gestures in the “bubble” phase are only used if the widget does
|
||||
not have its own event handlers, or takes care to chain up to the
|
||||
default GtkWidget handlers.
|
||||
default #GtkWidget handlers.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Anytime during the propagation phase, a widget may indicate that a
|
||||
Events are not delivered to a widget which is insensitive or unmapped.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Any time during the propagation phase, a widget may indicate that a
|
||||
received event was consumed and propagation should therefore be stopped.
|
||||
In traditional event handlers, this is hinted by returning GDK_EVENT_STOP,
|
||||
if gestures are used, this may happen when the widget tells the gesture
|
||||
In traditional event handlers, this is hinted by returning %GDK_EVENT_STOP.
|
||||
If gestures are used, this may happen when the widget tells the gesture
|
||||
to claim the event touch sequence (or the pointer events) for its own. See the
|
||||
"gesture states" section below to know more of the latter.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="event-masks">
|
||||
<title>Event masks</title>
|
||||
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If a widget is windowless (gtk_widget_get_has_window() returns %FALSE) and
|
||||
an application wants to receive custom events on it, it must be placed
|
||||
inside a #GtkEventBox to receive the events, and an appropriate event mask
|
||||
must be set on the box. When implementing a widget, use a %GDK_INPUT_ONLY
|
||||
#GdkWindow to receive the events instead.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering events against event masks happens inside #GdkWindow, 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.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This means that widgets must add to the event mask for each event type
|
||||
they expect to receive, using gtk_widget_set_events() or
|
||||
gtk_widget_add_events() to preserve the existing mask. Widgets which are
|
||||
aware of floating devices should use gtk_widget_set_device_events() or
|
||||
gtk_widget_add_device_events(), and must explicitly enable the device
|
||||
using gtk_widget_set_device_enabled(). See the #GdkDeviceManager
|
||||
documentation for more information.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All standard widgets set the event mask for all events they expect to
|
||||
receive, and it is not necessary to modify this. Masks should be set when
|
||||
implementing a new widget.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<title>Touch events</title>
|
||||
|
||||
<para>
|
||||
Touch events are emitted as events of type GDK_TOUCH_BEGIN, GDK_TOUCH_UPDATE or
|
||||
GDK_TOUCH_END, those events contain an “event sequence” that univocally identifies
|
||||
Touch events are emitted as events of type %GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE or
|
||||
%GDK_TOUCH_END, those events contain an “event sequence” that univocally identifies
|
||||
the physical touch until it is lifted from the device.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
On some windowing platforms, multitouch devices perform pointer emulation, this works
|
||||
by granting a “pointer emulating” hint to one of the currently interacting touch
|
||||
sequences, which will be reported on every GdkEventTouch event from that sequence. By
|
||||
default, if a widget didn't request touch events by setting GDK_TOUCH_MASK on its
|
||||
event mask and didn't override GtkWidget::touch-event, GTK+ will transform these
|
||||
“pointer emulating” events into semantically similar GdkEventButton and GdkEventMotion
|
||||
events. Depending on GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
|
||||
sequences, which will be reported on every #GdkEventTouch event from that sequence. By
|
||||
default, if a widget didn't request touch events by setting %GDK_TOUCH_MASK on its
|
||||
event mask and didn't override #GtkWidget::touch-event, GTK+ will transform these
|
||||
“pointer emulating” events into semantically similar #GdkEventButton and #GdkEventMotion
|
||||
events. Depending on %GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
|
||||
sequences could still trigger gestures or just get filtered out, regardless of the widget
|
||||
not handling those directly.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If the widget sets GDK_TOUCH_MASK on its event mask and doesn't chain up on
|
||||
GtkWidget::touch-event, only touch events will be received, and no pointer emulation
|
||||
If the widget sets %GDK_TOUCH_MASK on its event mask and doesn't chain up on
|
||||
#GtkWidget::touch-event, only touch events will be received, and no pointer emulation
|
||||
will be performed.
|
||||
</para>
|
||||
</refsect2>
|
||||
@@ -171,11 +258,11 @@
|
||||
<para>
|
||||
Grabs are a method to claim all input events from a device, they happen
|
||||
either implicitly on pointer and touch devices, or explicitly. Implicit grabs
|
||||
happen on user interaction, when a GdkEventButtonPress happens, all events from
|
||||
then on, until after the corresponding GdkEventButtonRelease, will be reported
|
||||
happen on user interaction, when a #GdkEventButtonPress happens, all events from
|
||||
then on, until after the corresponding #GdkEventButtonRelease, will be reported
|
||||
to the widget that got the first event. Likewise, on touch events, every
|
||||
GdkEventSequence will deliver only events to the widget that received its
|
||||
GDK_TOUCH_BEGIN event.
|
||||
#GdkEventSequence will deliver only events to the widget that received its
|
||||
%GDK_TOUCH_BEGIN event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -192,8 +279,8 @@
|
||||
point somewhere else, even while the pointer/touch device is already grabbed.
|
||||
This makes it necessary for widgets to handle the cancellation of any ongoing
|
||||
interaction. Depending on whether a GTK or GDK grab is causing this, the
|
||||
widget will respectively receive a GtkWidget::grab-notify signal, or a
|
||||
GdkEventGrabBroken event.
|
||||
widget will respectively receive a #GtkWidget::grab-notify signal, or a
|
||||
#GdkEventGrabBroken event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -209,12 +296,12 @@
|
||||
<!-- mnemonics, accelerators, bindings -->
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<refsect2 id="event-controllers-and-gestures">
|
||||
<title>Event controllers and gestures</title>
|
||||
|
||||
<para>
|
||||
Event controllers are standalone objects that can perform specific actions
|
||||
upon received GdkEvents. These are tied to a GtkWidget, and can be told of
|
||||
upon received #GdkEvents. These are tied to a #GtkWidget, and can be told of
|
||||
the event propagation phase at which they will manage the events.
|
||||
</para>
|
||||
|
||||
@@ -270,7 +357,7 @@
|
||||
Alternatively, or at a later point in time, the widget may choose to deny the touch
|
||||
sequences, thus letting those go through again in event propagation. When this happens
|
||||
in the capture phase, and if there are no other claiming gestures in the widget,
|
||||
a GDK_TOUCH_BEGIN/GDK_BUTTON_PRESS event will be emulated and
|
||||
a %GDK_TOUCH_BEGIN/%GDK_BUTTON_PRESS event will be emulated and
|
||||
propagated downwards, in order to preserve consistency.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
widgets have been deprecated. These deprecations are clearly spelled
|
||||
out in the API reference, with hints about the recommended replacements.
|
||||
The API reference for GTK+ 2 also includes an
|
||||
<ulink url="http://developer.gnome.org/gtk/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
<ulink url="https://developer.gnome.org/gtk2/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
</para>
|
||||
<para>
|
||||
To verify that your program does not use any deprecated symbols,
|
||||
|
||||
@@ -36,7 +36,7 @@ some additional commandline options.
|
||||
|
||||
<para>
|
||||
A list of modules to load in addition to those specified in the
|
||||
<envar>GTK_MODULES</envar> environment variable and the
|
||||
<envar>GTK3_MODULES</envar> environment variable and the
|
||||
<literal>gtk-modules</literal> setting.
|
||||
</para>
|
||||
</formalpara>
|
||||
@@ -223,14 +223,24 @@ additional environment variables.
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GTK_MODULES</envar></title>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
<link linkend="GtkStackSwitcher">
|
||||
<inlinegraphic fileref="stackswitcher.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkSidebar">
|
||||
<link linkend="GtkStackSidebar">
|
||||
<inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkTreeView">
|
||||
|
||||
@@ -1407,8 +1407,8 @@ create_sidebar (void)
|
||||
gtk_widget_show (view);
|
||||
gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2");
|
||||
|
||||
sidebar = gtk_sidebar_new ();
|
||||
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
sidebar = gtk_stack_sidebar_new ();
|
||||
gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
@@ -129,17 +129,15 @@ close_window (void)
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *da;
|
||||
GtkWidget *drawing_area;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
@@ -150,35 +148,46 @@ main (int argc,
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (window), frame);
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 100, 100);
|
||||
gtk_widget_set_size_request (drawing_area, 100, 100);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
gtk_container_add (GTK_CONTAINER (frame), drawing_area);
|
||||
|
||||
/* Signals used to handle the backing surface */
|
||||
g_signal_connect (da, "draw",
|
||||
g_signal_connect (drawing_area, "draw",
|
||||
G_CALLBACK (draw_cb), NULL);
|
||||
g_signal_connect (da,"configure-event",
|
||||
g_signal_connect (drawing_area,"configure-event",
|
||||
G_CALLBACK (configure_event_cb), NULL);
|
||||
|
||||
/* Event signals */
|
||||
g_signal_connect (da, "motion-notify-event",
|
||||
g_signal_connect (drawing_area, "motion-notify-event",
|
||||
G_CALLBACK (motion_notify_event_cb), NULL);
|
||||
g_signal_connect (da, "button-press-event",
|
||||
g_signal_connect (drawing_area, "button-press-event",
|
||||
G_CALLBACK (button_press_event_cb), NULL);
|
||||
|
||||
/* Ask to receive events the drawing area doesn't normally
|
||||
* subscribe to. In particular, we need to ask for the
|
||||
* button press and motion notify events that want to handle.
|
||||
*/
|
||||
gtk_widget_set_events (da, gtk_widget_get_events (da)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK);
|
||||
gtk_widget_set_events (drawing_area, gtk_widget_get_events (drawing_area)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -7,23 +7,17 @@ print_hello (GtkWidget *widget,
|
||||
g_print ("Hello World\n");
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *grid;
|
||||
GtkWidget *button;
|
||||
|
||||
/* This is called in all GTK applications. Arguments are parsed
|
||||
* from the command line and are returned to the application.
|
||||
*/
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* create a new window, and set its title */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Grid");
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
/* Here we construct the container that is going pack our buttons */
|
||||
@@ -49,7 +43,7 @@ main (int argc,
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1);
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
|
||||
/* Place the Quit button in the grid cell (0, 1), and make it
|
||||
* span 2 columns.
|
||||
@@ -63,11 +57,19 @@ main (int argc,
|
||||
*/
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
/* All GTK applications must have a gtk_main(). Control ends here
|
||||
* and waits for an event to occur (like a key press or a mouse event),
|
||||
* until gtk_main_quit() is called.
|
||||
*/
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* This is a callback function. The data arguments are ignored
|
||||
* in this example. More on callbacks below.
|
||||
*/
|
||||
static void
|
||||
print_hello (GtkWidget *widget,
|
||||
gpointer data)
|
||||
@@ -10,95 +7,40 @@ print_hello (GtkWidget *widget,
|
||||
g_print ("Hello World\n");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_delete_event (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
{
|
||||
/* If you return FALSE in the "delete_event" signal handler,
|
||||
* GTK will emit the "destroy" signal. Returning TRUE means
|
||||
* you don't want the window to be destroyed.
|
||||
*
|
||||
* This is useful for popping up 'are you sure you want to quit?'
|
||||
* type dialogs.
|
||||
*/
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkWidget *button_box;
|
||||
|
||||
g_print ("delete event occurred\n");
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
|
||||
return TRUE;
|
||||
button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_container_add (GTK_CONTAINER (window), button_box);
|
||||
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
gtk_container_add (GTK_CONTAINER (button_box), button);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
/* GtkWidget is the storage type for widgets */
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
/* This is called in all GTK applications. Arguments are parsed
|
||||
* from the command line and are returned to the application.
|
||||
*/
|
||||
gtk_init (&argc, &argv);
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
/* create a new window, and set its title */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Hello");
|
||||
|
||||
/* When the window emits the "delete-event" signal (which is emitted
|
||||
* by GTK+ in response to an event coming from the window manager,
|
||||
* usually as a result of clicking the "close" window control), we
|
||||
* ask it to call the on_delete_event() function as defined above.
|
||||
*
|
||||
* The data passed to the callback function is NULL and is ignored
|
||||
* in the callback function.
|
||||
*/
|
||||
g_signal_connect (window, "delete-event", G_CALLBACK (on_delete_event), NULL);
|
||||
|
||||
/* Here we connect the "destroy" event to the gtk_main_quit() function.
|
||||
*
|
||||
* This signal is emitted when we call gtk_widget_destroy() on the window,
|
||||
* or if we return FALSE in the "delete_event" callback.
|
||||
*/
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
/* Sets the border width of the window. */
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
/* Creates a new button with the label "Hello World". */
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
|
||||
/* When the button receives the "clicked" signal, it will call the
|
||||
* function print_hello() passing it NULL as its argument.
|
||||
*
|
||||
* The print_hello() function is defined above.
|
||||
*/
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
|
||||
/* The g_signal_connect_swapped() function will connect the "clicked" signal
|
||||
* of the button to the gtk_widget_destroy() function; instead of calling it
|
||||
* using the button as its argument, it will swap it with the user data
|
||||
* argument. This will cause the window to be destroyed by calling
|
||||
* gtk_widget_destroy() on the window.
|
||||
*/
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
|
||||
/* This packs the button into the window. A GtkWindow inherits from GtkBin,
|
||||
* which is a special container that can only have one child
|
||||
*/
|
||||
gtk_container_add (GTK_CONTAINER (window), button);
|
||||
|
||||
/* The final step is to display this newly created widget... */
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* ... and the window */
|
||||
gtk_widget_show (window);
|
||||
|
||||
/* All GTK applications must have a gtk_main(). Control ends here
|
||||
* and waits for an event to occur (like a key press or a mouse event),
|
||||
* until gtk_main_quit() is called.
|
||||
*/
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -267,16 +267,19 @@ disable_plugin (const gchar *name)
|
||||
plugin_menu = find_plugin_menu ();
|
||||
if (plugin_menu)
|
||||
{
|
||||
const gchar *id;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < g_menu_model_get_n_items (plugin_menu); i++)
|
||||
{
|
||||
if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id) &&
|
||||
g_strcmp0 (id, name) == 0)
|
||||
gchar *id;
|
||||
if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id))
|
||||
{
|
||||
g_menu_remove (G_MENU (plugin_menu), i);
|
||||
g_print ("Menus of '%s' plugin removed\n", name);
|
||||
if (g_strcmp0 (id, name) == 0)
|
||||
{
|
||||
g_menu_remove (G_MENU (plugin_menu), i);
|
||||
g_print ("Menus of '%s' plugin removed\n", name);
|
||||
}
|
||||
g_free (id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,7 +359,7 @@ configure_plugins (GSimpleAction *action,
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dialog = (GtkWidget *)gtk_builder_get_object (builder, "plugin-dialog");
|
||||
@@ -370,6 +373,9 @@ configure_plugins (GSimpleAction *action,
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
|
||||
out:
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
static GActionEntry app_entries[] = {
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
static void
|
||||
activate (GtkApplication* app,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ LDADD = \
|
||||
#
|
||||
gdk_public_h_sources = \
|
||||
gdk.h \
|
||||
gdk-autocleanup.h \
|
||||
gdkapplaunchcontext.h \
|
||||
gdkcairo.h \
|
||||
gdkcursor.h \
|
||||
|
||||
@@ -61,24 +61,24 @@ struct _GdkColor
|
||||
|
||||
#define GDK_TYPE_COLOR (gdk_color_get_type ())
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_get_type)
|
||||
GType gdk_color_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_copy)
|
||||
GdkColor *gdk_color_copy (const GdkColor *color);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_free)
|
||||
void gdk_color_free (GdkColor *color);
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_hash)
|
||||
guint gdk_color_hash (const GdkColor *color);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_equal)
|
||||
gboolean gdk_color_equal (const GdkColor *colora,
|
||||
const GdkColor *colorb);
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_parse)
|
||||
gboolean gdk_color_parse (const gchar *spec,
|
||||
GdkColor *color);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_to_string)
|
||||
gchar * gdk_color_to_string (const GdkColor *color);
|
||||
|
||||
|
||||
|
||||
42
gdk/gdk-autocleanup.h
Normal file
42
gdk/gdk-autocleanup.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GI_SCANNER__
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDeviceManager, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDragContext, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkKeymap, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkScreen, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVisual, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkWindow, g_object_unref)
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)
|
||||
|
||||
#endif
|
||||
@@ -130,6 +130,7 @@ static int gdk_initialized = 0; /* 1 if the library is initi
|
||||
*/
|
||||
|
||||
static gchar *gdk_progclass = NULL;
|
||||
static gboolean gdk_progclass_overridden;
|
||||
|
||||
static GMutex gdk_threads_mutex;
|
||||
|
||||
@@ -208,6 +209,7 @@ static gboolean
|
||||
gdk_arg_class_cb (const char *key, const char *value, gpointer user_data, GError **error)
|
||||
{
|
||||
gdk_set_program_class (value);
|
||||
gdk_progclass_overridden = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1025,10 +1027,16 @@ gdk_get_program_class (void)
|
||||
* Sets the program class. The X11 backend uses the program class to set
|
||||
* the class name part of the `WM_CLASS` property on
|
||||
* toplevel windows; see the ICCCM.
|
||||
*
|
||||
* The program class can still be overridden with the --class command
|
||||
* line option.
|
||||
*/
|
||||
void
|
||||
gdk_set_program_class (const char *program_class)
|
||||
{
|
||||
if (gdk_progclass_overridden)
|
||||
return;
|
||||
|
||||
g_free (gdk_progclass);
|
||||
|
||||
gdk_progclass = g_strdup (program_class);
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
#include <gdk/deprecated/gdkcolor.h>
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk-autocleanup.h>
|
||||
|
||||
#undef __GDK_H_INSIDE__
|
||||
|
||||
#endif /* __GDK_H__ */
|
||||
|
||||
@@ -185,6 +185,9 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
|
||||
int n_channels;
|
||||
int j;
|
||||
|
||||
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
|
||||
return;
|
||||
|
||||
/* This function can't just copy any pixbuf to any surface, be
|
||||
* sure to read the invariants here before calling it */
|
||||
|
||||
|
||||
44
gdk/gdkgl.c
44
gdk/gdkgl.c
@@ -52,7 +52,8 @@ get_vertex_type_name (int type)
|
||||
}
|
||||
|
||||
static guint
|
||||
create_shader (int type, const char const *code)
|
||||
create_shader (int type,
|
||||
const char *code)
|
||||
{
|
||||
guint shader;
|
||||
int status;
|
||||
@@ -85,8 +86,8 @@ create_shader (int type, const char const *code)
|
||||
|
||||
static void
|
||||
make_program (GdkGLContextProgram *program,
|
||||
const char const *vertex_shader_code,
|
||||
const char const *fragment_shader_code)
|
||||
const char *vertex_shader_code,
|
||||
const char *fragment_shader_code)
|
||||
{
|
||||
guint vertex_shader, fragment_shader;
|
||||
int status;
|
||||
@@ -146,8 +147,8 @@ bind_vao (GdkGLContextPaintData *paint_data)
|
||||
static void
|
||||
use_texture_2d_program (GdkGLContextPaintData *paint_data)
|
||||
{
|
||||
const char *vertex_shader_code =
|
||||
"#version 120\n"
|
||||
static const char *vertex_shader_code =
|
||||
"#version 150\n"
|
||||
"uniform sampler2D map;"
|
||||
"attribute vec2 position;\n"
|
||||
"attribute vec2 uv;\n"
|
||||
@@ -156,8 +157,8 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
|
||||
" gl_Position = vec4(position, 0, 1);\n"
|
||||
" vUv = uv;\n"
|
||||
"}\n";
|
||||
const char *fragment_shader_code =
|
||||
"#version 120\n"
|
||||
static const char *fragment_shader_code =
|
||||
"#version 150\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"uniform sampler2D map;\n"
|
||||
"void main() {\n"
|
||||
@@ -177,8 +178,8 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
|
||||
static void
|
||||
use_texture_rect_program (GdkGLContextPaintData *paint_data)
|
||||
{
|
||||
const char *vertex_shader_code =
|
||||
"#version 120\n"
|
||||
static const char *vertex_shader_code =
|
||||
"#version 150\n"
|
||||
"uniform sampler2DRect map;"
|
||||
"attribute vec2 position;\n"
|
||||
"attribute vec2 uv;\n"
|
||||
@@ -187,8 +188,8 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
|
||||
" gl_Position = vec4(position, 0, 1);\n"
|
||||
" vUv = uv;\n"
|
||||
"}\n";
|
||||
const char *fragment_shader_code =
|
||||
"#version 120\n"
|
||||
static const char *fragment_shader_code =
|
||||
"#version 150\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"uniform sampler2DRect map;\n"
|
||||
"void main() {\n"
|
||||
@@ -235,8 +236,8 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
|
||||
glActiveTexture (GL_TEXTURE0);
|
||||
glUniform1i(program->map_location, 0); /* Use texture unit 0 */
|
||||
|
||||
glEnableVertexAttribArray (0);
|
||||
glEnableVertexAttribArray (1);
|
||||
glEnableVertexAttribArray (program->position_location);
|
||||
glEnableVertexAttribArray (program->uv_location);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_vertex_buffer);
|
||||
|
||||
glVertexAttribPointer (program->position_location, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, NULL);
|
||||
@@ -272,8 +273,8 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
|
||||
|
||||
g_free (vertex_buffer_data);
|
||||
|
||||
glDisableVertexAttribArray (0);
|
||||
glDisableVertexAttribArray (1);
|
||||
glDisableVertexAttribArray (program->position_location);
|
||||
glDisableVertexAttribArray (program->uv_location);
|
||||
}
|
||||
|
||||
/* x,y,width,height describes a rectangle in the gl render buffer
|
||||
@@ -355,7 +356,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
|
||||
if (source_type == GL_RENDERBUFFER)
|
||||
{
|
||||
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, source);
|
||||
glBindRenderbuffer (GL_RENDERBUFFER, source);
|
||||
glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
|
||||
}
|
||||
else if (source_type == GL_TEXTURE)
|
||||
@@ -519,7 +520,6 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
|
||||
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
|
||||
|
||||
@@ -587,8 +587,6 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
if (alpha_size != 0)
|
||||
glDisable (GL_BLEND);
|
||||
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
|
||||
#undef FLIP_Y
|
||||
|
||||
}
|
||||
@@ -644,6 +642,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
|
||||
if (clip_region)
|
||||
cairo_region_destroy (clip_region);
|
||||
|
||||
}
|
||||
|
||||
/* This is always called with the paint context current */
|
||||
@@ -664,7 +663,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
float umax, vmax;
|
||||
gboolean use_texture_rectangle;
|
||||
guint target;
|
||||
|
||||
paint_context = gdk_gl_context_get_current ();
|
||||
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
|
||||
paint_context &&
|
||||
@@ -692,7 +690,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
target = GL_TEXTURE_2D;
|
||||
|
||||
glBindTexture (target, texture_id);
|
||||
glEnable (target);
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
|
||||
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -720,8 +717,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
e.height *= sy;
|
||||
image = cairo_surface_map_to_image (surface, &e);
|
||||
|
||||
/* We might have a different alignment, stride or format, so allow overriding here if needed */
|
||||
GDK_GL_CONTEXT_GET_CLASS (paint_context)->upload_texture (paint_context, image, e.width, e.height, target);
|
||||
gdk_gl_context_upload_texture (paint_context, image, e.width, e.height, target);
|
||||
|
||||
cairo_surface_unmap_image (surface, image);
|
||||
|
||||
@@ -750,8 +746,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
}
|
||||
}
|
||||
|
||||
#undef FLIP_Y
|
||||
|
||||
glDisable (GL_SCISSOR_TEST);
|
||||
glDisable (target);
|
||||
glDeleteTextures (1, &texture_id);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,14 @@
|
||||
* #GdkWindow, which you typically get during the realize call
|
||||
* of a widget.
|
||||
*
|
||||
* A #GdkGLContext is not realized until either gdk_gl_context_make_current(),
|
||||
* or until it is realized using gdk_gl_context_realize(). It is possible to
|
||||
* specify details of the GL context like the OpenGL version to be used, or
|
||||
* whether the GL context should have extra state validation enabled after
|
||||
* calling gdk_window_create_gl_context() by calling gdk_gl_context_realize().
|
||||
* If the realization fails you have the option to change the settings of the
|
||||
* #GdkGLContext and try again.
|
||||
*
|
||||
* ## Using a GdkGLContext ##
|
||||
*
|
||||
* You will need to make the #GdkGLContext the current context
|
||||
@@ -83,12 +91,18 @@ typedef struct {
|
||||
GdkDisplay *display;
|
||||
GdkWindow *window;
|
||||
GdkGLContext *shared_context;
|
||||
GdkGLProfile profile;
|
||||
|
||||
int major;
|
||||
int minor;
|
||||
int gl_version;
|
||||
|
||||
guint realized : 1;
|
||||
guint use_texture_rectangle : 1;
|
||||
guint has_gl_framebuffer_blit : 1;
|
||||
guint has_frame_terminator : 1;
|
||||
guint extensions_checked : 1;
|
||||
guint debug_enabled : 1;
|
||||
guint forward_compatible : 1;
|
||||
|
||||
GdkGLContextPaintData *paint_data;
|
||||
} GdkGLContextPrivate;
|
||||
@@ -98,7 +112,6 @@ enum {
|
||||
|
||||
PROP_DISPLAY,
|
||||
PROP_WINDOW,
|
||||
PROP_PROFILE,
|
||||
PROP_SHARED_CONTEXT,
|
||||
|
||||
LAST_PROP
|
||||
@@ -186,10 +199,6 @@ gdk_gl_context_set_property (GObject *gobject,
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_PROFILE:
|
||||
priv->profile = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
@@ -217,17 +226,12 @@ gdk_gl_context_get_property (GObject *gobject,
|
||||
g_value_set_object (value, priv->shared_context);
|
||||
break;
|
||||
|
||||
case PROP_PROFILE:
|
||||
g_value_set_enum (value, priv->profile);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
/* Default implementation of upload_texture() for gdk_gl_texture_from_surface() */
|
||||
static void
|
||||
void
|
||||
gdk_gl_context_upload_texture (GdkGLContext *context,
|
||||
cairo_surface_t *image_surface,
|
||||
int width,
|
||||
@@ -238,7 +242,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
|
||||
|
||||
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image_surface)/4);
|
||||
glTexImage2D (texture_target, 0, 4, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
cairo_image_surface_get_data (image_surface));
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
||||
}
|
||||
@@ -280,23 +284,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:profile:
|
||||
*
|
||||
* The #GdkGLProfile of the context
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_PROFILE] =
|
||||
g_param_spec_enum ("profile",
|
||||
P_("Profile"),
|
||||
P_("The GL profile the context was created for"),
|
||||
GDK_TYPE_GL_PROFILE,
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:shared-context:
|
||||
*
|
||||
@@ -318,9 +305,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
gobject_class->dispose = gdk_gl_context_dispose;
|
||||
gobject_class->finalize = gdk_gl_context_finalize;
|
||||
|
||||
/* Default Implementation of upload_texture() for gdk_gl_texture_from_surface() */
|
||||
klass->upload_texture = gdk_gl_context_upload_texture;
|
||||
|
||||
g_object_class_install_properties (gobject_class, LAST_PROP, obj_pspecs);
|
||||
}
|
||||
|
||||
@@ -389,19 +373,237 @@ gdk_gl_context_has_frame_terminator (GdkGLContext *context)
|
||||
return priv->has_frame_terminator;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_set_debug_enabled:
|
||||
* @context: a #GdkGLContext
|
||||
* @enabled: whether to enable debugging in the context
|
||||
*
|
||||
* Sets whether the #GdkGLContext should perform extra validations and
|
||||
* run time checking. This is useful during development, but has
|
||||
* additional overhead.
|
||||
*
|
||||
* The #GdkGLContext must not be realized or made current prior to
|
||||
* calling this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_set_debug_enabled (GdkGLContext *context,
|
||||
gboolean enabled)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (!priv->realized);
|
||||
|
||||
enabled = !!enabled;
|
||||
|
||||
priv->debug_enabled = enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_debug_enabled:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the value set using gdk_gl_context_set_debug_enabled().
|
||||
*
|
||||
* Returns: %TRUE if debugging is enabled
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_get_debug_enabled (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
|
||||
|
||||
return priv->debug_enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_set_forward_compatible:
|
||||
* @context: a #GdkGLContext
|
||||
* @compatible: whether the context should be forward compatible
|
||||
*
|
||||
* Sets whether the #GdkGLContext should be forward compatible.
|
||||
*
|
||||
* Forward compatibile contexts must not support OpenGL functionality that
|
||||
* has been marked as deprecated in the requested version; non-forward
|
||||
* compatible contexts, on the other hand, must support both deprecated and
|
||||
* non deprecated functionality.
|
||||
*
|
||||
* The #GdkGLContext must not be realized or made current prior to calling
|
||||
* this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_set_forward_compatible (GdkGLContext *context,
|
||||
gboolean compatible)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (!priv->realized);
|
||||
|
||||
compatible = !!compatible;
|
||||
|
||||
priv->forward_compatible = compatible;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_forward_compatible:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the value set using gdk_gl_context_set_forward_compatible().
|
||||
*
|
||||
* Returns: %TRUE if the context should be forward compatible
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_get_forward_compatible (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
|
||||
|
||||
return priv->forward_compatible;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_set_required_version:
|
||||
* @context: a #GdkGLContext
|
||||
* @major: the major version to request
|
||||
* @minor: the minor version to request
|
||||
*
|
||||
* Sets the major and minor version of OpenGL to request.
|
||||
*
|
||||
* Setting @major and @minor to zero will use the default values.
|
||||
*
|
||||
* The #GdkGLContext must not be realized or made current prior to calling
|
||||
* this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
int major,
|
||||
int minor)
|
||||
{
|
||||
int version;
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (!priv->realized);
|
||||
|
||||
/* this will take care of the default */
|
||||
if (major == 0 && minor == 0)
|
||||
{
|
||||
priv->major = 0;
|
||||
priv->minor = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Enforce a minimum context version number of 3.2 */
|
||||
version = (major * 100) + minor;
|
||||
if (version < 302)
|
||||
{
|
||||
g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
|
||||
version = 302;
|
||||
}
|
||||
priv->major = version / 100;
|
||||
priv->minor = version % 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_required_version:
|
||||
* @context: a #GdkGLContext
|
||||
* @major: (out) (nullable): return location for the major version to request
|
||||
* @minor: (out) (nullable): return location for the minor version to request
|
||||
*
|
||||
* Retrieves the major and minor version requested by calling
|
||||
* gdk_gl_context_set_required_version().
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_get_required_version (GdkGLContext *context,
|
||||
int *major,
|
||||
int *minor)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
int maj, min;
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
if (priv->major > 0)
|
||||
maj = priv->major;
|
||||
else
|
||||
maj = 3;
|
||||
|
||||
if (priv->minor > 0)
|
||||
min = priv->minor;
|
||||
else
|
||||
min = 2;
|
||||
|
||||
if (major != NULL)
|
||||
*major = maj;
|
||||
if (minor != NULL)
|
||||
*minor = min;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_realize:
|
||||
* @context: a #GdkGLContext
|
||||
* @error: return location for a #GError
|
||||
*
|
||||
* Realizes the given #GdkGLContext.
|
||||
*
|
||||
* It is safe to call this function on a realized #GdkGLContext.
|
||||
*
|
||||
* Returns: %TRUE if the context is realized
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
|
||||
|
||||
if (priv->realized)
|
||||
return TRUE;
|
||||
|
||||
priv->realized = GDK_GL_CONTEXT_GET_CLASS (context)->realize (context, error);
|
||||
|
||||
return priv->realized;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_realize (GdkGLContext *context)
|
||||
gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
gboolean has_npot, has_texture_rectangle;
|
||||
|
||||
if (!priv->realized)
|
||||
return;
|
||||
|
||||
if (priv->extensions_checked)
|
||||
return;
|
||||
|
||||
priv->gl_version = epoxy_gl_version ();
|
||||
|
||||
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
|
||||
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
|
||||
|
||||
priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
|
||||
priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
|
||||
|
||||
if (_gdk_gl_flags & GDK_GL_TEXTURE_RECTANGLE)
|
||||
if (G_UNLIKELY (_gdk_gl_flags & GDK_GL_TEXTURE_RECTANGLE))
|
||||
priv->use_texture_rectangle = TRUE;
|
||||
else if (has_npot)
|
||||
priv->use_texture_rectangle = FALSE;
|
||||
@@ -410,7 +612,22 @@ gdk_gl_context_realize (GdkGLContext *context)
|
||||
else
|
||||
g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
|
||||
|
||||
priv->realized = TRUE;
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("OpenGL version: %d.%d\n"
|
||||
"Extensions checked:\n"
|
||||
" - GL_ARB_texture_non_power_of_two: %s\n"
|
||||
" - GL_ARB_texture_rectangle: %s\n"
|
||||
" - GL_EXT_framebuffer_blit: %s\n"
|
||||
" - GL_GREMEDY_frame_terminator: %s\n"
|
||||
"Using texture rectangle: %s\n",
|
||||
priv->gl_version / 10, priv->gl_version % 10,
|
||||
has_npot ? "yes" : "no",
|
||||
has_texture_rectangle ? "yes" : "no",
|
||||
priv->has_gl_framebuffer_blit ? "yes" : "no",
|
||||
priv->has_frame_terminator ? "yes" : "no",
|
||||
priv->use_texture_rectangle ? "yes" : "no"));
|
||||
|
||||
priv->extensions_checked = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -433,11 +650,24 @@ gdk_gl_context_make_current (GdkGLContext *context)
|
||||
if (current == context)
|
||||
return;
|
||||
|
||||
/* we need to realize the GdkGLContext if it wasn't explicitly realized */
|
||||
if (!priv->realized)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
gdk_gl_context_realize (context, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
g_critical ("Could not realize the GL context: %s", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (gdk_display_make_gl_context_current (priv->display, context))
|
||||
{
|
||||
g_private_replace (&thread_current_context, g_object_ref (context));
|
||||
if (!priv->realized)
|
||||
gdk_gl_context_realize (context);
|
||||
gdk_gl_context_check_extensions (context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,26 +711,6 @@ gdk_gl_context_get_window (GdkGLContext *context)
|
||||
return priv->window;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_profile:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkGLProfile that @context was created for.
|
||||
*
|
||||
* Returns: a #GdkGLProfile
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLProfile
|
||||
gdk_gl_context_get_profile (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_LEGACY);
|
||||
|
||||
return priv->profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_shared_context:
|
||||
* @context: a #GdkGLContext
|
||||
@@ -521,6 +731,34 @@ gdk_gl_context_get_shared_context (GdkGLContext *context)
|
||||
return priv->shared_context;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_version:
|
||||
* @context: a #GdkGLContext
|
||||
* @major: (out): return location for the major version
|
||||
* @minor: (out): return location for the minor version
|
||||
*
|
||||
* Retrieves the OpenGL version of the @context.
|
||||
*
|
||||
* The @context must be realized prior to calling this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_get_version (GdkGLContext *context,
|
||||
int *major,
|
||||
int *minor)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (priv->realized);
|
||||
|
||||
if (major != NULL)
|
||||
*major = priv->gl_version / 10;
|
||||
if (minor != NULL)
|
||||
*minor = priv->gl_version % 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_clear_current:
|
||||
*
|
||||
|
||||
@@ -43,18 +43,44 @@ GDK_AVAILABLE_IN_3_16
|
||||
GType gdk_gl_context_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
|
||||
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
|
||||
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLProfile gdk_gl_context_get_profile (GdkGLContext *context);
|
||||
GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_get_version (GdkGLContext *context,
|
||||
int *major,
|
||||
int *minor);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_make_current (GdkGLContext *context);
|
||||
void gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
int major,
|
||||
int minor);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_gl_context_get_current (void);
|
||||
void gdk_gl_context_get_required_version (GdkGLContext *context,
|
||||
int *major,
|
||||
int *minor);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_clear_current (void);
|
||||
void gdk_gl_context_set_debug_enabled (GdkGLContext *context,
|
||||
gboolean enabled);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
gboolean gdk_gl_context_get_debug_enabled (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_set_forward_compatible (GdkGLContext *context,
|
||||
gboolean compatible);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
gboolean gdk_gl_context_get_forward_compatible (GdkGLContext *context);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
gboolean gdk_gl_context_realize (GdkGLContext *context,
|
||||
GError **error);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_make_current (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_gl_context_get_current (void);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_clear_current (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -40,17 +40,15 @@ struct _GdkGLContextClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
gboolean (* realize) (GdkGLContext *context,
|
||||
GError **error);
|
||||
|
||||
void (* end_frame) (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
gboolean (* texture_from_surface) (GdkGLContext *context,
|
||||
cairo_surface_t *surface,
|
||||
cairo_region_t *region);
|
||||
void (* upload_texture) (GdkGLContext *context,
|
||||
cairo_surface_t *image_surface,
|
||||
int width,
|
||||
int height,
|
||||
guint texture_target);
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -71,13 +69,18 @@ typedef struct {
|
||||
GdkGLContextProgram *current_program;
|
||||
} GdkGLContextPaintData;
|
||||
|
||||
GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
|
||||
void gdk_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
void gdk_gl_context_upload_texture (GdkGLContext *context,
|
||||
cairo_surface_t *image_surface,
|
||||
int width,
|
||||
int height,
|
||||
guint texture_target);
|
||||
GdkGLContextPaintData * gdk_gl_context_get_paint_data (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
|
||||
void gdk_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -333,6 +333,7 @@ struct _GdkWindow
|
||||
guint in_update : 1;
|
||||
guint geometry_dirty : 1;
|
||||
guint event_compression : 1;
|
||||
guint frame_clock_events_paused : 1;
|
||||
|
||||
/* The GdkWindow that has the impl, ref:ed if another window.
|
||||
* This ref is required to keep the wrapper of the impl window alive
|
||||
|
||||
@@ -669,6 +669,12 @@ gdk_offscreen_window_set_opacity (GdkWindow *window, gdouble opacity)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_offscreen_window_beep (GdkWindow *window)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
{
|
||||
@@ -701,7 +707,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
impl_class->destroy_foreign = NULL;
|
||||
impl_class->get_shape = NULL;
|
||||
impl_class->get_input_shape = NULL;
|
||||
impl_class->beep = NULL;
|
||||
impl_class->beep = gdk_offscreen_window_beep;
|
||||
|
||||
impl_class->focus = NULL;
|
||||
impl_class->set_type_hint = NULL;
|
||||
|
||||
@@ -207,6 +207,10 @@ typedef enum
|
||||
* reserved values such as %GDK_MODIFIER_RESERVED_13_MASK. Your code
|
||||
* should preserve and ignore them. You can use %GDK_MODIFIER_MASK to
|
||||
* remove all reserved values.
|
||||
*
|
||||
* Also note that the GDK X backend interprets button press events for button
|
||||
* 4-7 as scroll events, so %GDK_BUTTON4_MASK and %GDK_BUTTON5_MASK will never
|
||||
* be set.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@@ -372,6 +376,9 @@ typedef enum
|
||||
* Most of these masks map onto one or more of the #GdkEventType event types
|
||||
* above.
|
||||
*
|
||||
* See the [input handling overview][chap-input-handling] for details of
|
||||
* [event masks][event-masks] and [event propagation][event-propagation].
|
||||
*
|
||||
* %GDK_POINTER_MOTION_HINT_MASK is deprecated. It is a special mask
|
||||
* to reduce the number of %GDK_MOTION_NOTIFY events received. When using
|
||||
* %GDK_POINTER_MOTION_HINT_MASK, fewer %GDK_MOTION_NOTIFY events will
|
||||
@@ -434,19 +441,15 @@ struct _GdkPoint
|
||||
};
|
||||
|
||||
/**
|
||||
* GdkGLProfile:
|
||||
* @GDK_GL_PROFILE_DEFAULT: ...
|
||||
* @GDK_GL_PROFILE_LEGACY: ...
|
||||
* @GDK_GL_PROFILE_3_2_CORE: ...
|
||||
* GdkGLError:
|
||||
* @GDK_GL_ERROR_NOT_AVAILABLE: OpenGL support is not available
|
||||
* @GDK_GL_ERROR_UNSUPPORTED_FORMAT: The requested visual format is not supported
|
||||
* @GDK_GL_ERROR_UNSUPPORTED_PROFILE: The requested profile is not supported
|
||||
*
|
||||
* ...
|
||||
* Error enumeration for #GdkGLContext.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
typedef enum {
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
GDK_GL_PROFILE_LEGACY,
|
||||
GDK_GL_PROFILE_3_2_CORE
|
||||
} GdkGLProfile;
|
||||
|
||||
typedef enum {
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
|
||||
|
||||
@@ -1110,6 +1110,9 @@ find_native_sibling_above (GdkWindow *parent,
|
||||
{
|
||||
GdkWindow *w;
|
||||
|
||||
if (!parent)
|
||||
return NULL;
|
||||
|
||||
w = find_native_sibling_above_helper (parent, child);
|
||||
if (w)
|
||||
return w;
|
||||
@@ -2724,8 +2727,11 @@ gdk_window_ref_impl_surface (GdkWindow *window)
|
||||
}
|
||||
|
||||
GdkGLContext *
|
||||
gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
|
||||
gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
GError **error)
|
||||
{
|
||||
GError *internal_error = NULL;
|
||||
|
||||
if (_gdk_gl_flags & GDK_GL_DISABLE)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
@@ -2737,23 +2743,25 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
|
||||
if (window->impl_window->gl_paint_context == NULL)
|
||||
{
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
|
||||
TRUE,
|
||||
GDK_GL_PROFILE_3_2_CORE,
|
||||
NULL,
|
||||
error);
|
||||
if (window->impl_window->gl_paint_context == NULL &&
|
||||
g_error_matches (*error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE))
|
||||
{
|
||||
g_clear_error (error);
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
TRUE,
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
NULL,
|
||||
error);
|
||||
}
|
||||
&internal_error);
|
||||
}
|
||||
|
||||
if (internal_error != NULL)
|
||||
{
|
||||
g_propagate_error (error, internal_error);
|
||||
g_clear_object (&(window->impl_window->gl_paint_context));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdk_gl_context_realize (window->impl_window->gl_paint_context, &internal_error);
|
||||
if (internal_error != NULL)
|
||||
{
|
||||
g_propagate_error (error, internal_error);
|
||||
g_clear_object (&(window->impl_window->gl_paint_context));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return window->impl_window->gl_paint_context;
|
||||
@@ -2762,7 +2770,6 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
|
||||
/**
|
||||
* gdk_window_create_gl_context:
|
||||
* @window: a #GdkWindow
|
||||
* @profile: the GL profile the context should target
|
||||
* @error: return location for an error
|
||||
*
|
||||
* Creates a new #GdkGLContext matching the
|
||||
@@ -2771,6 +2778,9 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
|
||||
*
|
||||
* If the creation of the #GdkGLContext failed, @error will be set.
|
||||
*
|
||||
* Before using the returned #GdkGLContext, you will need to
|
||||
* call gdk_gl_context_make_current() or gdk_gl_context_realize().
|
||||
*
|
||||
* Returns: (transfer full): the newly created #GdkGLContext, or
|
||||
* %NULL on error
|
||||
*
|
||||
@@ -2778,7 +2788,6 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
|
||||
**/
|
||||
GdkGLContext *
|
||||
gdk_window_create_gl_context (GdkWindow *window,
|
||||
GdkGLProfile profile,
|
||||
GError **error)
|
||||
{
|
||||
GdkGLContext *paint_context;
|
||||
@@ -2790,9 +2799,8 @@ gdk_window_create_gl_context (GdkWindow *window,
|
||||
if (paint_context == NULL)
|
||||
return NULL;
|
||||
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
|
||||
FALSE,
|
||||
profile,
|
||||
paint_context,
|
||||
error);
|
||||
}
|
||||
@@ -2932,7 +2940,6 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glViewport (0, 0, ww, wh);
|
||||
}
|
||||
@@ -3104,7 +3111,6 @@ gdk_window_end_paint (GdkWindow *window)
|
||||
{
|
||||
surface = gdk_window_ref_impl_surface (window);
|
||||
cr = cairo_create (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
|
||||
gdk_cairo_region (cr, window->current_paint.region);
|
||||
@@ -3116,6 +3122,7 @@ gdk_window_end_paint (GdkWindow *window)
|
||||
cairo_destroy (cr);
|
||||
|
||||
cairo_surface_flush (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3901,10 +3908,10 @@ gdk_window_process_updates (GdkWindow *window,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
return gdk_window_process_updates_with_mode (window,
|
||||
update_children ?
|
||||
PROCESS_UPDATES_WITH_ALL_CHILDREN :
|
||||
PROCESS_UPDATES_NO_RECURSE);
|
||||
gdk_window_process_updates_with_mode (window,
|
||||
update_children ?
|
||||
PROCESS_UPDATES_WITH_ALL_CHILDREN :
|
||||
PROCESS_UPDATES_NO_RECURSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4661,6 +4668,8 @@ gdk_window_get_device_position_double (GdkWindow *window,
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
|
||||
|
||||
tmp_x = tmp_y = 0;
|
||||
tmp_mask = 0;
|
||||
normal_child = GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_device_state (window,
|
||||
device,
|
||||
&tmp_x, &tmp_y,
|
||||
@@ -5419,6 +5428,8 @@ gdk_window_withdraw (GdkWindow *window)
|
||||
* including #GDK_BUTTON_PRESS_MASK means the window should report button
|
||||
* press events. The event mask is the bitwise OR of values from the
|
||||
* #GdkEventMask enumeration.
|
||||
*
|
||||
* See the [input handling overview][event-masks] for details.
|
||||
**/
|
||||
void
|
||||
gdk_window_set_events (GdkWindow *window,
|
||||
@@ -5489,6 +5500,8 @@ gdk_window_get_events (GdkWindow *window)
|
||||
* press events. The event mask is the bitwise OR of values from the
|
||||
* #GdkEventMask enumeration.
|
||||
*
|
||||
* See the [input handling overview][event-masks] for details.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
void
|
||||
@@ -9946,7 +9959,7 @@ gdk_window_set_event_compression (GdkWindow *window,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
window->event_compression = event_compression;
|
||||
window->event_compression = !!event_compression;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -10912,6 +10925,8 @@ gdk_window_flush_events (GdkFrameClock *clock,
|
||||
_gdk_display_pause_events (display);
|
||||
|
||||
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS);
|
||||
|
||||
window->frame_clock_events_paused = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -10938,6 +10953,8 @@ gdk_window_resume_events (GdkFrameClock *clock,
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
_gdk_display_unpause_events (display);
|
||||
|
||||
window->frame_clock_events_paused = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -10970,6 +10987,9 @@ gdk_window_set_frame_clock (GdkWindow *window,
|
||||
|
||||
if (window->frame_clock)
|
||||
{
|
||||
if (window->frame_clock_events_paused)
|
||||
gdk_window_resume_events (window->frame_clock, G_OBJECT (window));
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
|
||||
G_CALLBACK (gdk_window_flush_events),
|
||||
window);
|
||||
@@ -11080,9 +11100,9 @@ gdk_window_get_unscaled_size (GdkWindow *window,
|
||||
/**
|
||||
* gdk_window_set_opaque_region:
|
||||
* @window: a top-level or non-native #GdkWindow
|
||||
* @region: a region
|
||||
* @region: (allow-none): a region, or %NULL
|
||||
*
|
||||
* For optimizization purposes, compositing window managers may
|
||||
* For optimisation purposes, compositing window managers may
|
||||
* like to not draw obscured regions of windows, or turn off blending
|
||||
* during for these regions. With RGB windows with no transparency,
|
||||
* this is just the shape of the window, but with ARGB32 windows, the
|
||||
@@ -11091,7 +11111,7 @@ gdk_window_get_unscaled_size (GdkWindow *window,
|
||||
*
|
||||
* This function only works for toplevel windows.
|
||||
*
|
||||
* GTK+ will automatically update this property automatically if
|
||||
* GTK+ will update this property automatically if
|
||||
* the @window background is opaque, as we know where the opaque regions
|
||||
* are. If your window background is not opaque, please update this
|
||||
* property in your #GtkWidget::style-updated handler.
|
||||
@@ -11110,7 +11130,7 @@ gdk_window_set_opaque_region (GdkWindow *window,
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
if (impl_class->set_opaque_region)
|
||||
return impl_class->set_opaque_region (window, region);
|
||||
impl_class->set_opaque_region (window, region);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1113,10 +1113,8 @@ gboolean gdk_window_show_window_menu (GdkWindow *window,
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_window_create_gl_context (GdkWindow *window,
|
||||
GdkGLProfile profile,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WINDOW_H__ */
|
||||
|
||||
@@ -293,9 +293,11 @@ struct _GdkWindowImplClass
|
||||
GdkEvent *event);
|
||||
GdkGLContext *(*create_gl_context) (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLProfile profile,
|
||||
GdkGLContext *share,
|
||||
GError **error);
|
||||
gboolean (* realize_gl_context) (GdkWindow *window,
|
||||
GdkGLContext *context,
|
||||
GError **error);
|
||||
void (*invalidate_for_new_frame)(GdkWindow *window,
|
||||
cairo_region_t *update_area);
|
||||
};
|
||||
@@ -303,7 +305,6 @@ struct _GdkWindowImplClass
|
||||
/* Interface Functions */
|
||||
GType gdk_window_impl_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WINDOW_IMPL_H__ */
|
||||
|
||||
@@ -269,6 +269,13 @@ _gdk_mir_print_resize_event (const MirResizeEvent *event)
|
||||
g_printerr (" Size (%i, %i)\n", event->width, event->height);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_close_event (const MirCloseSurfaceEvent *event)
|
||||
{
|
||||
g_printerr ("CLOSED\n");
|
||||
g_printerr (" Surface %i\n", event->surface_id);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_event (const MirEvent *event)
|
||||
{
|
||||
@@ -286,6 +293,9 @@ _gdk_mir_print_event (const MirEvent *event)
|
||||
case mir_event_type_resize:
|
||||
_gdk_mir_print_resize_event (&event->resize);
|
||||
break;
|
||||
case mir_event_type_close_surface:
|
||||
_gdk_mir_print_close_event (&event->close_surface);
|
||||
break;
|
||||
default:
|
||||
g_printerr ("EVENT %u\n", event->type);
|
||||
break;
|
||||
|
||||
@@ -69,6 +69,8 @@ GdkDevice *_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manage
|
||||
|
||||
GdkKeymap *_gdk_mir_keymap_new (void);
|
||||
|
||||
gboolean _gdk_mir_keymap_key_is_modifier (GdkKeymap *keymap, guint keycode);
|
||||
|
||||
GdkDevice *_gdk_mir_keyboard_new (GdkDeviceManager *device_manager, const gchar *name);
|
||||
|
||||
GdkDevice *_gdk_mir_pointer_new (GdkDeviceManager *device_manager, const gchar *name);
|
||||
@@ -131,4 +133,16 @@ void _gdk_mir_print_resize_event (const MirResizeEvent *event);
|
||||
|
||||
void _gdk_mir_print_event (const MirEvent *event);
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
GdkWindow * _gdk_mir_window_get_visible_transient_child (GdkWindow *window,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble *out_x,
|
||||
gdouble *out_y);
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
void _gdk_mir_window_transient_children_foreach (GdkWindow *window,
|
||||
void (*func) (GdkWindow *, gpointer),
|
||||
gpointer user_data);
|
||||
|
||||
#endif /* __GDK_PRIVATE_MIR_H__ */
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#define GDK_TYPE_MIR_WINDOW (gdk_mir_window_get_type ())
|
||||
#define GDK_IS_MIR_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_WINDOW))
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GType gdk_mir_display_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
MirConnection *gdk_mir_display_get_mir_connection (GdkDisplay *display);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GType gdk_mir_window_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
|
||||
@@ -416,9 +416,20 @@ gdk_mir_display_create_window_impl (GdkDisplay *display,
|
||||
g_printerr (" location=(%d, %d)", window->x, window->y);
|
||||
g_printerr (" size=(%d, %d)", window->width, window->height);
|
||||
g_printerr ("\n");
|
||||
if (attributes->wclass != GDK_INPUT_OUTPUT)
|
||||
return;
|
||||
window->impl = _gdk_mir_window_impl_new ();
|
||||
|
||||
if (attributes->wclass == GDK_INPUT_OUTPUT)
|
||||
{
|
||||
window->impl = _gdk_mir_window_impl_new ();
|
||||
window->impl_window = window;
|
||||
}
|
||||
else /* attributes->wclass == GDK_INPUT_ONLY */
|
||||
{
|
||||
window->impl = g_object_ref (real_parent->impl);
|
||||
window->impl_window = real_parent;
|
||||
|
||||
/* FIXME: this is called in gdk_window_new, which sets window->impl_window
|
||||
* back to window after this function returns. */
|
||||
}
|
||||
}
|
||||
|
||||
static GdkKeymap *
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "gdkmir.h"
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
#define NANO_TO_MILLI(x) ((x) / 1000000)
|
||||
|
||||
struct _GdkMirWindowReference {
|
||||
GdkMirEventSource *source;
|
||||
GdkWindow *window;
|
||||
@@ -39,6 +41,7 @@ struct _GdkMirEventSource
|
||||
|
||||
GMutex mir_event_lock;
|
||||
GQueue mir_events;
|
||||
gboolean log_events;
|
||||
|
||||
GdkDisplay *display;
|
||||
};
|
||||
@@ -50,6 +53,7 @@ send_event (GdkWindow *window, GdkDevice *device, GdkEvent *event)
|
||||
GList *node;
|
||||
|
||||
gdk_event_set_device (event, device);
|
||||
gdk_event_set_source_device (event, device);
|
||||
gdk_event_set_screen (event, gdk_display_get_screen (gdk_window_get_display (window), 0));
|
||||
event->any.window = g_object_ref (window);
|
||||
|
||||
@@ -118,7 +122,7 @@ set_key_event_string (GdkEventKey *event)
|
||||
}
|
||||
|
||||
static void
|
||||
generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint keyval, guint16 keycode, gboolean is_modifier)
|
||||
generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint keyval, guint16 keycode, gboolean is_modifier, guint32 event_time)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -127,6 +131,7 @@ generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint key
|
||||
event->key.keyval = keyval;
|
||||
event->key.hardware_keycode = keycode + 8;
|
||||
event->key.is_modifier = is_modifier;
|
||||
event->key.time = event_time;
|
||||
set_key_event_string (&event->key);
|
||||
|
||||
send_event (window, _gdk_mir_device_manager_get_keyboard (gdk_display_get_device_manager (gdk_window_get_display (window))), event);
|
||||
@@ -139,7 +144,7 @@ get_pointer (GdkWindow *window)
|
||||
}
|
||||
|
||||
static void
|
||||
generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint button, guint state)
|
||||
generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint button, guint state, guint32 event_time)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -148,12 +153,13 @@ generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble
|
||||
event->button.y = y;
|
||||
event->button.state = state;
|
||||
event->button.button = button;
|
||||
event->button.time = event_time;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x, gdouble delta_y, guint state)
|
||||
generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x, gdouble delta_y, guint state, guint32 event_time)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -161,15 +167,28 @@ generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x,
|
||||
event->scroll.x = x;
|
||||
event->scroll.y = y;
|
||||
event->scroll.state = state;
|
||||
event->scroll.direction = GDK_SCROLL_SMOOTH;
|
||||
event->scroll.delta_x = -delta_x;
|
||||
event->scroll.delta_y = -delta_y;
|
||||
event->scroll.time = event_time;
|
||||
|
||||
if (ABS (delta_x) == 1 && delta_y == 0)
|
||||
{
|
||||
event->scroll.direction = (delta_x < 0) ? GDK_SCROLL_LEFT : GDK_SCROLL_RIGHT;
|
||||
}
|
||||
else if (ABS (delta_y) == 1 && delta_x == 0)
|
||||
{
|
||||
event->scroll.direction = (delta_y < 0) ? GDK_SCROLL_DOWN : GDK_SCROLL_UP;
|
||||
}
|
||||
else
|
||||
{
|
||||
event->scroll.direction = GDK_SCROLL_SMOOTH;
|
||||
event->scroll.delta_x = -delta_x;
|
||||
event->scroll.delta_y = -delta_y;
|
||||
}
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state)
|
||||
generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state, guint32 event_time)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -178,12 +197,13 @@ generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state)
|
||||
event->motion.y = y;
|
||||
event->motion.state = state;
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.time = event_time;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y)
|
||||
generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint32 event_time)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -193,6 +213,7 @@ generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdoubl
|
||||
event->crossing.mode = GDK_CROSSING_NORMAL;
|
||||
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
||||
event->crossing.focus = TRUE;
|
||||
event->crossing.time = event_time;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
@@ -239,35 +260,30 @@ get_modifier_state (unsigned int modifiers, unsigned int button_state)
|
||||
return modifier_state;
|
||||
}
|
||||
|
||||
/*
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (event_data->window->impl);
|
||||
MirMotionButton changed_button_state;
|
||||
GdkEventType event_type;
|
||||
gdouble x, y;
|
||||
guint modifier_state;
|
||||
gboolean is_modifier = FALSE;
|
||||
*/
|
||||
|
||||
static void
|
||||
handle_key_event (GdkWindow *window, const MirKeyEvent *event)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
GdkKeymap *keymap;
|
||||
guint modifier_state;
|
||||
gboolean is_modifier = FALSE;
|
||||
|
||||
modifier_state = get_modifier_state (event->modifiers, 0); // FIXME: Need to track button state
|
||||
MirMotionButton button_state;
|
||||
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_key_action_down:
|
||||
case mir_key_action_up:
|
||||
// FIXME: Convert keycode
|
||||
// FIXME: is_modifier
|
||||
_gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, NULL, &button_state);
|
||||
modifier_state = get_modifier_state (event->modifiers, button_state);
|
||||
keymap = gdk_keymap_get_for_display (gdk_window_get_display (window));
|
||||
|
||||
generate_key_event (window,
|
||||
event->action == mir_key_action_down ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
|
||||
modifier_state,
|
||||
event->key_code,
|
||||
event->scan_code,
|
||||
is_modifier);
|
||||
_gdk_mir_keymap_key_is_modifier (keymap, event->key_code),
|
||||
NANO_TO_MILLI (event->event_time));
|
||||
break;
|
||||
default:
|
||||
//case mir_key_action_multiple:
|
||||
@@ -276,6 +292,47 @@ handle_key_event (GdkWindow *window, const MirKeyEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
typedef struct
|
||||
{
|
||||
GdkWindow *except;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
guint32 time;
|
||||
} LeaveInfo;
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
/*
|
||||
* leave_windows_except:
|
||||
*
|
||||
* Generate a leave event for every window except the one the cursor is in.
|
||||
*/
|
||||
static void
|
||||
leave_windows_except (GdkWindow *window,
|
||||
gpointer user_data)
|
||||
{
|
||||
LeaveInfo info = *((LeaveInfo *) user_data);
|
||||
|
||||
info.x -= window->x;
|
||||
info.y -= window->y;
|
||||
|
||||
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
|
||||
|
||||
if (window != info.except)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
gboolean cursor_inside;
|
||||
MirMotionButton button_state;
|
||||
|
||||
_gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, &cursor_inside, &button_state);
|
||||
|
||||
if (cursor_inside)
|
||||
generate_crossing_event (window, GDK_LEAVE_NOTIFY, info.x, info.y, info.time);
|
||||
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, info.x, info.y, FALSE, button_state);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
|
||||
{
|
||||
@@ -284,6 +341,7 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
|
||||
gboolean cursor_inside;
|
||||
MirMotionButton button_state;
|
||||
guint modifier_state;
|
||||
guint32 event_time;
|
||||
GdkEventType event_type;
|
||||
MirMotionButton changed_button_state;
|
||||
|
||||
@@ -294,45 +352,87 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
|
||||
y = event->pointer_coordinates[0].y;
|
||||
}
|
||||
modifier_state = get_modifier_state (event->modifiers, event->button_state);
|
||||
event_time = NANO_TO_MILLI (event->event_time);
|
||||
|
||||
/* The Mir events generate hover-exits even while inside the window so
|
||||
counteract this by always generating an enter notify on all other events */
|
||||
if (!cursor_inside && event->action != mir_motion_action_hover_exit)
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
if (event->action == mir_motion_action_hover_exit)
|
||||
{
|
||||
cursor_inside = TRUE;
|
||||
generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y);
|
||||
LeaveInfo info;
|
||||
|
||||
info.x = x;
|
||||
info.y = y;
|
||||
info.time = event_time;
|
||||
info.except = window;
|
||||
|
||||
/* Leave all transient children from leaf to root, except the root since we do it later. */
|
||||
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
|
||||
}
|
||||
else
|
||||
{
|
||||
LeaveInfo info;
|
||||
|
||||
info.x = x;
|
||||
info.y = y;
|
||||
info.time = event_time;
|
||||
info.except = _gdk_mir_window_get_visible_transient_child (window, x, y, &x, &y);
|
||||
|
||||
/* Leave all transient children from leaf to root, except the pointer window since we enter it. */
|
||||
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
|
||||
|
||||
window = info.except;
|
||||
|
||||
if (window)
|
||||
{
|
||||
/* Enter the pointer window. */
|
||||
gboolean cursor_inside_pointer_window;
|
||||
|
||||
impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
_gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, &cursor_inside_pointer_window, NULL);
|
||||
|
||||
if (!cursor_inside_pointer_window)
|
||||
{
|
||||
generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y, event_time);
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, x, y, TRUE, event->button_state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Update which window has focus */
|
||||
_gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
|
||||
switch (event->action)
|
||||
if (window)
|
||||
{
|
||||
case mir_motion_action_down:
|
||||
case mir_motion_action_up:
|
||||
event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
|
||||
changed_button_state = button_state ^ event->button_state;
|
||||
if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state);
|
||||
if ((changed_button_state & mir_motion_button_secondary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state);
|
||||
if ((changed_button_state & mir_motion_button_tertiary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state);
|
||||
button_state = event->button_state;
|
||||
break;
|
||||
case mir_motion_action_scroll:
|
||||
generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state);
|
||||
break;
|
||||
case mir_motion_action_move: // move with button
|
||||
case mir_motion_action_hover_move: // move without button
|
||||
generate_motion_event (window, x, y, modifier_state);
|
||||
break;
|
||||
case mir_motion_action_hover_exit:
|
||||
cursor_inside = FALSE;
|
||||
generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y);
|
||||
break;
|
||||
}
|
||||
/* Update which window has focus */
|
||||
_gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_motion_action_down:
|
||||
case mir_motion_action_up:
|
||||
event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
|
||||
changed_button_state = button_state ^ event->button_state;
|
||||
if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state, event_time);
|
||||
if ((changed_button_state & mir_motion_button_secondary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state, event_time);
|
||||
if ((changed_button_state & mir_motion_button_tertiary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state, event_time);
|
||||
button_state = event->button_state;
|
||||
break;
|
||||
case mir_motion_action_scroll:
|
||||
generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state, event_time);
|
||||
break;
|
||||
case mir_motion_action_move: // move with button
|
||||
case mir_motion_action_hover_move: // move without button
|
||||
generate_motion_event (window, x, y, modifier_state, event_time);
|
||||
break;
|
||||
case mir_motion_action_hover_exit:
|
||||
if (cursor_inside)
|
||||
{
|
||||
cursor_inside = FALSE;
|
||||
generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y, event_time);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state);
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -385,6 +485,14 @@ handle_resize_event (GdkWindow *window,
|
||||
generate_configure_event (window, event->width, event->height);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_close_event (GdkWindow *window,
|
||||
const MirCloseSurfaceEvent *event)
|
||||
{
|
||||
send_event (window, get_pointer (window), gdk_event_new (GDK_DESTROY));
|
||||
gdk_window_destroy_notify (window);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWindow *window;
|
||||
@@ -396,9 +504,6 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
const MirEvent *event)
|
||||
{
|
||||
if (g_getenv ("GDK_MIR_LOG_EVENTS"))
|
||||
_gdk_mir_print_event (event);
|
||||
|
||||
// FIXME: Only generate events if the window wanted them?
|
||||
switch (event->type)
|
||||
{
|
||||
@@ -420,6 +525,9 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
|
||||
case mir_event_type_orientation:
|
||||
// FIXME?
|
||||
break;
|
||||
case mir_event_type_close_surface:
|
||||
handle_close_event (window, &event->close_surface);
|
||||
break;
|
||||
default:
|
||||
g_warning ("Ignoring unknown Mir event %d", event->type);
|
||||
// FIXME?
|
||||
@@ -459,7 +567,12 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source)
|
||||
* event was being dispatched...
|
||||
*/
|
||||
if (window != NULL)
|
||||
gdk_mir_event_source_queue_event (source->display, window, &event->event);
|
||||
{
|
||||
if (source->log_events)
|
||||
_gdk_mir_print_event (&event->event);
|
||||
|
||||
gdk_mir_event_source_queue_event (source->display, window, &event->event);
|
||||
}
|
||||
else
|
||||
g_warning ("window was destroyed before event arrived...");
|
||||
|
||||
@@ -554,6 +667,7 @@ _gdk_mir_event_source_new (GdkDisplay *display)
|
||||
source = (GdkMirEventSource *) g_source;
|
||||
g_mutex_init (&source->mir_event_lock);
|
||||
source->display = display;
|
||||
source->log_events = (g_getenv ("GDK_MIR_LOG_EVENTS") != NULL);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,77 @@
|
||||
|
||||
G_DEFINE_TYPE (GdkMirGLContext, gdk_mir_gl_context, GDK_TYPE_GL_CONTEXT)
|
||||
|
||||
#define N_EGL_ATTRS 16
|
||||
|
||||
static gboolean
|
||||
gdk_mir_gl_context_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
GdkMirGLContext *context_mir = GDK_MIR_GL_CONTEXT (context);
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
GdkGLContext *share = gdk_gl_context_get_shared_context (context);
|
||||
EGLContext ctx;
|
||||
EGLint context_attribs[N_EGL_ATTRS];
|
||||
int major, minor, flags;
|
||||
gboolean debug_bit, forward_bit;
|
||||
int i = 0;
|
||||
|
||||
if (!_gdk_mir_display_init_egl_display (display))
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("No GL implementation is available"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gdk_gl_context_get_required_version (context, &major, &minor);
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
forward_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
|
||||
flags = 0;
|
||||
|
||||
if (debug_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
|
||||
if (forward_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
|
||||
/* We want a core profile */
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
|
||||
/* Specify the version */
|
||||
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
|
||||
context_attribs[i++] = major;
|
||||
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
|
||||
context_attribs[i++] = minor;
|
||||
|
||||
/* Specify the flags */
|
||||
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||
context_attribs[i++] = flags;
|
||||
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
g_assert (i < N_EGL_ATTRS);
|
||||
|
||||
ctx = eglCreateContext (_gdk_mir_display_get_egl_display (display),
|
||||
context_mir->egl_config,
|
||||
share != NULL ? GDK_MIR_GL_CONTEXT (share)->egl_context
|
||||
: EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL, g_print ("Created EGL context[%p]\n", ctx));
|
||||
|
||||
context_mir->egl_context = ctx;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
@@ -96,6 +167,7 @@ gdk_mir_gl_context_class_init (GdkMirGLContextClass *klass)
|
||||
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
context_class->realize = gdk_mir_gl_context_realize;
|
||||
context_class->end_frame = gdk_mir_gl_context_end_frame;
|
||||
gobject_class->dispose = gdk_mir_gl_context_dispose;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,12 @@ typedef struct GdkMirKeymapClass GdkMirKeymapClass;
|
||||
#define GDK_IS_MIR_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_KEYMAP))
|
||||
#define GDK_MIR_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_KEYMAP, GdkMirKeymapClass))
|
||||
|
||||
#define IsModifierKey(keysym) \
|
||||
(((keysym) >= XKB_KEY_Shift_L && (keysym) <= XKB_KEY_Hyper_R) || \
|
||||
((keysym) >= XKB_KEY_ISO_Lock && (keysym) <= XKB_KEY_ISO_Last_Group_Lock) || \
|
||||
((keysym) == XKB_KEY_Mode_switch) || \
|
||||
((keysym) == XKB_KEY_Num_Lock))
|
||||
|
||||
struct GdkMirKeymap
|
||||
{
|
||||
GdkKeymap parent_instance;
|
||||
@@ -342,6 +348,14 @@ gdk_mir_keymap_get_modifier_state (GdkKeymap *keymap)
|
||||
return get_gdk_modifiers (mir_keymap->xkb_keymap, mods);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_mir_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
guint keycode)
|
||||
{
|
||||
// FIXME: use xkb_state
|
||||
return IsModifierKey (keycode);
|
||||
}
|
||||
|
||||
static void
|
||||
update_direction (GdkMirKeymap *keymap)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkscreen.h"
|
||||
#include "gdkwindow.h"
|
||||
@@ -183,6 +184,11 @@ gdk_mir_pointer_ungrab (GdkDevice *device,
|
||||
{
|
||||
//g_printerr ("gdk_mir_pointer_ungrab\n");
|
||||
/* Mir doesn't do grabs */
|
||||
|
||||
GdkDeviceGrabInfo *grab = _gdk_display_get_last_device_grab (gdk_device_get_display (device), device);
|
||||
|
||||
if (grab)
|
||||
grab->serial_end = grab->serial_start;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
|
||||
@@ -327,35 +327,31 @@ gdk_mir_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
switch (output->type)
|
||||
{
|
||||
case mir_display_output_type_unknown:
|
||||
return g_strdup_printf ("UNKNOWN-%u", output->output_id);
|
||||
return g_strdup_printf ("None-%u", output->output_id);
|
||||
case mir_display_output_type_vga:
|
||||
return g_strdup_printf ("VGA-%u", output->output_id);
|
||||
case mir_display_output_type_dvii:
|
||||
return g_strdup_printf ("DVII-%u", output->output_id);
|
||||
case mir_display_output_type_dvid:
|
||||
return g_strdup_printf ("DVID-%u", output->output_id);
|
||||
case mir_display_output_type_dvia:
|
||||
return g_strdup_printf ("DVIA-%u", output->output_id);
|
||||
return g_strdup_printf ("DVI-%u", output->output_id);
|
||||
case mir_display_output_type_composite:
|
||||
return g_strdup_printf ("COMPOSITE-%u", output->output_id);
|
||||
case mir_display_output_type_svideo:
|
||||
return g_strdup_printf ("SVIDEO-%u", output->output_id);
|
||||
return g_strdup_printf ("Composite-%u", output->output_id);
|
||||
case mir_display_output_type_lvds:
|
||||
return g_strdup_printf ("LVDS-%u", output->output_id);
|
||||
case mir_display_output_type_component:
|
||||
return g_strdup_printf ("COMPONENT-%u", output->output_id);
|
||||
return g_strdup_printf ("CTV-%u", output->output_id);
|
||||
case mir_display_output_type_ninepindin:
|
||||
return g_strdup_printf ("NINEPINDIN-%u", output->output_id);
|
||||
return g_strdup_printf ("DIN-%u", output->output_id);
|
||||
case mir_display_output_type_displayport:
|
||||
return g_strdup_printf ("DISPLAYPORT-%u", output->output_id);
|
||||
return g_strdup_printf ("DP-%u", output->output_id);
|
||||
case mir_display_output_type_hdmia:
|
||||
return g_strdup_printf ("HDMIA-%u", output->output_id);
|
||||
case mir_display_output_type_hdmib:
|
||||
return g_strdup_printf ("HDMIB-%u", output->output_id);
|
||||
return g_strdup_printf ("HDMI-%u", output->output_id);
|
||||
case mir_display_output_type_svideo:
|
||||
case mir_display_output_type_tv:
|
||||
return g_strdup_printf ("TV-%u", output->output_id);
|
||||
case mir_display_output_type_edp:
|
||||
return g_strdup_printf ("EDP-%u", output->output_id);
|
||||
return g_strdup_printf ("eDP-%u", output->output_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,19 +183,29 @@ create_mir_surface (GdkDisplay *display,
|
||||
gint height,
|
||||
MirBufferUsage buffer_usage)
|
||||
{
|
||||
MirSurfaceParameters parameters;
|
||||
MirSurfaceSpec *spec;
|
||||
MirConnection *connection;
|
||||
|
||||
parameters.name = g_get_prgname ();
|
||||
parameters.width = width;
|
||||
parameters.height = height;
|
||||
parameters.pixel_format = _gdk_mir_display_get_pixel_format (display, buffer_usage);
|
||||
parameters.buffer_usage = buffer_usage;
|
||||
parameters.output_id = mir_display_output_id_invalid;
|
||||
MirPixelFormat format;
|
||||
MirSurface *surface;
|
||||
|
||||
connection = gdk_mir_display_get_mir_connection (display);
|
||||
format = _gdk_mir_display_get_pixel_format (display, buffer_usage);
|
||||
spec = mir_connection_create_spec_for_normal_surface (connection, width, height, format);
|
||||
mir_surface_spec_set_name (spec, g_get_prgname ());
|
||||
mir_surface_spec_set_buffer_usage (spec, buffer_usage);
|
||||
surface = mir_surface_create_sync (spec);
|
||||
mir_surface_spec_release (spec);
|
||||
|
||||
return mir_connection_create_surface_sync (connection, ¶meters);
|
||||
return surface;
|
||||
}
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
static gboolean
|
||||
should_render_in_parent (GdkWindow *window)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
return impl->transient_for && gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -206,7 +216,7 @@ ensure_surface_full (GdkWindow *window,
|
||||
MirEventDelegate event_delegate = { event_cb, NULL };
|
||||
GdkMirWindowReference *window_ref;
|
||||
|
||||
if (impl->surface)
|
||||
if (impl->surface || should_render_in_parent (window))
|
||||
return;
|
||||
|
||||
/* no destroy notify -- we must leak for now
|
||||
@@ -294,7 +304,7 @@ send_buffer (GdkWindow *window)
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
/* Transient windows draw onto parent instead */
|
||||
if (impl->transient_for)
|
||||
if (should_render_in_parent (window))
|
||||
{
|
||||
redraw_transient (window);
|
||||
return;
|
||||
@@ -352,7 +362,7 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
|
||||
}
|
||||
|
||||
/* Transient windows get rendered into a buffer and copied onto their parent */
|
||||
if (impl->transient_for || window->gl_paint_context)
|
||||
if (should_render_in_parent (window) || window->gl_paint_context)
|
||||
{
|
||||
cairo_surface = cairo_image_surface_create (pixel_format, window->width, window->height);
|
||||
}
|
||||
@@ -373,13 +383,13 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
|
||||
impl->cairo_surface = cairo_surface_reference (cairo_surface);
|
||||
|
||||
/* Draw background */
|
||||
c = cairo_create (impl->cairo_surface);
|
||||
if (impl->background)
|
||||
cairo_set_source (c, impl->background);
|
||||
else
|
||||
cairo_set_source_rgb (c, 1.0, 0.0, 0.0);
|
||||
cairo_paint (c);
|
||||
cairo_destroy (c);
|
||||
{
|
||||
c = cairo_create (impl->cairo_surface);
|
||||
cairo_set_source (c, impl->background);
|
||||
cairo_paint (c);
|
||||
cairo_destroy (c);
|
||||
}
|
||||
|
||||
return cairo_surface;
|
||||
}
|
||||
@@ -446,10 +456,11 @@ gdk_mir_window_impl_hide (GdkWindow *window)
|
||||
//g_printerr ("gdk_mir_window_impl_hide window=%p\n", window);
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
impl->cursor_inside = FALSE;
|
||||
impl->visible = FALSE;
|
||||
ensure_no_surface (window);
|
||||
|
||||
if (impl->transient_for)
|
||||
if (should_render_in_parent (window))
|
||||
redraw_transient (window);
|
||||
}
|
||||
|
||||
@@ -459,10 +470,11 @@ gdk_mir_window_impl_withdraw (GdkWindow *window)
|
||||
//g_printerr ("gdk_mir_window_impl_withdraw window=%p\n", window);
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
impl->cursor_inside = FALSE;
|
||||
impl->visible = FALSE;
|
||||
ensure_no_surface (window);
|
||||
|
||||
if (impl->transient_for)
|
||||
if (should_render_in_parent (window))
|
||||
redraw_transient (window);
|
||||
}
|
||||
|
||||
@@ -505,6 +517,7 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
/*
|
||||
g_printerr ("gdk_mir_window_impl_move_resize");
|
||||
g_printerr (" window=%p", window);
|
||||
if (with_move)
|
||||
@@ -512,24 +525,27 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
|
||||
if (width > 0)
|
||||
g_printerr (" size=%dx%dpx", width, height);
|
||||
g_printerr ("\n");
|
||||
*/
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
gboolean recreate_surface = FALSE;
|
||||
|
||||
/* Redraw parent where we moved from */
|
||||
if (impl->transient_for)
|
||||
if (should_render_in_parent (window))
|
||||
redraw_transient (window);
|
||||
|
||||
/* Transient windows can move wherever they want */
|
||||
if (with_move)
|
||||
{
|
||||
if (impl->transient_for)
|
||||
if (should_render_in_parent (window))
|
||||
{
|
||||
window->x = x;
|
||||
window->y = y;
|
||||
}
|
||||
else
|
||||
else if (x != impl->transient_x || y != impl->transient_y)
|
||||
{
|
||||
impl->transient_x = x;
|
||||
impl->transient_y = y;
|
||||
recreate_surface = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,16 +555,17 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
|
||||
/* We accept any resize */
|
||||
window->width = width;
|
||||
window->height = height;
|
||||
|
||||
if (impl->surface)
|
||||
{
|
||||
ensure_no_surface (window);
|
||||
ensure_surface (window);
|
||||
}
|
||||
recreate_surface = TRUE;
|
||||
}
|
||||
|
||||
if (recreate_surface && impl->surface)
|
||||
{
|
||||
ensure_no_surface (window);
|
||||
ensure_surface (window);
|
||||
}
|
||||
|
||||
/* Redraw parent where we moved to */
|
||||
if (impl->transient_for)
|
||||
if (should_render_in_parent (window))
|
||||
redraw_transient (window);
|
||||
}
|
||||
|
||||
@@ -711,7 +728,7 @@ gdk_mir_window_impl_input_shape_combine_region (GdkWindow *window,
|
||||
gint offset_x,
|
||||
gint offset_y)
|
||||
{
|
||||
g_printerr ("gdk_mir_window_impl_input_shape_combine_region window=%p\n", window);
|
||||
// g_printerr ("gdk_mir_window_impl_input_shape_combine_region window=%p\n", window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -725,7 +742,7 @@ gdk_mir_window_impl_destroy (GdkWindow *window,
|
||||
impl->visible = FALSE;
|
||||
ensure_no_surface (window);
|
||||
|
||||
if (impl->transient_for)
|
||||
if (should_render_in_parent (window))
|
||||
{
|
||||
/* Redraw parent */
|
||||
redraw_transient (window);
|
||||
@@ -862,7 +879,7 @@ static void
|
||||
gdk_mir_window_impl_set_title (GdkWindow *window,
|
||||
const gchar *title)
|
||||
{
|
||||
g_printerr ("gdk_mir_window_impl_set_title window=%p\n", window);
|
||||
// g_printerr ("gdk_mir_window_impl_set_title window=%p\n", window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -893,7 +910,7 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
|
||||
|
||||
/* Link this window to the parent */
|
||||
impl->transient_for = parent;
|
||||
if (parent)
|
||||
if (should_render_in_parent (window))
|
||||
{
|
||||
GdkMirWindowImpl *parent_impl = GDK_MIR_WINDOW_IMPL (parent->impl);
|
||||
parent_impl->transient_children = g_list_append (parent_impl->transient_children, window);
|
||||
@@ -902,12 +919,55 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
|
||||
window->x = impl->transient_x;
|
||||
window->y = impl->transient_y;
|
||||
|
||||
/* Remove surface if we had made one before this was set */
|
||||
ensure_no_surface (window);
|
||||
|
||||
/* Redraw onto parent */
|
||||
redraw_transient (window);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove surface if we had made one before this was set */
|
||||
ensure_no_surface (window);
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
GdkWindow *
|
||||
_gdk_mir_window_get_visible_transient_child (GdkWindow *window,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble *out_x,
|
||||
gdouble *out_y)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
GdkWindow *child = NULL;
|
||||
GList *i;
|
||||
|
||||
x -= window->x;
|
||||
y -= window->y;
|
||||
|
||||
if (x < 0 || x >= window->width || y < 0 || y >= window->height)
|
||||
return NULL;
|
||||
|
||||
for (i = impl->transient_children; i && !child; i = i->next)
|
||||
{
|
||||
if (GDK_MIR_WINDOW_IMPL (GDK_WINDOW (i->data)->impl)->visible)
|
||||
child = _gdk_mir_window_get_visible_transient_child (i->data, x, y, out_x, out_y);
|
||||
}
|
||||
|
||||
if (child)
|
||||
return child;
|
||||
|
||||
*out_x = x;
|
||||
*out_y = y;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/* TODO: Remove once we have proper transient window support. */
|
||||
void
|
||||
_gdk_mir_window_transient_children_foreach (GdkWindow *window,
|
||||
void (*func) (GdkWindow *, gpointer),
|
||||
gpointer user_data)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
g_list_foreach (impl->transient_children, (GFunc) func, user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1254,7 +1314,7 @@ gdk_mir_window_impl_set_shadow_width (GdkWindow *window,
|
||||
gint top,
|
||||
gint bottom)
|
||||
{
|
||||
g_printerr ("gdk_mir_window_impl_set_shadow_width window=%p\n", window);
|
||||
// g_printerr ("gdk_mir_window_impl_set_shadow_width window=%p\n", window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1332,16 +1392,12 @@ find_eglconfig_for_window (GdkWindow *window,
|
||||
static GdkGLContext *
|
||||
gdk_mir_window_impl_create_gl_context (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLProfile profile,
|
||||
GdkGLContext *share,
|
||||
GError **error)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkMirGLContext *context;
|
||||
EGLContext ctx;
|
||||
EGLConfig config;
|
||||
int i;
|
||||
EGLint context_attribs[3];
|
||||
|
||||
if (!_gdk_mir_display_init_egl_display (display))
|
||||
{
|
||||
@@ -1351,11 +1407,7 @@ gdk_mir_window_impl_create_gl_context (GdkWindow *window,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (profile == GDK_GL_PROFILE_DEFAULT)
|
||||
profile = GDK_GL_PROFILE_LEGACY;
|
||||
|
||||
if (profile == GDK_GL_PROFILE_3_2_CORE &&
|
||||
!_gdk_mir_display_have_egl_khr_create_context (display))
|
||||
if (!_gdk_mir_display_have_egl_khr_create_context (display))
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE,
|
||||
@@ -1366,38 +1418,13 @@ gdk_mir_window_impl_create_gl_context (GdkWindow *window,
|
||||
if (!find_eglconfig_for_window (window, &config, error))
|
||||
return NULL;
|
||||
|
||||
i = 0;
|
||||
if (profile == GDK_GL_PROFILE_3_2_CORE)
|
||||
{
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
}
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
|
||||
ctx = eglCreateContext (_gdk_mir_display_get_egl_display (display),
|
||||
config,
|
||||
share ? GDK_MIR_GL_CONTEXT (share)->egl_context : EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Created EGL context[%p]\n", ctx));
|
||||
|
||||
context = g_object_new (GDK_TYPE_MIR_GL_CONTEXT,
|
||||
"display", display,
|
||||
"window", window,
|
||||
"profile", profile,
|
||||
"shared-context", share,
|
||||
NULL);
|
||||
|
||||
context->egl_config = config;
|
||||
context->egl_context = ctx;
|
||||
context->is_attached = attached;
|
||||
|
||||
return GDK_GL_CONTEXT (context);
|
||||
|
||||
@@ -33,6 +33,8 @@ libgdk_quartz_la_SOURCES = \
|
||||
gdkdnd-quartz.h \
|
||||
gdkevents-quartz.c \
|
||||
gdkeventloop-quartz.c \
|
||||
gdkglcontext-quartz.c \
|
||||
gdkglcontext-quartz.h \
|
||||
gdkglobals-quartz.c \
|
||||
gdkkeys-quartz.c \
|
||||
gdkprivate-quartz.h \
|
||||
|
||||
39
gdk/quartz/gdkglcontext-quartz.c
Normal file
39
gdk/quartz/gdkglcontext-quartz.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontext-quartz.c: Quartz specific OpenGL wrappers
|
||||
*
|
||||
* Copyright © 2014 Emmanuele Bassi
|
||||
* Copyright © 2014 Alexander Larsson
|
||||
* Copyright © 2014 Brion Vibber
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkglcontext-quartz.h"
|
||||
|
||||
#include "gdkintl.h"
|
||||
|
||||
GdkGLContext *
|
||||
gdk_quartz_window_create_gl_context (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLContext *share,
|
||||
GError **error)
|
||||
{
|
||||
/* FIXME: implement */
|
||||
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Not implemented on OS X"));
|
||||
return NULL;
|
||||
}
|
||||
41
gdk/quartz/gdkglcontext-quartz.h
Normal file
41
gdk/quartz/gdkglcontext-quartz.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontext-quartz.h: Private Quartz specific OpenGL wrappers
|
||||
*
|
||||
* Copyright © 2014 Emmanuele Bassi
|
||||
* Copyright © 2014 Red Hat, Int
|
||||
* Copyright © 2014 Brion Vibber
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_QUARTZ_GL_CONTEXT__
|
||||
#define __GDK_QUARTZ_GL_CONTEXT__
|
||||
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdkvisual.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkmain.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GdkGLContext * gdk_quartz_window_create_gl_context (GdkWindow *window,
|
||||
gboolean attach,
|
||||
GdkGLContext *share,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_QUARTZ_GL_CONTEXT__ */
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "gdkwindowimpl.h"
|
||||
#include "gdkprivate-quartz.h"
|
||||
#include "gdkglcontext-quartz.h"
|
||||
#include "gdkquartzscreen.h"
|
||||
#include "gdkquartzcursor.h"
|
||||
|
||||
@@ -818,7 +819,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
|
||||
impl->view = NULL;
|
||||
|
||||
switch (attributes->window_type)
|
||||
switch (window->window_type)
|
||||
{
|
||||
case GDK_WINDOW_TOPLEVEL:
|
||||
case GDK_WINDOW_TEMP:
|
||||
@@ -846,8 +847,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
window->width,
|
||||
window->height);
|
||||
|
||||
if (attributes->window_type == GDK_WINDOW_TEMP ||
|
||||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
|
||||
if (window->window_type == GDK_WINDOW_TEMP ||
|
||||
((attributes_mask & GDK_WA_TYPE_HINT) &&
|
||||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
|
||||
{
|
||||
style_mask = NSBorderlessWindowMask;
|
||||
}
|
||||
@@ -2943,6 +2945,7 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
|
||||
impl_class->change_property = _gdk_quartz_window_change_property;
|
||||
impl_class->delete_property = _gdk_quartz_window_delete_property;
|
||||
|
||||
impl_class->create_gl_context = gdk_quartz_window_create_gl_context;
|
||||
|
||||
impl_quartz_class->get_context = gdk_window_impl_quartz_get_context;
|
||||
impl_quartz_class->release_context = gdk_window_impl_quartz_release_context;
|
||||
|
||||
@@ -32,15 +32,15 @@
|
||||
|
||||
static char *
|
||||
gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
|
||||
GAppInfo *info,
|
||||
GList *files)
|
||||
GAppInfo *info,
|
||||
GList *files)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
|
||||
const char *startup_notify_id)
|
||||
gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
|
||||
const char *startup_notify_id)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -59,6 +59,7 @@ struct _GdkWaylandCursor
|
||||
} surface;
|
||||
|
||||
struct wl_cursor *wl_cursor;
|
||||
int scale;
|
||||
};
|
||||
|
||||
struct _GdkWaylandCursorClass
|
||||
@@ -83,10 +84,18 @@ _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
|
||||
_gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
|
||||
GdkWaylandCursor *cursor)
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
/* Do nothing if this is not a wl_cursor cursor. */
|
||||
if (cursor->name == NULL)
|
||||
return FALSE;
|
||||
|
||||
theme = _gdk_wayland_display_get_scaled_cursor_theme (wayland_display,
|
||||
cursor->scale);
|
||||
c = wl_cursor_theme_get_cursor (theme, cursor->name);
|
||||
if (!c)
|
||||
{
|
||||
@@ -105,8 +114,7 @@ set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
struct wl_cursor_theme *theme)
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
const char *name;
|
||||
@@ -115,7 +123,7 @@ _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
g_hash_table_iter_init (&iter, display->cursor_cache);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &cursor))
|
||||
set_cursor_from_theme (cursor, theme);
|
||||
_gdk_wayland_cursor_update (display, cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -168,11 +176,11 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
|
||||
*w = image->width;
|
||||
*h = image->height;
|
||||
*scale = 1;
|
||||
*scale = wayland_cursor->scale;
|
||||
|
||||
return wl_cursor_image_get_buffer (image);
|
||||
}
|
||||
else /* From surface */
|
||||
else if (wayland_cursor->name == NULL) /* From surface */
|
||||
{
|
||||
*hotspot_x = wayland_cursor->surface.hotspot_x;
|
||||
*hotspot_y = wayland_cursor->surface.hotspot_y;
|
||||
@@ -185,9 +193,9 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
|
||||
if (wayland_cursor->surface.cairo_surface)
|
||||
return _gdk_wayland_shm_surface_get_wl_buffer (wayland_cursor->surface.cairo_surface);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
guint
|
||||
@@ -216,6 +224,28 @@ _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
|
||||
return current_image_index;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_cursor_set_scale (GdkCursor *cursor,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (gdk_cursor_get_display (cursor));
|
||||
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
|
||||
|
||||
if (scale > GDK_WAYLAND_MAX_THEME_SCALE)
|
||||
{
|
||||
g_warning (G_STRLOC ": cursor theme size %u too large", scale);
|
||||
scale = GDK_WAYLAND_MAX_THEME_SCALE;
|
||||
}
|
||||
|
||||
if (wayland_cursor->scale == scale)
|
||||
return;
|
||||
|
||||
wayland_cursor->scale = scale;
|
||||
|
||||
_gdk_wayland_cursor_update (wayland_display, wayland_cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_wayland_cursor_class_init (GdkWaylandCursorClass *wayland_cursor_class)
|
||||
{
|
||||
@@ -232,9 +262,15 @@ _gdk_wayland_cursor_init (GdkWaylandCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
guint scale);
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
|
||||
GdkCursorType cursor_type,
|
||||
guint scale)
|
||||
{
|
||||
GEnumClass *enum_class;
|
||||
GEnumValue *enum_value;
|
||||
@@ -247,7 +283,9 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
g_strdelimit (cursor_name, "-", '_');
|
||||
g_type_class_unref (enum_class);
|
||||
|
||||
result = _gdk_wayland_display_get_cursor_for_name (display, cursor_name);
|
||||
result = _gdk_wayland_display_get_cursor_for_name_with_scale (display,
|
||||
cursor_name,
|
||||
scale);
|
||||
|
||||
g_free (cursor_name);
|
||||
|
||||
@@ -255,8 +293,18 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
return _gdk_wayland_display_get_cursor_for_type_with_scale (display,
|
||||
cursor_type,
|
||||
1);
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandCursor *private;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
@@ -272,13 +320,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
"display", display,
|
||||
NULL);
|
||||
private->name = g_strdup (name);
|
||||
private->surface.scale = 1;
|
||||
private->scale = scale;
|
||||
|
||||
/* Blank cursor case */
|
||||
if (!name || g_str_equal (name, "blank_cursor"))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
if (!set_cursor_from_theme (private, wayland_display->cursor_theme))
|
||||
if (!_gdk_wayland_cursor_update (wayland_display, private))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
/* Insert into cache. */
|
||||
@@ -286,6 +334,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_wayland_display_get_cursor_for_name_with_scale (display, name, 1);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
cairo_surface_t *surface,
|
||||
|
||||
@@ -93,6 +93,11 @@ struct _GdkWaylandDeviceData
|
||||
GdkDragContext *drop_context;
|
||||
|
||||
struct wl_surface *pointer_surface;
|
||||
guint current_output_scale;
|
||||
GSList *pointer_surface_outputs;
|
||||
|
||||
/* Source/dest for non-local dnd */
|
||||
GdkWindow *foreign_dnd_window;
|
||||
};
|
||||
|
||||
struct _GdkWaylandDevice
|
||||
@@ -206,10 +211,13 @@ gdk_wayland_device_update_window_cursor (GdkWaylandDeviceData *wd)
|
||||
wd->enter_serial,
|
||||
wd->pointer_surface,
|
||||
x, y);
|
||||
wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
|
||||
wl_surface_set_buffer_scale (wd->pointer_surface, scale);
|
||||
wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
|
||||
wl_surface_commit (wd->pointer_surface);
|
||||
if (buffer)
|
||||
{
|
||||
wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
|
||||
wl_surface_set_buffer_scale (wd->pointer_surface, scale);
|
||||
wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
|
||||
wl_surface_commit (wd->pointer_surface);
|
||||
}
|
||||
|
||||
if (wd->grab_cursor)
|
||||
{
|
||||
@@ -254,10 +262,14 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device,
|
||||
*/
|
||||
if (!cursor)
|
||||
{
|
||||
/* FIXME: Is this the best sensible default ? */
|
||||
cursor = _gdk_wayland_display_get_cursor_for_type (device->display,
|
||||
GDK_LEFT_PTR);
|
||||
guint scale = wd->current_output_scale;
|
||||
cursor =
|
||||
_gdk_wayland_display_get_cursor_for_type_with_scale (wd->display,
|
||||
GDK_LEFT_PTR,
|
||||
scale);
|
||||
}
|
||||
else
|
||||
_gdk_wayland_cursor_set_scale (cursor, wd->current_output_scale);
|
||||
|
||||
if (cursor == wd->cursor)
|
||||
return;
|
||||
@@ -282,8 +294,10 @@ gdk_wayland_device_warp (GdkDevice *device,
|
||||
|
||||
static void
|
||||
get_coordinates (GdkWaylandDeviceData *data,
|
||||
double *x, double *y,
|
||||
double *x_root, double *y_root)
|
||||
double *x,
|
||||
double *y,
|
||||
double *x_root,
|
||||
double *y_root)
|
||||
{
|
||||
int root_x, root_y;
|
||||
|
||||
@@ -357,7 +371,6 @@ gdk_wayland_device_grab (GdkDevice *device,
|
||||
else
|
||||
{
|
||||
/* Device is a pointer */
|
||||
|
||||
if (wayland_device->pointer_grab_window != NULL &&
|
||||
time_ != 0 && wayland_device->pointer_grab_time > time_)
|
||||
{
|
||||
@@ -482,7 +495,7 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
|
||||
* gdk_wayland_device_get_wl_seat:
|
||||
* @device: (type GdkWaylandDevice): a #GdkDevice
|
||||
*
|
||||
* Returns the Wayland wl_seat of a #GdkDevice
|
||||
* Returns the Wayland wl_seat of a #GdkDevice.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_seat
|
||||
*
|
||||
@@ -491,7 +504,7 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
|
||||
struct wl_seat *
|
||||
gdk_wayland_device_get_wl_seat (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
|
||||
return GDK_WAYLAND_DEVICE (device)->device->wl_seat;
|
||||
}
|
||||
@@ -500,7 +513,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
|
||||
* gdk_wayland_device_get_wl_pointer:
|
||||
* @device: (type GdkWaylandDevice): a #GdkDevice
|
||||
*
|
||||
* Returns the Wayland wl_pointer of a #GdkDevice
|
||||
* Returns the Wayland wl_pointer of a #GdkDevice.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_pointer
|
||||
*
|
||||
@@ -509,7 +522,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
|
||||
struct wl_pointer *
|
||||
gdk_wayland_device_get_wl_pointer (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
|
||||
return GDK_WAYLAND_DEVICE (device)->device->wl_pointer;
|
||||
}
|
||||
@@ -518,7 +531,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
|
||||
* gdk_wayland_device_get_wl_keyboard:
|
||||
* @device: (type GdkWaylandDevice): a #GdkDevice
|
||||
*
|
||||
* Returns the Wayland wl_keyboard of a #GdkDevice
|
||||
* Returns the Wayland wl_keyboard of a #GdkDevice.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_keyboard
|
||||
*
|
||||
@@ -527,7 +540,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
|
||||
struct wl_keyboard *
|
||||
gdk_wayland_device_get_wl_keyboard (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
|
||||
return GDK_WAYLAND_DEVICE (device)->device->wl_keyboard;
|
||||
}
|
||||
@@ -574,11 +587,15 @@ emit_selection_owner_change_forall (GdkAtom atom)
|
||||
static void
|
||||
data_device_data_offer (void *data,
|
||||
struct wl_data_device *data_device,
|
||||
struct wl_data_offer *_offer)
|
||||
struct wl_data_offer *offer)
|
||||
{
|
||||
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *)data;
|
||||
gdk_wayland_selection_set_offer (device->display, _offer);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device data offer, data device %p, offer %p",
|
||||
data_device, offer));
|
||||
|
||||
gdk_wayland_selection_set_offer (device->display, offer);
|
||||
emit_selection_owner_change_forall (gdk_atom_intern_static_string ("GdkWaylandSelection"));
|
||||
}
|
||||
|
||||
@@ -599,8 +616,9 @@ data_device_enter (void *data,
|
||||
if (!GDK_IS_WINDOW (dest_window))
|
||||
return;
|
||||
|
||||
g_debug (G_STRLOC ": %s data_device = %p serial = %u, surface = %p, x = %d y = %d, offer = %p",
|
||||
G_STRFUNC, data_device, serial, surface, x, y, offer);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device enter, data device %p serial %u, surface %p, x %d y %d, offer %p",
|
||||
data_device, serial, surface, x, y, offer));
|
||||
|
||||
/* Update pointer state, so device state queries work during DnD */
|
||||
device->pointer_focus = g_object_ref (dest_window);
|
||||
@@ -611,8 +629,10 @@ data_device_enter (void *data,
|
||||
|
||||
dnd_owner = gdk_selection_owner_get_for_display (device->display, gdk_drag_get_selection (device->drop_context));
|
||||
|
||||
if (dnd_owner)
|
||||
_gdk_wayland_drag_context_set_source_window (device->drop_context, dnd_owner);
|
||||
if (!dnd_owner)
|
||||
dnd_owner = device->foreign_dnd_window;
|
||||
|
||||
_gdk_wayland_drag_context_set_source_window (device->drop_context, dnd_owner);
|
||||
|
||||
_gdk_wayland_drag_context_set_dest_window (device->drop_context,
|
||||
dest_window, serial);
|
||||
@@ -632,8 +652,8 @@ data_device_leave (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
|
||||
|
||||
g_debug (G_STRLOC ": %s data_device = %p",
|
||||
G_STRFUNC, data_device);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device leave, data device %p", data_device));
|
||||
|
||||
if (!gdk_drag_context_get_dest_window (device->drop_context))
|
||||
return;
|
||||
@@ -680,8 +700,8 @@ data_device_drop (void *data,
|
||||
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
|
||||
GdkWindow *local_dnd_owner;
|
||||
|
||||
g_debug (G_STRLOC ": %s data_device = %p",
|
||||
G_STRFUNC, data_device);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device drop, data device %p", data_device));
|
||||
|
||||
local_dnd_owner = gdk_selection_owner_get_for_display (device->display, gdk_drag_get_selection (device->drop_context));
|
||||
|
||||
@@ -704,8 +724,9 @@ data_device_selection (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
|
||||
|
||||
g_debug (G_STRLOC ": %s wl_data_device = %p wl_data_offer = %p",
|
||||
G_STRFUNC, wl_data_device, offer);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device selection, data device %p, data offer %p",
|
||||
wl_data_device, offer));
|
||||
|
||||
gdk_wayland_selection_set_offer (device->display, offer);
|
||||
emit_selection_owner_change_forall (gdk_atom_intern_static_string ("CLIPBOARD"));
|
||||
@@ -735,6 +756,7 @@ pointer_handle_enter (void *data,
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
@@ -781,13 +803,14 @@ pointer_handle_leave (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
if (!device->pointer_focus)
|
||||
return;
|
||||
|
||||
@@ -818,7 +841,7 @@ pointer_handle_leave (void *data,
|
||||
g_message ("leave, device %p surface %p",
|
||||
device, device->pointer_focus));
|
||||
|
||||
g_object_unref(device->pointer_focus);
|
||||
g_object_unref (device->pointer_focus);
|
||||
if (device->cursor)
|
||||
gdk_wayland_device_stop_window_cursor_animation (device);
|
||||
|
||||
@@ -862,8 +885,8 @@ pointer_handle_motion (void *data,
|
||||
&event->motion.y_root);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("motion %d %d, state %d",
|
||||
sx, sy, event->button.state));
|
||||
g_message ("motion %d %d, device %p state %d",
|
||||
sx, sy, device, event->button.state));
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
}
|
||||
@@ -881,25 +904,24 @@ pointer_handle_button (void *data,
|
||||
GdkEvent *event;
|
||||
uint32_t modifier;
|
||||
int gdk_button;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!device->pointer_focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
switch (button) {
|
||||
case 273:
|
||||
gdk_button = 3;
|
||||
break;
|
||||
case 274:
|
||||
gdk_button = 2;
|
||||
break;
|
||||
default:
|
||||
gdk_button = button - 271;
|
||||
break;
|
||||
}
|
||||
switch (button)
|
||||
{
|
||||
case 273:
|
||||
gdk_button = 3;
|
||||
break;
|
||||
case 274:
|
||||
gdk_button = 2;
|
||||
break;
|
||||
default:
|
||||
gdk_button = button - 271;
|
||||
break;
|
||||
}
|
||||
|
||||
device->time = time;
|
||||
if (state)
|
||||
@@ -928,9 +950,11 @@ pointer_handle_button (void *data,
|
||||
device->modifiers &= ~modifier;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("button %d %s, state %d",
|
||||
g_message ("button %d %s, device %p state %d",
|
||||
event->button.button,
|
||||
state ? "press" : "release", event->button.state));
|
||||
state ? "press" : "release",
|
||||
device,
|
||||
event->button.state));
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
}
|
||||
@@ -951,18 +975,19 @@ pointer_handle_axis (void *data,
|
||||
return;
|
||||
|
||||
/* get the delta and convert it into the expected range */
|
||||
switch (axis) {
|
||||
case WL_POINTER_AXIS_VERTICAL_SCROLL:
|
||||
delta_x = 0;
|
||||
delta_y = wl_fixed_to_double (value) / 10.0;
|
||||
break;
|
||||
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
|
||||
delta_x = wl_fixed_to_double (value) / 10.0;
|
||||
delta_y = 0;
|
||||
break;
|
||||
default:
|
||||
g_return_if_reached ();
|
||||
}
|
||||
switch (axis)
|
||||
{
|
||||
case WL_POINTER_AXIS_VERTICAL_SCROLL:
|
||||
delta_x = 0;
|
||||
delta_y = wl_fixed_to_double (value) / 10.0;
|
||||
break;
|
||||
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
|
||||
delta_x = wl_fixed_to_double (value) / 10.0;
|
||||
delta_y = 0;
|
||||
break;
|
||||
default:
|
||||
g_return_if_reached ();
|
||||
}
|
||||
|
||||
device->time = time;
|
||||
event = gdk_event_new (GDK_SCROLL);
|
||||
@@ -983,8 +1008,8 @@ pointer_handle_axis (void *data,
|
||||
&event->scroll.y_root);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("scroll %f %f",
|
||||
event->scroll.delta_x, event->scroll.delta_y));
|
||||
g_message ("scroll %f %f, device %p",
|
||||
event->scroll.delta_x, event->scroll.delta_y, device));
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
}
|
||||
@@ -1014,18 +1039,18 @@ keyboard_handle_enter (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
device->keyboard_focus = wl_surface_get_user_data(surface);
|
||||
g_object_ref(device->keyboard_focus);
|
||||
device->keyboard_focus = wl_surface_get_user_data (surface);
|
||||
g_object_ref (device->keyboard_focus);
|
||||
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->focus_change.window = g_object_ref (device->keyboard_focus);
|
||||
@@ -1035,7 +1060,7 @@ keyboard_handle_enter (void *data,
|
||||
gdk_event_set_source_device (event, device->keyboard);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("focus int, device %p surface %p",
|
||||
g_message ("focus in, device %p surface %p",
|
||||
device, device->keyboard_focus));
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
@@ -1049,17 +1074,18 @@ keyboard_handle_leave (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
if (!device->keyboard_focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->focus_change.window = g_object_ref (device->keyboard_focus);
|
||||
@@ -1068,7 +1094,7 @@ keyboard_handle_leave (void *data,
|
||||
gdk_event_set_device (event, device->master_keyboard);
|
||||
gdk_event_set_source_device (event, device->keyboard);
|
||||
|
||||
g_object_unref(device->keyboard_focus);
|
||||
g_object_unref (device->keyboard_focus);
|
||||
device->keyboard_focus = NULL;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
@@ -1078,8 +1104,7 @@ keyboard_handle_leave (void *data,
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
keyboard_repeat (gpointer data);
|
||||
static gboolean keyboard_repeat (gpointer data);
|
||||
|
||||
static void
|
||||
translate_keyboard_string (GdkEventKey *event)
|
||||
@@ -1100,11 +1125,11 @@ translate_keyboard_string (GdkEventKey *event)
|
||||
gsize bytes_written;
|
||||
gint len;
|
||||
|
||||
/* Apply the control key - Taken from Xlib
|
||||
*/
|
||||
/* Apply the control key - Taken from Xlib */
|
||||
if (event->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F;
|
||||
if ((c >= '@' && c < '\177') || c == ' ')
|
||||
c &= 0x1F;
|
||||
else if (c == '2')
|
||||
{
|
||||
event->string = g_memdup ("\0\0", 2);
|
||||
@@ -1112,9 +1137,12 @@ translate_keyboard_string (GdkEventKey *event)
|
||||
buf[0] = '\0';
|
||||
return;
|
||||
}
|
||||
else if (c >= '3' && c <= '7') c -= ('3' - '\033');
|
||||
else if (c == '8') c = '\177';
|
||||
else if (c == '/') c = '_' & 0x1F;
|
||||
else if (c >= '3' && c <= '7')
|
||||
c -= ('3' - '\033');
|
||||
else if (c == '8')
|
||||
c = '\177';
|
||||
else if (c == '/')
|
||||
c = '_' & 0x1F;
|
||||
}
|
||||
|
||||
len = g_unichar_to_utf8 (c, buf);
|
||||
@@ -1277,7 +1305,6 @@ deliver_key_event (GdkWaylandDeviceData *device,
|
||||
g_source_remove (device->repeat_timer);
|
||||
device->repeat_timer = 0;
|
||||
}
|
||||
|
||||
device->repeat_timer =
|
||||
gdk_threads_add_timeout (delay, keyboard_repeat, device);
|
||||
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
|
||||
@@ -1310,14 +1337,13 @@ keyboard_handle_key (void *data,
|
||||
uint32_t state_w)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!device->keyboard_focus)
|
||||
return;
|
||||
|
||||
device->repeat_count = 0;
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
deliver_key_event (data, time, key + 8, state_w);
|
||||
}
|
||||
|
||||
@@ -1439,12 +1465,11 @@ touch_handle_down (void *data,
|
||||
wl_fixed_t y)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandTouchData *touch;
|
||||
GdkEvent *event;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
touch = gdk_wayland_device_add_touch (device, id, wl_surface);
|
||||
touch->x = wl_fixed_to_double (x);
|
||||
@@ -1467,12 +1492,11 @@ touch_handle_up (void *data,
|
||||
int32_t id)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandTouchData *touch;
|
||||
GdkEvent *event;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
touch = gdk_wayland_device_get_touch (device, id);
|
||||
event = _create_touch_event (device, touch, GDK_TOUCH_END, time);
|
||||
@@ -1568,8 +1592,13 @@ seat_handle_capabilities (void *data,
|
||||
enum wl_seat_capability caps)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDeviceManager *device_manager =
|
||||
GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
|
||||
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("seat %p with %s%s%s", seat,
|
||||
(caps & WL_SEAT_CAPABILITY_POINTER) ? " pointer, " : "",
|
||||
(caps & WL_SEAT_CAPABILITY_KEYBOARD) ? " keyboard, " : "",
|
||||
(caps & WL_SEAT_CAPABILITY_TOUCH) ? " touch" : ""));
|
||||
|
||||
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !device->wl_pointer)
|
||||
{
|
||||
@@ -1689,11 +1718,13 @@ seat_handle_capabilities (void *data,
|
||||
}
|
||||
|
||||
static void
|
||||
seat_handle_name (void *data,
|
||||
struct wl_seat *seat,
|
||||
const char *name)
|
||||
seat_handle_name (void *data,
|
||||
struct wl_seat *seat,
|
||||
const char *name)
|
||||
{
|
||||
/* We don't care about the name. */
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("seat %p name %s", seat, name));
|
||||
}
|
||||
|
||||
static const struct wl_seat_listener seat_listener = {
|
||||
@@ -1704,8 +1735,7 @@ static const struct wl_seat_listener seat_listener = {
|
||||
static void
|
||||
init_devices (GdkWaylandDeviceData *device)
|
||||
{
|
||||
GdkWaylandDeviceManager *device_manager =
|
||||
GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
|
||||
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
|
||||
|
||||
/* pointer */
|
||||
device->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
|
||||
@@ -1744,6 +1774,98 @@ init_devices (GdkWaylandDeviceData *device)
|
||||
_gdk_device_set_associated_device (device->master_keyboard, device->master_pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_update_scale (GdkWaylandDeviceData *device)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
guint32 scale;
|
||||
GSList *l;
|
||||
|
||||
if (wayland_display->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
{
|
||||
/* We can't set the scale on this surface */
|
||||
return;
|
||||
}
|
||||
|
||||
scale = 1;
|
||||
for (l = device->pointer_surface_outputs; l != NULL; l = l->next)
|
||||
{
|
||||
guint32 output_scale =
|
||||
_gdk_wayland_screen_get_output_scale (wayland_display->screen,
|
||||
l->data);
|
||||
scale = MAX (scale, output_scale);
|
||||
}
|
||||
|
||||
device->current_output_scale = scale;
|
||||
|
||||
if (device->grab_cursor)
|
||||
_gdk_wayland_cursor_set_scale (device->grab_cursor, scale);
|
||||
if (device->cursor)
|
||||
_gdk_wayland_cursor_set_scale (device->cursor, scale);
|
||||
|
||||
gdk_wayland_device_update_window_cursor (device);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_enter (void *data,
|
||||
struct wl_surface *wl_surface,
|
||||
struct wl_output *output)
|
||||
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("pointer surface of device %p entered output %p",
|
||||
device, output));
|
||||
|
||||
device->pointer_surface_outputs =
|
||||
g_slist_append (device->pointer_surface_outputs, output);
|
||||
|
||||
pointer_surface_update_scale (device);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_leave (void *data,
|
||||
struct wl_surface *wl_surface,
|
||||
struct wl_output *output)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("pointer surface of device %p left output %p",
|
||||
device, output));
|
||||
|
||||
device->pointer_surface_outputs =
|
||||
g_slist_remove (device->pointer_surface_outputs, output);
|
||||
|
||||
pointer_surface_update_scale (device);
|
||||
}
|
||||
|
||||
static const struct wl_surface_listener pointer_surface_listener = {
|
||||
pointer_surface_enter,
|
||||
pointer_surface_leave
|
||||
};
|
||||
|
||||
static GdkWindow *
|
||||
create_foreign_dnd_window (GdkDisplay *display)
|
||||
{
|
||||
GdkWindowAttr attrs;
|
||||
GdkScreen *screen;
|
||||
guint mask;
|
||||
|
||||
screen = gdk_display_get_default_screen (display);
|
||||
|
||||
attrs.x = attrs.y = 0;
|
||||
attrs.width = attrs.height = 1;
|
||||
attrs.wclass = GDK_INPUT_OUTPUT;
|
||||
attrs.window_type = GDK_WINDOW_TEMP;
|
||||
attrs.visual = gdk_screen_get_system_visual (screen);
|
||||
|
||||
mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
|
||||
|
||||
return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
guint32 id,
|
||||
@@ -1763,6 +1885,7 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
device->device_manager = device_manager;
|
||||
device->touches = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) g_free);
|
||||
device->foreign_dnd_window = create_foreign_dnd_window (display);
|
||||
device->wl_seat = wl_seat;
|
||||
|
||||
wl_seat_add_listener (device->wl_seat, &seat_listener, device);
|
||||
@@ -1774,8 +1897,12 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
wl_data_device_add_listener (device->data_device,
|
||||
&data_device_listener, device);
|
||||
|
||||
device->current_output_scale = 1;
|
||||
device->pointer_surface =
|
||||
wl_compositor_create_surface (display_wayland->compositor);
|
||||
wl_surface_add_listener (device->pointer_surface,
|
||||
&pointer_surface_listener,
|
||||
device);
|
||||
|
||||
init_devices (device);
|
||||
}
|
||||
@@ -1800,6 +1927,7 @@ _gdk_wayland_device_manager_remove_seat (GdkDeviceManager *manager,
|
||||
/* FIXME: destroy data_device */
|
||||
g_clear_object (&device->keyboard_settings);
|
||||
g_hash_table_destroy (device->touches);
|
||||
gdk_window_destroy (device->foreign_dnd_window);
|
||||
g_free (device);
|
||||
|
||||
break;
|
||||
@@ -1832,7 +1960,7 @@ gdk_wayland_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkWaylandDeviceManager *wayland_device_manager;
|
||||
GList *devices = NULL, *l;
|
||||
|
||||
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
|
||||
wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
|
||||
|
||||
for (l = wayland_device_manager->devices; l; l = l->next)
|
||||
{
|
||||
@@ -1849,7 +1977,7 @@ gdk_wayland_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
GdkWaylandDeviceManager *wayland_device_manager;
|
||||
GList *l;
|
||||
|
||||
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
|
||||
wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
|
||||
|
||||
/* Find the first master pointer device */
|
||||
for (l = wayland_device_manager->devices; l != NULL; l = l->next)
|
||||
@@ -1943,6 +2071,7 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
|
||||
GdkWaylandDeviceData *device;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
|
||||
|
||||
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
|
||||
|
||||
gdk_wayland_device_remove_touch (device, GDK_EVENT_SEQUENCE_TO_SLOT (sequence));
|
||||
@@ -1953,12 +2082,9 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
|
||||
struct wl_data_device *
|
||||
gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
|
||||
{
|
||||
GdkWaylandDeviceData *device;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device), NULL);
|
||||
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
|
||||
|
||||
return device->data_device;
|
||||
return GDK_WAYLAND_DEVICE (gdk_device)->device->data_device;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1969,6 +2095,7 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
|
||||
|
||||
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (gdk_device_get_display (gdk_device));
|
||||
|
||||
|
||||
@@ -132,6 +132,9 @@ xdg_shell_ping (void *data,
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("ping, shell %p, serial %u\n", xdg_shell, serial));
|
||||
|
||||
xdg_shell_pong (xdg_shell, serial);
|
||||
}
|
||||
|
||||
@@ -140,59 +143,85 @@ static const struct xdg_shell_listener xdg_shell_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
|
||||
const char *interface, uint32_t version)
|
||||
gdk_registry_handle_global (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id,
|
||||
const char *interface,
|
||||
uint32_t version)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
|
||||
struct wl_seat *seat;
|
||||
struct wl_output *output;
|
||||
|
||||
if (strcmp(interface, "wl_compositor") == 0) {
|
||||
display_wayland->compositor =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
|
||||
display_wayland->compositor_version = MIN (version, 3);
|
||||
} else if (strcmp(interface, "wl_shm") == 0) {
|
||||
display_wayland->shm =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_shm_interface, 1);
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("add global %u, interface %s, version %u", id, interface, version));
|
||||
|
||||
/* SHM interface is prerequisite */
|
||||
_gdk_wayland_display_load_cursor_theme(display_wayland);
|
||||
} else if (strcmp(interface, "xdg_shell") == 0) {
|
||||
display_wayland->xdg_shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &xdg_shell_interface, 1);
|
||||
xdg_shell_use_unstable_version(display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
|
||||
xdg_shell_add_listener(display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
|
||||
} else if (strcmp(interface, "gtk_shell") == 0) {
|
||||
display_wayland->gtk_shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, >k_shell_interface, 1);
|
||||
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
|
||||
} else if (strcmp(interface, "wl_output") == 0) {
|
||||
output =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
|
||||
_gdk_wayland_screen_add_output(display_wayland->screen, id, output, MIN (version, 2));
|
||||
} else if (strcmp(interface, "wl_seat") == 0) {
|
||||
seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, 4);
|
||||
_gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
|
||||
} else if (strcmp(interface, "wl_data_device_manager") == 0) {
|
||||
if (strcmp (interface, "wl_compositor") == 0)
|
||||
{
|
||||
display_wayland->compositor =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
|
||||
display_wayland->compositor_version = MIN (version, 3);
|
||||
}
|
||||
else if (strcmp (interface, "wl_shm") == 0)
|
||||
{
|
||||
display_wayland->shm =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_shm_interface, 1);
|
||||
|
||||
/* SHM interface is prerequisite */
|
||||
_gdk_wayland_display_load_cursor_theme (display_wayland);
|
||||
}
|
||||
else if (strcmp (interface, "xdg_shell") == 0)
|
||||
{
|
||||
display_wayland->xdg_shell =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &xdg_shell_interface, 1);
|
||||
xdg_shell_use_unstable_version (display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
|
||||
xdg_shell_add_listener (display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
|
||||
}
|
||||
else if (strcmp (interface, "gtk_shell") == 0)
|
||||
{
|
||||
if (version == SUPPORTED_GTK_SHELL_VERSION)
|
||||
{
|
||||
display_wayland->gtk_shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
>k_shell_interface, SUPPORTED_GTK_SHELL_VERSION);
|
||||
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
|
||||
}
|
||||
}
|
||||
else if (strcmp (interface, "wl_output") == 0)
|
||||
{
|
||||
output =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
|
||||
_gdk_wayland_screen_add_output (display_wayland->screen, id, output, MIN (version, 2));
|
||||
wl_display_roundtrip (display_wayland->wl_display);
|
||||
}
|
||||
else if (strcmp (interface, "wl_seat") == 0)
|
||||
{
|
||||
seat = wl_registry_bind (display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
|
||||
_gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
|
||||
wl_display_roundtrip (display_wayland->wl_display);
|
||||
}
|
||||
else if (strcmp (interface, "wl_data_device_manager") == 0)
|
||||
{
|
||||
display_wayland->data_device_manager =
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
&wl_data_device_manager_interface, 1);
|
||||
} else if (strcmp (interface, "wl_subcompositor") == 0) {
|
||||
display_wayland->subcompositor =
|
||||
wl_registry_bind (display_wayland->wl_registry, id,
|
||||
&wl_subcompositor_interface, 1);
|
||||
}
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_data_device_manager_interface, 1);
|
||||
}
|
||||
else if (strcmp (interface, "wl_subcompositor") == 0)
|
||||
{
|
||||
display_wayland->subcompositor =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_registry_handle_global_remove(void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id)
|
||||
gdk_registry_handle_global_remove (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
GdkDisplay *display = GDK_DISPLAY (display_wayland);
|
||||
|
||||
GDK_NOTE (MISC, g_message ("remove global %u", id));
|
||||
_gdk_wayland_device_manager_remove_seat (display->device_manager, id);
|
||||
_gdk_wayland_screen_remove_output (display_wayland->screen, id);
|
||||
|
||||
@@ -205,7 +234,7 @@ static const struct wl_registry_listener registry_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
log_handler(const char *format, va_list args)
|
||||
log_handler (const char *format, va_list args)
|
||||
{
|
||||
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
|
||||
}
|
||||
@@ -217,6 +246,8 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
GdkDisplay *display;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
GDK_NOTE (MISC, g_message ("opening display %s", display_name ? display_name : ""));
|
||||
|
||||
/* If this variable is unset then wayland initialisation will surely
|
||||
* fail, logging a fatal error in the process. Save ourselves from
|
||||
* that.
|
||||
@@ -224,9 +255,9 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
if (g_getenv ("XDG_RUNTIME_DIR") == NULL)
|
||||
return NULL;
|
||||
|
||||
wl_log_set_handler_client(log_handler);
|
||||
wl_log_set_handler_client (log_handler);
|
||||
|
||||
wl_display = wl_display_connect(display_name);
|
||||
wl_display = wl_display_connect (display_name);
|
||||
if (!wl_display)
|
||||
return NULL;
|
||||
|
||||
@@ -239,8 +270,8 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
display_wayland->event_source = _gdk_wayland_display_event_source_new (display);
|
||||
_gdk_wayland_display_init_cursors (display_wayland);
|
||||
|
||||
display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
|
||||
wl_registry_add_listener(display_wayland->wl_registry, ®istry_listener, display_wayland);
|
||||
display_wayland->wl_registry = wl_display_get_registry (display_wayland->wl_display);
|
||||
wl_registry_add_listener (display_wayland->wl_registry, ®istry_listener, display_wayland);
|
||||
|
||||
/* Wait until the dust has settled during init... */
|
||||
wl_display_roundtrip (display_wayland->wl_display);
|
||||
@@ -326,7 +357,7 @@ gdk_wayland_display_sync (GdkDisplay *display)
|
||||
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
wl_display_roundtrip(display_wayland->wl_display);
|
||||
wl_display_roundtrip (display_wayland->wl_display);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -335,7 +366,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
if (!display->closed)
|
||||
wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);
|
||||
wl_display_flush (GDK_WAYLAND_DISPLAY (display)->wl_display);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -356,7 +387,7 @@ gdk_wayland_display_get_default_group (GdkDisplay *display)
|
||||
static gboolean
|
||||
gdk_wayland_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -485,7 +516,7 @@ gdk_wayland_display_pop_error_trap (GdkDisplay *display,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_display_class_init (GdkWaylandDisplayClass * class)
|
||||
gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
|
||||
@@ -550,10 +581,15 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
struct wl_cursor_theme *theme;
|
||||
int i;
|
||||
|
||||
g_assert (wayland_display);
|
||||
g_assert (wayland_display->shm);
|
||||
|
||||
if (g_strcmp0 (name, wayland_display->cursor_theme_name) == 0 &&
|
||||
wayland_display->cursor_theme_size == size)
|
||||
return;
|
||||
|
||||
theme = wl_cursor_theme_load (name, size, wayland_display->shm);
|
||||
if (theme == NULL)
|
||||
{
|
||||
@@ -561,11 +597,49 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
return;
|
||||
}
|
||||
|
||||
_gdk_wayland_display_update_cursors (wayland_display, theme);
|
||||
for (i = 0; i < GDK_WAYLAND_THEME_SCALES_COUNT; i++)
|
||||
{
|
||||
if (wayland_display->scaled_cursor_themes[i])
|
||||
{
|
||||
wl_cursor_theme_destroy (wayland_display->scaled_cursor_themes[i]);
|
||||
wayland_display->scaled_cursor_themes[i] = NULL;
|
||||
}
|
||||
}
|
||||
wayland_display->scaled_cursor_themes[0] = theme;
|
||||
if (wayland_display->cursor_theme_name != NULL)
|
||||
free (wayland_display->cursor_theme_name);
|
||||
wayland_display->cursor_theme_name = g_strdup (name);
|
||||
wayland_display->cursor_theme_size = size;
|
||||
|
||||
if (wayland_display->cursor_theme != NULL)
|
||||
wl_cursor_theme_destroy (wayland_display->cursor_theme);
|
||||
wayland_display->cursor_theme = theme;
|
||||
_gdk_wayland_display_update_cursors (wayland_display);
|
||||
}
|
||||
|
||||
struct wl_cursor_theme *
|
||||
_gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *wayland_display,
|
||||
guint scale)
|
||||
{
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
g_assert (wayland_display->cursor_theme_name);
|
||||
g_assert (scale <= GDK_WAYLAND_MAX_THEME_SCALE);
|
||||
g_assert (scale >= 1);
|
||||
|
||||
theme = wayland_display->scaled_cursor_themes[scale - 1];
|
||||
if (!theme)
|
||||
{
|
||||
theme = wl_cursor_theme_load (wayland_display->cursor_theme_name,
|
||||
wayland_display->cursor_theme_size * scale,
|
||||
wayland_display->shm);
|
||||
if (theme == NULL)
|
||||
{
|
||||
g_warning ("Failed to load cursor theme %s with scale %u\n",
|
||||
wayland_display->cursor_theme_name, scale);
|
||||
return NULL;
|
||||
}
|
||||
wayland_display->scaled_cursor_themes[scale - 1] = theme;
|
||||
}
|
||||
|
||||
return theme;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -591,8 +665,7 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
|
||||
else
|
||||
name = "default";
|
||||
|
||||
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display),
|
||||
name, size);
|
||||
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display), name, size);
|
||||
g_value_unset (&v);
|
||||
}
|
||||
|
||||
@@ -610,30 +683,28 @@ _gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_display_get_wl_display
|
||||
* gdk_wayland_display_get_wl_display:
|
||||
* @display: (type GdkWaylandDisplay): a #GdkDisplay
|
||||
*
|
||||
* Returns the Wayland wl_display of a #GdkDisplay
|
||||
* Returns the Wayland wl_display of a #GdkDisplay.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_display
|
||||
*
|
||||
* Since: 3.8
|
||||
*/
|
||||
struct wl_display *
|
||||
gdk_wayland_display_get_wl_display(GdkDisplay *display)
|
||||
gdk_wayland_display_get_wl_display (GdkDisplay *display)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
|
||||
|
||||
return wayland_display->wl_display;
|
||||
return GDK_WAYLAND_DISPLAY (display)->wl_display;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_display_get_wl_compositor
|
||||
* gdk_wayland_display_get_wl_compositor:
|
||||
* @display: (type GdkWaylandDisplay): a #GdkDisplay
|
||||
*
|
||||
* Returns the Wayland global singleton compositor of a #GdkDisplay
|
||||
* Returns the Wayland global singleton compositor of a #GdkDisplay.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_compositor
|
||||
*
|
||||
@@ -642,18 +713,16 @@ gdk_wayland_display_get_wl_display(GdkDisplay *display)
|
||||
struct wl_compositor *
|
||||
gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
|
||||
|
||||
return wayland_display->compositor;
|
||||
return GDK_WAYLAND_DISPLAY (display)->compositor;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_display_get_xdg_shell
|
||||
* gdk_wayland_display_get_xdg_shell:
|
||||
* @display: (type GdkWaylandDisplay): a #GdkDisplay
|
||||
*
|
||||
* Returns the Wayland global singleton shell of a #GdkDisplay
|
||||
* Returns the Wayland global singleton shell of a #GdkDisplay.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland xdg_shell
|
||||
*
|
||||
@@ -662,11 +731,9 @@ gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
|
||||
struct xdg_shell *
|
||||
gdk_wayland_display_get_xdg_shell (GdkDisplay *display)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
|
||||
|
||||
return wayland_display->xdg_shell;
|
||||
return GDK_WAYLAND_DISPLAY (display)->xdg_shell;
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t gdk_wayland_cairo_key;
|
||||
@@ -737,7 +804,7 @@ create_shm_pool (struct wl_shm *shm,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pool = wl_shm_create_pool(shm, fd, size);
|
||||
pool = wl_shm_create_pool (shm, fd, size);
|
||||
|
||||
close (fd);
|
||||
|
||||
@@ -834,6 +901,12 @@ _gdk_wayland_shm_surface_get_busy (cairo_surface_t *surface)
|
||||
return data->busy;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_wayland_is_shm_surface (cairo_surface_t *surface)
|
||||
{
|
||||
return cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key) != NULL;
|
||||
}
|
||||
|
||||
GdkWaylandSelection *
|
||||
gdk_wayland_display_get_selection (GdkDisplay *display)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* gdkdisplay-wayland.h
|
||||
*
|
||||
* Copyright 2001 Sun Microsystems Inc.
|
||||
*
|
||||
* Copyright 2001 Sun Microsystems Inc.
|
||||
*
|
||||
* Erwann Chenede <erwann.chenede@sun.com>
|
||||
*
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_WAYLAND_MAX_THEME_SCALE 2
|
||||
#define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
|
||||
|
||||
typedef struct _GdkWaylandSelection GdkWaylandSelection;
|
||||
|
||||
struct _GdkWaylandDisplay
|
||||
@@ -69,7 +72,9 @@ struct _GdkWaylandDisplay
|
||||
struct wl_data_device_manager *data_device_manager;
|
||||
struct wl_subcompositor *subcompositor;
|
||||
|
||||
struct wl_cursor_theme *cursor_theme;
|
||||
struct wl_cursor_theme *scaled_cursor_themes[GDK_WAYLAND_THEME_SCALES_COUNT];
|
||||
gchar *cursor_theme_name;
|
||||
int cursor_theme_size;
|
||||
GHashTable *cursor_cache;
|
||||
|
||||
GSource *event_source;
|
||||
@@ -99,4 +104,4 @@ struct _GdkWaylandDisplayClass
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WAYLAND_DISPLAY__ */
|
||||
#endif /* __GDK_WAYLAND_DISPLAY__ */
|
||||
|
||||
@@ -236,7 +236,8 @@ gdk_wayland_drag_context_drop_reply (GdkDragContext *context,
|
||||
gboolean accepted,
|
||||
guint32 time_)
|
||||
{
|
||||
gdk_wayland_drop_context_set_status (context, accepted);
|
||||
if (!accepted)
|
||||
gdk_wayland_drop_context_set_status (context, accepted);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -382,7 +383,11 @@ _gdk_wayland_drop_context_new (GdkDevice *device,
|
||||
void
|
||||
gdk_wayland_drop_context_update_targets (GdkDragContext *context)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (context->source_window);
|
||||
GdkDisplay *display;
|
||||
GdkDevice *device;
|
||||
|
||||
device = gdk_drag_context_get_device (context);
|
||||
display = gdk_device_get_display (device);
|
||||
g_list_free (context->targets);
|
||||
context->targets = g_list_copy (gdk_wayland_selection_get_targets (display));
|
||||
}
|
||||
@@ -414,6 +419,9 @@ _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
|
||||
GdkWindow *dest_window,
|
||||
uint32_t serial)
|
||||
{
|
||||
if (context->dest_window)
|
||||
g_object_unref (context->dest_window);
|
||||
|
||||
context->dest_window = dest_window ? g_object_ref (dest_window) : NULL;
|
||||
GDK_WAYLAND_DRAG_CONTEXT (context)->serial = serial;
|
||||
gdk_wayland_drop_context_update_targets (context);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkprivate-wayland.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef struct _GdkWaylandEventSource {
|
||||
@@ -32,7 +33,8 @@ typedef struct _GdkWaylandEventSource {
|
||||
static GList *event_sources = NULL;
|
||||
|
||||
static gboolean
|
||||
gdk_event_source_prepare(GSource *base, gint *timeout)
|
||||
gdk_event_source_prepare (GSource *base,
|
||||
gint *timeout)
|
||||
{
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
|
||||
@@ -59,7 +61,7 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_event_source_check(GSource *base)
|
||||
gdk_event_source_check (GSource *base)
|
||||
{
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
|
||||
@@ -71,9 +73,9 @@ gdk_event_source_check(GSource *base)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_event_source_dispatch(GSource *base,
|
||||
GSourceFunc callback,
|
||||
gpointer data)
|
||||
gdk_event_source_dispatch (GSource *base,
|
||||
GSourceFunc callback,
|
||||
gpointer data)
|
||||
{
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
GdkDisplay *display = source->display;
|
||||
@@ -109,7 +111,8 @@ static GSourceFuncs wl_glib_source_funcs = {
|
||||
};
|
||||
|
||||
void
|
||||
_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
|
||||
_gdk_wayland_display_deliver_event (GdkDisplay *display,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GList *node;
|
||||
|
||||
@@ -160,11 +163,17 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
|
||||
if (source->pfd.revents & G_IO_IN)
|
||||
{
|
||||
if (wl_display_dispatch (display_wayland->wl_display) < 0)
|
||||
g_error ("Error dispatching display: %s", g_strerror (errno));
|
||||
{
|
||||
g_warning ("Error %d (%s) dispatching to Wayland display.",
|
||||
errno, g_strerror (errno));
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
|
||||
g_error ("Lost connection to wayland compositor");
|
||||
|
||||
{
|
||||
g_warning ("Lost connection to Wayland compositor.");
|
||||
exit (1);
|
||||
}
|
||||
source->pfd.revents = 0;
|
||||
}
|
||||
|
||||
@@ -95,13 +95,78 @@ gdk_wayland_window_invalidate_for_new_frame (GdkWindow *window,
|
||||
window_rect.height = gdk_window_get_height (window);
|
||||
|
||||
/* If nothing else is known, repaint everything so that the back
|
||||
buffer is fully up-to-date for the swapbuffer */
|
||||
* buffer is fully up-to-date for the swapbuffer
|
||||
*/
|
||||
cairo_region_union_rectangle (update_area, &window_rect);
|
||||
}
|
||||
}
|
||||
|
||||
#define N_EGL_ATTRS 16
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_gl_context_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context);
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
GdkGLContext *share = gdk_gl_context_get_shared_context (context);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
EGLContext ctx;
|
||||
EGLint context_attribs[N_EGL_ATTRS];
|
||||
int major, minor, flags;
|
||||
gboolean debug_bit, forward_bit;
|
||||
int i = 0;
|
||||
|
||||
gdk_gl_context_get_required_version (context, &major, &minor);
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
forward_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
|
||||
flags = 0;
|
||||
|
||||
if (debug_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
|
||||
if (forward_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
|
||||
/* We want a core profile */
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
|
||||
/* Specify the version */
|
||||
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
|
||||
context_attribs[i++] = major;
|
||||
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
|
||||
context_attribs[i++] = minor;
|
||||
|
||||
/* Specify the flags */
|
||||
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||
context_attribs[i++] = flags;
|
||||
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
g_assert (i < N_EGL_ATTRS);
|
||||
|
||||
ctx = eglCreateContext (display_wayland->egl_display,
|
||||
context_wayland->egl_config,
|
||||
share != NULL ? GDK_WAYLAND_GL_CONTEXT (share)->egl_context
|
||||
: EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL, g_print ("Created EGL context[%p]\n", ctx));
|
||||
|
||||
context_wayland->egl_context = ctx;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_gl_context_end_frame (GdkGLContext *context,
|
||||
gdk_wayland_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage)
|
||||
{
|
||||
@@ -116,7 +181,7 @@ gdk_wayland_gl_context_end_frame (GdkGLContext *context,
|
||||
egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window,
|
||||
context_wayland->egl_config);
|
||||
|
||||
// TODO: Use eglSwapBuffersWithDamageEXT if available
|
||||
/* TODO: Use eglSwapBuffersWithDamageEXT if available */
|
||||
if (display_wayland->have_egl_swap_buffers_with_damage)
|
||||
{
|
||||
int i, j, n_rects = cairo_region_num_rectangles (damage);
|
||||
@@ -142,11 +207,13 @@ gdk_wayland_gl_context_end_frame (GdkGLContext *context,
|
||||
static void
|
||||
gdk_wayland_gl_context_class_init (GdkWaylandGLContextClass *klass)
|
||||
{
|
||||
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
|
||||
|
||||
context_class->end_frame = gdk_wayland_gl_context_end_frame;
|
||||
gobject_class->dispose = gdk_x11_gl_context_dispose;
|
||||
|
||||
context_class->realize = gdk_wayland_gl_context_realize;
|
||||
context_class->end_frame = gdk_wayland_gl_context_end_frame;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -213,9 +280,9 @@ gdk_wayland_display_init_gl (GdkDisplay *display)
|
||||
#define MAX_EGL_ATTRS 30
|
||||
|
||||
static gboolean
|
||||
find_eglconfig_for_window (GdkWindow *window,
|
||||
EGLConfig *egl_config_out,
|
||||
GError **error)
|
||||
find_eglconfig_for_window (GdkWindow *window,
|
||||
EGLConfig *egl_config_out,
|
||||
GError **error)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
@@ -287,17 +354,13 @@ find_eglconfig_for_window (GdkWindow *window,
|
||||
GdkGLContext *
|
||||
gdk_wayland_window_create_gl_context (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLProfile profile,
|
||||
GdkGLContext *share,
|
||||
GError **error)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandGLContext *context;
|
||||
EGLContext ctx;
|
||||
EGLConfig config;
|
||||
int i;
|
||||
EGLint context_attribs[3];
|
||||
|
||||
if (!gdk_wayland_display_init_gl (display))
|
||||
{
|
||||
@@ -307,53 +370,24 @@ gdk_wayland_window_create_gl_context (GdkWindow *window,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (profile == GDK_GL_PROFILE_DEFAULT)
|
||||
profile = GDK_GL_PROFILE_LEGACY;
|
||||
|
||||
if (profile == GDK_GL_PROFILE_3_2_CORE &&
|
||||
!display_wayland->have_egl_khr_create_context)
|
||||
if (!display_wayland->have_egl_khr_create_context)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE,
|
||||
_("3.2 core GL profile is not available on EGL implementation"));
|
||||
_("Core GL is not available on EGL implementation"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!find_eglconfig_for_window (window, &config, error))
|
||||
return NULL;
|
||||
|
||||
i = 0;
|
||||
if (profile == GDK_GL_PROFILE_3_2_CORE)
|
||||
{
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
}
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
|
||||
ctx = eglCreateContext (display_wayland->egl_display,
|
||||
config,
|
||||
share ? GDK_WAYLAND_GL_CONTEXT (share)->egl_context : EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Created EGL context[%p]\n", ctx));
|
||||
|
||||
context = g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT,
|
||||
"display", display,
|
||||
"window", window,
|
||||
"profile", profile,
|
||||
"shared-context", share,
|
||||
NULL);
|
||||
|
||||
context->egl_config = config;
|
||||
context->egl_context = ctx;
|
||||
context->is_attached = attached;
|
||||
|
||||
return GDK_GL_CONTEXT (context);
|
||||
|
||||
@@ -50,7 +50,6 @@ struct _GdkWaylandGLContextClass
|
||||
gboolean gdk_wayland_display_init_gl (GdkDisplay *display);
|
||||
GdkGLContext * gdk_wayland_window_create_gl_context (GdkWindow *window,
|
||||
gboolean attach,
|
||||
GdkGLProfile profile,
|
||||
GdkGLContext *share,
|
||||
GError **error);
|
||||
void gdk_wayland_window_invalidate_for_new_frame (GdkWindow *window,
|
||||
|
||||
@@ -250,7 +250,7 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap,
|
||||
if (state & GDK_MOD1_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT);
|
||||
if (state & GDK_MOD2_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2");
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM);
|
||||
if (state & GDK_MOD3_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3");
|
||||
if (state & GDK_MOD4_MASK)
|
||||
@@ -275,7 +275,7 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
|
||||
state |= GDK_CONTROL_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT)))
|
||||
state |= GDK_MOD1_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2")))
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM)))
|
||||
state |= GDK_MOD2_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3")))
|
||||
state |= GDK_MOD3_MASK;
|
||||
@@ -457,7 +457,7 @@ update_direction (GdkWaylandKeymap *keymap)
|
||||
}
|
||||
|
||||
GdkKeymap *
|
||||
_gdk_wayland_keymap_new ()
|
||||
_gdk_wayland_keymap_new (void)
|
||||
{
|
||||
GdkWaylandKeymap *keymap;
|
||||
struct xkb_context *context;
|
||||
@@ -494,12 +494,12 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
|
||||
|
||||
context = xkb_context_new (0);
|
||||
|
||||
map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
map_str = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
if (map_str == MAP_FAILED)
|
||||
{
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
|
||||
munmap (map_str, size);
|
||||
@@ -523,12 +523,14 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
|
||||
update_direction (keymap_wayland);
|
||||
}
|
||||
|
||||
struct xkb_keymap *_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
|
||||
struct xkb_keymap *
|
||||
_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
|
||||
{
|
||||
return GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
|
||||
}
|
||||
|
||||
struct xkb_state *_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
|
||||
struct xkb_state *
|
||||
_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
|
||||
{
|
||||
return GDK_WAYLAND_KEYMAP (keymap)->xkb_state;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user