Compare commits
812 Commits
theme-load
...
constraint
Author | SHA1 | Date | |
---|---|---|---|
|
36bea407fd | ||
|
3dc50c1e62 | ||
|
57664f1234 | ||
|
c5d9d723a5 | ||
|
d8db962995 | ||
|
61289b0dc7 | ||
|
ae665b2fe2 | ||
|
4e381ee15c | ||
|
81e0e94eec | ||
|
44380b0584 | ||
|
4751f375dc | ||
|
6835ce4a95 | ||
|
5ed66d069d | ||
|
5472cc5fe9 | ||
|
556a51d862 | ||
|
6e8feebb3b | ||
|
78e86b4df1 | ||
|
13d7f59c40 | ||
|
aec8da3363 | ||
|
97ba872ef3 | ||
|
a5c327bb02 | ||
|
bda5a8214b | ||
|
3ad8797068 | ||
|
2457ed03c2 | ||
|
4623642925 | ||
|
75713a9e47 | ||
|
cc667926d6 | ||
|
bc56860fa1 | ||
|
820929958d | ||
|
72d306c132 | ||
|
9bb2d1eb5c | ||
|
d2e0d3222f | ||
|
44970b5182 | ||
|
00c828e752 | ||
|
3b565d7f6e | ||
|
db7f0189dd | ||
|
d2a794b411 | ||
|
8cfdd6c591 | ||
|
732630e0e2 | ||
|
4c94f7b217 | ||
|
4d06ef5a39 | ||
|
7815d0e933 | ||
|
76b2f97602 | ||
|
2dfda67e4a | ||
|
1d92fb1013 | ||
|
f1fe54f337 | ||
|
0740445d19 | ||
|
d5f7d853de | ||
|
1e3ec7c1f9 | ||
|
121011b05b | ||
|
6f12c39a04 | ||
|
6452aeef3c | ||
|
10ce2076f9 | ||
|
0509f8cff3 | ||
|
3dd7b41077 | ||
|
fcf92eb6e7 | ||
|
441a9dfa80 | ||
|
f12057b9dc | ||
|
037e205da0 | ||
|
964b2574cf | ||
|
1b21d6ecba | ||
|
6030465cdf | ||
|
a28d5d1888 | ||
|
cbc0a8447d | ||
|
a7e121384c | ||
|
6c7cb8d862 | ||
|
5b0002a9dc | ||
|
ed9b874d2e | ||
|
c16f10abea | ||
|
d0a38c677c | ||
|
a56f99355a | ||
|
5df592d33e | ||
|
aa69ca4ef4 | ||
|
28c40a4c3d | ||
|
0269d670b5 | ||
|
af7b3df659 | ||
|
f5ce5a0abd | ||
|
21a5c7f0eb | ||
|
f03c7c379a | ||
|
67c82e8bd9 | ||
|
37090a7ab4 | ||
|
714eadfdb5 | ||
|
f63cec30a4 | ||
|
ddee5cfc43 | ||
|
1d93e38456 | ||
|
cfebff5dcf | ||
|
d2cde1fb2d | ||
|
436d7cc0d1 | ||
|
31066a697b | ||
|
4c65868643 | ||
|
0e075a876f | ||
|
f1b9e7c23b | ||
|
9182f0fe9d | ||
|
ec5854bb9b | ||
|
062244ab71 | ||
|
df8340e0cf | ||
|
c82dcc8e3a | ||
|
2248980c6b | ||
|
3c1163e7f4 | ||
|
8e5985d05e | ||
|
17ec958f30 | ||
|
65f71cdbae | ||
|
d936967b7a | ||
|
d78b6451b3 | ||
|
bc4f744562 | ||
|
6342287288 | ||
|
143ea34ca1 | ||
|
8452b9a13d | ||
|
abc9fef615 | ||
|
18fd512c80 | ||
|
f82898f393 | ||
|
ae8373f116 | ||
|
f01e5d2267 | ||
|
f1eb0724bd | ||
|
0d800acd40 | ||
|
3d56a89506 | ||
|
4ecaa754e2 | ||
|
6f689ec5b1 | ||
|
d48a8fddab | ||
|
407ab93b59 | ||
|
583c6a9072 | ||
|
c1791d030a | ||
|
d736778c2f | ||
|
4d191aa0b5 | ||
|
f91cc6c473 | ||
|
609f1659bd | ||
|
724f315ae6 | ||
|
59ed4da717 | ||
|
640c7939ea | ||
|
0755491b77 | ||
|
698e39bcac | ||
|
06470c2378 | ||
|
84243d0f55 | ||
|
e080f35d25 | ||
|
3313322864 | ||
|
dd572ed10a | ||
|
fc3d3fb3af | ||
|
eda31dff5d | ||
|
b4aac42605 | ||
|
30f6bea25f | ||
|
fc6010be37 | ||
|
0d59ece4a4 | ||
|
4494884f9a | ||
|
4a954a9a1c | ||
|
868e13e471 | ||
|
a10ce07437 | ||
|
828c36636c | ||
|
c168116e64 | ||
|
0dcb71722a | ||
|
d90143d09c | ||
|
e7cb88b710 | ||
|
69016825aa | ||
|
e08bab012c | ||
|
1a93ab053c | ||
|
e961943508 | ||
|
0aa9e16294 | ||
|
054b5216a1 | ||
|
ecb353f4af | ||
|
259bbdcb09 | ||
|
1f70bc4bf3 | ||
|
7293fd517e | ||
|
c9cea36b37 | ||
|
4020399439 | ||
|
efc31161f0 | ||
|
102cc1c8d3 | ||
|
2529385fe4 | ||
|
f37274dbb0 | ||
|
a3757936c1 | ||
|
adb5df020c | ||
|
cf4ff56ca5 | ||
|
e2ffad7b07 | ||
|
b74bb90c7d | ||
|
66b081dc9c | ||
|
bb5871fd81 | ||
|
4b3986ae1f | ||
|
ac333d712d | ||
|
5c0737e44c | ||
|
098f182d8f | ||
|
836635d1ae | ||
|
6a0e0031b1 | ||
|
24effe45cc | ||
|
206970c1e8 | ||
|
2f7047147d | ||
|
4ed57449ba | ||
|
d93fb5a3fa | ||
|
0ab4a232b7 | ||
|
4efa457a63 | ||
|
a1161456ff | ||
|
d81cf5a443 | ||
|
a0cb68283d | ||
|
88344ccf4e | ||
|
d228f4bb76 | ||
|
3a49c0eb2f | ||
|
05ca772631 | ||
|
efe9bba343 | ||
|
fb1f929c38 | ||
|
6560a35c9c | ||
|
c7ccaa5ef2 | ||
|
3ae15aad16 | ||
|
42e0c9892c | ||
|
286fd742a6 | ||
|
3c6c07e94d | ||
|
a2c3c65729 | ||
|
92994bac6c | ||
|
3788e1dea7 | ||
|
e0bf301d34 | ||
|
e0803f039f | ||
|
3059d76b4c | ||
|
0a09b8dca7 | ||
|
ad2a1c92ce | ||
|
fd4182f5c5 | ||
|
c7387a8e7f | ||
|
a64dfb1dfc | ||
|
1c1d4f32c8 | ||
|
caf50bcb93 | ||
|
7e9cb07a92 | ||
|
3a42aab680 | ||
|
41e373f10c | ||
|
f9562757ff | ||
|
5a0c8805fc | ||
|
1a4e360c2c | ||
|
69629ebb1a | ||
|
68a987922a | ||
|
a51b694314 | ||
|
b6cc774312 | ||
|
db548ee2a0 | ||
|
f999572e8f | ||
|
f1996783ec | ||
|
aa267c1c84 | ||
|
3dea73bd4a | ||
|
29252eac6a | ||
|
2ace3113d6 | ||
|
0ee9a4ff90 | ||
|
03964b5edb | ||
|
0c7e567c32 | ||
|
e31190cf7c | ||
|
fcdea03796 | ||
|
0a33d74c1b | ||
|
feef0ef93a | ||
|
ccd7110107 | ||
|
6c201e7927 | ||
|
ace30d42ea | ||
|
e599336ad4 | ||
|
8ba3c75682 | ||
|
3f6272f56e | ||
|
13e010deb6 | ||
|
ae1ba79f63 | ||
|
57175dd5b1 | ||
|
17cd6d7f44 | ||
|
c7f06dd35e | ||
|
f645c4e923 | ||
|
4e464b4960 | ||
|
d971c4e69d | ||
|
e702a33432 | ||
|
e64e9cd520 | ||
|
21491d27bb | ||
|
4db41b01a5 | ||
|
8799e5798b | ||
|
173ffbb547 | ||
|
97e15b8718 | ||
|
2ae6f1a741 | ||
|
8145872e27 | ||
|
4df049e81c | ||
|
bd26cce812 | ||
|
6b2518a190 | ||
|
6b1cfd0bca | ||
|
8925c17297 | ||
|
df9aed6c61 | ||
|
2eb0333017 | ||
|
22e0785802 | ||
|
7a3ffec762 | ||
|
b9dc13ad99 | ||
|
53f23f8ae9 | ||
|
1e0c0c0ba7 | ||
|
2f37207487 | ||
|
d71bf4d35c | ||
|
93a34eb62d | ||
|
dad5da8028 | ||
|
1e7225aa1c | ||
|
2d55fce23d | ||
|
78ee4c0677 | ||
|
d691393f5f | ||
|
3f6b64fc1d | ||
|
3a0beeadc5 | ||
|
853e832702 | ||
|
e0cc72e94f | ||
|
82afe850e8 | ||
|
164e362ec2 | ||
|
f507a79056 | ||
|
90f330e27a | ||
|
3874f37395 | ||
|
2be733497b | ||
|
200373f435 | ||
|
d47434bdb6 | ||
|
792d578f4b | ||
|
9ecd906b7f | ||
|
51396533a1 | ||
|
b867cbe0d8 | ||
|
8ed27d6e3b | ||
|
956e94a8d4 | ||
|
2081bf346e | ||
|
74db7cbe00 | ||
|
d6d5d60703 | ||
|
ece7fff339 | ||
|
147adc0bc5 | ||
|
12da0a6db1 | ||
|
b636e32d85 | ||
|
d515c43dce | ||
|
879f22fd27 | ||
|
a8899cc6a3 | ||
|
d2bc5b490a | ||
|
4f9c1bf14e | ||
|
987e7878a2 | ||
|
f0ef5332be | ||
|
0103c13632 | ||
|
fd048005f5 | ||
|
83827d3199 | ||
|
fcc8a365b9 | ||
|
902a49af9d | ||
|
fdcbd75e02 | ||
|
7f65e5f96b | ||
|
745a7cf29e | ||
|
5675d585f4 | ||
|
56db17e5e8 | ||
|
863f4d13ff | ||
|
cabe39862b | ||
|
2380f9673b | ||
|
170c25a9d2 | ||
|
e85f1e176a | ||
|
a079fd2def | ||
|
89fb752a8f | ||
|
9ee2b23176 | ||
|
d71c196c5c | ||
|
6e15538328 | ||
|
ead96b65fd | ||
|
0cc94ed72e | ||
|
dd5839dfe8 | ||
|
9abc7262b0 | ||
|
79940b32b5 | ||
|
aec5e3d71e | ||
|
217115d35f | ||
|
ee29b9ba95 | ||
|
c34abb6775 | ||
|
b523f2b46a | ||
|
6836bfc208 | ||
|
8695e8c1b8 | ||
|
6ffc9f9e6e | ||
|
0a6813d0aa | ||
|
ef3e20cffe | ||
|
5db4530a22 | ||
|
4b5fee943e | ||
|
f0fd4843d5 | ||
|
700e9e03c5 | ||
|
055a991e08 | ||
|
bc739e607b | ||
|
211128fb7c | ||
|
461e8e0218 | ||
|
a4b1ff7736 | ||
|
173a4b00bc | ||
|
908632138c | ||
|
84739dde99 | ||
|
d14e987c6c | ||
|
b12d521bce | ||
|
493b30c2a8 | ||
|
90058ed951 | ||
|
82c80c06e8 | ||
|
5ff7c3431b | ||
|
5ccb081fdb | ||
|
6ab565b84a | ||
|
11fdde0b8f | ||
|
d08805d7f0 | ||
|
2fa1a0a651 | ||
|
07b0da615b | ||
|
2aa0ceaeca | ||
|
28addd3775 | ||
|
a3f127b0d0 | ||
|
37f8df2722 | ||
|
f154fd4c09 | ||
|
c7f9f8f63d | ||
|
78c94f9357 | ||
|
895962d781 | ||
|
3d283cc8f4 | ||
|
44be64278b | ||
|
c638a0aa59 | ||
|
db21cbdfb3 | ||
|
ec413357c6 | ||
|
a841ff0316 | ||
|
2c43f87ef7 | ||
|
83f952d771 | ||
|
138104de27 | ||
|
d5e26cdb76 | ||
|
c2b9a12f6f | ||
|
8f291be8c6 | ||
|
26b4329061 | ||
|
693b2aa4d1 | ||
|
7447abb52b | ||
|
f728295e8c | ||
|
7b9789d029 | ||
|
6674f2764e | ||
|
948347afa9 | ||
|
8af89b3380 | ||
|
8fc6f07327 | ||
|
302d2a04ae | ||
|
9765aabebd | ||
|
c3d7c947ad | ||
|
a65696fc9f | ||
|
25aef96d5d | ||
|
09ec88d0ce | ||
|
6e885abf66 | ||
|
ebee21b248 | ||
|
0b3a971056 | ||
|
b99962e7a2 | ||
|
43bed7986a | ||
|
0047492bf9 | ||
|
18788c2a86 | ||
|
db855e092d | ||
|
fd0a290d77 | ||
|
fa9cbf6c7d | ||
|
ef353f24c6 | ||
|
07c8fd9997 | ||
|
61247a8921 | ||
|
a33d4f0f49 | ||
|
6c3ffa1380 | ||
|
07426da074 | ||
|
4cab6ae61a | ||
|
507b2d332e | ||
|
e6f71d841e | ||
|
1f2d3c0900 | ||
|
f3559fe0f0 | ||
|
27596c328a | ||
|
18e396ef6c | ||
|
ebb89bca0d | ||
|
1c7eb5ca33 | ||
|
49268c23fd | ||
|
b15ba64ec9 | ||
|
2dd15346a7 | ||
|
6f1c32b3eb | ||
|
99783c7fb7 | ||
|
1661615fef | ||
|
1fa2a8217f | ||
|
9af6d7f733 | ||
|
33c6dff881 | ||
|
07b3a093bf | ||
|
712a5d4f25 | ||
|
93b8f2563d | ||
|
d2951d3aac | ||
|
0571fc265b | ||
|
8536557007 | ||
|
47fb092393 | ||
|
2855729cb4 | ||
|
1a23ebf105 | ||
|
82c8a05855 | ||
|
346bd3f6b5 | ||
|
7c1509feaa | ||
|
448312594c | ||
|
6029875ed3 | ||
|
8bb7fcd30c | ||
|
f692974e5a | ||
|
bab5836e89 | ||
|
fa25b06a28 | ||
|
81a673c908 | ||
|
55c286661b | ||
|
73a6aaebfd | ||
|
48b522c487 | ||
|
bb399b5d8f | ||
|
cb23d40d36 | ||
|
8ee1620a2c | ||
|
2ccd0dc8c6 | ||
|
a3e0329a12 | ||
|
9b54f124e5 | ||
|
3248bdc726 | ||
|
0f5a6a3927 | ||
|
77e99f70fe | ||
|
0699b17848 | ||
|
2eebac8819 | ||
|
7aae92656d | ||
|
e68c5541e2 | ||
|
0760958f71 | ||
|
edab50139a | ||
|
6183d58f80 | ||
|
bb1dd3f3ae | ||
|
60ec1ee334 | ||
|
90e86b351d | ||
|
989792cbc0 | ||
|
52c3507ae1 | ||
|
43d4c908c9 | ||
|
d6a85188b6 | ||
|
f7e1146eda | ||
|
68e5456db9 | ||
|
c3c33ac168 | ||
|
0d25233e39 | ||
|
66ccc825de | ||
|
580aa8204f | ||
|
82d506acd8 | ||
|
1cbc26d9ee | ||
|
4bf4f04d1f | ||
|
6ab8ab87c8 | ||
|
9e6d8becbb | ||
|
2764652b3c | ||
|
2606ca0bd1 | ||
|
54662f4ca0 | ||
|
8713397948 | ||
|
f2447e06af | ||
|
5de06f47cf | ||
|
9059eee2f0 | ||
|
c1d5e82d95 | ||
|
7dcb163ee6 | ||
|
d4257d20f8 | ||
|
5bf2b633bb | ||
|
d51c85cf4e | ||
|
12a16a298b | ||
|
618f1f08ec | ||
|
afcf3e66f6 | ||
|
ff1150d87c | ||
|
096d28e60c | ||
|
81548911de | ||
|
236983d2aa | ||
|
2ae531ee9f | ||
|
e795c0c67e | ||
|
6a7bf78b15 | ||
|
933a9fba70 | ||
|
27f854042d | ||
|
19de2ce937 | ||
|
1b34e15893 | ||
|
e11c1fcb91 | ||
|
dbdb137428 | ||
|
e0a9952a56 | ||
|
b080a980d9 | ||
|
5c16de71f5 | ||
|
5b4dfb3079 | ||
|
4b4e370c9d | ||
|
d5fe6fa517 | ||
|
fe2865259f | ||
|
44640aeeea | ||
|
36e76db0d0 | ||
|
2ef8bd0b95 | ||
|
90aebd4f84 | ||
|
106dd75b3b | ||
|
f111e3f467 | ||
|
1e2874fc59 | ||
|
b49d1e8c6b | ||
|
e22073dc97 | ||
|
4134b67827 | ||
|
23ddac2e72 | ||
|
3a26efb5ca | ||
|
cfe648eb11 | ||
|
1f21badd72 | ||
|
be305d6dab | ||
|
5e4512d4c7 | ||
|
273fa042a8 | ||
|
d26eb4fce7 | ||
|
5d3c85c7e9 | ||
|
a29fe385df | ||
|
6d9bac47b3 | ||
|
bf2ff5f582 | ||
|
4e7f251b18 | ||
|
749c9720ce | ||
|
b68554b14a | ||
|
bba97eae36 | ||
|
a2d2c8afc4 | ||
|
546cbd55eb | ||
|
4730b5c281 | ||
|
e57da00824 | ||
|
a62a7ab282 | ||
|
54f469bba4 | ||
|
ff115472e3 | ||
|
30925a532d | ||
|
85cd9ab7c6 | ||
|
efed83d3c6 | ||
|
53010fd0b3 | ||
|
58bad1d409 | ||
|
7167113da9 | ||
|
19b3f692d1 | ||
|
835f392196 | ||
|
4a3ae35832 | ||
|
8cffa11a8b | ||
|
aea82cb331 | ||
|
f47a84f233 | ||
|
86f81a11d8 | ||
|
23f55f1c24 | ||
|
72ef09f55d | ||
|
537cf2acec | ||
|
265daf9082 | ||
|
280bbfe522 | ||
|
886de6c164 | ||
|
597c816368 | ||
|
50f753c60a | ||
|
d5b41a55a6 | ||
|
51036ff043 | ||
|
dcfa2fa4bd | ||
|
b2da9c919b | ||
|
028417185f | ||
|
651a2b2e40 | ||
|
9ce9f0427e | ||
|
ee299e80fa | ||
|
12042332ef | ||
|
8dba12e1c5 | ||
|
367f350f1f | ||
|
dc918a00fc | ||
|
c21d74e48d | ||
|
d20c7e3077 | ||
|
0a41fc5452 | ||
|
70af933804 | ||
|
a5c2ad18d5 | ||
|
509cd3ae61 | ||
|
c1cc94b08b | ||
|
ebc2bb9a2f | ||
|
b55f1b4c8f | ||
|
11e121d344 | ||
|
0b65c4476d | ||
|
b835367413 | ||
|
695b450e80 | ||
|
76f2a8f2dc | ||
|
796ee8816c | ||
|
864da2fcd5 | ||
|
6a669265ac | ||
|
cc1c1df405 | ||
|
15f4c40a91 | ||
|
33bb80f387 | ||
|
651b29b797 | ||
|
9422973c2a | ||
|
cb2369bf70 | ||
|
6a5963a395 | ||
|
5ec165e088 | ||
|
c0eea6c5de | ||
|
bb46cc6470 | ||
|
210a439365 | ||
|
8438510034 | ||
|
fb334b1b15 | ||
|
96eefd49fa | ||
|
c2fd6b9fa4 | ||
|
e9bc767691 | ||
|
8de9f41b5d | ||
|
848f658b32 | ||
|
71cc68b14b | ||
|
4df64bce83 | ||
|
8d1f05f5ac | ||
|
928c85ccc3 | ||
|
fda643952d | ||
|
0cd8dd4294 | ||
|
c50052e223 | ||
|
758830e7c3 | ||
|
e95e39cbd3 | ||
|
beedec1904 | ||
|
63f6aca1cf | ||
|
6c3e874701 | ||
|
018795127e | ||
|
fb86fd900e | ||
|
f32756e705 | ||
|
e2fc00222e | ||
|
cb63878b4f | ||
|
713fceb1bd | ||
|
d0137ef627 | ||
|
4594d82b14 | ||
|
5ec7a31cf1 | ||
|
7575d5216f | ||
|
45a98d6a93 | ||
|
037454d904 | ||
|
49d994ddc2 | ||
|
9bbd489f06 | ||
|
2a9b3c6a0c | ||
|
9f739ab135 | ||
|
799e9214dd | ||
|
e3fa2bafcc | ||
|
fcfc2ca518 | ||
|
3f1afd6040 | ||
|
a474beb7b8 | ||
|
e197752afe | ||
|
fc9f4add92 | ||
|
143bba075f | ||
|
5273634f47 | ||
|
ca2bffc060 | ||
|
b36b9323fc | ||
|
3ace1f5939 | ||
|
4f0cc3086f | ||
|
9521af0f6a | ||
|
0877b29e8e | ||
|
1793546d7a | ||
|
321a21015e | ||
|
63a8144e1a | ||
|
0a32305f01 | ||
|
eb386134e3 | ||
|
29cb9230bf | ||
|
b37c2216fc | ||
|
b90a66cab5 | ||
|
1a65a6ce76 | ||
|
678aa8088f | ||
|
a1d08b4b52 | ||
|
0fd0be4f9a | ||
|
20d1bc2ccc | ||
|
ed0ecf0ff0 | ||
|
c8fc40e793 | ||
|
6c473d5ff7 | ||
|
fc2dc82b70 | ||
|
5327799046 | ||
|
aa922f0779 | ||
|
7e502d0752 | ||
|
6a69dc6e5d | ||
|
5aa531674e | ||
|
322507f24c | ||
|
0a217cdd39 | ||
|
a798e2ff5e | ||
|
c8a901c1dc | ||
|
825b48911b | ||
|
56e93332d8 | ||
|
cbab83b843 | ||
|
2dec0b8d7f | ||
|
8c1bce72d5 | ||
|
ced07b92a2 | ||
|
d9626820e9 | ||
|
f6dc6bed07 | ||
|
8808e194cf | ||
|
be40ecbfe6 | ||
|
c31eadc3a1 | ||
|
963152a85a | ||
|
f656d38e59 | ||
|
3250e703b6 | ||
|
54530334f4 | ||
|
2c9a1f8b6c | ||
|
bd6c4a0dec | ||
|
eed37cd59a | ||
|
68f2cd1f09 | ||
|
d4f6bfbdad | ||
|
e74c655016 | ||
|
3030e887a4 | ||
|
c878168b8d | ||
|
f2d598b9a1 | ||
|
74eea6511f | ||
|
bcfff5e469 | ||
|
5368f98dd5 | ||
|
cf47bb9355 | ||
|
6c9d50a013 | ||
|
6e2df85ec8 | ||
|
04da31f5f5 | ||
|
b76eb96c58 | ||
|
2bad613cb0 | ||
|
fe592cd414 | ||
|
9d16715eb3 | ||
|
83d9e7a1c3 | ||
|
0eb7784785 | ||
|
9111541807 | ||
|
6a7d70cc9f | ||
|
63267a2f70 | ||
|
a9fb528a60 | ||
|
a2518493a2 | ||
|
2979aea3ae | ||
|
ccb9877534 | ||
|
dc7bf31b6e | ||
|
06c0a3d02c | ||
|
1e613485d3 | ||
|
8e9ac826a1 | ||
|
3a863ccd00 | ||
|
7cec5323d1 | ||
|
533a3f1b4b | ||
|
7d8be1c1ff | ||
|
7e59ec4afc | ||
|
74ff970804 | ||
|
15fec034df | ||
|
be8e25c4d8 | ||
|
33ffd54d5f | ||
|
96a806e096 | ||
|
061b36e6e4 | ||
|
3e5f5d3959 | ||
|
45b552d146 | ||
|
7793818f2a | ||
|
d53d7eb9e7 | ||
|
d9b6435f9a | ||
|
6a27fe15e3 | ||
|
58cfafdf04 | ||
|
c2d92794e2 | ||
|
33642e2255 | ||
|
c4446d36de | ||
|
c4cf72ecb8 | ||
|
f3250172a4 | ||
|
599806ca82 | ||
|
c009611401 | ||
|
ebc6bd834b | ||
|
66dcbcdfe7 | ||
|
2164c3dba7 | ||
|
8cd1a4a095 | ||
|
0334ea1c88 | ||
|
9281e058f3 | ||
|
91d6893f02 | ||
|
6de0874336 | ||
|
0e9085ac7e | ||
|
bb2e362533 | ||
|
57061ea7df | ||
|
ed4af4e777 | ||
|
66c8a996f9 | ||
|
1318d3748a | ||
|
04754d753b | ||
|
f8c1f7173a | ||
|
a04ea72ca1 | ||
|
0886ade182 | ||
|
0103704171 | ||
|
b76d5bda37 | ||
|
6f6b07aaae | ||
|
4bccd17941 | ||
|
0049b39375 | ||
|
63578d832a | ||
|
3a373b9b33 | ||
|
8be95ca348 | ||
|
5da58ba47d | ||
|
4505f4f17b | ||
|
7b7fe14b23 | ||
|
e0e9d8c6b5 | ||
|
24fcfa91b1 | ||
|
4f0ea69e9b | ||
|
f2e197a389 | ||
|
777beb0d0a | ||
|
1fa4b9f58c | ||
|
9117ee83eb |
@@ -13,7 +13,7 @@ stages:
|
||||
- subprojects/pango/
|
||||
|
||||
fedora-x86_64:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/master:v5
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/master:v6
|
||||
stage: build
|
||||
script:
|
||||
- bash -x ./.gitlab-ci/test-docker.sh
|
||||
@@ -28,6 +28,7 @@ fedora-x86_64:
|
||||
- "${CI_PROJECT_DIR}/_build/report.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report.html"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png"
|
||||
cache:
|
||||
key: "$CI_JOB_NAME"
|
||||
<<: *cache-paths
|
||||
@@ -101,7 +102,7 @@ flatpak-master:icon-browser:
|
||||
<<: *flatpak-master
|
||||
|
||||
pages:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/master:v4
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/master:v6
|
||||
stage: deploy
|
||||
script:
|
||||
- meson -Ddocumentation=true _build .
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FROM fedora:29
|
||||
FROM fedora:30
|
||||
|
||||
RUN dnf -y install \
|
||||
hicolor-icon-theme \
|
||||
@@ -11,6 +11,7 @@ RUN dnf -y install \
|
||||
ccache \
|
||||
colord-devel \
|
||||
cups-devel \
|
||||
dbus-daemon \
|
||||
dejavu-sans-mono-fonts \
|
||||
desktop-file-utils \
|
||||
elfutils-libelf-devel \
|
||||
@@ -59,6 +60,7 @@ RUN dnf -y install \
|
||||
pango-devel \
|
||||
pcre-devel \
|
||||
python3 \
|
||||
python3-jinja2 \
|
||||
python3-pip \
|
||||
python3-wheel \
|
||||
redhat-rpm-config \
|
||||
@@ -71,9 +73,7 @@ RUN dnf -y install \
|
||||
xorg-x11-server-Xvfb \
|
||||
&& dnf clean all
|
||||
|
||||
RUN pip3 install meson==0.50.0
|
||||
|
||||
RUN pip3 install jinja2
|
||||
RUN pip3 install meson==0.50.1
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v4"
|
||||
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v6"
|
||||
|
||||
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
|
||||
--file "Dockerfile" .
|
||||
|
@@ -42,10 +42,11 @@ ccache --zero-stats
|
||||
ccache --show-stats
|
||||
export CCACHE_DISABLE=true
|
||||
meson \
|
||||
-Denable-x11-backend=false \
|
||||
-Denable-wayland-backend=false \
|
||||
-Denable-win32-backend=true \
|
||||
-Dx11-backend=false \
|
||||
-Dwayland-backend=false \
|
||||
-Dwin32-backend=true \
|
||||
-Dvulkan=no \
|
||||
--werror \
|
||||
_build
|
||||
unset CCACHE_DISABLE
|
||||
|
||||
|
@@ -7,8 +7,8 @@
|
||||
<!--
|
||||
You should try and reproduce with the demos applications available
|
||||
under the `demos` directory, or the test programs in the `tests` directory.
|
||||
Alternatively, please attach a *small and self-contained* example that
|
||||
exhibits the issue.
|
||||
Alternatively, please attach a *small and self-contained* example
|
||||
*written in C* that exhibits the issue.
|
||||
-->
|
||||
|
||||
## Current behavior
|
||||
|
@@ -131,6 +131,9 @@
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#mesondefine HAVE_SYS_PARAM_H
|
||||
|
||||
/* Have the sysprof-capture library */
|
||||
#mesondefine HAVE_SYSPROF_CAPTURE
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#mesondefine HAVE_SYS_STAT_H
|
||||
|
||||
@@ -241,9 +244,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define to 1 if XInput 2.0 is available */
|
||||
#mesondefine XINPUT_2
|
||||
|
||||
/* Define to 1 if XInput 2.2 is available */
|
||||
#mesondefine XINPUT_2_2
|
||||
|
||||
@@ -297,6 +297,8 @@
|
||||
|
||||
#mesondefine GTK_PRINT_BACKENDS
|
||||
|
||||
#mesondefine HAVE_CAIRO_SCRIPT_INTERPRETER
|
||||
|
||||
#mesondefine HAVE_HARFBUZZ
|
||||
|
||||
#mesondefine HAVE_PANGOFT
|
||||
|
@@ -477,7 +477,7 @@ surface_state_changed (GtkWidget *widget)
|
||||
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
|
||||
GdkSurfaceState new_state;
|
||||
|
||||
new_state = gdk_surface_get_state (gtk_widget_get_surface (widget));
|
||||
new_state = gdk_surface_get_state (gtk_native_get_surface (GTK_NATIVE (widget)));
|
||||
window->maximized = (new_state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
|
||||
window->fullscreen = (new_state & GDK_SURFACE_STATE_FULLSCREEN) != 0;
|
||||
}
|
||||
@@ -487,14 +487,14 @@ demo_application_window_realize (GtkWidget *widget)
|
||||
{
|
||||
GTK_WIDGET_CLASS (demo_application_window_parent_class)->realize (widget);
|
||||
|
||||
g_signal_connect_swapped (gtk_widget_get_surface (widget), "notify::state",
|
||||
g_signal_connect_swapped (gtk_native_get_surface (GTK_NATIVE (widget)), "notify::state",
|
||||
G_CALLBACK (surface_state_changed), widget);
|
||||
}
|
||||
|
||||
static void
|
||||
demo_application_window_unrealize (GtkWidget *widget)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (gtk_widget_get_surface (widget),
|
||||
g_signal_handlers_disconnect_by_func (gtk_native_get_surface (GTK_NATIVE (widget)),
|
||||
surface_state_changed, widget);
|
||||
|
||||
GTK_WIDGET_CLASS (demo_application_window_parent_class)->unrealize (widget);
|
||||
|
@@ -458,7 +458,6 @@ blur_overlay_class_init (BlurOverlayClass *klass)
|
||||
static void
|
||||
blur_overlay_init (BlurOverlay *overlay)
|
||||
{
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (overlay), FALSE);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
@@ -74,17 +74,17 @@ find_toplevel_at_pointer (GdkDisplay *display)
|
||||
pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (), NULL, NULL);
|
||||
|
||||
if (pointer_window)
|
||||
widget = GTK_WIDGET (gtk_root_get_for_surface (pointer_window));
|
||||
widget = GTK_WIDGET (gtk_native_get_for_surface (pointer_window));
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
static void
|
||||
released_cb (GtkGestureMultiPress *gesture,
|
||||
guint n_press,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gboolean *clicked)
|
||||
released_cb (GtkGestureClick *gesture,
|
||||
guint n_press,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gboolean *clicked)
|
||||
{
|
||||
*clicked = TRUE;
|
||||
}
|
||||
@@ -105,7 +105,6 @@ query_for_toplevel (GdkDisplay *display,
|
||||
popup = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_window_set_display (GTK_WINDOW (popup), display);
|
||||
gtk_window_set_modal (GTK_WINDOW (popup), TRUE);
|
||||
gtk_window_set_position (GTK_WINDOW (popup), GTK_WIN_POS_CENTER);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
||||
@@ -120,11 +119,11 @@ query_for_toplevel (GdkDisplay *display,
|
||||
device = gtk_get_current_event_device ();
|
||||
|
||||
if (gdk_seat_grab (gdk_device_get_seat (device),
|
||||
gtk_widget_get_surface (popup),
|
||||
gtk_native_get_surface (GTK_NATIVE (popup)),
|
||||
GDK_SEAT_CAPABILITY_ALL_POINTING,
|
||||
FALSE, cursor, NULL, NULL, NULL) == GDK_GRAB_SUCCESS)
|
||||
{
|
||||
GtkGesture *gesture = gtk_gesture_multi_press_new ();
|
||||
GtkGesture *gesture = gtk_gesture_click_new ();
|
||||
gboolean clicked = FALSE;
|
||||
|
||||
g_signal_connect (gesture, "released",
|
||||
|
@@ -319,7 +319,7 @@ do_clipboard (GtkWidget *do_widget)
|
||||
G_CALLBACK (drag_data_received), image);
|
||||
|
||||
/* context menu on image */
|
||||
gesture = gtk_gesture_multi_press_new ();
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
|
||||
@@ -344,7 +344,7 @@ do_clipboard (GtkWidget *do_widget)
|
||||
G_CALLBACK (drag_data_received), image);
|
||||
|
||||
/* context menu on image */
|
||||
gesture = gtk_gesture_multi_press_new ();
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
257
demos/gtk-demo/constraints.c
Normal file
257
demos/gtk-demo/constraints.c
Normal file
@@ -0,0 +1,257 @@
|
||||
/* Constraints/Simple
|
||||
*
|
||||
* GtkConstraintLayout provides a layout manager that uses relations
|
||||
* between widgets (also known as "constraints") to compute the position
|
||||
* and size of each child.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_DECLARE_FINAL_TYPE (SimpleGrid, simple_grid, SIMPLE, GRID, GtkWidget)
|
||||
|
||||
struct _SimpleGrid
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GtkWidget *button1, *button2;
|
||||
GtkWidget *button3;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (SimpleGrid, simple_grid, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
simple_grid_destroy (GtkWidget *widget)
|
||||
{
|
||||
SimpleGrid *self = SIMPLE_GRID (widget);
|
||||
|
||||
g_clear_pointer (&self->button1, gtk_widget_destroy);
|
||||
g_clear_pointer (&self->button2, gtk_widget_destroy);
|
||||
g_clear_pointer (&self->button3, gtk_widget_destroy);
|
||||
|
||||
GTK_WIDGET_CLASS (simple_grid_parent_class)->destroy (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
simple_grid_class_init (SimpleGridClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->destroy = simple_grid_destroy;
|
||||
|
||||
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_CONSTRAINT_LAYOUT);
|
||||
}
|
||||
|
||||
/* Layout:
|
||||
*
|
||||
* +-----------------------------+
|
||||
* | +-----------+ +-----------+ |
|
||||
* | | Child 1 | | Child 2 | |
|
||||
* | +-----------+ +-----------+ |
|
||||
* | +-------------------------+ |
|
||||
* | | Child 3 | |
|
||||
* | +-------------------------+ |
|
||||
* +-----------------------------+
|
||||
*
|
||||
* Constraints:
|
||||
*
|
||||
* super.start = child1.start - 8
|
||||
* child1.width = child2.width
|
||||
* child1.end = child2.start - 12
|
||||
* child2.end = super.end - 8
|
||||
* super.start = child3.start - 8
|
||||
* child3.end = super.end - 8
|
||||
* super.top = child1.top - 8
|
||||
* super.top = child2.top - 8
|
||||
* child1.bottom = child3.top - 12
|
||||
* child2.bottom = child3.top - 12
|
||||
* child3.height = child1.height
|
||||
* child3.height = child2.height
|
||||
* child3.bottom = super.bottom - 8
|
||||
*
|
||||
*/
|
||||
static void
|
||||
build_constraints (SimpleGrid *self,
|
||||
GtkConstraintLayout *manager)
|
||||
{
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_START,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button1,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_START,
|
||||
1.0,
|
||||
-8.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button1,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_WIDTH,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button2,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_WIDTH,
|
||||
1.0,
|
||||
0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button1,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_END,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button2,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_START,
|
||||
1.0,
|
||||
-12.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button2,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_END,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_END,
|
||||
1.0,
|
||||
-8.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_START,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button3,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_START,
|
||||
1.0,
|
||||
-8.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button3,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_END,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_END,
|
||||
1.0,
|
||||
-8.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button1,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
1.0,
|
||||
-8.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button2,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
1.0,
|
||||
-8.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button1,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button3,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
1.0,
|
||||
-12.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button2,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button3,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
1.0,
|
||||
-12.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button3,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_HEIGHT,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button1,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_HEIGHT,
|
||||
1.0,
|
||||
0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button3,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_HEIGHT,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button2,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_HEIGHT,
|
||||
1.0,
|
||||
0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
gtk_constraint_layout_add_constraint (manager,
|
||||
gtk_constraint_new (self->button3,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
|
||||
1.0,
|
||||
-8.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
}
|
||||
|
||||
static void
|
||||
simple_grid_init (SimpleGrid *self)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (self);
|
||||
|
||||
self->button1 = gtk_button_new_with_label ("Child 1");
|
||||
gtk_widget_set_parent (self->button1, widget);
|
||||
gtk_widget_set_name (self->button1, "button1");
|
||||
|
||||
self->button2 = gtk_button_new_with_label ("Child 2");
|
||||
gtk_widget_set_parent (self->button2, widget);
|
||||
gtk_widget_set_name (self->button2, "button2");
|
||||
|
||||
self->button3 = gtk_button_new_with_label ("Child 3");
|
||||
gtk_widget_set_parent (self->button3, widget);
|
||||
gtk_widget_set_name (self->button3, "button3");
|
||||
|
||||
GtkLayoutManager *manager = gtk_widget_get_layout_manager (GTK_WIDGET (self));
|
||||
build_constraints (self, GTK_CONSTRAINT_LAYOUT (manager));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_constraints (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (header), "Constraints");
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
grid = g_object_new (simple_grid_get_type (), NULL);
|
||||
gtk_widget_set_hexpand (grid, TRUE);
|
||||
gtk_widget_set_vexpand (grid, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), grid);
|
||||
|
||||
button = gtk_button_new_with_label ("Close");
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
gtk_widget_set_hexpand (grid, TRUE);
|
||||
g_signal_connect_swapped (button, "clicked",
|
||||
G_CALLBACK (gtk_widget_destroy), window);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
190
demos/gtk-demo/constraints2.c
Normal file
190
demos/gtk-demo/constraints2.c
Normal file
@@ -0,0 +1,190 @@
|
||||
/* Constraints/Grid
|
||||
*
|
||||
* GtkConstraintLayout lets you define complex layouts
|
||||
* like grids.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_DECLARE_FINAL_TYPE (ComplexGrid, complex_grid, COMPLEX, GRID, GtkWidget)
|
||||
|
||||
struct _ComplexGrid
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GtkWidget *button1, *button2, *button3;
|
||||
GtkWidget *button4, *button5;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (ComplexGrid, complex_grid, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
complex_grid_destroy (GtkWidget *widget)
|
||||
{
|
||||
ComplexGrid *self = COMPLEX_GRID (widget);
|
||||
|
||||
g_clear_pointer (&self->button1, gtk_widget_destroy);
|
||||
g_clear_pointer (&self->button2, gtk_widget_destroy);
|
||||
g_clear_pointer (&self->button3, gtk_widget_destroy);
|
||||
g_clear_pointer (&self->button4, gtk_widget_destroy);
|
||||
g_clear_pointer (&self->button5, gtk_widget_destroy);
|
||||
|
||||
GTK_WIDGET_CLASS (complex_grid_parent_class)->destroy (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
complex_grid_class_init (ComplexGridClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->destroy = complex_grid_destroy;
|
||||
|
||||
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_CONSTRAINT_LAYOUT);
|
||||
}
|
||||
|
||||
/* Layout:
|
||||
*
|
||||
* +--------------------------------------+
|
||||
* | +-----------+ |
|
||||
* | | Child 4 | |
|
||||
* | +-----------+-----------+----------+ |
|
||||
* | | Child 1 | Child 2 | Child 3 | |
|
||||
* | +-----------+-----------+----------+ |
|
||||
* | | Child 5 | |
|
||||
* | +-----------+ |
|
||||
* +--------------------------------------+
|
||||
*
|
||||
*/
|
||||
static void
|
||||
build_constraints (ComplexGrid *self,
|
||||
GtkConstraintLayout *manager)
|
||||
{
|
||||
GtkGridConstraint *constraint;
|
||||
GtkConstraint *s;
|
||||
|
||||
s = gtk_constraint_new (NULL, GTK_CONSTRAINT_ATTRIBUTE_LEFT,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button1, GTK_CONSTRAINT_ATTRIBUTE_LEFT,
|
||||
1.0, 0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
gtk_constraint_layout_add_constraint (manager, s);
|
||||
|
||||
s = gtk_constraint_new (self->button3, GTK_CONSTRAINT_ATTRIBUTE_RIGHT,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
NULL, GTK_CONSTRAINT_ATTRIBUTE_RIGHT,
|
||||
1.0, 0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
gtk_constraint_layout_add_constraint (manager, s);
|
||||
|
||||
s = gtk_constraint_new (NULL, GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button4, GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
1.0, 0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
gtk_constraint_layout_add_constraint (manager, s);
|
||||
|
||||
s = gtk_constraint_new (NULL, GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
self->button5, GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
|
||||
1.0, 0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
gtk_constraint_layout_add_constraint (manager, s);
|
||||
|
||||
constraint = gtk_grid_constraint_new ();
|
||||
g_object_set (constraint, "column-homogeneous", TRUE, NULL);
|
||||
gtk_grid_constraint_add (constraint,
|
||||
self->button1,
|
||||
0, 1, 0, 1);
|
||||
gtk_grid_constraint_add (constraint,
|
||||
self->button2,
|
||||
1, 2, 0, 1);
|
||||
gtk_grid_constraint_add (constraint,
|
||||
self->button3,
|
||||
2, 3, 0, 1);
|
||||
gtk_constraint_layout_add_grid_constraint (manager, constraint);
|
||||
|
||||
constraint = gtk_grid_constraint_new ();
|
||||
g_object_set (constraint, "row-homogeneous", TRUE, NULL);
|
||||
gtk_grid_constraint_add (constraint,
|
||||
self->button4,
|
||||
0, 1, 0, 1);
|
||||
gtk_grid_constraint_add (constraint,
|
||||
self->button2,
|
||||
0, 1, 1, 2);
|
||||
gtk_grid_constraint_add (constraint,
|
||||
self->button5,
|
||||
0, 1, 2, 3);
|
||||
gtk_constraint_layout_add_grid_constraint (manager, constraint);
|
||||
}
|
||||
|
||||
static void
|
||||
complex_grid_init (ComplexGrid *self)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (self);
|
||||
GtkLayoutManager *manager = gtk_widget_get_layout_manager (GTK_WIDGET (self));
|
||||
|
||||
self->button1 = gtk_button_new_with_label ("Child 1");
|
||||
gtk_widget_set_parent (self->button1, widget);
|
||||
gtk_widget_set_name (self->button1, "button1");
|
||||
|
||||
self->button2 = gtk_button_new_with_label ("Child 2");
|
||||
gtk_widget_set_parent (self->button2, widget);
|
||||
gtk_widget_set_name (self->button2, "button2");
|
||||
|
||||
self->button3 = gtk_button_new_with_label ("Child 3");
|
||||
gtk_widget_set_parent (self->button3, widget);
|
||||
gtk_widget_set_name (self->button3, "button3");
|
||||
|
||||
self->button4 = gtk_button_new_with_label ("Child 4");
|
||||
gtk_widget_set_parent (self->button4, widget);
|
||||
gtk_widget_set_name (self->button4, "button4");
|
||||
|
||||
self->button5 = gtk_button_new_with_label ("Child 5");
|
||||
gtk_widget_set_parent (self->button5, widget);
|
||||
gtk_widget_set_name (self->button5, "button5");
|
||||
|
||||
build_constraints (self, GTK_CONSTRAINT_LAYOUT (manager));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_constraints2 (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (header), "Constraints");
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
grid = g_object_new (complex_grid_get_type (), NULL);
|
||||
gtk_widget_set_hexpand (grid, TRUE);
|
||||
gtk_widget_set_vexpand (grid, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), grid);
|
||||
|
||||
button = gtk_button_new_with_label ("Close");
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
gtk_widget_set_hexpand (grid, TRUE);
|
||||
g_signal_connect_swapped (button, "clicked",
|
||||
G_CALLBACK (gtk_widget_destroy), window);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
355
demos/gtk-demo/constraints3.c
Normal file
355
demos/gtk-demo/constraints3.c
Normal file
@@ -0,0 +1,355 @@
|
||||
/* Constraints/Words
|
||||
*
|
||||
* GtkConstraintLayout lets you define big grids.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define WORDS_TYPE_BASE (words_base_get_type ())
|
||||
#define WORDS_TYPE_GRID (words_grid_get_type ())
|
||||
#define WORDS_TYPE_CONSTRAINT (words_constraint_get_type ())
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
} WordsBase;
|
||||
|
||||
typedef WordsBase WordsGrid;
|
||||
typedef WordsBase WordsConstraint;
|
||||
|
||||
typedef GtkWidgetClass WordsBaseClass;
|
||||
typedef GtkWidgetClass WordsGridClass;
|
||||
typedef GtkWidgetClass WordsConstraintClass;
|
||||
|
||||
G_DEFINE_TYPE (WordsBase, words_base, GTK_TYPE_WIDGET)
|
||||
G_DEFINE_TYPE (WordsGrid, words_grid, WORDS_TYPE_BASE)
|
||||
G_DEFINE_TYPE (WordsConstraint, words_constraint, WORDS_TYPE_BASE)
|
||||
|
||||
static void
|
||||
words_grid_init (WordsGrid *words)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
words_grid_class_init (WordsGridClass *class)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_GRID_LAYOUT);
|
||||
}
|
||||
|
||||
static void
|
||||
words_constraint_init (WordsGrid *words)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
words_constraint_class_init (WordsConstraintClass *class)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_CONSTRAINT_LAYOUT);
|
||||
}
|
||||
|
||||
static void
|
||||
word_base_dispose (GObject *object)
|
||||
{
|
||||
GtkWidget *self = GTK_WIDGET (object);
|
||||
GtkWidget *child;
|
||||
|
||||
while ((child = gtk_widget_get_first_child (self)) != NULL)
|
||||
gtk_widget_unparent (child);
|
||||
|
||||
G_OBJECT_CLASS (words_base_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
words_base_class_init (WordsBaseClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = word_base_dispose;
|
||||
}
|
||||
|
||||
static int num_words = 100;
|
||||
static gboolean use_constraints = FALSE;
|
||||
|
||||
static void
|
||||
read_words (WordsBase *self)
|
||||
{
|
||||
GBytes *data;
|
||||
const char *words;
|
||||
int left, top;
|
||||
GtkWidget *child = NULL;
|
||||
GtkLayoutManager *layout = gtk_widget_get_layout_manager (GTK_WIDGET (self));
|
||||
GtkGridConstraint *grid;
|
||||
GtkConstraint *constraint;
|
||||
int count;
|
||||
int rightmost;
|
||||
GtkWidget *right_child;
|
||||
|
||||
if (GTK_IS_CONSTRAINT_LAYOUT (layout))
|
||||
{
|
||||
grid = gtk_grid_constraint_new ();
|
||||
g_object_set (grid,
|
||||
"row-homogeneous", TRUE,
|
||||
"column-homogeneous", FALSE,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_grid_layout_set_row_homogeneous (GTK_GRID_LAYOUT (layout), TRUE);
|
||||
gtk_grid_layout_set_column_homogeneous (GTK_GRID_LAYOUT (layout), FALSE);
|
||||
}
|
||||
|
||||
data = g_resources_lookup_data ("/constraints3/words", 0, NULL);
|
||||
words = g_bytes_get_data (data, NULL);
|
||||
count = 0;
|
||||
|
||||
rightmost = 0;
|
||||
left = 0;
|
||||
top = 0;
|
||||
while (words && words[0])
|
||||
{
|
||||
char *p = strchr (words, '\n');
|
||||
char *word;
|
||||
int len;
|
||||
|
||||
if (p)
|
||||
{
|
||||
word = strndup (words, p - words);
|
||||
words = p + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
word = strdup (words);
|
||||
words = NULL;
|
||||
}
|
||||
|
||||
len = strlen (word);
|
||||
child = gtk_button_new_with_label (word);
|
||||
|
||||
if (left + len > 50)
|
||||
{
|
||||
top++;
|
||||
left = 0;
|
||||
}
|
||||
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (self));
|
||||
|
||||
if (left + len > rightmost)
|
||||
{
|
||||
rightmost = left + len;
|
||||
right_child = child;
|
||||
}
|
||||
|
||||
//g_print ("%d %d %d %d %s\n", left, left + len, top, top + 1, word);
|
||||
if (GTK_IS_CONSTRAINT_LAYOUT (layout))
|
||||
{
|
||||
gtk_grid_constraint_add (grid, child,
|
||||
left, left + len,
|
||||
top, top + 1);
|
||||
if (left == 0 && top == 0)
|
||||
{
|
||||
constraint = gtk_constraint_new (NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
child,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_TOP,
|
||||
1.0,
|
||||
0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (layout),
|
||||
constraint);
|
||||
constraint = gtk_constraint_new (NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_LEFT,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
child,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_LEFT,
|
||||
1.0,
|
||||
0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (layout),
|
||||
constraint);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkGridLayoutChild *grid_child = GTK_GRID_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (layout, child));
|
||||
|
||||
g_object_set (grid_child,
|
||||
"left-attach", left,
|
||||
"top-attach", top,
|
||||
"column-span", len,
|
||||
"row-span", 1,
|
||||
NULL);
|
||||
}
|
||||
|
||||
left = left + len;
|
||||
count++;
|
||||
|
||||
if (count >= num_words)
|
||||
break;
|
||||
}
|
||||
|
||||
if (GTK_IS_CONSTRAINT_LAYOUT (layout))
|
||||
{
|
||||
constraint = gtk_constraint_new (NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_RIGHT,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
right_child,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_RIGHT,
|
||||
1.0,
|
||||
0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (layout),
|
||||
constraint);
|
||||
constraint = gtk_constraint_new (NULL,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
child,
|
||||
GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
|
||||
1.0,
|
||||
0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (layout),
|
||||
constraint);
|
||||
|
||||
gtk_constraint_layout_add_grid_constraint (GTK_CONSTRAINT_LAYOUT (layout),
|
||||
grid);
|
||||
}
|
||||
|
||||
g_bytes_unref (data);
|
||||
}
|
||||
|
||||
static void
|
||||
words_base_init (WordsBase *self)
|
||||
{
|
||||
read_words (self);
|
||||
}
|
||||
|
||||
static void
|
||||
show_words (GtkWidget *parent)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
GtkWidget *swin;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window),
|
||||
GTK_WINDOW (gtk_widget_get_root (parent)));
|
||||
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (header), use_constraints ? "Constraints" : "Grid");
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
swin = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_propagate_natural_width (GTK_SCROLLED_WINDOW (swin), TRUE);
|
||||
gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (swin), TRUE);
|
||||
gtk_widget_set_hexpand (swin, TRUE);
|
||||
gtk_widget_set_vexpand (swin, TRUE);
|
||||
gtk_widget_set_halign (swin, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (swin, GTK_ALIGN_FILL);
|
||||
gtk_container_add (GTK_CONTAINER (box), swin);
|
||||
|
||||
if (use_constraints)
|
||||
grid = g_object_new (WORDS_TYPE_CONSTRAINT, NULL);
|
||||
else
|
||||
grid = g_object_new (WORDS_TYPE_GRID, NULL);
|
||||
|
||||
gtk_widget_set_halign (swin, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (swin, GTK_ALIGN_START);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (swin), grid);
|
||||
|
||||
button = gtk_button_new_with_label ("Close");
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
g_signal_connect_swapped (button, "clicked",
|
||||
G_CALLBACK (gtk_widget_destroy), window);
|
||||
|
||||
gtk_widget_show (window);
|
||||
}
|
||||
|
||||
static void
|
||||
use_constraints_cb (GtkButton *button)
|
||||
{
|
||||
use_constraints = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
|
||||
}
|
||||
|
||||
static void
|
||||
word_count_cb (GtkSpinButton *button)
|
||||
{
|
||||
num_words = gtk_spin_button_get_value_as_int (button);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_constraints3 (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *header, *grid, *button, *label;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (header), "Words");
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
grid = gtk_grid_new ();
|
||||
g_object_set (grid,
|
||||
"margin", 12,
|
||||
"row-spacing", 12,
|
||||
"column-spacing", 6,
|
||||
"halign", GTK_ALIGN_FILL,
|
||||
"valign", GTK_ALIGN_FILL,
|
||||
"hexpand", TRUE,
|
||||
"vexpand", TRUE,
|
||||
NULL);
|
||||
gtk_container_add (GTK_CONTAINER (window), grid);
|
||||
|
||||
label = gtk_label_new ("Constraints:");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 1.0);
|
||||
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
|
||||
button = gtk_check_button_new ();
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (use_constraints_cb), NULL);
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1);
|
||||
label = gtk_label_new ("Words:");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 1.0);
|
||||
gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
|
||||
button = gtk_spin_button_new_with_range (0, 1300, 1);
|
||||
g_signal_connect (button, "value-changed", G_CALLBACK (word_count_cb), NULL);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (button), 10);
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 1, 1, 1, 1);
|
||||
|
||||
button = gtk_button_new_with_label ("Show");
|
||||
gtk_widget_set_halign (button, GTK_ALIGN_END);
|
||||
gtk_widget_set_valign (button, GTK_ALIGN_END);
|
||||
g_signal_connect_swapped (button, "clicked",
|
||||
G_CALLBACK (show_words), window);
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 0, 2, 2, 1);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -12,6 +12,9 @@
|
||||
<gresource prefix="/builder">
|
||||
<file>demo.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/constraints3">
|
||||
<file>words</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_accordion">
|
||||
<file>css_accordion.css</file>
|
||||
<file>reset.css</file>
|
||||
@@ -37,6 +40,9 @@
|
||||
<gresource prefix="/theming_style_classes">
|
||||
<file>theming.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/themes">
|
||||
<file>themes.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_pixbufs">
|
||||
<file alias="gtk.css">css_pixbufs.css</file>
|
||||
<file>cssview.css</file>
|
||||
@@ -147,6 +153,9 @@
|
||||
<file>clipboard.c</file>
|
||||
<file>colorsel.c</file>
|
||||
<file>combobox.c</file>
|
||||
<file>constraints.c</file>
|
||||
<file>constraints2.c</file>
|
||||
<file>constraints3.c</file>
|
||||
<file>css_accordion.c</file>
|
||||
<file>css_basics.c</file>
|
||||
<file>css_blendmodes.c</file>
|
||||
@@ -212,6 +221,7 @@
|
||||
<file>textview.c</file>
|
||||
<file>textscroll.c</file>
|
||||
<file>theming_style_classes.c</file>
|
||||
<file>themes.c</file>
|
||||
<file>transparent.c</file>
|
||||
<file>tree_store.c</file>
|
||||
<file>textmask.c</file>
|
||||
|
@@ -41,8 +41,6 @@ demo_tagged_entry_init (DemoTaggedEntry *entry)
|
||||
{
|
||||
DemoTaggedEntryPrivate *priv = demo_tagged_entry_get_instance_private (entry);
|
||||
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (entry), FALSE);
|
||||
|
||||
priv->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_widget_set_parent (priv->box, GTK_WIDGET (entry));
|
||||
|
||||
@@ -252,11 +250,11 @@ static guint signals[LAST_SIGNAL] = { 0, };
|
||||
G_DEFINE_TYPE (DemoTaggedEntryTag, demo_tagged_entry_tag, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
on_released (GtkGestureMultiPress *gesture,
|
||||
on_released (GtkGestureClick *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
DemoTaggedEntryTag *tag)
|
||||
DemoTaggedEntryTag *tag)
|
||||
{
|
||||
g_signal_emit (tag, signals[SIGNAL_CLICKED], 0);
|
||||
}
|
||||
@@ -267,14 +265,12 @@ demo_tagged_entry_tag_init (DemoTaggedEntryTag *tag)
|
||||
GtkGesture *gesture;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (tag), FALSE);
|
||||
|
||||
tag->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_widget_set_parent (tag->box, GTK_WIDGET (tag));
|
||||
tag->label = gtk_label_new ("");
|
||||
gtk_container_add (GTK_CONTAINER (tag->box), tag->label);
|
||||
|
||||
gesture = gtk_gesture_multi_press_new ();
|
||||
gesture = gtk_gesture_click_new ();
|
||||
g_signal_connect (gesture, "released", G_CALLBACK (on_released), tag);
|
||||
gtk_widget_add_controller (GTK_WIDGET (tag), GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
|
@@ -299,7 +299,7 @@ pressed_cb (GtkGesture *gesture,
|
||||
rect.height = 0;
|
||||
|
||||
gtk_menu_popup_at_rect (GTK_MENU (menu),
|
||||
gtk_widget_get_surface (widget),
|
||||
gtk_native_get_surface (gtk_widget_get_native (widget)),
|
||||
&rect,
|
||||
GDK_GRAVITY_NORTH_WEST,
|
||||
GDK_GRAVITY_NORTH_WEST,
|
||||
@@ -356,7 +356,7 @@ do_dnd (GtkWidget *do_widget)
|
||||
gtk_widget_set_hexpand (fixed, TRUE);
|
||||
gtk_widget_set_vexpand (fixed, TRUE);
|
||||
|
||||
multipress = gtk_gesture_multi_press_new ();
|
||||
multipress = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (multipress), 0);
|
||||
g_signal_connect (multipress, "pressed", G_CALLBACK (pressed_cb), NULL);
|
||||
g_signal_connect (multipress, "released", G_CALLBACK (released_cb), NULL);
|
||||
|
@@ -38,7 +38,7 @@ do_expander (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
toplevel = gtk_widget_get_toplevel (do_widget);
|
||||
toplevel = GTK_WIDGET (gtk_widget_get_root (do_widget));
|
||||
window = gtk_message_dialog_new_with_markup (GTK_WINDOW (toplevel),
|
||||
0,
|
||||
GTK_MESSAGE_ERROR,
|
||||
|
@@ -164,6 +164,26 @@ create_switch (void)
|
||||
return w;
|
||||
}
|
||||
|
||||
static void
|
||||
mapped (GtkWidget *w)
|
||||
{
|
||||
gtk_menu_button_popup (GTK_MENU_BUTTON (w));
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_menu_button (void)
|
||||
{
|
||||
GtkWidget *w = gtk_menu_button_new ();
|
||||
GtkWidget *popover = gtk_popover_new (NULL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (popover), gtk_button_new_with_label ("Hey!"));
|
||||
gtk_popover_set_autohide (GTK_POPOVER (popover), FALSE);
|
||||
gtk_menu_button_set_popover (GTK_MENU_BUTTON (w), popover);
|
||||
g_signal_connect (w, "map", G_CALLBACK (mapped), NULL);
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
GtkWidget * (*create_func) (void);
|
||||
@@ -179,6 +199,7 @@ static const struct {
|
||||
{ "Video", create_video },
|
||||
{ "Gears", create_gears },
|
||||
{ "Switch", create_switch },
|
||||
{ "Menubutton", create_menu_button },
|
||||
};
|
||||
|
||||
static int selected_widget_type = -1;
|
||||
@@ -198,7 +219,7 @@ set_widget_type (GtkFishbowl *fishbowl,
|
||||
gtk_fishbowl_set_creation_func (fishbowl,
|
||||
widget_types[selected_widget_type].create_func);
|
||||
|
||||
window = gtk_widget_get_toplevel (GTK_WIDGET (fishbowl));
|
||||
window = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (fishbowl)));
|
||||
headerbar = gtk_window_get_titlebar (GTK_WINDOW (window));
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (headerbar),
|
||||
widget_types[selected_widget_type].name);
|
||||
@@ -234,6 +255,15 @@ prev_button_clicked_cb (GtkButton *source,
|
||||
set_widget_type (fishbowl, new_index);
|
||||
}
|
||||
|
||||
void
|
||||
changes_toggled_cb (GtkToggleButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (gtk_toggle_button_get_active (button))
|
||||
gtk_button_set_icon_name (GTK_BUTTON (button), "changes-prevent");
|
||||
else
|
||||
gtk_button_set_icon_name (GTK_BUTTON (button), "changes-allow");
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_fishbowl (GtkWidget *do_widget)
|
||||
@@ -261,6 +291,7 @@ do_fishbowl (GtkWidget *do_widget)
|
||||
gtk_builder_add_callback_symbols (builder,
|
||||
"next_button_clicked_cb", G_CALLBACK (next_button_clicked_cb),
|
||||
"prev_button_clicked_cb", G_CALLBACK (prev_button_clicked_cb),
|
||||
"changes_toggled_cb", G_CALLBACK (changes_toggled_cb),
|
||||
NULL);
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
|
@@ -2,6 +2,8 @@
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="title" translatable="yes">Fishbowl</property>
|
||||
<property name="default-width">400</property>
|
||||
<property name="default-height">400</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="">
|
||||
<property name="show-title-buttons">1</property>
|
||||
@@ -31,7 +33,7 @@
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkLabel">
|
||||
<property name="label" bind-source="bowl" bind-property="framerate"/>
|
||||
<property name="label" bind-source="bowl" bind-property="framerate-string"/>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
@@ -46,17 +48,9 @@
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="changes_allow">
|
||||
<property name="visible" bind-source="changes_allow" bind-property="active" bind-flags="invert-boolean"/>
|
||||
<property name="icon-name">changes-allow</property>
|
||||
<property name="relief">none</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="changes_prevent">
|
||||
<property name="active" bind-source="changes_allow" bind-property="active" bind-flags="bidirectional|invert-boolean"/>
|
||||
<property name="visible" bind-source="changes_prevent" bind-property="active" bind-flags="invert-boolean"/>
|
||||
<property name="icon-name">changes-prevent</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="notify::active" handler="changes_toggled_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -65,7 +59,7 @@
|
||||
<object class="GtkFishbowl" id="bowl">
|
||||
<property name="visible">True</property>
|
||||
<property name="animating">True</property>
|
||||
<property name="benchmark" bind-source="changes_allow" bind-property="active" bind-flags="invert-boolean"/>
|
||||
<property name="benchmark" bind-source="changes_allow" bind-property="active" bind-flags="invert-boolean | sync-create"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -1669,7 +1669,7 @@ toggle_edit (void)
|
||||
static void
|
||||
stop_edit (void)
|
||||
{
|
||||
gtk_button_clicked (GTK_BUTTON (edit_toggle));
|
||||
g_signal_emit_by_name (edit_toggle, "clicked");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -209,7 +209,6 @@ gtk_font_plane_init (GtkFontPlane *plane)
|
||||
{
|
||||
GtkGesture *gesture;
|
||||
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (plane), FALSE);
|
||||
gtk_widget_set_can_focus (GTK_WIDGET (plane), TRUE);
|
||||
|
||||
gesture = gtk_gesture_drag_new ();
|
||||
|
@@ -53,6 +53,7 @@ enum {
|
||||
PROP_BENCHMARK,
|
||||
PROP_COUNT,
|
||||
PROP_FRAMERATE,
|
||||
PROP_FRAMERATE_STRING,
|
||||
PROP_UPDATE_DELAY,
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
@@ -66,8 +67,6 @@ gtk_fishbowl_init (GtkFishbowl *fishbowl)
|
||||
{
|
||||
GtkFishbowlPrivate *priv = gtk_fishbowl_get_instance_private (fishbowl);
|
||||
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (fishbowl), FALSE);
|
||||
|
||||
priv->update_delay = G_USEC_PER_SEC;
|
||||
}
|
||||
|
||||
@@ -290,6 +289,14 @@ gtk_fishbowl_get_property (GObject *object,
|
||||
g_value_set_double (value, gtk_fishbowl_get_framerate (fishbowl));
|
||||
break;
|
||||
|
||||
case PROP_FRAMERATE_STRING:
|
||||
{
|
||||
char *s = g_strdup_printf ("%.2f", gtk_fishbowl_get_framerate (fishbowl));
|
||||
g_value_set_string (value, s);
|
||||
g_free (s);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_UPDATE_DELAY:
|
||||
g_value_set_int64 (value, gtk_fishbowl_get_update_delay (fishbowl));
|
||||
break;
|
||||
@@ -343,6 +350,13 @@ gtk_fishbowl_class_init (GtkFishbowlClass *klass)
|
||||
0,
|
||||
G_PARAM_READABLE);
|
||||
|
||||
props[PROP_FRAMERATE_STRING] =
|
||||
g_param_spec_string ("framerate-string",
|
||||
"Framerate as string",
|
||||
"Framerate as string, with 2 decimals",
|
||||
NULL,
|
||||
G_PARAM_READABLE);
|
||||
|
||||
props[PROP_UPDATE_DELAY] =
|
||||
g_param_spec_int64 ("update-delay",
|
||||
"Update delay",
|
||||
@@ -491,7 +505,10 @@ gtk_fishbowl_do_update (GtkFishbowl *fishbowl)
|
||||
|
||||
n_frames = end_counter - start_counter;
|
||||
priv->framerate = ((double) n_frames) * G_USEC_PER_SEC / (end_timestamp - start_timestamp);
|
||||
priv->framerate = ((int)(priv->framerate * 100))/100.0;
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (fishbowl), props[PROP_FRAMERATE]);
|
||||
g_object_notify_by_pspec (G_OBJECT (fishbowl), props[PROP_FRAMERATE_STRING]);
|
||||
|
||||
if (!priv->benchmark)
|
||||
return;
|
||||
|
@@ -136,11 +136,11 @@ static void set_cursor_if_appropriate (GtkTextView *text_view,
|
||||
gint y);
|
||||
|
||||
static void
|
||||
released_cb (GtkGestureMultiPress *gesture,
|
||||
guint n_press,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
GtkWidget *text_view)
|
||||
released_cb (GtkGestureClick *gesture,
|
||||
guint n_press,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
GtkWidget *text_view)
|
||||
{
|
||||
GtkTextIter start, end, iter;
|
||||
GtkTextBuffer *buffer;
|
||||
@@ -247,7 +247,7 @@ do_hypertext (GtkWidget *do_widget)
|
||||
g_signal_connect (controller, "key-pressed", G_CALLBACK (key_pressed), view);
|
||||
gtk_widget_add_controller (view, controller);
|
||||
|
||||
controller = GTK_EVENT_CONTROLLER (gtk_gesture_multi_press_new ());
|
||||
controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ());
|
||||
g_signal_connect (controller, "released",
|
||||
G_CALLBACK (released_cb), view);
|
||||
gtk_widget_add_controller (view, controller);
|
||||
|
@@ -20,7 +20,7 @@ on_bar_response (GtkInfoBar *info_bar,
|
||||
return;
|
||||
}
|
||||
|
||||
window = gtk_widget_get_toplevel (GTK_WIDGET (info_bar));
|
||||
window = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (info_bar)));
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
|
@@ -25,7 +25,7 @@ activate_link (GtkWidget *label,
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *parent;
|
||||
|
||||
parent = gtk_widget_get_toplevel (label);
|
||||
parent = GTK_WIDGET (gtk_widget_get_root (label));
|
||||
dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
|
@@ -171,13 +171,9 @@
|
||||
<object class="GtkMenuButton" id="more-button">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="popup">menu1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label7">
|
||||
<property name="label" translatable="yes">More...</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="relief">none</property>
|
||||
<property name="label" translatable="yes">More...</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -164,7 +164,7 @@ run_example_for_row (GtkWidget *window,
|
||||
cbdata->model = model;
|
||||
cbdata->path = gtk_tree_model_get_path (model, iter);
|
||||
|
||||
if (gtk_widget_is_toplevel (demo))
|
||||
if (GTK_IS_WINDOW (demo))
|
||||
{
|
||||
gtk_window_set_transient_for (GTK_WINDOW (demo), GTK_WINDOW (window));
|
||||
gtk_window_set_modal (GTK_WINDOW (demo), TRUE);
|
||||
@@ -991,7 +991,7 @@ row_activated_cb (GtkWidget *tree_view,
|
||||
GtkWidget *window;
|
||||
GtkTreeModel *model;
|
||||
|
||||
window = gtk_widget_get_toplevel (tree_view);
|
||||
window = GTK_WIDGET (gtk_widget_get_root (tree_view));
|
||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
|
||||
|
@@ -8,6 +8,9 @@ demos = files([
|
||||
'clipboard.c',
|
||||
'colorsel.c',
|
||||
'combobox.c',
|
||||
'constraints.c',
|
||||
'constraints2.c',
|
||||
'constraints3.c',
|
||||
'css_accordion.c',
|
||||
'css_basics.c',
|
||||
'css_blendmodes.c',
|
||||
@@ -70,6 +73,7 @@ demos = files([
|
||||
'textmask.c',
|
||||
'textview.c',
|
||||
'textscroll.c',
|
||||
'themes.c',
|
||||
'theming_style_classes.c',
|
||||
'transparent.c',
|
||||
'tree_store.c',
|
||||
|
@@ -176,7 +176,7 @@ drawing_area_unroot (GtkWidget *widget)
|
||||
DrawingArea *area = (DrawingArea *) widget;
|
||||
GtkWidget *toplevel;
|
||||
|
||||
toplevel = gtk_widget_get_toplevel (widget);
|
||||
toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
|
||||
|
||||
if (area->pad_controller)
|
||||
{
|
||||
@@ -198,7 +198,7 @@ drawing_area_root (GtkWidget *widget)
|
||||
|
||||
GTK_WIDGET_CLASS (drawing_area_parent_class)->root (widget);
|
||||
|
||||
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (area));
|
||||
toplevel = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (area)));
|
||||
|
||||
action_group = g_simple_action_group_new ();
|
||||
area->pad_controller = gtk_pad_controller_new (G_ACTION_GROUP (action_group), NULL);
|
||||
@@ -330,8 +330,6 @@ drawing_area_init (DrawingArea *area)
|
||||
{
|
||||
GtkGesture *gesture;
|
||||
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (area), FALSE);
|
||||
|
||||
gesture = gtk_gesture_stylus_new ();
|
||||
g_signal_connect (gesture, "down",
|
||||
G_CALLBACK (stylus_gesture_down), area);
|
||||
|
@@ -143,7 +143,7 @@ do_popover (GtkWidget *do_widget)
|
||||
popover = create_popover (widget,
|
||||
gtk_label_new ("This popover does not grab input"),
|
||||
GTK_POS_TOP);
|
||||
gtk_popover_set_modal (GTK_POPOVER (popover), FALSE);
|
||||
gtk_popover_set_autohide (GTK_POPOVER (popover), FALSE);
|
||||
g_signal_connect (widget, "toggled",
|
||||
G_CALLBACK (toggle_changed_cb), popover);
|
||||
gtk_container_add (GTK_CONTAINER (box), widget);
|
||||
|
@@ -8,8 +8,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GtkWidget *menu = NULL;
|
||||
static GtkWidget *notebook = NULL;
|
||||
static GSimpleActionGroup *actions = NULL;
|
||||
|
||||
static guint search_progress_id = 0;
|
||||
static guint finish_search_id = 0;
|
||||
@@ -83,69 +83,42 @@ stop_search (GtkButton *button,
|
||||
}
|
||||
|
||||
static void
|
||||
clear_entry (GtkEntry *entry)
|
||||
clear_entry (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), "");
|
||||
GtkEditable *editable = user_data;
|
||||
|
||||
gtk_editable_set_text (editable, "");
|
||||
}
|
||||
|
||||
static void
|
||||
search_by_name (GtkWidget *item,
|
||||
GtkEntry *entry)
|
||||
set_search_by (GSimpleAction *action,
|
||||
GVariant *value,
|
||||
gpointer user_data)
|
||||
{
|
||||
gtk_entry_set_icon_tooltip_text (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
"Search by name\n"
|
||||
"Click here to change the search type");
|
||||
gtk_entry_set_placeholder_text (entry, "name");
|
||||
}
|
||||
GtkEntry *entry = user_data;
|
||||
const char *term;
|
||||
|
||||
static void
|
||||
search_by_description (GtkWidget *item,
|
||||
GtkEntry *entry)
|
||||
{
|
||||
term = g_variant_get_string (value, NULL);
|
||||
|
||||
gtk_entry_set_icon_tooltip_text (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
"Search by description\n"
|
||||
"Click here to change the search type");
|
||||
gtk_entry_set_placeholder_text (entry, "description");
|
||||
}
|
||||
g_simple_action_set_state (action, value);
|
||||
|
||||
static void
|
||||
search_by_file (GtkWidget *item,
|
||||
GtkEntry *entry)
|
||||
{
|
||||
gtk_entry_set_icon_tooltip_text (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
"Search by file name\n"
|
||||
"Click here to change the search type");
|
||||
gtk_entry_set_placeholder_text (entry, "file name");
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
create_search_menu (GtkWidget *entry)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *item;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic ("Search by _name");
|
||||
g_signal_connect (item, "activate",
|
||||
G_CALLBACK (search_by_name), entry);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic ("Search by _description");
|
||||
g_signal_connect (item, "activate",
|
||||
G_CALLBACK (search_by_description), entry);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic ("Search by _file name");
|
||||
g_signal_connect (item, "activate",
|
||||
G_CALLBACK (search_by_file), entry);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
|
||||
return menu;
|
||||
if (g_str_equal (term, "name"))
|
||||
{
|
||||
gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, "Search by name");
|
||||
gtk_entry_set_placeholder_text (entry, "name");
|
||||
}
|
||||
else if (g_str_equal (term, "description"))
|
||||
{
|
||||
gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, "Search by description");
|
||||
gtk_entry_set_placeholder_text (entry, "description");
|
||||
}
|
||||
else if (g_str_equal (term, "filename"))
|
||||
{
|
||||
gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, "Search by file name");
|
||||
gtk_entry_set_placeholder_text (entry, "file name");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -154,7 +127,28 @@ icon_press_cb (GtkEntry *entry,
|
||||
gpointer data)
|
||||
{
|
||||
if (position == GTK_ENTRY_ICON_PRIMARY)
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), NULL);
|
||||
{
|
||||
GAction *action;
|
||||
GVariant *state;
|
||||
GVariant *new_state;
|
||||
const char *s;
|
||||
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (actions), "search-by");
|
||||
state = g_action_get_state (action);
|
||||
s = g_variant_get_string (state, NULL);
|
||||
|
||||
if (g_str_equal (s, "name"))
|
||||
new_state = g_variant_new_string ("description");
|
||||
else if (g_str_equal (s, "description"))
|
||||
new_state = g_variant_new_string ("filename");
|
||||
else if (g_str_equal (s, "filename"))
|
||||
new_state = g_variant_new_string ("name");
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
g_action_change_state (action, new_state);
|
||||
g_variant_unref (state);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -165,7 +159,6 @@ activate_cb (GtkEntry *entry,
|
||||
return;
|
||||
|
||||
start_search (button, entry);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -187,32 +180,62 @@ search_entry_destroyed (GtkWidget *widget)
|
||||
}
|
||||
|
||||
static void
|
||||
entry_populate_popup (GtkEntry *entry,
|
||||
GtkMenu *menu,
|
||||
gpointer user_data)
|
||||
text_changed (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *item;
|
||||
GtkWidget *search_menu;
|
||||
GtkEntry *entry = GTK_ENTRY (object);
|
||||
GActionMap *actions = data;
|
||||
GAction *action;
|
||||
gboolean has_text;
|
||||
|
||||
has_text = gtk_entry_get_text_length (entry) > 0;
|
||||
|
||||
item = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
action = g_action_map_lookup_action (actions, "clear");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), has_text);
|
||||
}
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic ("C_lear");
|
||||
gtk_widget_show (item);
|
||||
g_signal_connect_swapped (item, "activate",
|
||||
G_CALLBACK (clear_entry), entry);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
gtk_widget_set_sensitive (item, has_text);
|
||||
static GMenuModel *
|
||||
create_search_menu_model (void)
|
||||
{
|
||||
GMenu *menu = g_menu_new ();
|
||||
g_menu_append (menu, _("Name"), "search.search-by::name");
|
||||
g_menu_append (menu, _("Description"), "search.search-by::description");
|
||||
g_menu_append (menu, _("File Name"), "search.search-by::filename");
|
||||
|
||||
search_menu = create_search_menu (GTK_WIDGET (entry));
|
||||
item = gtk_menu_item_new_with_label ("Search by");
|
||||
gtk_widget_show (item);
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), search_menu);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
return G_MENU_MODEL (menu);
|
||||
}
|
||||
|
||||
static void
|
||||
entry_add_to_context_menu (GtkEntry *entry)
|
||||
{
|
||||
GMenu *menu;
|
||||
GActionEntry entries[] = {
|
||||
{ "clear", clear_entry, NULL, NULL, NULL },
|
||||
{ "search-by", NULL, "s", "'name'", set_search_by }
|
||||
};
|
||||
GMenuModel *submenu;
|
||||
GMenuItem *item;
|
||||
|
||||
actions = g_simple_action_group_new ();
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS(entries), entry);
|
||||
gtk_widget_insert_action_group (GTK_WIDGET (entry), "search", G_ACTION_GROUP (actions));
|
||||
|
||||
menu = g_menu_new ();
|
||||
item = g_menu_item_new (_("C_lear"), "search.clear");
|
||||
g_menu_item_set_attribute (item, "touch-icon", "s", "edit-clear-symbolic");
|
||||
g_menu_append_item (G_MENU (menu), item);
|
||||
g_object_unref (item);
|
||||
|
||||
submenu = create_search_menu_model ();
|
||||
g_menu_append_submenu (menu, _("Search By"), submenu);
|
||||
g_object_unref (submenu);
|
||||
|
||||
gtk_entry_set_extra_menu (entry, G_MENU_MODEL (menu));
|
||||
|
||||
g_object_unref (menu);
|
||||
|
||||
g_signal_connect (entry, "notify::text", G_CALLBACK (text_changed), actions);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
@@ -271,29 +294,25 @@ do_search_entry (GtkWidget *do_widget)
|
||||
gtk_widget_show (cancel_button);
|
||||
|
||||
/* Set up the search icon */
|
||||
search_by_name (NULL, GTK_ENTRY (entry));
|
||||
GVariant *value = g_variant_ref_sink (g_variant_new_string ("name"));
|
||||
set_search_by (NULL, value, entry);
|
||||
g_variant_unref (value);
|
||||
|
||||
/* Set up the clear icon */
|
||||
g_signal_connect (entry, "icon-press",
|
||||
G_CALLBACK (icon_press_cb), NULL);
|
||||
g_signal_connect (entry, "activate",
|
||||
G_CALLBACK (activate_cb), NULL);
|
||||
gtk_entry_set_icon_activatable (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, TRUE);
|
||||
gtk_entry_set_icon_sensitive (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, TRUE);
|
||||
|
||||
/* Create the menu */
|
||||
menu = create_search_menu (entry);
|
||||
gtk_menu_attach_to_widget (GTK_MENU (menu), entry, NULL);
|
||||
g_signal_connect (entry, "icon-press", G_CALLBACK (icon_press_cb), NULL);
|
||||
g_signal_connect (entry, "activate", G_CALLBACK (activate_cb), NULL);
|
||||
|
||||
/* add accessible alternatives for icon functionality */
|
||||
g_object_set (entry, "populate-all", TRUE, NULL);
|
||||
g_signal_connect (entry, "populate-popup",
|
||||
G_CALLBACK (entry_populate_popup), NULL);
|
||||
entry_add_to_context_menu (GTK_ENTRY (entry));
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (menu);
|
||||
g_clear_object (&actions);
|
||||
gtk_widget_destroy (window);
|
||||
}
|
||||
|
||||
|
@@ -218,11 +218,11 @@ puzzle_key_pressed (GtkEventControllerKey *controller,
|
||||
}
|
||||
|
||||
static void
|
||||
puzzle_button_pressed (GtkGestureMultiPress *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *grid)
|
||||
puzzle_button_pressed (GtkGestureClick *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *grid)
|
||||
{
|
||||
GtkWidget *child;
|
||||
int l, t, i;
|
||||
@@ -282,6 +282,7 @@ start_puzzle (GdkPaintable *puzzle)
|
||||
GtkWidget *picture, *grid;
|
||||
GtkEventController *controller;
|
||||
guint x, y;
|
||||
float aspect_ratio;
|
||||
|
||||
/* Remove the old grid (if there is one) */
|
||||
grid = gtk_bin_get_child (GTK_BIN (frame));
|
||||
@@ -292,7 +293,10 @@ start_puzzle (GdkPaintable *puzzle)
|
||||
grid = gtk_grid_new ();
|
||||
gtk_widget_set_can_focus (grid, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (frame), grid);
|
||||
gtk_aspect_frame_set (GTK_ASPECT_FRAME (frame), 0.5, 0.5, (float) gdk_paintable_get_intrinsic_aspect_ratio (puzzle), FALSE);
|
||||
aspect_ratio = gdk_paintable_get_intrinsic_aspect_ratio (puzzle);
|
||||
if (aspect_ratio == 0.0)
|
||||
aspect_ratio = 1.0;
|
||||
gtk_aspect_frame_set (GTK_ASPECT_FRAME (frame), 0.5, 0.5, aspect_ratio, FALSE);
|
||||
|
||||
/* Add a key event controller so people can use the arrow
|
||||
* keys to move the puzzle */
|
||||
@@ -302,7 +306,7 @@ start_puzzle (GdkPaintable *puzzle)
|
||||
grid);
|
||||
gtk_widget_add_controller (GTK_WIDGET (grid), controller);
|
||||
|
||||
controller = GTK_EVENT_CONTROLLER (gtk_gesture_multi_press_new ());
|
||||
controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ());
|
||||
g_signal_connect (controller, "pressed",
|
||||
G_CALLBACK (puzzle_button_pressed),
|
||||
grid);
|
||||
@@ -445,12 +449,11 @@ do_sliding_puzzle (GtkWidget *do_widget)
|
||||
g_signal_connect (apply, "clicked", G_CALLBACK (reconfigure), NULL);
|
||||
|
||||
popover = gtk_popover_new (NULL);
|
||||
gtk_popover_set_modal (GTK_POPOVER (popover), TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (popover), tweaks);
|
||||
|
||||
tweak = gtk_menu_button_new ();
|
||||
gtk_menu_button_set_popover (GTK_MENU_BUTTON (tweak), popover);
|
||||
gtk_button_set_icon_name (GTK_BUTTON (tweak), "emblem-system-symbolic");
|
||||
gtk_menu_button_set_icon_name (GTK_MENU_BUTTON (tweak), "emblem-system-symbolic");
|
||||
|
||||
restart = gtk_button_new_from_icon_name ("view-refresh-symbolic");
|
||||
g_signal_connect (restart, "clicked", G_CALLBACK (reshuffle), NULL);
|
||||
|
203
demos/gtk-demo/themes.c
Normal file
203
demos/gtk-demo/themes.c
Normal file
@@ -0,0 +1,203 @@
|
||||
/* Benchmark/Themes
|
||||
*
|
||||
* This demo switches themes like a maniac, like some of you.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static guint tick_cb;
|
||||
|
||||
static gint64
|
||||
guess_refresh_interval (GdkFrameClock *frame_clock)
|
||||
{
|
||||
gint64 interval;
|
||||
gint64 i;
|
||||
|
||||
interval = G_MAXINT64;
|
||||
|
||||
for (i = gdk_frame_clock_get_history_start (frame_clock);
|
||||
i < gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
i++)
|
||||
{
|
||||
GdkFrameTimings *t, *before;
|
||||
gint64 ts, before_ts;
|
||||
|
||||
t = gdk_frame_clock_get_timings (frame_clock, i);
|
||||
before = gdk_frame_clock_get_timings (frame_clock, i - 1);
|
||||
if (t == NULL || before == NULL)
|
||||
continue;
|
||||
|
||||
ts = gdk_frame_timings_get_frame_time (t);
|
||||
before_ts = gdk_frame_timings_get_frame_time (before);
|
||||
if (ts == 0 || before_ts == 0)
|
||||
continue;
|
||||
|
||||
interval = MIN (interval, ts - before_ts);
|
||||
}
|
||||
|
||||
if (interval == G_MAXINT64)
|
||||
return 0;
|
||||
|
||||
return interval;
|
||||
}
|
||||
|
||||
static double
|
||||
frame_clock_get_fps (GdkFrameClock *frame_clock)
|
||||
{
|
||||
GdkFrameTimings *start, *end;
|
||||
gint64 start_counter, end_counter;
|
||||
gint64 start_timestamp, end_timestamp;
|
||||
gint64 interval;
|
||||
|
||||
start_counter = gdk_frame_clock_get_history_start (frame_clock);
|
||||
end_counter = gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
start = gdk_frame_clock_get_timings (frame_clock, start_counter);
|
||||
for (end = gdk_frame_clock_get_timings (frame_clock, end_counter);
|
||||
end_counter > start_counter && end != NULL && !gdk_frame_timings_get_complete (end);
|
||||
end = gdk_frame_clock_get_timings (frame_clock, end_counter))
|
||||
end_counter--;
|
||||
if (end_counter - start_counter < 4)
|
||||
return 0.0;
|
||||
|
||||
start_timestamp = gdk_frame_timings_get_presentation_time (start);
|
||||
end_timestamp = gdk_frame_timings_get_presentation_time (end);
|
||||
if (start_timestamp == 0 || end_timestamp == 0)
|
||||
{
|
||||
start_timestamp = gdk_frame_timings_get_frame_time (start);
|
||||
end_timestamp = gdk_frame_timings_get_frame_time (end);
|
||||
}
|
||||
interval = gdk_frame_timings_get_refresh_interval (end);
|
||||
if (interval == 0)
|
||||
{
|
||||
interval = guess_refresh_interval (frame_clock);
|
||||
if (interval == 0)
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
return ((double) end_counter - start_counter) * G_USEC_PER_SEC / (end_timestamp - start_timestamp);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
gboolean dark;
|
||||
} Theme;
|
||||
|
||||
static Theme themes[] = {
|
||||
{ "Adwaita", FALSE },
|
||||
{ "Adwaita", TRUE },
|
||||
{ "HighContrast", FALSE },
|
||||
{ "HighContrastInverse", FALSE }
|
||||
};
|
||||
|
||||
static int theme;
|
||||
|
||||
static gboolean
|
||||
change_theme (GtkWidget *widget,
|
||||
GdkFrameClock *frame_clock,
|
||||
gpointer data)
|
||||
{
|
||||
GtkBuilder *builder = data;
|
||||
GtkWidget *header;
|
||||
GtkWidget *label;
|
||||
Theme next = themes[theme++ % G_N_ELEMENTS (themes)];
|
||||
char *name;
|
||||
|
||||
g_object_set (gtk_settings_get_default (),
|
||||
"gtk-theme-name", next.name,
|
||||
"gtk-application-prefer-dark-theme", next.dark,
|
||||
NULL);
|
||||
|
||||
header = GTK_WIDGET (gtk_builder_get_object (builder, "header"));
|
||||
name = g_strconcat (next.name, next.dark ? " (dark)" : NULL, NULL);
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (header), name);
|
||||
g_free (name);
|
||||
|
||||
label = GTK_WIDGET (gtk_builder_get_object (builder, "fps"));
|
||||
if (frame_clock)
|
||||
{
|
||||
char *fps;
|
||||
|
||||
fps = g_strdup_printf ("%.2f fps", frame_clock_get_fps (frame_clock));
|
||||
gtk_label_set_label (GTK_LABEL (label), fps);
|
||||
g_free (fps);
|
||||
}
|
||||
else
|
||||
gtk_label_set_label (GTK_LABEL (label), "");
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clicked (GtkGestureClick *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *window;
|
||||
const GdkEvent *event;
|
||||
GdkModifierType state;
|
||||
|
||||
window = gtk_widget_get_ancestor (gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)), GTK_TYPE_WINDOW);
|
||||
|
||||
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), NULL);
|
||||
gdk_event_get_state (event, &state);
|
||||
|
||||
if (state & GDK_CONTROL_MASK)
|
||||
{
|
||||
if (tick_cb)
|
||||
{
|
||||
gtk_widget_remove_tick_callback (window, tick_cb);
|
||||
tick_cb = 0;
|
||||
}
|
||||
|
||||
change_theme (window, NULL, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tick_cb)
|
||||
{
|
||||
gtk_widget_remove_tick_callback (window, tick_cb);
|
||||
tick_cb = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tick_cb = gtk_widget_add_tick_callback (window, change_theme, data, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_themes (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *header;
|
||||
GtkGesture *gesture;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/themes/themes.ui");
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
header = GTK_WIDGET (gtk_builder_get_object (builder, "header"));
|
||||
gesture = gtk_gesture_click_new ();
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (clicked), builder);
|
||||
gtk_widget_add_controller (header, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
gtk_widget_realize (window);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
241
demos/gtk-demo/themes.ui
Normal file
241
demos/gtk-demo/themes.ui
Normal file
@@ -0,0 +1,241 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="resizable">0</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<property name="show-title-buttons">1</property>
|
||||
<child type="end">
|
||||
<object class="GtkLabel" id="fps">
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="margin">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="show-arrow">0</property>
|
||||
<style>
|
||||
<class name="primary-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-chars">10</property>
|
||||
<property name="invisible-char">•</property>
|
||||
<property name="placeholder-text" translatable="yes">Search...</property>
|
||||
<property name="secondary-icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip_text">Switch it</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Hi, I am a button</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">And I'm another button</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">This is a button party!</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<style>
|
||||
<class name="inline-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">go-up-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Plain</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Destructive</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Suggested</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
@@ -33,7 +33,7 @@ open_clicked_cb (GtkWidget *button,
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_file_chooser_dialog_new ("Select a video",
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (button)),
|
||||
GTK_WINDOW (gtk_widget_get_root (button)),
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
"_Cancel", GTK_RESPONSE_CANCEL,
|
||||
"_Open", GTK_RESPONSE_ACCEPT,
|
||||
@@ -48,7 +48,7 @@ static void
|
||||
fullscreen_clicked_cb (GtkWidget *button,
|
||||
gpointer unused)
|
||||
{
|
||||
GtkWidget *window = gtk_widget_get_toplevel (button);
|
||||
GtkWidget *window = GTK_WIDGET (gtk_widget_get_root (button));
|
||||
|
||||
gtk_window_fullscreen (GTK_WINDOW (window));
|
||||
}
|
||||
|
1315
demos/gtk-demo/words
Normal file
1315
demos/gtk-demo/words
Normal file
File diff suppressed because it is too large
Load Diff
1316
demos/gtk-demo/words-full
Normal file
1316
demos/gtk-demo/words-full
Normal file
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,7 @@ executable('gtk4-node-editor',
|
||||
node_editor_sources, node_editor_resources,
|
||||
dependencies: libgtk_dep,
|
||||
include_directories: confinc,
|
||||
c_args: ['-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())],
|
||||
gui_app: true,
|
||||
link_args: extra_demo_ldflags,
|
||||
install: false)
|
||||
|
@@ -25,6 +25,10 @@
|
||||
|
||||
#include "gsk/gskrendernodeparserprivate.h"
|
||||
|
||||
#ifndef NODE_EDITOR_SOURCE_DIR
|
||||
#define NODE_EDITOR_SOURCE_DIR "." /* Fallback */
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gsize start_chars;
|
||||
@@ -41,6 +45,12 @@ struct _NodeEditorWindow
|
||||
GtkTextBuffer *text_buffer;
|
||||
GtkTextTagTable *tag_table;
|
||||
|
||||
GtkWidget *testcase_popover;
|
||||
GtkWidget *testcase_error_label;
|
||||
GtkWidget *testcase_cairo_checkbutton;
|
||||
GtkWidget *testcase_name_entry;
|
||||
GtkWidget *testcase_save_button;
|
||||
|
||||
GtkWidget *renderer_listbox;
|
||||
GListStore *renderers;
|
||||
GdkPaintable *paintable;
|
||||
@@ -68,11 +78,20 @@ get_current_text (GtkTextBuffer *buffer)
|
||||
|
||||
gtk_text_buffer_get_start_iter (buffer, &start);
|
||||
gtk_text_buffer_get_end_iter (buffer, &end);
|
||||
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
|
||||
|
||||
return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
text_buffer_remove_all_tags (GtkTextBuffer *buffer)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
|
||||
gtk_text_buffer_get_start_iter (buffer, &start);
|
||||
gtk_text_buffer_get_end_iter (buffer, &end);
|
||||
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
|
||||
}
|
||||
|
||||
static void
|
||||
deserialize_error_func (const GtkCssSection *section,
|
||||
const GError *error,
|
||||
@@ -146,6 +165,7 @@ text_changed (GtkTextBuffer *buffer,
|
||||
|
||||
g_array_remove_range (self->errors, 0, self->errors->len);
|
||||
text = get_current_text (self->text_buffer);
|
||||
text_buffer_remove_all_tags (self->text_buffer);
|
||||
bytes = g_bytes_new_take (text, strlen (text));
|
||||
|
||||
/* If this is too slow, go fix the parser performance */
|
||||
@@ -255,6 +275,7 @@ text_view_query_tooltip_cb (GtkWidget *widget,
|
||||
{
|
||||
GtkTextIter iter;
|
||||
guint i;
|
||||
GString *text;
|
||||
|
||||
if (keyboard_tip)
|
||||
{
|
||||
@@ -272,6 +293,8 @@ text_view_query_tooltip_cb (GtkWidget *widget,
|
||||
gtk_text_view_get_iter_at_position (GTK_TEXT_VIEW (self->text_view), &iter, &trailing, bx, by);
|
||||
}
|
||||
|
||||
text = g_string_new ("");
|
||||
|
||||
for (i = 0; i < self->errors->len; i ++)
|
||||
{
|
||||
const TextViewError *e = &g_array_index (self->errors, TextViewError, i);
|
||||
@@ -282,12 +305,23 @@ text_view_query_tooltip_cb (GtkWidget *widget,
|
||||
|
||||
if (gtk_text_iter_in_range (&iter, &start_iter, &end_iter))
|
||||
{
|
||||
gtk_tooltip_set_text (tooltip, e->message);
|
||||
return TRUE;
|
||||
if (text->len > 0)
|
||||
g_string_append (text, "\n");
|
||||
g_string_append (text, e->message);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
if (text->len > 0)
|
||||
{
|
||||
gtk_tooltip_set_text (tooltip, text->str);
|
||||
g_string_free (text, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_free (text, TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -382,7 +416,7 @@ save_response_cb (GtkWidget *dialog,
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))),
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (self))),
|
||||
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
@@ -406,7 +440,7 @@ save_cb (GtkWidget *button,
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_file_chooser_dialog_new ("Save node",
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))),
|
||||
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
"_Cancel", GTK_RESPONSE_CANCEL,
|
||||
"_Save", GTK_RESPONSE_ACCEPT,
|
||||
@@ -440,14 +474,46 @@ create_texture (NodeEditorWindow *self)
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
/* ahem */
|
||||
renderer = GTK_ROOT_GET_IFACE (gtk_widget_get_root (GTK_WIDGET (self)))->get_renderer (gtk_widget_get_root (GTK_WIDGET (self)));
|
||||
renderer = gtk_native_get_renderer (gtk_widget_get_native (GTK_WIDGET (self)));
|
||||
texture = gsk_renderer_render_texture (renderer, node, NULL);
|
||||
gsk_render_node_unref (node);
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
static GdkTexture *
|
||||
create_cairo_texture (NodeEditorWindow *self)
|
||||
{
|
||||
GdkPaintable *paintable;
|
||||
GtkSnapshot *snapshot;
|
||||
GskRenderer *renderer;
|
||||
GskRenderNode *node;
|
||||
GdkTexture *texture;
|
||||
GdkSurface *surface;
|
||||
|
||||
paintable = gtk_picture_get_paintable (GTK_PICTURE (self->picture));
|
||||
if (paintable == NULL ||
|
||||
gdk_paintable_get_intrinsic_width (paintable) <= 0 ||
|
||||
gdk_paintable_get_intrinsic_height (paintable) <= 0)
|
||||
return NULL;
|
||||
snapshot = gtk_snapshot_new ();
|
||||
gdk_paintable_snapshot (paintable, snapshot, gdk_paintable_get_intrinsic_width (paintable), gdk_paintable_get_intrinsic_height (paintable));
|
||||
node = gtk_snapshot_free_to_node (snapshot);
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
surface = gtk_native_get_surface (gtk_widget_get_native (GTK_WIDGET (self)));
|
||||
renderer = gsk_cairo_renderer_new ();
|
||||
gsk_renderer_realize (renderer, surface, NULL);
|
||||
|
||||
texture = gsk_renderer_render_texture (renderer, node, NULL);
|
||||
gsk_render_node_unref (node);
|
||||
gsk_renderer_unrealize (renderer);
|
||||
g_object_unref (renderer);
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
static void
|
||||
export_image_response_cb (GtkWidget *dialog,
|
||||
gint response,
|
||||
@@ -491,7 +557,7 @@ export_image_cb (GtkWidget *button,
|
||||
return;
|
||||
|
||||
dialog = gtk_file_chooser_dialog_new ("",
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))),
|
||||
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
"_Cancel", GTK_RESPONSE_CANCEL,
|
||||
"_Save", GTK_RESPONSE_ACCEPT,
|
||||
@@ -504,6 +570,72 @@ export_image_cb (GtkWidget *button,
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
testcase_name_entry_changed_cb (GtkWidget *button,
|
||||
GParamSpec *pspec,
|
||||
NodeEditorWindow *self)
|
||||
|
||||
{
|
||||
const char *text = gtk_editable_get_text (GTK_EDITABLE (self->testcase_name_entry));
|
||||
|
||||
if (strlen (text) > 0)
|
||||
gtk_widget_set_sensitive (self->testcase_save_button, TRUE);
|
||||
else
|
||||
gtk_widget_set_sensitive (self->testcase_save_button, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
testcase_save_clicked_cb (GtkWidget *button,
|
||||
NodeEditorWindow *self)
|
||||
{
|
||||
const char *testcase_name = gtk_editable_get_text (GTK_EDITABLE (self->testcase_name_entry));
|
||||
char *source_dir = g_canonicalize_filename (NODE_EDITOR_SOURCE_DIR, NULL);
|
||||
char *node_file_name;
|
||||
char *node_file;
|
||||
char *png_file_name;
|
||||
char *png_file;
|
||||
char *text = NULL;
|
||||
GdkTexture *texture;
|
||||
GError *error = NULL;
|
||||
|
||||
node_file_name = g_strconcat (testcase_name, ".node", NULL);
|
||||
node_file = g_build_filename (source_dir, node_file_name, NULL);
|
||||
g_free (node_file_name);
|
||||
|
||||
png_file_name = g_strconcat (testcase_name, ".png", NULL);
|
||||
png_file = g_build_filename (source_dir, png_file_name, NULL);
|
||||
g_free (png_file_name);
|
||||
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->testcase_cairo_checkbutton)))
|
||||
texture = create_cairo_texture (self);
|
||||
else
|
||||
texture = create_texture (self);
|
||||
|
||||
if (!gdk_texture_save_to_png (texture, png_file))
|
||||
{
|
||||
gtk_label_set_label (GTK_LABEL (self->testcase_error_label),
|
||||
"Could not save texture file");
|
||||
goto out;
|
||||
}
|
||||
|
||||
text = get_current_text (self->text_buffer);
|
||||
if (!g_file_set_contents (node_file, text, -1, &error))
|
||||
{
|
||||
gtk_label_set_label (GTK_LABEL (self->testcase_error_label), error->message);
|
||||
/* TODO: Remove texture file again? */
|
||||
goto out;
|
||||
}
|
||||
|
||||
gtk_editable_set_text (GTK_EDITABLE (self->testcase_name_entry), "");
|
||||
gtk_popover_popdown (GTK_POPOVER (self->testcase_popover));
|
||||
|
||||
out:
|
||||
g_free (text);
|
||||
g_free (png_file);
|
||||
g_free (node_file);
|
||||
g_free (source_dir);
|
||||
}
|
||||
|
||||
static void
|
||||
node_editor_window_finalize (GObject *object)
|
||||
{
|
||||
@@ -524,7 +656,7 @@ node_editor_window_add_renderer (NodeEditorWindow *self,
|
||||
GdkSurface *surface;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
surface = gtk_widget_get_surface (GTK_WIDGET (self));
|
||||
surface = gtk_native_get_surface (GTK_NATIVE (self));
|
||||
g_assert (surface != NULL);
|
||||
|
||||
if (renderer != NULL && !gsk_renderer_realize (renderer, surface, NULL))
|
||||
@@ -598,11 +730,18 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, text_view);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, picture);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, renderer_listbox);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_popover);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_error_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_cairo_checkbutton);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_name_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_save_button);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, text_view_query_tooltip_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, open_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, save_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, export_image_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, testcase_save_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, testcase_name_entry_changed_cb);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@@ -620,6 +759,9 @@ node_editor_window_create_renderer_widget (gpointer item,
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
|
||||
picture = gtk_picture_new_for_paintable (paintable);
|
||||
/* don't ever scale up, we want to be as accurate as possible */
|
||||
gtk_widget_set_halign (picture, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (picture, GTK_ALIGN_CENTER);
|
||||
gtk_container_add (GTK_CONTAINER (box), picture);
|
||||
|
||||
row = gtk_list_box_row_new ();
|
||||
|
@@ -1,5 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkPopover" id="testcase_popover">
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="column-spacing">12</property>
|
||||
<property name="row-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Testcase Name:</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="testcase_name_entry">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="activates-default">1</property>
|
||||
<signal name="notify::text" handler="testcase_name_entry_changed_cb" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="testcase_cairo_checkbutton">
|
||||
<property name="label">Render using Cairo renderer</property>
|
||||
<layout>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="column-span">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="wrap">1</property>
|
||||
<property name="label"><i>There will be a .node and a .png file placed in the testsuite/gsk/compare directory. <b>You need to add it to the meson.build yourself.</b></i></property>
|
||||
<property name="use-markup">1</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<layout>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="column-span">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="testcase_error_label">
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<layout>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="column-span">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkButton" id="testcase_save_button">
|
||||
<property name="label">Save</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<signal name="clicked" handler="testcase_save_clicked_cb" />
|
||||
<style>
|
||||
<class name="suggested-action" />
|
||||
</style>
|
||||
<layout>
|
||||
<property name="top-attach">4</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="column-span">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
<template class="NodeEditorWindow" parent="GtkApplicationWindow">
|
||||
<style>
|
||||
<class name="devel"/>
|
||||
@@ -32,6 +108,17 @@
|
||||
<signal name="clicked" handler="export_image_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="label">Save Testcase</property>
|
||||
<property name="popover">testcase_popover</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="title">
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">GTK Node Editor</property>
|
||||
|
@@ -64,7 +64,7 @@ get_idle (gpointer data)
|
||||
GtkApplication *app = gtk_window_get_application (GTK_WINDOW (window));
|
||||
|
||||
gtk_widget_set_sensitive (window, TRUE);
|
||||
gdk_surface_set_cursor (gtk_widget_get_surface (window), NULL);
|
||||
gdk_surface_set_cursor (gtk_native_get_surface (GTK_NATIVE (window)), NULL);
|
||||
g_application_unmark_busy (G_APPLICATION (app));
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
@@ -81,7 +81,7 @@ get_busy (GSimpleAction *action,
|
||||
|
||||
g_application_mark_busy (G_APPLICATION (app));
|
||||
cursor = gdk_cursor_new_from_name ("wait", NULL);
|
||||
gdk_surface_set_cursor (gtk_widget_get_surface (window), cursor);
|
||||
gdk_surface_set_cursor (gtk_native_get_surface (GTK_NATIVE (window)), cursor);
|
||||
g_object_unref (cursor);
|
||||
g_timeout_add (5000, get_idle, window);
|
||||
|
||||
@@ -118,6 +118,8 @@ activate_delete (GSimpleAction *action,
|
||||
GtkWidget *window = user_data;
|
||||
GtkWidget *infobar;
|
||||
|
||||
g_print ("Activate action delete\n");
|
||||
|
||||
if (!on_page (2))
|
||||
return;
|
||||
|
||||
@@ -158,7 +160,7 @@ activate_open (GSimpleAction *action,
|
||||
return;
|
||||
|
||||
button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "open_menubutton"));
|
||||
gtk_button_clicked (GTK_BUTTON (button));
|
||||
g_signal_emit_by_name (button, "clicked");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -173,7 +175,7 @@ activate_record (GSimpleAction *action,
|
||||
return;
|
||||
|
||||
button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "record_button"));
|
||||
gtk_button_clicked (GTK_BUTTON (button));
|
||||
g_signal_emit_by_name (button, "clicked");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -188,7 +190,7 @@ activate_lock (GSimpleAction *action,
|
||||
return;
|
||||
|
||||
button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "lockbutton"));
|
||||
gtk_button_clicked (GTK_BUTTON (button));
|
||||
g_signal_emit_by_name (button, "clicked");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -523,22 +525,6 @@ on_range_to_changed (GtkSpinButton *to)
|
||||
gtk_spin_button_set_value (from, v2);
|
||||
}
|
||||
|
||||
static void
|
||||
update_header (GtkListBoxRow *row,
|
||||
GtkListBoxRow *before,
|
||||
gpointer data)
|
||||
{
|
||||
if (before != NULL &&
|
||||
gtk_list_box_row_get_header (row) == NULL)
|
||||
{
|
||||
GtkWidget *separator;
|
||||
|
||||
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_widget_show (separator);
|
||||
gtk_list_box_row_set_header (row, separator);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
info_bar_response (GtkWidget *infobar, gint response_id)
|
||||
{
|
||||
@@ -1284,11 +1270,11 @@ textbuffer_notify_selection (GObject *object, GParamSpec *pspec, GtkWidget *butt
|
||||
}
|
||||
|
||||
static gboolean
|
||||
osd_frame_pressed (GtkGestureMultiPress *gesture,
|
||||
int press,
|
||||
double x,
|
||||
double y,
|
||||
gpointer data)
|
||||
osd_frame_pressed (GtkGestureClick *gesture,
|
||||
int press,
|
||||
double x,
|
||||
double y,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *frame = data;
|
||||
GtkWidget *osd;
|
||||
@@ -1317,96 +1303,113 @@ page_combo_separator_func (GtkTreeModel *model,
|
||||
}
|
||||
|
||||
static void
|
||||
activate_item (GtkWidget *item, GtkTextView *tv)
|
||||
toggle_format (GSimpleAction *action,
|
||||
GVariant *value,
|
||||
gpointer user_data)
|
||||
{
|
||||
const gchar *tag;
|
||||
GtkTextView *text_view = user_data;
|
||||
GtkTextIter start, end;
|
||||
gboolean active;
|
||||
const char *name;
|
||||
|
||||
g_object_get (item, "active", &active, NULL);
|
||||
tag = (const gchar *)g_object_get_data (G_OBJECT (item), "tag");
|
||||
gtk_text_buffer_get_selection_bounds (gtk_text_view_get_buffer (tv), &start, &end);
|
||||
if (active)
|
||||
gtk_text_buffer_apply_tag_by_name (gtk_text_view_get_buffer (tv), tag, &start, &end);
|
||||
name = g_action_get_name (G_ACTION (action));
|
||||
|
||||
g_simple_action_set_state (action, value);
|
||||
|
||||
gtk_text_buffer_get_selection_bounds (gtk_text_view_get_buffer (text_view), &start, &end);
|
||||
if (g_variant_get_boolean (value))
|
||||
gtk_text_buffer_apply_tag_by_name (gtk_text_view_get_buffer (text_view), name, &start, &end);
|
||||
else
|
||||
gtk_text_buffer_remove_tag_by_name (gtk_text_view_get_buffer (tv), tag, &start, &end);
|
||||
gtk_text_buffer_remove_tag_by_name (gtk_text_view_get_buffer (text_view), name, &start, &end);
|
||||
}
|
||||
|
||||
static void
|
||||
add_item (GtkTextView *tv,
|
||||
GtkWidget *popup,
|
||||
const gchar *text,
|
||||
const gchar *tag,
|
||||
gboolean set)
|
||||
{
|
||||
GtkWidget *item, *label;
|
||||
|
||||
if (GTK_IS_MENU (popup))
|
||||
{
|
||||
item = gtk_check_menu_item_new ();
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), set);
|
||||
g_signal_connect (item, "toggled", G_CALLBACK (activate_item), tv);
|
||||
}
|
||||
else
|
||||
{
|
||||
item = gtk_check_button_new ();
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), set);
|
||||
gtk_widget_set_focus_on_click (item, FALSE);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (activate_item), tv);
|
||||
}
|
||||
|
||||
label = gtk_label_new ("");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
gtk_label_set_markup (GTK_LABEL (label), text);
|
||||
gtk_widget_show (label);
|
||||
gtk_container_add (GTK_CONTAINER (item), label);
|
||||
g_object_set_data (G_OBJECT (item), "tag", (gpointer)tag);
|
||||
gtk_widget_show (item);
|
||||
gtk_container_add (GTK_CONTAINER (popup), item);
|
||||
}
|
||||
static GActionGroup *actions;
|
||||
|
||||
static void
|
||||
populate_popup (GtkTextView *tv,
|
||||
GtkWidget *popup)
|
||||
text_changed (GtkTextBuffer *buffer)
|
||||
{
|
||||
gboolean has_selection;
|
||||
GtkWidget *item;
|
||||
GtkTextIter start, end, iter;
|
||||
GAction *bold;
|
||||
GAction *italic;
|
||||
GAction *underline;
|
||||
GtkTextIter iter;
|
||||
GtkTextTagTable *tags;
|
||||
GtkTextTag *bold, *italic, *underline;
|
||||
GtkTextTag *bold_tag, *italic_tag, *underline_tag;
|
||||
gboolean all_bold, all_italic, all_underline;
|
||||
GtkTextIter start, end;
|
||||
gboolean has_selection;
|
||||
|
||||
has_selection = gtk_text_buffer_get_selection_bounds (gtk_text_view_get_buffer (tv), &start, &end);
|
||||
bold = g_action_map_lookup_action (G_ACTION_MAP (actions), "bold");
|
||||
italic = g_action_map_lookup_action (G_ACTION_MAP (actions), "italic");
|
||||
underline = g_action_map_lookup_action (G_ACTION_MAP (actions), "underline");
|
||||
|
||||
has_selection = gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (bold), has_selection);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (italic), has_selection);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (underline), has_selection);
|
||||
if (!has_selection)
|
||||
return;
|
||||
|
||||
tags = gtk_text_buffer_get_tag_table (gtk_text_view_get_buffer (tv));
|
||||
bold = gtk_text_tag_table_lookup (tags, "bold");
|
||||
italic = gtk_text_tag_table_lookup (tags, "italic");
|
||||
underline = gtk_text_tag_table_lookup (tags, "underline");
|
||||
tags = gtk_text_buffer_get_tag_table (buffer);
|
||||
bold_tag = gtk_text_tag_table_lookup (tags, "bold");
|
||||
italic_tag = gtk_text_tag_table_lookup (tags, "italic");
|
||||
underline_tag = gtk_text_tag_table_lookup (tags, "underline");
|
||||
all_bold = TRUE;
|
||||
all_italic = TRUE;
|
||||
all_underline = TRUE;
|
||||
gtk_text_iter_assign (&iter, &start);
|
||||
while (!gtk_text_iter_equal (&iter, &end))
|
||||
{
|
||||
all_bold &= gtk_text_iter_has_tag (&iter, bold);
|
||||
all_italic &= gtk_text_iter_has_tag (&iter, italic);
|
||||
all_underline &= gtk_text_iter_has_tag (&iter, underline);
|
||||
all_bold &= gtk_text_iter_has_tag (&iter, bold_tag);
|
||||
all_italic &= gtk_text_iter_has_tag (&iter, italic_tag);
|
||||
all_underline &= gtk_text_iter_has_tag (&iter, underline_tag);
|
||||
gtk_text_iter_forward_char (&iter);
|
||||
}
|
||||
|
||||
if (GTK_IS_MENU (popup))
|
||||
{
|
||||
item = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (item);
|
||||
gtk_container_add (GTK_CONTAINER (popup), item);
|
||||
}
|
||||
g_simple_action_set_state (G_SIMPLE_ACTION (bold), g_variant_new_boolean (all_bold));
|
||||
g_simple_action_set_state (G_SIMPLE_ACTION (italic), g_variant_new_boolean (all_italic));
|
||||
g_simple_action_set_state (G_SIMPLE_ACTION (underline), g_variant_new_boolean (all_underline));
|
||||
}
|
||||
|
||||
add_item (tv, popup, "<b>Bold</b>", "bold", all_bold);
|
||||
add_item (tv, popup, "<i>Italics</i>", "italic", all_italic);
|
||||
add_item (tv, popup, "<u>Underline</u>", "underline", all_underline);
|
||||
static void
|
||||
text_view_add_to_context_menu (GtkTextView *text_view)
|
||||
{
|
||||
GMenu *menu;
|
||||
GActionEntry entries[] = {
|
||||
{ "bold", NULL, NULL, "false", toggle_format },
|
||||
{ "italic", NULL, NULL, "false", toggle_format },
|
||||
{ "underline", NULL, NULL, "false", toggle_format },
|
||||
};
|
||||
GMenuItem *item;
|
||||
GAction *action;
|
||||
|
||||
actions = G_ACTION_GROUP (g_simple_action_group_new ());
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), text_view);
|
||||
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (actions), "bold");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (actions), "italic");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (actions), "underline");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
|
||||
gtk_widget_insert_action_group (GTK_WIDGET (text_view), "format", G_ACTION_GROUP (actions));
|
||||
|
||||
menu = g_menu_new ();
|
||||
item = g_menu_item_new (_("Bold"), "format.bold");
|
||||
g_menu_item_set_attribute (item, "touch-icon", "s", "format-text-bold-symbolic");
|
||||
g_menu_append_item (G_MENU (menu), item);
|
||||
g_object_unref (item);
|
||||
item = g_menu_item_new (_("Italics"), "format.italic");
|
||||
g_menu_item_set_attribute (item, "touch-icon", "s", "format-text-italic-symbolic");
|
||||
g_menu_append_item (G_MENU (menu), item);
|
||||
g_object_unref (item);
|
||||
item = g_menu_item_new (_("Underline"), "format.underline");
|
||||
g_menu_item_set_attribute (item, "touch-icon", "s", "format-text-underline-symbolic");
|
||||
g_menu_append_item (G_MENU (menu), item);
|
||||
|
||||
gtk_text_view_set_extra_menu (text_view, G_MENU_MODEL (menu));
|
||||
|
||||
g_signal_connect (gtk_text_view_get_buffer (text_view), "changed", G_CALLBACK (text_changed), NULL);
|
||||
g_signal_connect (gtk_text_view_get_buffer (text_view), "mark-set", G_CALLBACK (text_changed), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1620,6 +1623,37 @@ adjustment3_value_changed (GtkAdjustment *adj, GtkProgressBar *pbar)
|
||||
gtk_progress_bar_set_fraction (pbar, fraction);
|
||||
}
|
||||
|
||||
static void
|
||||
clicked_cb (GtkGesture *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
GtkPopover *popover)
|
||||
{
|
||||
GdkRectangle rect;
|
||||
|
||||
rect.x = x;
|
||||
rect.y = y;
|
||||
rect.width = 1;
|
||||
rect.height = 1;
|
||||
gtk_popover_set_pointing_to (popover, &rect);
|
||||
gtk_popover_popup (popover);
|
||||
}
|
||||
|
||||
static void
|
||||
set_up_context_popover (GtkWidget *widget,
|
||||
GMenuModel *model)
|
||||
{
|
||||
GtkWidget *popover = gtk_popover_menu_new_from_model (widget, model);
|
||||
GtkGesture *gesture;
|
||||
|
||||
g_object_set (popover, "has-arrow", FALSE, NULL);
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (clicked_cb), popover);
|
||||
gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture));
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GApplication *app)
|
||||
{
|
||||
@@ -1633,6 +1667,7 @@ activate (GApplication *app)
|
||||
GtkWidget *dialog;
|
||||
GtkAdjustment *adj;
|
||||
GtkCssProvider *provider;
|
||||
GMenuModel *model;
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "dark", NULL, NULL, "false", change_theme_state },
|
||||
{ "transition", NULL, NULL, "false", change_transition_state },
|
||||
@@ -1650,6 +1685,10 @@ activate (GApplication *app)
|
||||
} accels[] = {
|
||||
{ "app.about", { "F1", NULL } },
|
||||
{ "app.quit", { "<Primary>q", NULL } },
|
||||
{ "app.open-in", { "<Primary>n", NULL } },
|
||||
{ "app.cut", { "<Primary>x", NULL } },
|
||||
{ "app.copy", { "<Primary>c", NULL } },
|
||||
{ "app.paste", { "<Primary>v", NULL } },
|
||||
{ "win.dark", { "<Primary>d", NULL } },
|
||||
{ "win.search", { "<Primary>s", NULL } },
|
||||
{ "win.delete", { "Delete", NULL } },
|
||||
@@ -1731,7 +1770,6 @@ activate (GApplication *app)
|
||||
g_signal_connect (adj, "value-changed", G_CALLBACK (spin_value_changed), widget);
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "listbox");
|
||||
gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_header, NULL, NULL);
|
||||
g_signal_connect (widget, "row-activated", G_CALLBACK (row_activated), NULL);
|
||||
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "listboxrow1switch");
|
||||
@@ -1856,8 +1894,7 @@ activate (GApplication *app)
|
||||
g_object_set_data (G_OBJECT (widget), "osd", widget2);
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "textview1");
|
||||
g_signal_connect (widget, "populate-popup",
|
||||
G_CALLBACK (populate_popup), NULL);
|
||||
text_view_add_to_context_menu (GTK_TEXT_VIEW (widget));
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "open_popover");
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "open_popover_entry");
|
||||
@@ -1903,6 +1940,13 @@ activate (GApplication *app)
|
||||
g_signal_connect (adj, "value-changed", G_CALLBACK (adjustment3_value_changed), widget);
|
||||
g_signal_connect (adj, "value-changed", G_CALLBACK (adjustment3_value_changed), widget2);
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "extra_info_entry");
|
||||
g_timeout_add (100, (GSourceFunc)pulse_it, widget);
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "box_for_context");
|
||||
model = (GMenuModel *)gtk_builder_get_object (builder, "new_style_context_menu_model");
|
||||
set_up_context_popover (widget, model);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (window));
|
||||
|
||||
g_object_unref (builder);
|
||||
@@ -1935,6 +1979,41 @@ local_options (GApplication *app,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
activate_action (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_print ("Activate action %s\n", g_action_get_name (G_ACTION (action)));
|
||||
}
|
||||
|
||||
static void
|
||||
select_action (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_print ("Select action %s value %s\n",
|
||||
g_action_get_name (G_ACTION (action)),
|
||||
g_variant_get_string (parameter, NULL));
|
||||
|
||||
g_simple_action_set_state (action, parameter);
|
||||
}
|
||||
|
||||
static void
|
||||
toggle_action (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
GVariant *state = g_action_get_state (G_ACTION (action));
|
||||
|
||||
g_print ("Toggle action %s to %s\n",
|
||||
g_action_get_name (G_ACTION (action)),
|
||||
g_variant_get_boolean (state) ? "false" : "true");
|
||||
|
||||
g_simple_action_set_state (action,
|
||||
g_variant_new_boolean (!g_variant_get_boolean (state)));
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@@ -1949,7 +2028,36 @@ main (int argc, char *argv[])
|
||||
{ "beer", NULL, NULL, "false", NULL },
|
||||
{ "water", NULL, NULL, "true", NULL },
|
||||
{ "dessert", NULL, "s", "'bars'", NULL },
|
||||
{ "pay", NULL, "s", NULL, NULL }
|
||||
{ "pay", NULL, "s", NULL, NULL },
|
||||
{ "print", activate_action, NULL, NULL, NULL },
|
||||
{ "share", activate_action, NULL, NULL, NULL },
|
||||
{ "labels", activate_action, NULL, NULL, NULL },
|
||||
{ "new", activate_action, NULL, NULL, NULL },
|
||||
{ "open", activate_action, NULL, NULL, NULL },
|
||||
{ "open-in", activate_action, NULL, NULL, NULL },
|
||||
{ "open-tab", activate_action, NULL, NULL, NULL },
|
||||
{ "open-window", activate_action, NULL, NULL, NULL },
|
||||
{ "save", activate_action, NULL, NULL, NULL },
|
||||
{ "save-as", activate_action, NULL, NULL, NULL },
|
||||
{ "cut", activate_action, NULL, NULL, NULL },
|
||||
{ "copy", activate_action, NULL, NULL, NULL },
|
||||
{ "paste", activate_action, NULL, NULL, NULL },
|
||||
{ "pin", toggle_action, NULL, "true", NULL },
|
||||
{ "size", select_action, "s", "'medium'", NULL },
|
||||
{ "berk", toggle_action, NULL, "true", NULL },
|
||||
{ "broni", toggle_action, NULL, "true", NULL },
|
||||
{ "drutt", toggle_action, NULL, "true", NULL },
|
||||
{ "upstairs", toggle_action, NULL, "true", NULL },
|
||||
{ "option-a", activate_action, NULL, NULL, NULL },
|
||||
{ "option-b", activate_action, NULL, NULL, NULL },
|
||||
{ "option-c", activate_action, NULL, NULL, NULL },
|
||||
{ "option-d", activate_action, NULL, NULL, NULL },
|
||||
{ "check-on", NULL, NULL, "true", NULL },
|
||||
{ "check-off", NULL, NULL, "false", NULL },
|
||||
{ "radio-x", NULL, "s", "'x'", NULL },
|
||||
{ "check-on-disabled", NULL, NULL, "true", NULL },
|
||||
{ "check-off-disabled", NULL, NULL, "false", NULL },
|
||||
{ "radio-x-disabled", NULL, "s", "'x'", NULL },
|
||||
};
|
||||
gint status;
|
||||
|
||||
@@ -1960,6 +2068,12 @@ main (int argc, char *argv[])
|
||||
app);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "wine");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "check-on-disabled");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "check-off-disabled");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "radio-x-disabled");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
|
||||
|
@@ -33,12 +33,12 @@
|
||||
<menu id="dinner_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Steak</attribute>
|
||||
<attribute name="label" translatable="yes">_Steak</attribute>
|
||||
<attribute name="action">app.main</attribute>
|
||||
<attribute name="target">steak</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Pizza</attribute>
|
||||
<attribute name="label" translatable="yes">_Pizza</attribute>
|
||||
<attribute name="action">app.main</attribute>
|
||||
<attribute name="target">pizza</attribute>
|
||||
</item>
|
||||
@@ -1207,7 +1207,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="wrap-mode">2</property>
|
||||
<property name="left-margin">10</property>
|
||||
<property name="right-margin">10</property>
|
||||
<property name="populate-all">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -1577,6 +1576,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<object class="GtkImage" id="imageo">
|
||||
<property name="icon-name">org.gtk.WidgetFactory4</property>
|
||||
<property name="pixel-size">256</property>
|
||||
<style>
|
||||
<class name="icon-dropshadow" />
|
||||
</style>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
@@ -1617,6 +1619,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="listbox">
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="show-separators">1</property>
|
||||
<child type="placeholder">
|
||||
<object class="GtkLabel">
|
||||
<property name="label">No rows found</property>
|
||||
@@ -1817,11 +1820,16 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkPopoverMenuBar">
|
||||
<property name="menu-model">menu_bar_model</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuBar">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem1">
|
||||
<property name="label" translatable="yes">_File</property>
|
||||
<property name="label" translatable="yes">File</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu1">
|
||||
@@ -1865,7 +1873,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem2">
|
||||
<property name="label" translatable="yes">_Edit</property>
|
||||
<property name="label" translatable="yes">Edit</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu2">
|
||||
@@ -2007,7 +2015,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem3">
|
||||
<property name="label" translatable="yes">_View</property>
|
||||
<property name="label" translatable="yes">View</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="view-menu">
|
||||
@@ -2047,7 +2055,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem4">
|
||||
<property name="label" translatable="yes">_Help</property>
|
||||
<property name="label" translatable="yes">Help</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu3">
|
||||
@@ -2429,37 +2437,18 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="halign">start</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="lockbox">
|
||||
<property name="halign">start</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="open_menubutton">
|
||||
<property name="halign">center</property>
|
||||
<property name="popover">open_popover</property>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="valign">baseline</property>
|
||||
<property name="icon-name">pan-down-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<property name="label">Open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -2525,6 +2514,15 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<child>
|
||||
<object class="GtkLockButton" id="lockbutton"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">view-more-symbolic</property>
|
||||
<property name="popover">new_style_menu</property>
|
||||
<!--
|
||||
<property name="menu-model">new_style_menu_model</property>
|
||||
-->
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -2979,7 +2977,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGestureMultiPress">
|
||||
<object class="GtkGestureClick">
|
||||
<signal name="pressed" handler="osd_frame_pressed" object="osd_frame" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
@@ -3039,7 +3037,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<object class="GtkNotebookPage">
|
||||
<property name="tab-expand">1</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<object class="GtkBox" id="box_for_context">
|
||||
<property name="height-request">120</property>
|
||||
</object>
|
||||
</property>
|
||||
@@ -3420,8 +3418,9 @@ bad things might happen.</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<object class="GtkEntry" id="extra_info_entry">
|
||||
<property name="placeholder-text">Tell me anything…</property>
|
||||
<property name="progress-fraction">0.2</property>
|
||||
</object>
|
||||
</child>
|
||||
<layout>
|
||||
@@ -3479,7 +3478,7 @@ bad things might happen.</property>
|
||||
</widgets>
|
||||
</object>
|
||||
<object class="GtkPopover" id="notebook_info_popover">
|
||||
<property name="modal">0</property>
|
||||
<property name="autohide">0</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">No updates at this time</property>
|
||||
@@ -3490,7 +3489,7 @@ bad things might happen.</property>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopover" id="notebook_info_popover3">
|
||||
<property name="modal">0</property>
|
||||
<property name="autohide">0</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">You're in too deep!</property>
|
||||
@@ -3501,7 +3500,7 @@ bad things might happen.</property>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopover" id="notebook_info_popover2">
|
||||
<property name="modal">0</property>
|
||||
<property name="autohide">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
@@ -3524,4 +3523,510 @@ bad things might happen.</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopoverMenu" id="new_style_menu">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="name">main</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="halign">fill</property>
|
||||
<style>
|
||||
<class name="circular-buttons"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">printer-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="action-name">app.print</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">emblem-shared-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="action-name">app.share</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Open in New Window</property>
|
||||
<property name="action-name">app.open-in</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="inline-buttons"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkLabel" id="cut_copy_paste_filler">
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Edit</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">edit-cut-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="relief">none</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">edit-copy-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="relief">none</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">edit-paste-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="relief">none</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Pin</property>
|
||||
<property name="action-name">app.pin</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Select Labels…</property>
|
||||
<property name="action-name">app.labels</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Share…</property>
|
||||
<property name="action-name">app.share</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Basement</property>
|
||||
<property name="menu-name">basement</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Large</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'large'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Medium</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'medium'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Small</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'small'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Move to Trash</property>
|
||||
<property name="action-name">win.delete</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="name">basement</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Basement</property>
|
||||
<property name="role">title</property>
|
||||
<property name="menu-name">main</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Berk</property>
|
||||
<property name="action-name">app.berk</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Broni</property>
|
||||
<property name="action-name">app.broni</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Drutt</property>
|
||||
<property name="action-name">app.drutt</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">The Thing Upstairs</property>
|
||||
<property name="action-name">app.upstairs</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkSizeGroup" id="main-indicators">
|
||||
<property name="mode">horizontal</property>
|
||||
<widgets>
|
||||
<widget name="cut_copy_paste_filler"/>
|
||||
</widgets>
|
||||
</object>
|
||||
<object class="GtkSizeGroup" id="basement-indicators">
|
||||
<property name="mode">horizontal</property>
|
||||
</object>
|
||||
<menu id="new_style_menu_model">
|
||||
<section>
|
||||
<attribute name="display-hint">circular-buttons</attribute>
|
||||
<item>
|
||||
<attribute name="verb-icon">printer-symbolic</attribute>
|
||||
<attribute name="action">app.print</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="verb-icon">emblem-shared-symbolic</attribute>
|
||||
<attribute name="action">app.share</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Open in New Window</attribute>
|
||||
<attribute name="action">app.open-in</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<attribute name="display-hint">inline-buttons</attribute>
|
||||
<attribute name="label" translatable="yes">Edit</attribute>
|
||||
<item>
|
||||
<attribute name="verb-icon">edit-cut-symbolic</attribute>
|
||||
<attribute name="action">app.cut</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="verb-icon">edit-copy-symbolic</attribute>
|
||||
<attribute name="action">app.copy</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="verb-icon">edit-paste-symbolic</attribute>
|
||||
<attribute name="action">app.paste</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Pin</attribute>
|
||||
<attribute name="action">app.pin</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Select Labels…</attribute>
|
||||
<attribute name="action">app.labels</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Share…</attribute>
|
||||
<attribute name="action">app.share</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">Basement</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Berk</attribute>
|
||||
<attribute name="action">app.berk</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Broni</attribute>
|
||||
<attribute name="action">app.broni</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Drutt</attribute>
|
||||
<attribute name="action">app.drutt</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">The Thing Upstairs</attribute>
|
||||
<attribute name="action">app.upstairs</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Large</attribute>
|
||||
<attribute name="action">app.size</attribute>
|
||||
<attribute name="target">large</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Medium</attribute>
|
||||
<attribute name="action">app.size</attribute>
|
||||
<attribute name="target">medium</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Small</attribute>
|
||||
<attribute name="action">app.size</attribute>
|
||||
<attribute name="target">small</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Move to Trash</attribute>
|
||||
<attribute name="action">win.delete</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="new_style_context_menu_model">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Open</attribute>
|
||||
<attribute name="action">win.open</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Open in New Tab</attribute>
|
||||
<attribute name="action">app.open-tab</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Open in New Window</attribute>
|
||||
<attribute name="action">app.open-window</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Cut</attribute>
|
||||
<attribute name="action">app.cut</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Copy</attribute>
|
||||
<attribute name="action">app.copy</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">Options</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Option A</attribute>
|
||||
<attribute name="action">app.option-a</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Option B</attribute>
|
||||
<attribute name="action">app.option-b</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Option C</attribute>
|
||||
<attribute name="action">app.option-c</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Option D</attribute>
|
||||
<attribute name="action">app.option-d</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Move to Trash</attribute>
|
||||
<attribute name="action">win.delete</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="menu_bar_model">
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_File</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_New</attribute>
|
||||
<attribute name="action">app.new</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Open</attribute>
|
||||
<attribute name="action">app.open</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Save</attribute>
|
||||
<attribute name="action">app.save</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Save _As</attribute>
|
||||
<attribute name="action">app.save-as</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Edit</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Cu_t</attribute>
|
||||
<attribute name="action">app.cut</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Copy</attribute>
|
||||
<attribute name="action">app.copy</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Paste</attribute>
|
||||
<attribute name="action">app.paste</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Delete</attribute>
|
||||
<attribute name="action">win.delete</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Search</attribute>
|
||||
<attribute name="action">win.search</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">Checks & Radios</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Check</attribute>
|
||||
<attribute name="action">app.check-on</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Check</attribute>
|
||||
<attribute name="action">app.check-off</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Check</attribute>
|
||||
<attribute name="action">app.check-on-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Check</attribute>
|
||||
<attribute name="action">app.check-off-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Check</attribute>
|
||||
<attribute name="action">app.check-no-action</attribute>
|
||||
<attribute name="hidden-when">action-missing</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Radio</attribute>
|
||||
<attribute name="action">app.radio-x</attribute>
|
||||
<attribute name="target">x</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Radio</attribute>
|
||||
<attribute name="action">app.radio-x</attribute>
|
||||
<attribute name="target">y</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Radio</attribute>
|
||||
<attribute name="action">app.radio-x-disabled</attribute>
|
||||
<attribute name="target">x</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Radio</attribute>
|
||||
<attribute name="action">app.radio-x-disabled</attribute>
|
||||
<attribute name="target">y</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Radio</attribute>
|
||||
<attribute name="action">app.radio-no-action</attribute>
|
||||
<attribute name="hidden-when">action-missing</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
</section>
|
||||
</submenu>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_View</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Dark Theme</attribute>
|
||||
<attribute name="action">win.dark</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Toolbar</attribute>
|
||||
<attribute name="action">win.toolbar</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Statusbar</attribute>
|
||||
<attribute name="action">win.statusbar</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Select Background</attribute>
|
||||
<attribute name="action">win.background</attribute>
|
||||
</item>
|
||||
</section>
|
||||
|
||||
</submenu>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Help</attribute>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">About</attribute>
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
</submenu>
|
||||
</menu>
|
||||
</interface>
|
||||
|
@@ -1,8 +1,9 @@
|
||||
|
||||
# GdkAtom is an opaque typedef
|
||||
<STRUCT>
|
||||
<TYPEDEF>
|
||||
<NAME>GdkAtom</NAME>
|
||||
</STRUCT>
|
||||
typedef struct _GdkAtom *GdkAtom;
|
||||
</TYPEDEF>
|
||||
|
||||
<MACRO>
|
||||
<NAME>GDK_WINDOWING_X11</NAME>
|
||||
|
@@ -95,7 +95,6 @@ gdk_display_list_seats
|
||||
gdk_display_get_n_monitors
|
||||
gdk_display_get_monitor
|
||||
gdk_display_get_primary_monitor
|
||||
gdk_display_get_monitor_at_point
|
||||
gdk_display_get_monitor_at_surface
|
||||
gdk_display_get_clipboard
|
||||
gdk_display_get_primary_clipboard
|
||||
@@ -179,19 +178,19 @@ GdkSurfaceEdge
|
||||
GdkSurfaceTypeHint
|
||||
GdkSurfaceState
|
||||
gdk_surface_new_toplevel
|
||||
gdk_surface_new_popup
|
||||
gdk_surface_new_temp
|
||||
gdk_surface_new_child
|
||||
gdk_surface_new_popup
|
||||
gdk_surface_get_parent
|
||||
gdk_surface_destroy
|
||||
gdk_surface_get_surface_type
|
||||
gdk_surface_get_display
|
||||
gdk_surface_show
|
||||
gdk_surface_show_unraised
|
||||
gdk_surface_show_with_auto_dismissal
|
||||
gdk_surface_hide
|
||||
gdk_surface_is_destroyed
|
||||
gdk_surface_is_visible
|
||||
gdk_surface_is_viewable
|
||||
gdk_surface_is_input_only
|
||||
gdk_surface_get_state
|
||||
gdk_surface_iconify
|
||||
gdk_surface_deiconify
|
||||
@@ -208,13 +207,8 @@ gdk_surface_set_fullscreen_mode
|
||||
gdk_surface_set_keep_above
|
||||
gdk_surface_set_keep_below
|
||||
gdk_surface_set_opacity
|
||||
gdk_surface_set_pass_through
|
||||
gdk_surface_get_pass_through
|
||||
gdk_surface_move
|
||||
gdk_surface_resize
|
||||
gdk_surface_move_resize
|
||||
gdk_surface_move_to_rect
|
||||
gdk_surface_has_native
|
||||
gdk_surface_raise
|
||||
gdk_surface_lower
|
||||
gdk_surface_restack
|
||||
@@ -245,13 +239,10 @@ gdk_surface_get_accept_focus
|
||||
gdk_surface_set_focus_on_map
|
||||
gdk_surface_get_focus_on_map
|
||||
gdk_surface_input_shape_combine_region
|
||||
gdk_surface_set_child_input_shapes
|
||||
gdk_surface_merge_child_input_shapes
|
||||
gdk_surface_set_title
|
||||
GDK_PARENT_RELATIVE
|
||||
gdk_surface_set_cursor
|
||||
gdk_surface_get_cursor
|
||||
gdk_surface_get_geometry
|
||||
gdk_surface_set_geometry_hints
|
||||
gdk_surface_get_width
|
||||
gdk_surface_get_height
|
||||
@@ -262,17 +253,9 @@ gdk_surface_set_type_hint
|
||||
gdk_surface_get_type_hint
|
||||
gdk_surface_set_shadow_width
|
||||
gdk_surface_get_position
|
||||
gdk_surface_get_root_origin
|
||||
gdk_surface_get_frame_extents
|
||||
gdk_surface_get_origin
|
||||
gdk_surface_get_root_coords
|
||||
gdk_surface_get_device_position
|
||||
GdkModifierType
|
||||
GdkModifierIntent
|
||||
gdk_surface_get_parent
|
||||
gdk_surface_get_toplevel
|
||||
gdk_surface_get_children
|
||||
gdk_surface_peek_children
|
||||
gdk_surface_set_icon_name
|
||||
gdk_surface_set_transient_for
|
||||
gdk_surface_set_startup_id
|
||||
@@ -288,10 +271,6 @@ gdk_surface_set_support_multidevice
|
||||
gdk_surface_get_device_cursor
|
||||
gdk_surface_set_device_cursor
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_surface_coords_from_parent
|
||||
gdk_surface_coords_to_parent
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_SURFACE
|
||||
GDK_SURFACE_GET_CLASS
|
||||
@@ -498,7 +477,6 @@ gdk_device_get_seat
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_device_get_state
|
||||
gdk_device_get_position
|
||||
gdk_device_get_surface_at_position
|
||||
gdk_device_get_history
|
||||
gdk_device_free_history
|
||||
@@ -613,7 +591,6 @@ gdk_event_get_click_count
|
||||
gdk_event_get_coords
|
||||
gdk_event_get_keycode
|
||||
gdk_event_get_keyval
|
||||
gdk_event_get_root_coords
|
||||
gdk_event_get_scroll_direction
|
||||
gdk_event_get_scroll_deltas
|
||||
gdk_event_is_scroll_stop_event
|
||||
@@ -823,7 +800,6 @@ gdk_x11_lookup_xdisplay
|
||||
gdk_x11_get_server_time
|
||||
gdk_x11_device_get_id
|
||||
gdk_x11_device_manager_lookup
|
||||
gdk_disable_multidevice
|
||||
gdk_x11_display_open
|
||||
gdk_x11_display_set_program_class
|
||||
gdk_x11_display_get_user_time
|
||||
@@ -881,18 +857,6 @@ GDK_X11_APP_LAUNCH_CONTEXT_CLASS
|
||||
GDK_IS_X11_APP_LAUNCH_CONTEXT
|
||||
GDK_IS_X11_APP_LAUNCH_CONTEXT_CLASS
|
||||
GDK_X11_APP_LAUNCH_CONTEXT_GET_CLASS
|
||||
GDK_TYPE_X11_DEVICE_CORE
|
||||
GDK_X11_DEVICE_CORE
|
||||
GDK_X11_DEVICE_CORE_CLASS
|
||||
GDK_IS_X11_DEVICE_CORE
|
||||
GDK_IS_X11_DEVICE_CORE_CLASS
|
||||
GDK_X11_DEVICE_CORE_GET_CLASS
|
||||
GDK_TYPE_X11_DEVICE_MANAGER_CORE
|
||||
GDK_X11_DEVICE_MANAGER_CORE
|
||||
GDK_X11_DEVICE_MANAGER_CORE_CLASS
|
||||
GDK_IS_X11_DEVICE_MANAGER_CORE
|
||||
GDK_IS_X11_DEVICE_MANAGER_CORE_CLASS
|
||||
GDK_X11_DEVICE_MANAGER_CORE_GET_CLASS
|
||||
GDK_TYPE_X11_DEVICE_MANAGER_XI2
|
||||
GDK_X11_DEVICE_MANAGER_XI2
|
||||
GDK_X11_DEVICE_MANAGER_XI2_CLASS
|
||||
@@ -962,8 +926,6 @@ GDK_X11_SURFACE_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gdk_x11_app_launch_context_get_type
|
||||
gdk_x11_cursor_get_type
|
||||
gdk_x11_device_core_get_type
|
||||
gdk_x11_device_manager_core_get_type
|
||||
gdk_x11_device_manager_xi2_get_type
|
||||
gdk_x11_device_manager_xi_get_type
|
||||
gdk_x11_device_xi2_get_type
|
||||
|
@@ -99,24 +99,26 @@ if wayland_enabled
|
||||
src_dir += [ gdkwayland_inc ]
|
||||
endif
|
||||
|
||||
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
|
||||
if get_option('documentation')
|
||||
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
|
||||
|
||||
gnome.gtkdoc('gdk4',
|
||||
mode: 'none',
|
||||
main_xml: 'gdk4-docs.xml',
|
||||
src_dir: src_dir,
|
||||
dependencies: libgtk_dep,
|
||||
gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk4.types'),
|
||||
scan_args: [
|
||||
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
|
||||
'--ignore-headers=' + ' '.join(private_headers),
|
||||
],
|
||||
fixxref_args: [
|
||||
'--html-dir=@0@'.format(docpath),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
|
||||
'--extra-dir=@0@'.format(cairo_docpath),
|
||||
],
|
||||
html_assets: images,
|
||||
install: true)
|
||||
gnome.gtkdoc('gdk4',
|
||||
mode: 'none',
|
||||
main_xml: 'gdk4-docs.xml',
|
||||
src_dir: src_dir,
|
||||
dependencies: libgtk_dep,
|
||||
gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk4.types'),
|
||||
scan_args: [
|
||||
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
|
||||
'--ignore-headers=' + ' '.join(private_headers),
|
||||
],
|
||||
fixxref_args: [
|
||||
'--html-dir=@0@'.format(docpath),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
|
||||
'--extra-dir=@0@'.format(cairo_docpath),
|
||||
],
|
||||
html_assets: images,
|
||||
install: true)
|
||||
endif
|
||||
|
@@ -34,27 +34,29 @@ private_headers = [
|
||||
images = [
|
||||
]
|
||||
|
||||
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
|
||||
if get_option('documentation')
|
||||
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
|
||||
|
||||
gnome.gtkdoc('gsk4',
|
||||
mode: 'none',
|
||||
main_xml: 'gsk4-docs.xml',
|
||||
src_dir: [
|
||||
gskinc,
|
||||
],
|
||||
dependencies: libgtk_dep,
|
||||
gobject_typesfile: join_paths(meson.current_source_dir(), 'gsk4.types'),
|
||||
scan_args: [
|
||||
'--ignore-decorators=_GDK_EXTERN',
|
||||
'--ignore-headers=' + ' '.join(private_headers),
|
||||
],
|
||||
fixxref_args: [
|
||||
'--html-dir=@0@'.format(docpath),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
|
||||
'--extra-dir=@0@'.format(cairo_docpath),
|
||||
'--extra-dir=../gdk',
|
||||
],
|
||||
html_assets: images,
|
||||
install: true)
|
||||
gnome.gtkdoc('gsk4',
|
||||
mode: 'none',
|
||||
main_xml: 'gsk4-docs.xml',
|
||||
src_dir: [
|
||||
gskinc,
|
||||
],
|
||||
dependencies: libgtk_dep,
|
||||
gobject_typesfile: join_paths(meson.current_source_dir(), 'gsk4.types'),
|
||||
scan_args: [
|
||||
'--ignore-decorators=_GDK_EXTERN',
|
||||
'--ignore-headers=' + ' '.join(private_headers),
|
||||
],
|
||||
fixxref_args: [
|
||||
'--html-dir=@0@'.format(docpath),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
|
||||
'--extra-dir=@0@'.format(cairo_docpath),
|
||||
'--extra-dir=../gdk',
|
||||
],
|
||||
html_assets: images,
|
||||
install: true)
|
||||
endif
|
||||
|
@@ -224,6 +224,7 @@
|
||||
<xi:include href="xml/gtkradiotoolbutton.xml" />
|
||||
<xi:include href="xml/gtkpopover.xml" />
|
||||
<xi:include href="xml/gtkpopovermenu.xml" />
|
||||
<xi:include href="xml/gtkpopovermenubar.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="SelectorWidgets">
|
||||
@@ -332,7 +333,7 @@
|
||||
<xi:include href="xml/gtkgesturesingle.xml" />
|
||||
<xi:include href="xml/gtkgesturedrag.xml" />
|
||||
<xi:include href="xml/gtkgesturelongpress.xml" />
|
||||
<xi:include href="xml/gtkgesturemultipress.xml" />
|
||||
<xi:include href="xml/gtkgestureclick.xml" />
|
||||
<xi:include href="xml/gtkgesturepan.xml" />
|
||||
<xi:include href="xml/gtkgestureswipe.xml" />
|
||||
<xi:include href="xml/gtkgesturerotate.xml" />
|
||||
|
@@ -537,7 +537,6 @@ gtk_button_new
|
||||
gtk_button_new_with_label
|
||||
gtk_button_new_with_mnemonic
|
||||
gtk_button_new_from_icon_name
|
||||
gtk_button_clicked
|
||||
gtk_button_set_relief
|
||||
gtk_button_get_relief
|
||||
gtk_button_get_label
|
||||
@@ -894,6 +893,8 @@ gtk_text_get_attributes
|
||||
gtk_text_set_tabs
|
||||
gtk_text_get_tabs
|
||||
gtk_text_grab_focus_without_selecting
|
||||
gtk_text_set_extra_menu
|
||||
gtk_text_get_extra_menu
|
||||
<SUBSECTION Private>
|
||||
gtk_text_get_type
|
||||
</SECTION>
|
||||
@@ -964,6 +965,8 @@ GtkInputHints
|
||||
gtk_entry_set_input_hints
|
||||
gtk_entry_get_input_hints
|
||||
gtk_entry_grab_focus_without_selecting
|
||||
gtk_entry_set_extra_menu
|
||||
gtk_entry_get_extra_menu
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_ENTRY
|
||||
@@ -986,6 +989,8 @@ GtkPasswordEntry
|
||||
gtk_password_entry_new
|
||||
gtk_password_entry_set_show_peek_icon
|
||||
gtk_password_entry_get_show_peek_icon
|
||||
gtk_password_entry_set_extra_menu
|
||||
gtk_password_entry_get_extra_menu
|
||||
<SUBSECTION Private>
|
||||
gtk_password_entry_get_type
|
||||
</SECTION>
|
||||
@@ -1714,6 +1719,9 @@ gtk_label_set_single_line_mode
|
||||
gtk_label_get_current_uri
|
||||
gtk_label_set_track_visited_links
|
||||
gtk_label_get_track_visited_links
|
||||
gtk_label_set_extra_menu
|
||||
gtk_label_get_extra_menu
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_LABEL
|
||||
GTK_IS_LABEL
|
||||
@@ -1776,7 +1784,6 @@ gtk_map_list_model_get_type
|
||||
<FILE>gtkmenu</FILE>
|
||||
<TITLE>GtkMenu</TITLE>
|
||||
GtkMenu
|
||||
GtkArrowPlacement
|
||||
gtk_menu_new
|
||||
gtk_menu_new_from_model
|
||||
gtk_menu_reorder_child
|
||||
@@ -1850,6 +1857,14 @@ gtk_menu_button_set_direction
|
||||
gtk_menu_button_get_direction
|
||||
gtk_menu_button_set_align_widget
|
||||
gtk_menu_button_get_align_widget
|
||||
gtk_menu_button_set_icon_name
|
||||
gtk_menu_button_get_icon_name
|
||||
gtk_menu_button_set_label
|
||||
gtk_menu_button_get_label
|
||||
gtk_menu_button_set_relief
|
||||
gtk_menu_button_get_relief
|
||||
gtk_menu_button_popup
|
||||
gtk_menu_button_popdown
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_MENU_BUTTON
|
||||
GTK_MENU_BUTTON
|
||||
@@ -3083,6 +3098,9 @@ gtk_text_view_set_input_hints
|
||||
gtk_text_view_get_input_hints
|
||||
gtk_text_view_set_monospace
|
||||
gtk_text_view_get_monospace
|
||||
gtk_text_view_set_extra_menu
|
||||
gtk_text_view_get_extra_menu
|
||||
|
||||
GTK_TEXT_VIEW_PRIORITY_VALIDATE
|
||||
<SUBSECTION Standard>
|
||||
GTK_TEXT_VIEW
|
||||
@@ -4436,8 +4454,8 @@ gtk_widget_set_name
|
||||
gtk_widget_get_name
|
||||
gtk_widget_set_sensitive
|
||||
gtk_widget_set_parent
|
||||
gtk_widget_get_toplevel
|
||||
gtk_widget_get_root
|
||||
gtk_widget_get_native
|
||||
gtk_widget_get_ancestor
|
||||
gtk_widget_is_ancestor
|
||||
gtk_widget_translate_coordinates
|
||||
@@ -4487,9 +4505,6 @@ gtk_widget_set_tooltip_window
|
||||
gtk_widget_get_has_tooltip
|
||||
gtk_widget_set_has_tooltip
|
||||
gtk_widget_trigger_tooltip_query
|
||||
gtk_widget_get_surface
|
||||
gtk_widget_register_surface
|
||||
gtk_widget_unregister_surface
|
||||
gtk_widget_get_allocated_width
|
||||
gtk_widget_get_allocated_height
|
||||
gtk_widget_get_allocation
|
||||
@@ -4509,8 +4524,6 @@ gtk_widget_set_focus_on_click
|
||||
gtk_widget_set_focus_child
|
||||
gtk_widget_get_can_target
|
||||
gtk_widget_set_can_target
|
||||
gtk_widget_get_has_surface
|
||||
gtk_widget_set_has_surface
|
||||
gtk_widget_get_sensitive
|
||||
gtk_widget_is_sensitive
|
||||
gtk_widget_get_visible
|
||||
@@ -4524,8 +4537,6 @@ gtk_widget_has_focus
|
||||
gtk_widget_has_visible_focus
|
||||
gtk_widget_has_grab
|
||||
gtk_widget_is_drawable
|
||||
gtk_widget_is_toplevel
|
||||
gtk_widget_set_surface
|
||||
gtk_widget_set_receives_default
|
||||
gtk_widget_get_receives_default
|
||||
gtk_widget_set_support_multidevice
|
||||
@@ -4540,7 +4551,6 @@ gtk_widget_get_overflow
|
||||
gtk_widget_set_overflow
|
||||
gtk_widget_insert_action_group
|
||||
gtk_widget_list_action_prefixes
|
||||
gtk_widget_get_action_group
|
||||
gtk_widget_activate_action
|
||||
gtk_widget_activate_default
|
||||
gtk_widget_measure
|
||||
@@ -4553,6 +4563,7 @@ gtk_widget_insert_before
|
||||
gtk_widget_insert_after
|
||||
gtk_widget_set_layout_manager
|
||||
gtk_widget_get_layout_manager
|
||||
gtk_widget_should_layout
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_widget_get_path
|
||||
@@ -4649,8 +4660,6 @@ gtk_window_set_modal
|
||||
gtk_window_set_default_size
|
||||
gtk_window_set_hide_on_close
|
||||
gtk_window_get_hide_on_close
|
||||
GtkWindowPosition
|
||||
gtk_window_set_position
|
||||
gtk_window_set_transient_for
|
||||
gtk_window_set_attached_to
|
||||
gtk_window_set_destroy_with_parent
|
||||
@@ -6441,8 +6450,6 @@ gtk_flow_box_child_get_type
|
||||
<TITLE>GtkPopover</TITLE>
|
||||
GtkPopover
|
||||
gtk_popover_new
|
||||
gtk_popover_new_from_model
|
||||
gtk_popover_bind_model
|
||||
gtk_popover_popup
|
||||
gtk_popover_popdown
|
||||
gtk_popover_set_relative_to
|
||||
@@ -6454,8 +6461,10 @@ gtk_popover_get_position
|
||||
GtkPopoverConstraint
|
||||
gtk_popover_set_constrain_to
|
||||
gtk_popover_get_constrain_to
|
||||
gtk_popover_set_modal
|
||||
gtk_popover_get_modal
|
||||
gtk_popover_set_autohide
|
||||
gtk_popover_get_autohide
|
||||
gtk_popover_set_has_arrow
|
||||
gtk_popover_get_has_arrow
|
||||
gtk_popover_set_default_widget
|
||||
gtk_popover_get_default_widget
|
||||
<SUBSECTION Standard>
|
||||
@@ -6478,6 +6487,7 @@ gtk_popover_get_type
|
||||
<TITLE>GtkPopoverMenu</TITLE>
|
||||
GtkPopoverMenu
|
||||
gtk_popover_menu_new
|
||||
gtk_popover_menu_new_from_model
|
||||
gtk_popover_menu_add_submenu
|
||||
gtk_popover_menu_open_submenu
|
||||
|
||||
@@ -6493,6 +6503,23 @@ GTK_POPOVER_MENU_GET_CLASS
|
||||
gtk_popover_menu_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkpopovermenubar</FILE>
|
||||
<TITLE>GtkPopoverMenuBar</TITLE>
|
||||
GtkPopoverMenuBar
|
||||
gtk_popover_menu_bar_new_from_model
|
||||
gtk_popover_menu_bar_set_menu_model
|
||||
gtk_popover_menu_bar_get_menu_model
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER_MENU_BAR
|
||||
GTK_IS_POPOVER_MENU_BAR
|
||||
GTK_POPOVER_MENU_BAR
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_popover_menu_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmodelbutton</FILE>
|
||||
<TITLE>GtkModelButton</TITLE>
|
||||
@@ -6514,6 +6541,9 @@ GtkEventController
|
||||
GtkPropagationPhase
|
||||
gtk_event_controller_get_propagation_phase
|
||||
gtk_event_controller_set_propagation_phase
|
||||
GtkPropagationLimit
|
||||
gtk_event_controller_get_propagation_limit
|
||||
gtk_event_controller_set_propagation_limit
|
||||
gtk_event_controller_handle_event
|
||||
gtk_event_controller_get_widget
|
||||
gtk_event_controller_reset
|
||||
@@ -6717,23 +6747,23 @@ gtk_gesture_long_press_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkgesturemultipress</FILE>
|
||||
<TITLE>GtkGestureMultiPress</TITLE>
|
||||
GtkGestureMultiPress
|
||||
gtk_gesture_multi_press_new
|
||||
gtk_gesture_multi_press_set_area
|
||||
gtk_gesture_multi_press_get_area
|
||||
<FILE>gtkgestureclick</FILE>
|
||||
<TITLE>GtkGestureClick</TITLE>
|
||||
GtkGestureClick
|
||||
gtk_gesture_click_new
|
||||
gtk_gesture_click_set_area
|
||||
gtk_gesture_click_get_area
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_GESTURE_MULTI_PRESS
|
||||
GTK_GESTURE_MULTI_PRESS
|
||||
GTK_GESTURE_MULTI_PRESS_CLASS
|
||||
GTK_IS_GESTURE_MULTI_PRESS
|
||||
GTK_IS_GESTURE_MULTI_PRESS_CLASS
|
||||
GTK_GESTURE_MULTI_PRESS_GET_CLASS
|
||||
GTK_TYPE_GESTURE_CLICK
|
||||
GTK_GESTURE_CLICK
|
||||
GTK_GESTURE_CLICK_CLASS
|
||||
GTK_IS_GESTURE_CLICK
|
||||
GTK_IS_GESTURE_CLICK_CLASS
|
||||
GTK_GESTURE_CLICK_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_gesture_multi_press_get_type
|
||||
gtk_gesture_click_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -7103,17 +7133,26 @@ gtk_media_stream_get_type
|
||||
<FILE>gtkroot</FILE>
|
||||
<TITLE>GtkRoot</TITLE>
|
||||
GtkRoot
|
||||
gtk_root_get_for_surface
|
||||
gtk_root_get_display
|
||||
gtk_root_get_focus
|
||||
gtk_root_set_focus
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_root_install_properties
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_root_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtknative</FILE>
|
||||
GtkNative
|
||||
gtk_native_get_for_surface
|
||||
gtk_native_get_surface
|
||||
gtk_native_get_renderer
|
||||
gtk_native_check_resize
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_native_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtklayoutmanager</FILE>
|
||||
GtkLayoutManager
|
||||
|
@@ -75,9 +75,9 @@ gtk_font_chooser_dialog_get_type
|
||||
gtk_font_chooser_widget_get_type
|
||||
gtk_frame_get_type
|
||||
gtk_gesture_get_type
|
||||
gtk_gesture_click_get_type
|
||||
gtk_gesture_drag_get_type
|
||||
gtk_gesture_long_press_get_type
|
||||
gtk_gesture_multi_press_get_type
|
||||
gtk_gesture_pan_get_type
|
||||
gtk_gesture_rotate_get_type
|
||||
gtk_gesture_single_get_type
|
||||
@@ -129,6 +129,7 @@ gtk_password_entry_get_type
|
||||
gtk_picture_get_type
|
||||
gtk_popover_get_type
|
||||
gtk_popover_menu_get_type
|
||||
gtk_popover_menu_bar_get_type
|
||||
@DISABLE_ON_W32@gtk_printer_get_type
|
||||
gtk_print_context_get_type
|
||||
@DISABLE_ON_W32@gtk_print_job_get_type
|
||||
|
@@ -104,8 +104,7 @@
|
||||
a #GdkSurface, which in turn represents a windowing system surface in the
|
||||
backend. If a widget has grabbed the current input device, or all input
|
||||
devices, the event is propagated to that #GtkWidget. Otherwise, it is
|
||||
propagated to the the #GtkWidget which called gtk_widget_register_surface()
|
||||
on the #GdkSurface receiving the event.
|
||||
propagated to the the #GtkRoot which owns the #GdkSurface receiving the event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@@ -141,7 +141,7 @@ private_headers = [
|
||||
'gtkplacesviewrowprivate.h',
|
||||
'gtkpointerfocusprivate.h',
|
||||
'gtkpopoverprivate.h',
|
||||
'gtkprinter-private.h',
|
||||
'gtkprinterprivate.h',
|
||||
'gtkprintoperation-private.h',
|
||||
'gtkprivate.h',
|
||||
'gtkprogresstrackerprivate.h',
|
||||
@@ -381,9 +381,6 @@ expand_content_files = [
|
||||
'tree_widget.sgml',
|
||||
]
|
||||
|
||||
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
|
||||
configure_file(input: 'getting_started.xml.in', output: 'getting_started.xml', configuration: src_dir_conf)
|
||||
|
||||
types_conf = configuration_data()
|
||||
if os_win32
|
||||
types_conf.set('DISABLE_ON_W32', '%')
|
||||
@@ -397,39 +394,44 @@ else
|
||||
types_conf.set('DISABLE_ON_QUARTZ', '')
|
||||
endif
|
||||
|
||||
gnome.gtkdoc('gtk4',
|
||||
mode: 'none',
|
||||
main_xml: 'gtk4-docs.xml',
|
||||
src_dir: [
|
||||
gtkinc,
|
||||
],
|
||||
dependencies: libgtk_dep,
|
||||
gobject_typesfile: configure_file(
|
||||
input: 'gtk4.types.in',
|
||||
output: 'gtk4.types',
|
||||
configuration: types_conf,
|
||||
),
|
||||
scan_args: [
|
||||
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
|
||||
'--ignore-headers=' + ' '.join(private_headers),
|
||||
],
|
||||
mkdb_args: [
|
||||
'--default-includes=gtk/gtk.h',
|
||||
],
|
||||
fixxref_args: [
|
||||
'--html-dir=@0@'.format(docpath),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
|
||||
'--extra-dir=@0@'.format(cairo_docpath),
|
||||
'--extra-dir=@0@'.format(gdkpixbuf_docpath),
|
||||
'--extra-dir=../gdk',
|
||||
'--extra-dir=../gsk',
|
||||
],
|
||||
content_files: content_files,
|
||||
expand_content_files: expand_content_files,
|
||||
html_assets: images,
|
||||
install: true)
|
||||
if get_option('documentation')
|
||||
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
|
||||
configure_file(input: 'getting_started.xml.in', output: 'getting_started.xml', configuration: src_dir_conf)
|
||||
|
||||
gnome.gtkdoc('gtk4',
|
||||
mode: 'none',
|
||||
main_xml: 'gtk4-docs.xml',
|
||||
src_dir: [
|
||||
gtkinc,
|
||||
],
|
||||
dependencies: libgtk_dep,
|
||||
gobject_typesfile: configure_file(
|
||||
input: 'gtk4.types.in',
|
||||
output: 'gtk4.types',
|
||||
configuration: types_conf,
|
||||
),
|
||||
scan_args: [
|
||||
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
|
||||
'--ignore-headers=' + ' '.join(private_headers),
|
||||
],
|
||||
mkdb_args: [
|
||||
'--default-includes=gtk/gtk.h',
|
||||
],
|
||||
fixxref_args: [
|
||||
'--html-dir=@0@'.format(docpath),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
|
||||
'--extra-dir=@0@'.format(cairo_docpath),
|
||||
'--extra-dir=@0@'.format(gdkpixbuf_docpath),
|
||||
'--extra-dir=../gdk',
|
||||
'--extra-dir=../gsk',
|
||||
],
|
||||
content_files: content_files,
|
||||
expand_content_files: expand_content_files,
|
||||
html_assets: images,
|
||||
install: true)
|
||||
endif
|
||||
|
||||
xsltproc = find_program('xsltproc', required: false)
|
||||
if get_option('man-pages') and not xsltproc.found()
|
||||
|
@@ -265,9 +265,8 @@
|
||||
<para>
|
||||
The gdk_window_new() function has been replaced by a number of more
|
||||
specialized constructors: gdk_surface_new_toplevel(), gdk_surface_new_popup(),
|
||||
gdk_surface_new_temp(), gdk_surface_new_child(), gdk_surface_new_input(),
|
||||
gdk_wayland_surface_new_subsurface(). Use the appropriate ones to create
|
||||
your windows.
|
||||
gdk_surface_new_temp(), gdk_wayland_surface_new_subsurface().
|
||||
Use the appropriate ones to create your windows.
|
||||
</para>
|
||||
<para>
|
||||
Native and foreign subwindows are no longer supported. These concepts were
|
||||
@@ -315,8 +314,15 @@
|
||||
doubles, and the _double variants have been removed. Update your
|
||||
code accordingly.
|
||||
</para>
|
||||
<para>
|
||||
Any APIs that deal with global (or root) coordinates have been
|
||||
removed in GTK4, since not all backends support them. You should
|
||||
replace your use of such APIs with surface-relative equivalents.
|
||||
Examples of this are gdk_surfae_get_origin(), gdk_surface_move()
|
||||
or gdk_event_get_root_coords().
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<title>Adapt to GdkKeymap API changes</title>
|
||||
<para>
|
||||
@@ -325,6 +331,21 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Adapt to event controller API changes</title>
|
||||
<para>
|
||||
A few changes to the event controller and #GtkGesture APIs
|
||||
did not make it back to GTK3, and have to be taken into account
|
||||
when moving to GTK4. One is that the
|
||||
#GtkEventControllerMotion::enter,
|
||||
#GtkEventControllerMotion::leave,
|
||||
#GtkEventControllerKey::focus-in and
|
||||
#GtkEventControllerKey::focus-out signals
|
||||
have gained new arguments. Another is that #GtkGestureMultiPress
|
||||
has been renamed to #GtkGestureClick.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using GtkEventBox</title>
|
||||
<para>
|
||||
@@ -671,7 +692,7 @@
|
||||
<title>Adapt to changes in GtkOverlay API</title>
|
||||
<para>
|
||||
The GtkOverlay::pass-through child property has been replaced by the
|
||||
GtkWidget::can-pick property. Note that they have the oppositve sense:
|
||||
GtkWidget::can-pick property. Note that they have the opposite sense:
|
||||
pass-through == !can-pick.
|
||||
</para>
|
||||
</section>
|
||||
@@ -756,6 +777,42 @@
|
||||
instead.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkPopover::modal has been renamed to autohide</title>
|
||||
<para>
|
||||
The modal property has been renamed to autohide.
|
||||
gtk-builder-tool can assist with the rename in ui files.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>gtk_widget_get_surface has been removed</title>
|
||||
<para>
|
||||
gtk_widget_get_surface() has been removed.
|
||||
Use gtk_native_get_surface() in combination with
|
||||
gtk_widget_get_native() instead.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>gtk_widget_is_toplevel has been removed</title>
|
||||
<para>
|
||||
gtk_widget_is_toplevel() has been removed.
|
||||
Use GTK_IS_ROOT, GTK_IS_NATIVE or GTK_IS_WINDOW
|
||||
instead, as appropriate.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>gtk_widget_get_toplevel has been removed</title>
|
||||
<para>
|
||||
gtk_widget_get_toplevel() has been removed.
|
||||
Use gtk_widget_get_root() or gtk_widget_get_native()
|
||||
instead, as appropriate.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
@@ -65,15 +65,6 @@ The X11 GDK backend can be influenced with some additional environment variables
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GDK_CORE_DEVICE_EVENTS</envar></title>
|
||||
|
||||
<para>
|
||||
If set, GDK makes does not use the XInput extension, and only reacts
|
||||
to core X input events.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GDK_SCALE</envar></title>
|
||||
|
||||
|
@@ -1,19 +1,21 @@
|
||||
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
|
||||
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
|
||||
if get_option('documentation')
|
||||
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
|
||||
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
|
||||
|
||||
cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix')
|
||||
cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo')
|
||||
cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix')
|
||||
cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo')
|
||||
|
||||
gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix')
|
||||
gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf')
|
||||
gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix')
|
||||
gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf')
|
||||
|
||||
docpath = join_paths(gtk_datadir, 'gtk-doc', 'html')
|
||||
docpath = join_paths(gtk_datadir, 'gtk-doc', 'html')
|
||||
|
||||
version_conf = configuration_data()
|
||||
version_conf.set('GTK_VERSION', meson.project_version())
|
||||
version_conf = configuration_data()
|
||||
version_conf.set('GTK_VERSION', meson.project_version())
|
||||
|
||||
src_dir_conf = configuration_data()
|
||||
src_dir_conf.set('SRC_DIR', meson.source_root())
|
||||
src_dir_conf = configuration_data()
|
||||
src_dir_conf.set('SRC_DIR', meson.source_root())
|
||||
endif
|
||||
|
||||
subdir('gdk')
|
||||
subdir('gsk')
|
||||
|
@@ -1,4 +1,4 @@
|
||||
if x11_enabled
|
||||
if x11_enabled and get_option('documentation')
|
||||
doc_shooter_sources = [
|
||||
'shadow.c',
|
||||
'shooter.c',
|
||||
|
@@ -235,7 +235,7 @@ shoot_one (WidgetInfo *info)
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
window = gtk_widget_get_surface (info->window);
|
||||
window = gtk_native_get_surface (GTK_NATIVE (info->window));
|
||||
id = gdk_x11_surface_get_xid (window);
|
||||
if (window_is_csd (window))
|
||||
decor = (info->include_decorations) ? DECOR_NONE : DECOR_WINDOW_FRAME;
|
||||
|
@@ -29,9 +29,9 @@ size_allocate_cb (GtkWidget *widget,
|
||||
surface = NULL;
|
||||
}
|
||||
|
||||
if (gtk_widget_get_surface (widget))
|
||||
if (gtk_native_get_surface (gtk_widget_get_native (widget)))
|
||||
{
|
||||
surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (widget),
|
||||
surface = gdk_surface_create_similar_surface (gtk_native_get_surface (gtk_widget_get_native (widget)),
|
||||
CAIRO_CONTENT_COLOR,
|
||||
gtk_widget_get_width (widget),
|
||||
gtk_widget_get_height (widget));
|
||||
@@ -110,11 +110,11 @@ drag_end (GtkGestureDrag *gesture,
|
||||
}
|
||||
|
||||
static void
|
||||
pressed (GtkGestureMultiPress *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *area)
|
||||
pressed (GtkGestureClick *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *area)
|
||||
{
|
||||
clear_surface ();
|
||||
gtk_widget_queue_draw (area);
|
||||
@@ -164,7 +164,7 @@ activate (GtkApplication *app,
|
||||
g_signal_connect (drag, "drag-update", G_CALLBACK (drag_update), drawing_area);
|
||||
g_signal_connect (drag, "drag-end", G_CALLBACK (drag_end), drawing_area);
|
||||
|
||||
press = gtk_gesture_multi_press_new ();
|
||||
press = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (press), GDK_BUTTON_SECONDARY);
|
||||
gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (press));
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "gdkdevice-broadway.h"
|
||||
|
||||
#include "gdksurface.h"
|
||||
#include "gdksurfaceprivate.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
|
||||
static gboolean gdk_broadway_device_get_history (GdkDevice *device,
|
||||
@@ -215,7 +215,7 @@ _gdk_broadway_surface_grab_check_destroy (GdkSurface *surface)
|
||||
/* Make sure there is no lasting grab in this native surface */
|
||||
grab = _gdk_display_get_last_device_grab (display, d->data);
|
||||
|
||||
if (grab && grab->native_surface == surface)
|
||||
if (grab && grab->surface == surface)
|
||||
{
|
||||
grab->serial_end = grab->serial_start;
|
||||
grab->implicit_ungrab = TRUE;
|
||||
@@ -251,7 +251,7 @@ gdk_broadway_device_grab (GdkDevice *device,
|
||||
{
|
||||
/* Device is a pointer */
|
||||
return _gdk_broadway_server_grab_pointer (broadway_display->server,
|
||||
GDK_SURFACE_IMPL_BROADWAY (surface->impl)->id,
|
||||
GDK_BROADWAY_SURFACE (surface)->id,
|
||||
owner_events,
|
||||
event_mask,
|
||||
time_);
|
||||
|
@@ -95,10 +95,10 @@ _gdk_broadway_display_size_changed (GdkDisplay *display,
|
||||
toplevels = broadway_display->toplevels;
|
||||
for (l = toplevels; l != NULL; l = l->next)
|
||||
{
|
||||
GdkSurfaceImplBroadway *toplevel_impl = l->data;
|
||||
GdkBroadwaySurface *toplevel = l->data;
|
||||
|
||||
if (toplevel_impl->maximized)
|
||||
gdk_surface_move_resize (toplevel_impl->wrapper, 0, 0, msg->width, msg->height);
|
||||
if (toplevel->maximized)
|
||||
gdk_surface_move_resize (GDK_SURFACE (toplevel), 0, 0, msg->width, msg->height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,7 +420,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
object_class->dispose = gdk_broadway_display_dispose;
|
||||
object_class->finalize = gdk_broadway_display_finalize;
|
||||
|
||||
display_class->surface_type = GDK_TYPE_BROADWAY_SURFACE;
|
||||
display_class->cairo_context_type = GDK_TYPE_BROADWAY_CAIRO_CONTEXT;
|
||||
|
||||
display_class->get_name = gdk_broadway_display_get_name;
|
||||
@@ -435,7 +434,7 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
|
||||
display_class->get_next_serial = gdk_broadway_display_get_next_serial;
|
||||
display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete;
|
||||
display_class->create_surface_impl = _gdk_broadway_display_create_surface_impl;
|
||||
display_class->create_surface = _gdk_broadway_display_create_surface;
|
||||
display_class->get_keymap = _gdk_broadway_display_get_keymap;
|
||||
display_class->text_property_to_utf8_list = _gdk_broadway_display_text_property_to_utf8_list;
|
||||
display_class->utf8_to_string_target = _gdk_broadway_display_utf8_to_string_target;
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "gdkdragprivate.h"
|
||||
|
||||
#include "gdkinternals.h"
|
||||
#include "gdksurfaceprivate.h"
|
||||
#include "gdkproperty.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
#include "gdkinternals.h"
|
||||
@@ -94,7 +94,7 @@ _gdk_broadway_surface_drag_begin (GdkSurface *surface,
|
||||
GdkDrag *new_context;
|
||||
|
||||
g_return_val_if_fail (surface != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_SURFACE_IS_BROADWAY (surface), NULL);
|
||||
g_return_val_if_fail (GDK_IS_BROADWAY_SURFACE (surface), NULL);
|
||||
|
||||
new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG,
|
||||
"device", device,
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include "gdkeventsource.h"
|
||||
#include "gdkseat.h"
|
||||
|
||||
#include "gdkinternals.h"
|
||||
#include "gdksurfaceprivate.h"
|
||||
#include "gdkframeclockprivate.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -288,6 +288,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface->x = message->configure_notify.x;
|
||||
surface->y = message->configure_notify.y;
|
||||
|
||||
gdk_broadway_surface_update_popups (surface);
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->any.surface = g_object_ref (surface);
|
||||
event->configure.x = message->configure_notify.x;
|
||||
|
@@ -68,6 +68,7 @@ void _gdk_broadway_roundtrip_notify (GdkSurface *surface,
|
||||
void _gdk_broadway_surface_grab_check_destroy (GdkSurface *surface);
|
||||
void _gdk_broadway_surface_grab_check_unmap (GdkSurface *surface,
|
||||
gulong serial);
|
||||
void gdk_broadway_surface_update_popups (GdkSurface *surface);
|
||||
|
||||
void _gdk_keymap_keys_changed (GdkDisplay *display);
|
||||
gint _gdk_broadway_get_group_for_state (GdkDisplay *display,
|
||||
@@ -101,10 +102,13 @@ void _gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
|
||||
void _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height);
|
||||
void _gdk_broadway_display_create_surface_impl (GdkDisplay *display,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *real_parent,
|
||||
GdkSurfaceAttr *attributes);
|
||||
GdkSurface * _gdk_broadway_display_create_surface (GdkDisplay *display,
|
||||
GdkSurfaceType surface_type,
|
||||
GdkSurface *parent,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
gint _gdk_broadway_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
@@ -126,6 +130,4 @@ void _gdk_broadway_surface_resize_surface (GdkSurface *surface);
|
||||
void _gdk_broadway_cursor_update_theme (GdkCursor *cursor);
|
||||
void _gdk_broadway_cursor_display_finalize (GdkDisplay *display);
|
||||
|
||||
#define GDK_SURFACE_IS_BROADWAY(win) (GDK_IS_SURFACE_IMPL_BROADWAY (((GdkSurface *)win)->impl))
|
||||
|
||||
#endif /* __GDK_PRIVATE_BROADWAY_H__ */
|
||||
|
@@ -29,51 +29,26 @@
|
||||
|
||||
#include "gdkbroadwaydisplay.h"
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdksurface.h"
|
||||
#include "gdksurfaceimpl.h"
|
||||
#include "gdksurfaceprivate.h"
|
||||
#include "gdkdisplay-broadway.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkeventsource.h"
|
||||
#include <gdk/gdktextureprivate.h>
|
||||
#include <gdk/gdkframeclockprivate.h>
|
||||
#include "gdktextureprivate.h"
|
||||
#include "gdkframeclockidleprivate.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Forward declarations */
|
||||
static void gdk_surface_impl_broadway_finalize (GObject *object);
|
||||
static void gdk_broadway_surface_finalize (GObject *object);
|
||||
|
||||
#define SURFACE_IS_TOPLEVEL(surface) \
|
||||
(GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD)
|
||||
|
||||
struct _GdkBroadwaySurface {
|
||||
GdkSurface parent;
|
||||
};
|
||||
|
||||
struct _GdkBroadwaySurfaceClass {
|
||||
GdkSurfaceClass parent_class;
|
||||
};
|
||||
#define SURFACE_IS_TOPLEVEL(surface) TRUE
|
||||
|
||||
G_DEFINE_TYPE (GdkBroadwaySurface, gdk_broadway_surface, GDK_TYPE_SURFACE)
|
||||
|
||||
static void
|
||||
gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *broadway_surface_class)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_surface_init (GdkBroadwaySurface *broadway_surface)
|
||||
{
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE (GdkSurfaceImplBroadway,
|
||||
gdk_surface_impl_broadway,
|
||||
GDK_TYPE_SURFACE_IMPL)
|
||||
|
||||
|
||||
/* We need to flush in an idle rather than AFTER_PAINT, as the clock
|
||||
is frozen during e.g. surface resizes so the paint will not happen
|
||||
and the surface resize request is never flushed. */
|
||||
@@ -84,26 +59,23 @@ queue_flush (GdkSurface *surface)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_impl_broadway_init (GdkSurfaceImplBroadway *impl)
|
||||
gdk_broadway_surface_init (GdkBroadwaySurface *impl)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_impl_broadway_finalize (GObject *object)
|
||||
gdk_broadway_surface_finalize (GObject *object)
|
||||
{
|
||||
GdkSurface *wrapper;
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE_IMPL_BROADWAY (object));
|
||||
g_return_if_fail (GDK_IS_BROADWAY_SURFACE (object));
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (object);
|
||||
impl = GDK_BROADWAY_SURFACE (object);
|
||||
|
||||
wrapper = impl->wrapper;
|
||||
_gdk_broadway_surface_grab_check_destroy (GDK_SURFACE (impl));
|
||||
|
||||
_gdk_broadway_surface_grab_check_destroy (wrapper);
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (impl->wrapper));
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (GDK_SURFACE (impl)));
|
||||
|
||||
g_hash_table_remove (broadway_display->id_ht, GINT_TO_POINTER(impl->id));
|
||||
|
||||
@@ -112,7 +84,7 @@ gdk_surface_impl_broadway_finalize (GObject *object)
|
||||
|
||||
broadway_display->toplevels = g_list_remove (broadway_display->toplevels, impl);
|
||||
|
||||
G_OBJECT_CLASS (gdk_surface_impl_broadway_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_surface_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -125,17 +97,17 @@ thaw_clock_cb (GdkFrameClock *clock)
|
||||
|
||||
void
|
||||
_gdk_broadway_roundtrip_notify (GdkSurface *surface,
|
||||
guint32 tag,
|
||||
gboolean local_reply)
|
||||
guint32 tag,
|
||||
gboolean local_reply)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
GdkBroadwaySurface *impl = GDK_BROADWAY_SURFACE (surface);
|
||||
GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
|
||||
GdkFrameTimings *timings;
|
||||
|
||||
timings = gdk_frame_clock_get_timings (clock, impl->pending_frame_counter);
|
||||
impl->pending_frame_counter = 0;
|
||||
|
||||
/* If there is no remove web client, rate limit update to once a second */
|
||||
/* If there is no remote web client, rate limit update to once a second */
|
||||
if (local_reply)
|
||||
g_timeout_add_seconds (1, (GSourceFunc)thaw_clock_cb, g_object_ref (clock));
|
||||
else
|
||||
@@ -152,16 +124,19 @@ _gdk_broadway_roundtrip_notify (GdkSurface *surface,
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
|
||||
_gdk_frame_clock_debug_print_timings (clock, timings);
|
||||
|
||||
if (gdk_profiler_is_running ())
|
||||
_gdk_frame_clock_add_timings_to_profiler (clock, timings);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
GdkSurface *surface)
|
||||
GdkSurface *surface)
|
||||
{
|
||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||
GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
GdkBroadwaySurface *impl = GDK_BROADWAY_SURFACE (surface);
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
impl->pending_frame_counter = gdk_frame_clock_get_frame_counter (clock);
|
||||
@@ -176,7 +151,7 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
|
||||
static void
|
||||
on_frame_clock_before_paint (GdkFrameClock *clock,
|
||||
GdkSurface *surface)
|
||||
GdkSurface *surface)
|
||||
{
|
||||
GdkFrameTimings *timings = gdk_frame_clock_get_current_timings (clock);
|
||||
gint64 presentation_time;
|
||||
@@ -201,30 +176,58 @@ on_frame_clock_before_paint (GdkFrameClock *clock,
|
||||
static void
|
||||
connect_frame_clock (GdkSurface *surface)
|
||||
{
|
||||
if (SURFACE_IS_TOPLEVEL (surface))
|
||||
{
|
||||
GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (surface);
|
||||
GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (surface);
|
||||
|
||||
g_signal_connect (frame_clock, "before-paint",
|
||||
G_CALLBACK (on_frame_clock_before_paint), surface);
|
||||
g_signal_connect (frame_clock, "after-paint",
|
||||
G_CALLBACK (on_frame_clock_after_paint), surface);
|
||||
}
|
||||
g_signal_connect (frame_clock, "before-paint",
|
||||
G_CALLBACK (on_frame_clock_before_paint), surface);
|
||||
g_signal_connect (frame_clock, "after-paint",
|
||||
G_CALLBACK (on_frame_clock_after_paint), surface);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_create_surface_impl (GdkDisplay *display,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *real_parent,
|
||||
GdkSurfaceAttr *attributes)
|
||||
static void
|
||||
disconnect_frame_clock (GdkSurface *surface)
|
||||
{
|
||||
GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (surface);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (frame_clock,
|
||||
on_frame_clock_before_paint, surface);
|
||||
g_signal_handlers_disconnect_by_func (frame_clock,
|
||||
on_frame_clock_after_paint, surface);
|
||||
}
|
||||
|
||||
GdkSurface *
|
||||
_gdk_broadway_display_create_surface (GdkDisplay *display,
|
||||
GdkSurfaceType surface_type,
|
||||
GdkSurface *parent,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
GdkFrameClock *frame_clock;
|
||||
GdkSurface *surface;
|
||||
GdkBroadwaySurface *impl;
|
||||
|
||||
frame_clock = _gdk_frame_clock_idle_new ();
|
||||
|
||||
surface = g_object_new (GDK_TYPE_BROADWAY_SURFACE,
|
||||
"surface-type", surface_type,
|
||||
"display", display,
|
||||
"frame-clock", frame_clock,
|
||||
NULL);
|
||||
|
||||
g_object_unref (frame_clock);
|
||||
|
||||
surface->parent = parent;
|
||||
surface->x = x;
|
||||
surface->y = y;
|
||||
surface->width = width;
|
||||
surface->height = height;
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
|
||||
impl = g_object_new (GDK_TYPE_SURFACE_IMPL_BROADWAY, NULL);
|
||||
surface->impl = (GdkSurfaceImpl *)impl;
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
impl->id = _gdk_broadway_server_new_surface (broadway_display->server,
|
||||
surface->x,
|
||||
surface->y,
|
||||
@@ -232,24 +235,20 @@ _gdk_broadway_display_create_surface_impl (GdkDisplay *display,
|
||||
surface->height,
|
||||
surface->surface_type == GDK_SURFACE_TEMP);
|
||||
g_hash_table_insert (broadway_display->id_ht, GINT_TO_POINTER(impl->id), surface);
|
||||
impl->wrapper = surface;
|
||||
|
||||
g_assert (surface->surface_type == GDK_SURFACE_TOPLEVEL ||
|
||||
surface->surface_type == GDK_SURFACE_TEMP);
|
||||
g_assert (surface->parent == NULL);
|
||||
|
||||
broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl);
|
||||
if (!surface->parent)
|
||||
broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl);
|
||||
|
||||
connect_frame_clock (surface);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
gdk_surface_broadway_ref_cairo_surface (GdkSurface *surface)
|
||||
gdk_broadway_surface_ref_cairo_surface (GdkSurface *surface)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
|
||||
if (GDK_IS_SURFACE_IMPL_BROADWAY (surface) &&
|
||||
GDK_SURFACE_DESTROYED (impl->wrapper))
|
||||
if (GDK_IS_BROADWAY_SURFACE (surface) &&
|
||||
GDK_SURFACE_DESTROYED (surface))
|
||||
return NULL;
|
||||
|
||||
return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
|
||||
@@ -257,15 +256,16 @@ gdk_surface_broadway_ref_cairo_surface (GdkSurface *surface)
|
||||
|
||||
static void
|
||||
_gdk_broadway_surface_destroy (GdkSurface *surface,
|
||||
gboolean recursing,
|
||||
gboolean foreign_destroy)
|
||||
gboolean foreign_destroy)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
|
||||
disconnect_frame_clock (surface);
|
||||
|
||||
if (impl->node_data)
|
||||
g_array_unref (impl->node_data);
|
||||
@@ -283,15 +283,15 @@ _gdk_broadway_surface_destroy (GdkSurface *surface,
|
||||
|
||||
void
|
||||
gdk_broadway_surface_set_nodes (GdkSurface *surface,
|
||||
GArray *nodes,
|
||||
GPtrArray *node_textures)
|
||||
GArray *nodes,
|
||||
GPtrArray *node_textures)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (surface));
|
||||
|
||||
@@ -322,13 +322,13 @@ gdk_broadway_surface_destroy_notify (GdkSurface *surface)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_show (GdkSurface *surface,
|
||||
gboolean already_mapped)
|
||||
gdk_broadway_surface_show (GdkSurface *surface,
|
||||
gboolean already_mapped)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
impl->visible = TRUE;
|
||||
|
||||
/* FIXME: update state ? */
|
||||
@@ -340,12 +340,12 @@ gdk_surface_broadway_show (GdkSurface *surface,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_hide (GdkSurface *surface)
|
||||
gdk_broadway_surface_hide (GdkSurface *surface)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
impl->visible = FALSE;
|
||||
|
||||
/* FIXME: update state ? */
|
||||
@@ -362,20 +362,20 @@ gdk_surface_broadway_hide (GdkSurface *surface)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_withdraw (GdkSurface *surface)
|
||||
gdk_broadway_surface_withdraw (GdkSurface *surface)
|
||||
{
|
||||
gdk_surface_broadway_hide (surface);
|
||||
gdk_broadway_surface_hide (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_move_resize (GdkSurface *surface,
|
||||
gdk_broadway_surface_move_resize (GdkSurface *surface,
|
||||
gboolean with_move,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
GdkBroadwaySurface *impl = GDK_BROADWAY_SURFACE (surface);
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
gboolean size_changed;
|
||||
|
||||
@@ -405,6 +405,12 @@ gdk_surface_broadway_move_resize (GdkSurface *surface,
|
||||
}
|
||||
}
|
||||
|
||||
if (surface->parent)
|
||||
{
|
||||
impl->offset_x = x - surface->parent->x;
|
||||
impl->offset_y = y - surface->parent->y;
|
||||
}
|
||||
|
||||
_gdk_broadway_server_surface_move_resize (broadway_display->server,
|
||||
impl->id,
|
||||
with_move,
|
||||
@@ -419,19 +425,19 @@ gdk_surface_broadway_move_resize (GdkSurface *surface,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_raise (GdkSurface *surface)
|
||||
gdk_broadway_surface_raise (GdkSurface *surface)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_restack_toplevel (GdkSurface *surface,
|
||||
gdk_broadway_surface_restack_toplevel (GdkSurface *surface,
|
||||
GdkSurface *sibling,
|
||||
gboolean above)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_lower (GdkSurface *surface)
|
||||
gdk_broadway_surface_lower (GdkSurface *surface)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -440,7 +446,7 @@ static void
|
||||
gdk_broadway_surface_focus (GdkSurface *surface,
|
||||
guint32 timestamp)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
@@ -449,7 +455,7 @@ gdk_broadway_surface_focus (GdkSurface *surface,
|
||||
!surface->accept_focus)
|
||||
return;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (surface));
|
||||
_gdk_broadway_server_surface_focus (broadway_display->server,
|
||||
impl->id);
|
||||
@@ -474,26 +480,26 @@ gdk_broadway_surface_set_modal_hint (GdkSurface *surface,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_surface_set_geometry_hints (GdkSurface *surface,
|
||||
gdk_broadway_surface_set_geometry_hints (GdkSurface *surface,
|
||||
const GdkGeometry *geometry,
|
||||
GdkSurfaceHints geom_mask)
|
||||
GdkSurfaceHints geom_mask)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
|
||||
impl->geometry_hints = *geometry;
|
||||
impl->geometry_hints_mask = geom_mask;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_surface_set_title (GdkSurface *surface,
|
||||
gdk_broadway_surface_set_title (GdkSurface *surface,
|
||||
const gchar *title)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_surface_set_startup_id (GdkSurface *surface,
|
||||
gdk_broadway_surface_set_startup_id (GdkSurface *surface,
|
||||
const gchar *startup_id)
|
||||
{
|
||||
}
|
||||
@@ -503,80 +509,58 @@ gdk_broadway_surface_set_transient_for (GdkSurface *surface,
|
||||
GdkSurface *parent)
|
||||
{
|
||||
GdkBroadwayDisplay *display;
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
int parent_id;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
|
||||
parent_id = 0;
|
||||
if (parent)
|
||||
parent_id = GDK_SURFACE_IMPL_BROADWAY (parent->impl)->id;
|
||||
parent_id = GDK_BROADWAY_SURFACE (parent)->id;
|
||||
|
||||
impl->transient_for = parent_id;
|
||||
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (impl->wrapper));
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (surface));
|
||||
_gdk_broadway_server_surface_set_transient_for (display->server, impl->id, impl->transient_for);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_get_geometry (GdkSurface *surface,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height)
|
||||
gdk_broadway_surface_get_geometry (GdkSurface *surface,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
|
||||
/* TODO: These should really roundtrip to the client to get the current data */
|
||||
|
||||
if (x)
|
||||
*x = impl->wrapper->x;
|
||||
*x = surface->x;
|
||||
if (y)
|
||||
*y = impl->wrapper->y;
|
||||
*y = surface->y;
|
||||
if (width)
|
||||
*width = impl->wrapper->width;
|
||||
*width = surface->width;
|
||||
if (height)
|
||||
*height = impl->wrapper->height;
|
||||
*height = surface->height;
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_get_root_coords (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y,
|
||||
gint *root_x,
|
||||
gint *root_y)
|
||||
gdk_broadway_surface_get_root_coords (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y,
|
||||
gint *root_x,
|
||||
gint *root_y)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
|
||||
if (root_x)
|
||||
*root_x = x + impl->wrapper->x;
|
||||
*root_x = x + surface->x;
|
||||
if (root_y)
|
||||
*root_y = y + impl->wrapper->y;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_surface_get_frame_extents (GdkSurface *surface,
|
||||
GdkRectangle *rect)
|
||||
{
|
||||
g_return_if_fail (rect != NULL);
|
||||
|
||||
/* TODO: This should take wm frame into account */
|
||||
|
||||
rect->x = surface->x;
|
||||
rect->y = surface->y;
|
||||
rect->width = surface->width;
|
||||
rect->height = surface->height;
|
||||
*root_y = y + surface->y;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_surface_broadway_get_device_state (GdkSurface *surface,
|
||||
gdk_broadway_surface_get_device_state (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
@@ -597,7 +581,7 @@ gdk_surface_broadway_get_device_state (GdkSurface *surface,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_broadway_input_shape_combine_region (GdkSurface *surface,
|
||||
gdk_broadway_surface_input_shape_combine_region (GdkSurface *surface,
|
||||
const cairo_region_t *shape_region,
|
||||
gint offset_x,
|
||||
gint offset_y)
|
||||
@@ -684,7 +668,7 @@ gdk_broadway_surface_unstick (GdkSurface *surface)
|
||||
static void
|
||||
gdk_broadway_surface_maximize (GdkSurface *surface)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
GdkDisplay *display;
|
||||
GdkMonitor *monitor;
|
||||
GdkRectangle geom;
|
||||
@@ -693,7 +677,7 @@ gdk_broadway_surface_maximize (GdkSurface *surface)
|
||||
!SURFACE_IS_TOPLEVEL (surface))
|
||||
return;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
|
||||
if (impl->maximized)
|
||||
return;
|
||||
@@ -719,13 +703,13 @@ gdk_broadway_surface_maximize (GdkSurface *surface)
|
||||
static void
|
||||
gdk_broadway_surface_unmaximize (GdkSurface *surface)
|
||||
{
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface) ||
|
||||
!SURFACE_IS_TOPLEVEL (surface))
|
||||
return;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
|
||||
if (!impl->maximized)
|
||||
return;
|
||||
@@ -816,6 +800,24 @@ gdk_broadway_surface_set_functions (GdkSurface *surface,
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_broadway_surface_update_popups (GdkSurface *parent)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = parent ->children; l; l = l->next)
|
||||
{
|
||||
GdkBroadwaySurface *popup_impl = l->data;
|
||||
GdkSurface *popup = GDK_SURFACE (popup_impl);
|
||||
int new_x = parent->x + popup_impl->offset_x;
|
||||
int new_y = parent->y + popup_impl->offset_y;
|
||||
|
||||
if (new_x != popup->x || new_y != popup->y)
|
||||
gdk_broadway_surface_move_resize (popup, TRUE, new_x, new_y, popup->width, popup->height);
|
||||
gdk_broadway_surface_restack_toplevel (popup, parent, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct _MoveResizeData MoveResizeData;
|
||||
|
||||
struct _MoveResizeData
|
||||
@@ -1080,10 +1082,11 @@ create_moveresize_surface (MoveResizeData *mv_resize,
|
||||
GdkGrabStatus status;
|
||||
GdkSeat *seat;
|
||||
GdkDevice *pointer;
|
||||
GdkRectangle rect = { -100, -100, 1, 1 };
|
||||
|
||||
g_assert (mv_resize->moveresize_emulation_surface == NULL);
|
||||
|
||||
mv_resize->moveresize_emulation_surface = gdk_surface_new_temp (mv_resize->display);
|
||||
mv_resize->moveresize_emulation_surface = gdk_surface_new_temp (mv_resize->display, &rect);
|
||||
|
||||
gdk_surface_show (mv_resize->moveresize_emulation_surface);
|
||||
|
||||
@@ -1115,8 +1118,7 @@ create_moveresize_surface (MoveResizeData *mv_resize,
|
||||
static void
|
||||
calculate_unmoving_origin (MoveResizeData *mv_resize)
|
||||
{
|
||||
GdkRectangle rect;
|
||||
gint width, height;
|
||||
gint x, y, width, height;
|
||||
|
||||
if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY &&
|
||||
mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC)
|
||||
@@ -1127,52 +1129,51 @@ calculate_unmoving_origin (MoveResizeData *mv_resize)
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_surface_get_frame_extents (mv_resize->moveresize_surface, &rect);
|
||||
gdk_surface_get_geometry (mv_resize->moveresize_surface,
|
||||
NULL, NULL, &width, &height);
|
||||
&x, &y, &width, &height);
|
||||
|
||||
switch (mv_resize->moveresize_geometry.win_gravity)
|
||||
{
|
||||
case GDK_GRAVITY_NORTH_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
mv_resize->moveresize_orig_x = x;
|
||||
mv_resize->moveresize_orig_y = y;
|
||||
break;
|
||||
case GDK_GRAVITY_NORTH:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
mv_resize->moveresize_orig_x = x + width / 2;
|
||||
mv_resize->moveresize_orig_y = y;
|
||||
break;
|
||||
case GDK_GRAVITY_NORTH_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
mv_resize->moveresize_orig_x = x = width;
|
||||
mv_resize->moveresize_orig_y = y;
|
||||
break;
|
||||
case GDK_GRAVITY_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
mv_resize->moveresize_orig_x = x;
|
||||
mv_resize->moveresize_orig_y = y + height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_CENTER:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
mv_resize->moveresize_orig_x = x + width / 2;
|
||||
mv_resize->moveresize_orig_y = y + height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
mv_resize->moveresize_orig_x = x + width;
|
||||
mv_resize->moveresize_orig_y = y + height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
mv_resize->moveresize_orig_x = x + width;
|
||||
mv_resize->moveresize_orig_y = y + height;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
mv_resize->moveresize_orig_x = x + width / 2;
|
||||
mv_resize->moveresize_orig_y = y + height;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
mv_resize->moveresize_orig_x = x;
|
||||
mv_resize->moveresize_orig_y = y + height;
|
||||
break;
|
||||
case GDK_GRAVITY_STATIC:
|
||||
default:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
mv_resize->moveresize_orig_x = x;
|
||||
mv_resize->moveresize_orig_y = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1188,9 +1189,9 @@ gdk_broadway_surface_begin_resize_drag (GdkSurface *surface,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MoveResizeData *mv_resize;
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface) ||
|
||||
!SURFACE_IS_TOPLEVEL (surface))
|
||||
@@ -1207,8 +1208,8 @@ gdk_broadway_surface_begin_resize_drag (GdkSurface *surface,
|
||||
mv_resize->is_resize = TRUE;
|
||||
mv_resize->moveresize_button = button;
|
||||
mv_resize->resize_edge = edge;
|
||||
mv_resize->moveresize_x = x + impl->wrapper->x;
|
||||
mv_resize->moveresize_y = y + impl->wrapper->y;
|
||||
mv_resize->moveresize_x = x + surface->x;
|
||||
mv_resize->moveresize_y = y + surface->y;
|
||||
mv_resize->moveresize_surface = g_object_ref (surface);
|
||||
|
||||
mv_resize->moveresize_orig_width = gdk_surface_get_width (surface);
|
||||
@@ -1231,9 +1232,9 @@ gdk_broadway_surface_begin_move_drag (GdkSurface *surface,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MoveResizeData *mv_resize;
|
||||
GdkSurfaceImplBroadway *impl;
|
||||
GdkBroadwaySurface *impl;
|
||||
|
||||
impl = GDK_SURFACE_IMPL_BROADWAY (surface->impl);
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface) ||
|
||||
!SURFACE_IS_TOPLEVEL (surface))
|
||||
@@ -1249,8 +1250,8 @@ gdk_broadway_surface_begin_move_drag (GdkSurface *surface,
|
||||
|
||||
mv_resize->is_resize = FALSE;
|
||||
mv_resize->moveresize_button = button;
|
||||
mv_resize->moveresize_x = x + impl->wrapper->x;
|
||||
mv_resize->moveresize_y = y + impl->wrapper->y;
|
||||
mv_resize->moveresize_x = x + surface->x;
|
||||
mv_resize->moveresize_y = y + surface->y;
|
||||
mv_resize->moveresize_surface = g_object_ref (surface);
|
||||
|
||||
mv_resize->moveresize_orig_width = gdk_surface_get_width (surface);
|
||||
@@ -1296,25 +1297,25 @@ gdk_broadway_get_last_seen_time (GdkSurface *surface)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_impl_broadway_class_init (GdkSurfaceImplBroadwayClass *klass)
|
||||
gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass);
|
||||
GdkSurfaceClass *impl_class = GDK_SURFACE_CLASS (klass);
|
||||
|
||||
object_class->finalize = gdk_surface_impl_broadway_finalize;
|
||||
object_class->finalize = gdk_broadway_surface_finalize;
|
||||
|
||||
impl_class->ref_cairo_surface = gdk_surface_broadway_ref_cairo_surface;
|
||||
impl_class->show = gdk_surface_broadway_show;
|
||||
impl_class->hide = gdk_surface_broadway_hide;
|
||||
impl_class->withdraw = gdk_surface_broadway_withdraw;
|
||||
impl_class->raise = gdk_surface_broadway_raise;
|
||||
impl_class->lower = gdk_surface_broadway_lower;
|
||||
impl_class->restack_toplevel = gdk_surface_broadway_restack_toplevel;
|
||||
impl_class->move_resize = gdk_surface_broadway_move_resize;
|
||||
impl_class->get_geometry = gdk_surface_broadway_get_geometry;
|
||||
impl_class->get_root_coords = gdk_surface_broadway_get_root_coords;
|
||||
impl_class->get_device_state = gdk_surface_broadway_get_device_state;
|
||||
impl_class->input_shape_combine_region = gdk_surface_broadway_input_shape_combine_region;
|
||||
impl_class->ref_cairo_surface = gdk_broadway_surface_ref_cairo_surface;
|
||||
impl_class->show = gdk_broadway_surface_show;
|
||||
impl_class->hide = gdk_broadway_surface_hide;
|
||||
impl_class->withdraw = gdk_broadway_surface_withdraw;
|
||||
impl_class->raise = gdk_broadway_surface_raise;
|
||||
impl_class->lower = gdk_broadway_surface_lower;
|
||||
impl_class->restack_toplevel = gdk_broadway_surface_restack_toplevel;
|
||||
impl_class->move_resize = gdk_broadway_surface_move_resize;
|
||||
impl_class->get_geometry = gdk_broadway_surface_get_geometry;
|
||||
impl_class->get_root_coords = gdk_broadway_surface_get_root_coords;
|
||||
impl_class->get_device_state = gdk_broadway_surface_get_device_state;
|
||||
impl_class->input_shape_combine_region = gdk_broadway_surface_input_shape_combine_region;
|
||||
impl_class->destroy = _gdk_broadway_surface_destroy;
|
||||
impl_class->beep = gdk_broadway_surface_beep;
|
||||
|
||||
@@ -1326,7 +1327,6 @@ gdk_surface_impl_broadway_class_init (GdkSurfaceImplBroadwayClass *klass)
|
||||
impl_class->set_title = gdk_broadway_surface_set_title;
|
||||
impl_class->set_startup_id = gdk_broadway_surface_set_startup_id;
|
||||
impl_class->set_transient_for = gdk_broadway_surface_set_transient_for;
|
||||
impl_class->get_frame_extents = gdk_broadway_surface_get_frame_extents;
|
||||
impl_class->set_accept_focus = gdk_broadway_surface_set_accept_focus;
|
||||
impl_class->set_focus_on_map = gdk_broadway_surface_set_focus_on_map;
|
||||
impl_class->set_icon_list = gdk_broadway_surface_set_icon_list;
|
||||
|
@@ -25,28 +25,17 @@
|
||||
#ifndef __GDK_SURFACE_BROADWAY_H__
|
||||
#define __GDK_SURFACE_BROADWAY_H__
|
||||
|
||||
#include <gdk/gdksurfaceimpl.h>
|
||||
#include <gdk/gdksurfaceprivate.h>
|
||||
#include "gdkbroadwaysurface.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkSurfaceImplBroadway GdkSurfaceImplBroadway;
|
||||
typedef struct _GdkSurfaceImplBroadwayClass GdkSurfaceImplBroadwayClass;
|
||||
|
||||
/* Surface implementation for Broadway
|
||||
*/
|
||||
|
||||
#define GDK_TYPE_SURFACE_IMPL_BROADWAY (gdk_surface_impl_broadway_get_type ())
|
||||
#define GDK_SURFACE_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadway))
|
||||
#define GDK_SURFACE_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadwayClass))
|
||||
#define GDK_IS_SURFACE_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_BROADWAY))
|
||||
#define GDK_IS_SURFACE_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_BROADWAY))
|
||||
#define GDK_SURFACE_IMPL_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadwayClass))
|
||||
|
||||
struct _GdkSurfaceImplBroadway
|
||||
struct _GdkBroadwaySurface
|
||||
{
|
||||
GdkSurfaceImpl parent_instance;
|
||||
|
||||
GdkSurface *wrapper;
|
||||
GdkSurface parent_instance;
|
||||
|
||||
GdkCursor *cursor;
|
||||
|
||||
@@ -71,14 +60,17 @@ struct _GdkSurfaceImplBroadway
|
||||
|
||||
GArray *node_data;
|
||||
GPtrArray *node_data_textures;
|
||||
|
||||
int offset_x;
|
||||
int offset_y;
|
||||
};
|
||||
|
||||
struct _GdkSurfaceImplBroadwayClass
|
||||
struct _GdkBroadwaySurfaceClass
|
||||
{
|
||||
GdkSurfaceImplClass parent_class;
|
||||
GdkSurfaceClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_surface_impl_broadway_get_type (void);
|
||||
GType gdk_surface_broadway_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -1,224 +0,0 @@
|
||||
/* sp-capture-types.h
|
||||
*
|
||||
* Copyright © 2016 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This file 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 file 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 General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SP_CAPTURE_FORMAT_H
|
||||
#define SP_CAPTURE_FORMAT_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifndef SP_DISABLE_GOBJECT
|
||||
# include <glib-object.h>
|
||||
#endif
|
||||
|
||||
#include "sp-clock.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define SP_CAPTURE_MAGIC (GUINT32_TO_LE(0xFDCA975E))
|
||||
#define SP_CAPTURE_ALIGN (sizeof(SpCaptureAddress))
|
||||
|
||||
#if __WORDSIZE == 64
|
||||
# define SP_CAPTURE_JITMAP_MARK G_GUINT64_CONSTANT(0xE000000000000000)
|
||||
# define SP_CAPTURE_ADDRESS_FORMAT "0x%016lx"
|
||||
#else
|
||||
# define SP_CAPTURE_JITMAP_MARK G_GUINT64_CONSTANT(0xE0000000)
|
||||
# define SP_CAPTURE_ADDRESS_FORMAT "0x%016llx"
|
||||
#endif
|
||||
|
||||
#define SP_CAPTURE_CURRENT_TIME (sp_clock_get_current_time())
|
||||
#define SP_CAPTURE_COUNTER_INT64 0
|
||||
#define SP_CAPTURE_COUNTER_DOUBLE 1
|
||||
|
||||
typedef struct _SpCaptureReader SpCaptureReader;
|
||||
typedef struct _SpCaptureWriter SpCaptureWriter;
|
||||
typedef struct _SpCaptureCursor SpCaptureCursor;
|
||||
typedef struct _SpCaptureCondition SpCaptureCondition;
|
||||
|
||||
typedef guint64 SpCaptureAddress;
|
||||
|
||||
typedef union
|
||||
{
|
||||
gint64 v64;
|
||||
gdouble vdbl;
|
||||
} SpCaptureCounterValue;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SP_CAPTURE_FRAME_TIMESTAMP = 1,
|
||||
SP_CAPTURE_FRAME_SAMPLE = 2,
|
||||
SP_CAPTURE_FRAME_MAP = 3,
|
||||
SP_CAPTURE_FRAME_PROCESS = 4,
|
||||
SP_CAPTURE_FRAME_FORK = 5,
|
||||
SP_CAPTURE_FRAME_EXIT = 6,
|
||||
SP_CAPTURE_FRAME_JITMAP = 7,
|
||||
SP_CAPTURE_FRAME_CTRDEF = 8,
|
||||
SP_CAPTURE_FRAME_CTRSET = 9,
|
||||
SP_CAPTURE_FRAME_MARK = 10,
|
||||
} SpCaptureFrameType;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guint32 magic;
|
||||
guint8 version;
|
||||
guint32 little_endian : 1;
|
||||
guint32 padding : 23;
|
||||
gchar capture_time[64];
|
||||
gint64 time;
|
||||
gint64 end_time;
|
||||
gchar suffix[168];
|
||||
} SpCaptureFileHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guint16 len;
|
||||
gint16 cpu;
|
||||
gint32 pid;
|
||||
gint64 time;
|
||||
guint8 type;
|
||||
guint64 padding : 56;
|
||||
guint8 data[0];
|
||||
} SpCaptureFrame;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
guint64 start;
|
||||
guint64 end;
|
||||
guint64 offset;
|
||||
guint64 inode;
|
||||
gchar filename[0];
|
||||
} SpCaptureMap;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
guint32 n_jitmaps;
|
||||
guint8 data[0];
|
||||
} SpCaptureJitmap;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
gchar cmdline[0];
|
||||
} SpCaptureProcess;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
guint16 n_addrs;
|
||||
guint64 padding : 48;
|
||||
SpCaptureAddress addrs[0];
|
||||
} SpCaptureSample;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
GPid child_pid;
|
||||
} SpCaptureFork;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
} SpCaptureExit;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
} SpCaptureTimestamp;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gchar category[32];
|
||||
gchar name[32];
|
||||
gchar description[52];
|
||||
guint32 id : 24;
|
||||
guint8 type;
|
||||
SpCaptureCounterValue value;
|
||||
} SpCaptureCounter;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
guint16 n_counters;
|
||||
guint64 padding : 48;
|
||||
SpCaptureCounter counters[0];
|
||||
} SpCaptureFrameCounterDefine;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/*
|
||||
* 96 bytes might seem a bit odd, but the counter frame header is 32
|
||||
* bytes. So this makes a nice 2-cacheline aligned size which is
|
||||
* useful when the number of counters is rather small.
|
||||
*/
|
||||
guint32 ids[8];
|
||||
SpCaptureCounterValue values[8];
|
||||
} SpCaptureCounterValues;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
guint16 n_values;
|
||||
guint64 padding : 48;
|
||||
SpCaptureCounterValues values[0];
|
||||
} SpCaptureFrameCounterSet;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SpCaptureFrame frame;
|
||||
gint64 duration;
|
||||
gchar group[24];
|
||||
gchar name[40];
|
||||
gchar message[0];
|
||||
} SpCaptureMark;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureFileHeader) == 256);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureFrame) == 24);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureMap) == 56);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureJitmap) == 28);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureProcess) == 24);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureSample) == 32);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureFork) == 28);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureExit) == 24);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureTimestamp) == 24);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureCounter) == 128);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureCounterValues) == 96);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureFrameCounterDefine) == 32);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureFrameCounterSet) == 32);
|
||||
G_STATIC_ASSERT (sizeof (SpCaptureMark) == 96);
|
||||
|
||||
static inline gint
|
||||
sp_capture_address_compare (SpCaptureAddress a,
|
||||
SpCaptureAddress b)
|
||||
{
|
||||
if (a < b)
|
||||
return -1;
|
||||
if (a > b)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* SP_CAPTURE_FORMAT_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,132 +0,0 @@
|
||||
/* sp-capture-writer.h
|
||||
*
|
||||
* Copyright © 2016 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This file 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 file 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 General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SP_CAPTURE_WRITER_H
|
||||
#define SP_CAPTURE_WRITER_H
|
||||
|
||||
#include "capture/sp-capture-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _SpCaptureWriter SpCaptureWriter;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/*
|
||||
* The number of frames indexed by SpCaptureFrameType
|
||||
*/
|
||||
gsize frame_count[16];
|
||||
|
||||
/*
|
||||
* Padding for future expansion.
|
||||
*/
|
||||
gsize padding[48];
|
||||
} SpCaptureStat;
|
||||
|
||||
SpCaptureWriter *sp_capture_writer_new (const gchar *filename,
|
||||
gsize buffer_size);
|
||||
SpCaptureWriter *sp_capture_writer_new_from_fd (int fd,
|
||||
gsize buffer_size);
|
||||
SpCaptureWriter *sp_capture_writer_ref (SpCaptureWriter *self);
|
||||
void sp_capture_writer_unref (SpCaptureWriter *self);
|
||||
void sp_capture_writer_stat (SpCaptureWriter *self,
|
||||
SpCaptureStat *stat);
|
||||
gboolean sp_capture_writer_add_map (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid,
|
||||
guint64 start,
|
||||
guint64 end,
|
||||
guint64 offset,
|
||||
guint64 inode,
|
||||
const gchar *filename);
|
||||
gboolean sp_capture_writer_add_mark (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid,
|
||||
guint64 duration,
|
||||
const gchar *group,
|
||||
const gchar *name,
|
||||
const gchar *message);
|
||||
guint64 sp_capture_writer_add_jitmap (SpCaptureWriter *self,
|
||||
const gchar *name);
|
||||
gboolean sp_capture_writer_add_process (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid,
|
||||
const gchar *cmdline);
|
||||
gboolean sp_capture_writer_add_sample (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid,
|
||||
const SpCaptureAddress *addrs,
|
||||
guint n_addrs);
|
||||
gboolean sp_capture_writer_add_fork (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid,
|
||||
GPid child_pid);
|
||||
gboolean sp_capture_writer_add_exit (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid);
|
||||
gboolean sp_capture_writer_add_timestamp (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid);
|
||||
gboolean sp_capture_writer_define_counters (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid,
|
||||
const SpCaptureCounter *counters,
|
||||
guint n_counters);
|
||||
gboolean sp_capture_writer_set_counters (SpCaptureWriter *self,
|
||||
gint64 time,
|
||||
gint cpu,
|
||||
GPid pid,
|
||||
const guint *counters_ids,
|
||||
const SpCaptureCounterValue *values,
|
||||
guint n_counters);
|
||||
gboolean sp_capture_writer_flush (SpCaptureWriter *self);
|
||||
gboolean sp_capture_writer_save_as (SpCaptureWriter *self,
|
||||
const gchar *filename,
|
||||
GError **error);
|
||||
gint sp_capture_writer_request_counter (SpCaptureWriter *self,
|
||||
guint n_counters);
|
||||
SpCaptureReader *sp_capture_writer_create_reader (SpCaptureWriter *self,
|
||||
GError **error);
|
||||
gboolean sp_capture_writer_splice (SpCaptureWriter *self,
|
||||
SpCaptureWriter *dest,
|
||||
GError **error);
|
||||
gboolean _sp_capture_writer_splice_from_fd (SpCaptureWriter *self,
|
||||
int fd,
|
||||
GError **error) G_GNUC_INTERNAL;
|
||||
|
||||
#ifndef SP_DISABLE_GOBJECT
|
||||
# define SP_TYPE_CAPTURE_WRITER (sp_capture_writer_get_type())
|
||||
GType sp_capture_writer_get_type (void);
|
||||
#endif
|
||||
|
||||
#if GLIB_CHECK_VERSION(2, 44, 0)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpCaptureWriter, sp_capture_writer_unref)
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* SP_CAPTURE_WRITER_H */
|
||||
|
@@ -1,52 +0,0 @@
|
||||
/* sp-clock.c
|
||||
*
|
||||
* Copyright © 2016 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This file 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 file 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 General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "sp-clock.h"
|
||||
|
||||
gint sp_clock = -1;
|
||||
|
||||
void
|
||||
sp_clock_init (void)
|
||||
{
|
||||
static const gint clock_ids[] = {
|
||||
CLOCK_MONOTONIC_RAW,
|
||||
CLOCK_MONOTONIC_COARSE,
|
||||
CLOCK_MONOTONIC,
|
||||
CLOCK_REALTIME_COARSE,
|
||||
CLOCK_REALTIME,
|
||||
};
|
||||
guint i;
|
||||
|
||||
if (sp_clock != -1)
|
||||
return;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (clock_ids); i++)
|
||||
{
|
||||
struct timespec ts;
|
||||
int clock_id = clock_ids [i];
|
||||
|
||||
if (0 == clock_gettime (clock_id, &ts))
|
||||
{
|
||||
sp_clock = clock_id;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
@@ -1,55 +0,0 @@
|
||||
/* sp-clock.h
|
||||
*
|
||||
* Copyright © 2016 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This file 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 file 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 General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SP_CLOCK_H
|
||||
#define SP_CLOCK_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <time.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef gint SpClock;
|
||||
typedef gint64 SpTimeStamp;
|
||||
typedef gint32 SpTimeSpan;
|
||||
|
||||
extern SpClock sp_clock;
|
||||
|
||||
static inline SpTimeStamp
|
||||
sp_clock_get_current_time (void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
clock_gettime (sp_clock, &ts);
|
||||
|
||||
return (ts.tv_sec * G_GINT64_CONSTANT (1000000000)) + ts.tv_nsec;
|
||||
}
|
||||
|
||||
static inline SpTimeSpan
|
||||
sp_clock_get_relative_time (SpTimeStamp epoch)
|
||||
{
|
||||
return sp_clock_get_current_time () - epoch;
|
||||
}
|
||||
|
||||
void sp_clock_init (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* SP_CLOCK_H */
|
||||
|
||||
|
@@ -213,8 +213,8 @@ gdk_pre_parse (void)
|
||||
(GDebugKey *) gdk_debug_keys,
|
||||
G_N_ELEMENTS (gdk_debug_keys));
|
||||
|
||||
if (g_getenv ("SYSPROF_TRACE_FD"))
|
||||
gdk_profiler_start (atoi (g_getenv ("SYSPROF_TRACE_FD")));
|
||||
if (g_getenv ("GTK_TRACE_FD"))
|
||||
gdk_profiler_start (atoi (g_getenv ("GTK_TRACE_FD")));
|
||||
else if (g_getenv ("GTK_TRACE"))
|
||||
gdk_profiler_start (-1);
|
||||
}
|
||||
|
@@ -79,15 +79,7 @@ struct _GdkContentProviderClass
|
||||
GError **error);
|
||||
|
||||
/*< private >*/
|
||||
/* Padding for future expansion */
|
||||
void (*_gdk_reserved1) (void);
|
||||
void (*_gdk_reserved2) (void);
|
||||
void (*_gdk_reserved3) (void);
|
||||
void (*_gdk_reserved4) (void);
|
||||
void (*_gdk_reserved5) (void);
|
||||
void (*_gdk_reserved6) (void);
|
||||
void (*_gdk_reserved7) (void);
|
||||
void (*_gdk_reserved8) (void);
|
||||
gpointer padding[8];
|
||||
};
|
||||
|
||||
|
||||
|
@@ -314,7 +314,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -330,7 +330,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1, GDK_TYPE_DEVICE_TOOL);
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ gdk_device_get_property (GObject *object,
|
||||
* Gets the current state of a pointer device relative to @surface. As a slave
|
||||
* device’s coordinates are those of its master pointer, this
|
||||
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
|
||||
* unless there is an ongoing grab on them. See gdk_device_grab().
|
||||
* unless there is an ongoing grab on them. See gdk_seat_grab().
|
||||
*/
|
||||
void
|
||||
gdk_device_get_state (GdkDevice *device,
|
||||
@@ -528,24 +528,20 @@ gdk_device_get_state (GdkDevice *device,
|
||||
GDK_DEVICE_GET_CLASS (device)->get_state (device, surface, axes, mask);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* gdk_device_get_position:
|
||||
* @device: pointer device to query status about.
|
||||
* @x: (out) (allow-none): location to store root window X coordinate of @device, or %NULL.
|
||||
* @y: (out) (allow-none): location to store root window Y coordinate of @device, or %NULL.
|
||||
* @x: (out): location to store root window X coordinate of @device
|
||||
* @y: (out): location to store root window Y coordinate of @device
|
||||
*
|
||||
* Gets the current location of @device in double precision. As a slave device's
|
||||
* coordinates are those of its master pointer, this function
|
||||
* may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
|
||||
* unless there is an ongoing grab on them. See gdk_device_grab().
|
||||
**/
|
||||
* Gets the current location of @device in double precision.
|
||||
*/
|
||||
void
|
||||
gdk_device_get_position (GdkDevice *device,
|
||||
double *x,
|
||||
double *y)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
gdouble tmp_x, tmp_y;
|
||||
|
||||
g_return_if_fail (GDK_IS_DEVICE (device));
|
||||
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
|
||||
@@ -555,16 +551,7 @@ gdk_device_get_position (GdkDevice *device,
|
||||
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
|
||||
gdk_display_device_is_grabbed (display, device));
|
||||
|
||||
_gdk_device_query_state (device,
|
||||
NULL,
|
||||
NULL,
|
||||
&tmp_x, &tmp_y,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if (x)
|
||||
*x = tmp_x;
|
||||
if (y)
|
||||
*y = tmp_y;
|
||||
_gdk_device_query_state (device, NULL, NULL, x, y, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -581,7 +568,7 @@ gdk_device_get_position (GdkDevice *device,
|
||||
*
|
||||
* As a slave device coordinates are those of its master pointer, This
|
||||
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
|
||||
* unless there is an ongoing grab on them, see gdk_device_grab().
|
||||
* unless there is an ongoing grab on them, see gdk_seat_grab().
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the #GdkSurface under the
|
||||
* device position, or %NULL.
|
||||
@@ -601,13 +588,6 @@ gdk_device_get_surface_at_position (GdkDevice *device,
|
||||
|
||||
surface = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL, FALSE);
|
||||
|
||||
/* This might need corrections, as the native surface returned
|
||||
may contain client side children */
|
||||
if (surface)
|
||||
surface = _gdk_surface_find_descendant_at (surface,
|
||||
tmp_x, tmp_y,
|
||||
&tmp_x, &tmp_y);
|
||||
|
||||
if (win_x)
|
||||
*win_x = tmp_x;
|
||||
if (win_y)
|
||||
@@ -1244,7 +1224,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
|
||||
|
||||
GdkGrabStatus
|
||||
gdk_device_grab (GdkDevice *device,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *surface,
|
||||
GdkGrabOwnership grab_ownership,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
@@ -1252,19 +1232,16 @@ gdk_device_grab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
{
|
||||
GdkGrabStatus res;
|
||||
GdkSurface *native;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (gdk_surface_get_display (surface) == gdk_device_get_display (device), GDK_GRAB_FAILED);
|
||||
|
||||
native = gdk_surface_get_toplevel (surface);
|
||||
|
||||
if (native == NULL || GDK_SURFACE_DESTROYED (native))
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return GDK_GRAB_NOT_VIEWABLE;
|
||||
|
||||
res = GDK_DEVICE_GET_CLASS (device)->grab (device,
|
||||
native,
|
||||
surface,
|
||||
owner_events,
|
||||
get_native_grab_event_mask (event_mask),
|
||||
NULL,
|
||||
@@ -1282,7 +1259,6 @@ gdk_device_grab (GdkDevice *device,
|
||||
_gdk_display_add_device_grab (display,
|
||||
device,
|
||||
surface,
|
||||
native,
|
||||
grab_ownership,
|
||||
owner_events,
|
||||
event_mask,
|
||||
@@ -1548,7 +1524,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
|
||||
else
|
||||
scale = 1;
|
||||
|
||||
offset = - surface_root_x - surface->abs_x;
|
||||
offset = - surface_root_x;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1557,7 +1533,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
|
||||
else
|
||||
scale = 1;
|
||||
|
||||
offset = - surface_root_y - surface->abs_y;
|
||||
offset = - surface_root_y;
|
||||
}
|
||||
|
||||
if (axis_value)
|
||||
|
@@ -167,10 +167,6 @@ void gdk_device_get_state (GdkDevice *device,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_device_get_position (GdkDevice *device,
|
||||
double *x,
|
||||
double *y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device,
|
||||
double *win_x,
|
||||
double *win_y);
|
||||
|
118
gdk/gdkdisplay.c
118
gdk/gdkdisplay.c
@@ -31,9 +31,9 @@
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdisplaymanagerprivate.h"
|
||||
#include "gdkevents.h"
|
||||
#include "gdksurfaceimpl.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkmonitorprivate.h"
|
||||
#include "gdkframeclockidleprivate.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <glib.h>
|
||||
@@ -171,8 +171,6 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
object_class->get_property = gdk_display_get_property;
|
||||
|
||||
class->get_app_launch_context = gdk_display_real_get_app_launch_context;
|
||||
class->surface_type = GDK_TYPE_SURFACE;
|
||||
|
||||
class->opened = gdk_display_real_opened;
|
||||
class->make_default = gdk_display_real_make_default;
|
||||
class->event_data_copy = gdk_display_real_event_data_copy;
|
||||
@@ -222,7 +220,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDisplayClass, opened),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -239,7 +237,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDisplayClass, closed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__BOOLEAN,
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
1,
|
||||
G_TYPE_BOOLEAN);
|
||||
@@ -257,7 +255,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1, GDK_TYPE_SEAT);
|
||||
|
||||
/**
|
||||
@@ -273,7 +271,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1, GDK_TYPE_SEAT);
|
||||
|
||||
/**
|
||||
@@ -289,7 +287,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1, GDK_TYPE_MONITOR);
|
||||
|
||||
/**
|
||||
@@ -305,7 +303,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1, GDK_TYPE_MONITOR);
|
||||
|
||||
/**
|
||||
@@ -336,7 +334,6 @@ static void
|
||||
free_device_grab (GdkDeviceGrabInfo *info)
|
||||
{
|
||||
g_object_unref (info->surface);
|
||||
g_object_unref (info->native_surface);
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
@@ -558,7 +555,6 @@ GdkDeviceGrabInfo *
|
||||
_gdk_display_add_device_grab (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *native_surface,
|
||||
GdkGrabOwnership grab_ownership,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
@@ -572,7 +568,6 @@ _gdk_display_add_device_grab (GdkDisplay *display,
|
||||
info = g_new0 (GdkDeviceGrabInfo, 1);
|
||||
|
||||
info->surface = g_object_ref (surface);
|
||||
info->native_surface = g_object_ref (native_surface);
|
||||
info->serial_start = serial_start;
|
||||
info->serial_end = G_MAXULONG;
|
||||
info->owner_events = owner_events;
|
||||
@@ -845,9 +840,7 @@ _gdk_display_end_device_grab (GdkDisplay *display,
|
||||
return FALSE;
|
||||
|
||||
grab = l->data;
|
||||
if (grab &&
|
||||
(if_child == NULL ||
|
||||
_gdk_surface_event_parent_of (if_child, grab->surface)))
|
||||
if (grab && (if_child == NULL || if_child == grab->surface))
|
||||
{
|
||||
grab->serial_end = serial;
|
||||
grab->implicit_ungrab = implicit;
|
||||
@@ -1329,24 +1322,19 @@ _gdk_display_event_data_free (GdkDisplay *display,
|
||||
GDK_DISPLAY_GET_CLASS (display)->event_data_free (display, event);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_create_surface_impl (GdkDisplay *display,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *real_parent,
|
||||
GdkSurfaceAttr *attributes)
|
||||
{
|
||||
GDK_DISPLAY_GET_CLASS (display)->create_surface_impl (display,
|
||||
surface,
|
||||
real_parent,
|
||||
attributes);
|
||||
}
|
||||
|
||||
GdkSurface *
|
||||
_gdk_display_create_surface (GdkDisplay *display)
|
||||
gdk_display_create_surface (GdkDisplay *display,
|
||||
GdkSurfaceType surface_type,
|
||||
GdkSurface *parent,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
return g_object_new (GDK_DISPLAY_GET_CLASS (display)->surface_type,
|
||||
"display", display,
|
||||
NULL);
|
||||
return GDK_DISPLAY_GET_CLASS (display)->create_surface (display,
|
||||
surface_type,
|
||||
parent,
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1626,66 +1614,6 @@ gdk_display_get_primary_monitor (GdkDisplay *display)
|
||||
return GDK_DISPLAY_GET_CLASS (display)->get_primary_monitor (display);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_get_monitor_at_point:
|
||||
* @display: a #GdkDisplay
|
||||
* @x: the x coordinate of the point
|
||||
* @y: the y coordinate of the point
|
||||
*
|
||||
* Gets the monitor in which the point (@x, @y) is located,
|
||||
* or a nearby monitor if the point is not in any monitor.
|
||||
*
|
||||
* Returns: (transfer none): the monitor containing the point
|
||||
*/
|
||||
GdkMonitor *
|
||||
gdk_display_get_monitor_at_point (GdkDisplay *display,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
GdkMonitor *nearest = NULL;
|
||||
int nearest_dist = G_MAXINT;
|
||||
int n_monitors, i;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
n_monitors = gdk_display_get_n_monitors (display);
|
||||
for (i = 0; i < n_monitors; i++)
|
||||
{
|
||||
GdkMonitor *monitor;
|
||||
GdkRectangle geometry;
|
||||
int dist_x, dist_y, dist;
|
||||
|
||||
monitor = gdk_display_get_monitor (display, i);
|
||||
gdk_monitor_get_geometry (monitor, &geometry);
|
||||
|
||||
if (x < geometry.x)
|
||||
dist_x = geometry.x - x;
|
||||
else if (geometry.x + geometry.width <= x)
|
||||
dist_x = x - (geometry.x + geometry.width) + 1;
|
||||
else
|
||||
dist_x = 0;
|
||||
|
||||
if (y < geometry.y)
|
||||
dist_y = geometry.y - y;
|
||||
else if (geometry.y + geometry.height <= y)
|
||||
dist_y = y - (geometry.y + geometry.height) + 1;
|
||||
else
|
||||
dist_y = 0;
|
||||
|
||||
dist = dist_x + dist_y;
|
||||
if (dist < nearest_dist)
|
||||
{
|
||||
nearest_dist = dist;
|
||||
nearest = monitor;
|
||||
}
|
||||
|
||||
if (nearest_dist == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return nearest;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_get_monitor_at_surface:
|
||||
* @display: a #GdkDisplay
|
||||
@@ -1718,6 +1646,7 @@ gdk_display_get_monitor_at_surface (GdkDisplay *display,
|
||||
return best;
|
||||
}
|
||||
|
||||
/* the fallback implementation requires global coordinates */
|
||||
gdk_surface_get_geometry (surface, &win.x, &win.y, &win.width, &win.height);
|
||||
gdk_surface_get_origin (surface, &win.x, &win.y);
|
||||
|
||||
@@ -1739,12 +1668,7 @@ gdk_display_get_monitor_at_surface (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
if (best)
|
||||
return best;
|
||||
|
||||
return gdk_display_get_monitor_at_point (display,
|
||||
win.x + win.width / 2,
|
||||
win.y + win.height / 2);
|
||||
return best;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -114,10 +114,6 @@ GdkMonitor * gdk_display_get_monitor (GdkDisplay *display,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkMonitor * gdk_display_get_primary_monitor (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkMonitor * gdk_display_get_monitor_at_point (GdkDisplay *display,
|
||||
int x,
|
||||
int y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkMonitor * gdk_display_get_monitor_at_surface (GdkDisplay *display,
|
||||
GdkSurface *surface);
|
||||
|
||||
|
@@ -156,7 +156,7 @@ gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDisplayManagerClass, display_opened),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
1,
|
||||
GDK_TYPE_DISPLAY);
|
||||
|
@@ -41,7 +41,6 @@ typedef struct _GdkDisplayClass GdkDisplayClass;
|
||||
typedef struct
|
||||
{
|
||||
GdkSurface *surface;
|
||||
GdkSurface *native_surface;
|
||||
gulong serial_start;
|
||||
gulong serial_end; /* exclusive, i.e. not active on serial_end */
|
||||
guint event_mask;
|
||||
@@ -113,7 +112,6 @@ struct _GdkDisplayClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
GType surface_type; /* type for native surfaces for this display, set in class_init */
|
||||
GType cairo_context_type; /* type for GdkCairoContext, must be set */
|
||||
GType vk_context_type; /* type for GdkVulkanContext, must be set if vk_extension_name != NULL */
|
||||
const char *vk_extension_name; /* Name of required windowing vulkan extension or %NULL (default) if Vulkan isn't supported */
|
||||
@@ -142,10 +140,13 @@ struct _GdkDisplayClass
|
||||
GdkEvent *new_event);
|
||||
void (*event_data_free) (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
void (*create_surface_impl) (GdkDisplay *display,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *real_parent,
|
||||
GdkSurfaceAttr *attributes);
|
||||
GdkSurface * (*create_surface) (GdkDisplay *display,
|
||||
GdkSurfaceType surface_type,
|
||||
GdkSurface *parent,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
GdkKeymap * (*get_keymap) (GdkDisplay *display);
|
||||
|
||||
@@ -200,7 +201,6 @@ GdkDeviceGrabInfo * _gdk_display_get_last_device_grab (GdkDisplay *display,
|
||||
GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *native_surface,
|
||||
GdkGrabOwnership grab_ownership,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
@@ -231,11 +231,13 @@ void _gdk_display_event_data_copy (GdkDisplay *display
|
||||
GdkEvent *new_event);
|
||||
void _gdk_display_event_data_free (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
void gdk_display_create_surface_impl (GdkDisplay *display,
|
||||
GdkSurface *surface,
|
||||
GdkSurface *real_parent,
|
||||
GdkSurfaceAttr *attributes);
|
||||
GdkSurface * _gdk_display_create_surface (GdkDisplay *display);
|
||||
GdkSurface * gdk_display_create_surface (GdkDisplay *display,
|
||||
GdkSurfaceType surface_type,
|
||||
GdkSurface *parent,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkGLContext *context);
|
||||
|
@@ -450,7 +450,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDragClass, cancel),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__ENUM,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1, GDK_TYPE_DRAG_CANCEL_REASON);
|
||||
|
||||
/**
|
||||
@@ -465,7 +465,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDragClass, drop_performed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -482,7 +482,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDragClass, dnd_finished),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkintl.h"
|
||||
#include "gdkprofilerprivate.h"
|
||||
|
||||
/**
|
||||
* SECTION:gdkdrawcontext
|
||||
@@ -174,9 +175,15 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass)
|
||||
g_object_class_install_properties (gobject_class, LAST_PROP, pspecs);
|
||||
}
|
||||
|
||||
static guint pixels_counter;
|
||||
|
||||
static void
|
||||
gdk_draw_context_init (GdkDrawContext *self)
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (pixels_counter == 0)
|
||||
pixels_counter = gdk_profiler_define_int_counter ("frame pixels", "Pixels drawn per frame");
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,6 +322,25 @@ gdk_draw_context_begin_frame (GdkDrawContext *context,
|
||||
GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, priv->frame_region);
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static gint64
|
||||
region_get_pixels (cairo_region_t *region)
|
||||
{
|
||||
int i, n;
|
||||
cairo_rectangle_int_t rect;
|
||||
gint64 pixels = 0;
|
||||
|
||||
n = cairo_region_num_rectangles (region);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (region, i, &rect);
|
||||
pixels += rect.width * rect.height;
|
||||
}
|
||||
|
||||
return pixels;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* gdk_draw_context_end_frame:
|
||||
* @context: a #GdkDrawContext
|
||||
@@ -354,6 +380,13 @@ gdk_draw_context_end_frame (GdkDrawContext *context)
|
||||
|
||||
GDK_DRAW_CONTEXT_GET_CLASS (context)->end_frame (context, priv->frame_region);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (gdk_profiler_is_running ())
|
||||
gdk_profiler_set_int_counter (pixels_counter,
|
||||
g_get_monotonic_time () * 1000,
|
||||
region_get_pixels (priv->frame_region));
|
||||
#endif
|
||||
|
||||
g_clear_pointer (&priv->frame_region, cairo_region_destroy);
|
||||
g_clear_object (&priv->surface->paint_context);
|
||||
}
|
||||
|
@@ -12,21 +12,26 @@
|
||||
GType
|
||||
@enum_name@_get_type (void)
|
||||
{
|
||||
static GType etype = 0;
|
||||
if (G_UNLIKELY(etype == 0)) {
|
||||
static const G@Type@Value values[] = {
|
||||
static volatile gsize g_define_type_id__volatile = 0;
|
||||
|
||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||
{
|
||||
static const G@Type@Value values[] = {
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN value-production ***/
|
||||
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||
/*** END value-production ***/
|
||||
|
||||
/*** BEGIN value-tail ***/
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
GType g_define_type_id =
|
||||
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||
}
|
||||
return etype;
|
||||
|
||||
return g_define_type_id__volatile;
|
||||
}
|
||||
|
||||
/*** END value-tail ***/
|
||||
|
@@ -960,81 +960,6 @@ gdk_event_get_coords (const GdkEvent *event,
|
||||
return fetched;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_event_get_root_coords:
|
||||
* @event: a #GdkEvent
|
||||
* @x_root: (out) (optional): location to put root window x coordinate
|
||||
* @y_root: (out) (optional): location to put root window y coordinate
|
||||
*
|
||||
* Extract the root window relative x/y coordinates from an event.
|
||||
*
|
||||
* Returns: %TRUE if the event delivered root window coordinates
|
||||
**/
|
||||
gboolean
|
||||
gdk_event_get_root_coords (const GdkEvent *event,
|
||||
gdouble *x_root,
|
||||
gdouble *y_root)
|
||||
{
|
||||
gdouble x = 0, y = 0;
|
||||
gboolean fetched = TRUE;
|
||||
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
switch ((guint) event->any.type)
|
||||
{
|
||||
case GDK_MOTION_NOTIFY:
|
||||
x = event->motion.x_root;
|
||||
y = event->motion.y_root;
|
||||
break;
|
||||
case GDK_SCROLL:
|
||||
x = event->scroll.x_root;
|
||||
y = event->scroll.y_root;
|
||||
break;
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
x = event->button.x_root;
|
||||
y = event->button.y_root;
|
||||
break;
|
||||
case GDK_TOUCH_BEGIN:
|
||||
case GDK_TOUCH_UPDATE:
|
||||
case GDK_TOUCH_END:
|
||||
case GDK_TOUCH_CANCEL:
|
||||
x = event->touch.x_root;
|
||||
y = event->touch.y_root;
|
||||
break;
|
||||
case GDK_ENTER_NOTIFY:
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
x = event->crossing.x_root;
|
||||
y = event->crossing.y_root;
|
||||
break;
|
||||
case GDK_DRAG_ENTER:
|
||||
case GDK_DRAG_LEAVE:
|
||||
case GDK_DRAG_MOTION:
|
||||
case GDK_DROP_START:
|
||||
x = event->dnd.x_root;
|
||||
y = event->dnd.y_root;
|
||||
break;
|
||||
case GDK_TOUCHPAD_SWIPE:
|
||||
x = event->touchpad_swipe.x_root;
|
||||
y = event->touchpad_swipe.y_root;
|
||||
break;
|
||||
case GDK_TOUCHPAD_PINCH:
|
||||
x = event->touchpad_pinch.x_root;
|
||||
y = event->touchpad_pinch.y_root;
|
||||
break;
|
||||
default:
|
||||
fetched = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (x_root)
|
||||
*x_root = x;
|
||||
if (y_root)
|
||||
*y_root = y;
|
||||
|
||||
return fetched;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_event_set_coords (GdkEvent *event,
|
||||
gdouble x,
|
||||
|
@@ -141,7 +141,6 @@ typedef union _GdkEvent GdkEvent;
|
||||
* @GDK_LEAVE_NOTIFY: the pointer has left the surface.
|
||||
* @GDK_FOCUS_CHANGE: the keyboard focus has entered or left the surface.
|
||||
* @GDK_CONFIGURE: the size, position or stacking order of the surface has changed.
|
||||
* Note that GTK+ discards these events for %GDK_SURFACE_CHILD surfaces.
|
||||
* @GDK_PROXIMITY_IN: an input device has moved into contact with a sensing
|
||||
* surface (e.g. a touchscreen or graphics tablet).
|
||||
* @GDK_PROXIMITY_OUT: an input device has moved out of contact with a sensing
|
||||
@@ -365,10 +364,6 @@ void gdk_event_set_coords (GdkEvent *event,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_event_get_root_coords (const GdkEvent *event,
|
||||
gdouble *x_root,
|
||||
gdouble *y_root);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_event_get_button (const GdkEvent *event,
|
||||
guint *button);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
@@ -87,6 +87,8 @@ enum {
|
||||
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
static guint fps_counter;
|
||||
|
||||
#define FRAME_HISTORY_MAX_LENGTH 16
|
||||
|
||||
struct _GdkFrameClockPrivate
|
||||
@@ -132,8 +134,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -148,8 +149,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -168,8 +168,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -186,8 +185,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -205,8 +203,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -221,8 +218,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -238,8 +234,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
@@ -252,6 +247,11 @@ gdk_frame_clock_init (GdkFrameClock *clock)
|
||||
|
||||
priv->frame_counter = -1;
|
||||
priv->current = FRAME_HISTORY_MAX_LENGTH - 1;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (fps_counter == 0)
|
||||
fps_counter = gdk_profiler_define_counter ("fps", "Frames per Second");
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -645,3 +645,105 @@ _gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock)
|
||||
{
|
||||
g_signal_emit (frame_clock, signals[RESUME_EVENTS], 0);
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static gint64
|
||||
guess_refresh_interval (GdkFrameClock *frame_clock)
|
||||
{
|
||||
gint64 interval;
|
||||
gint64 i;
|
||||
|
||||
interval = G_MAXINT64;
|
||||
|
||||
for (i = gdk_frame_clock_get_history_start (frame_clock);
|
||||
i < gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
i++)
|
||||
{
|
||||
GdkFrameTimings *t, *before;
|
||||
gint64 ts, before_ts;
|
||||
|
||||
t = gdk_frame_clock_get_timings (frame_clock, i);
|
||||
before = gdk_frame_clock_get_timings (frame_clock, i - 1);
|
||||
if (t == NULL || before == NULL)
|
||||
continue;
|
||||
|
||||
ts = gdk_frame_timings_get_frame_time (t);
|
||||
before_ts = gdk_frame_timings_get_frame_time (before);
|
||||
if (ts == 0 || before_ts == 0)
|
||||
continue;
|
||||
|
||||
interval = MIN (interval, ts - before_ts);
|
||||
}
|
||||
|
||||
if (interval == G_MAXINT64)
|
||||
return 0;
|
||||
|
||||
return interval;
|
||||
}
|
||||
|
||||
static double
|
||||
frame_clock_get_fps (GdkFrameClock *frame_clock)
|
||||
{
|
||||
GdkFrameTimings *start, *end;
|
||||
gint64 start_counter, end_counter;
|
||||
gint64 start_timestamp, end_timestamp;
|
||||
gint64 interval;
|
||||
|
||||
start_counter = gdk_frame_clock_get_history_start (frame_clock);
|
||||
end_counter = gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
start = gdk_frame_clock_get_timings (frame_clock, start_counter);
|
||||
for (end = gdk_frame_clock_get_timings (frame_clock, end_counter);
|
||||
end_counter > start_counter && end != NULL && !gdk_frame_timings_get_complete (end);
|
||||
end = gdk_frame_clock_get_timings (frame_clock, end_counter))
|
||||
end_counter--;
|
||||
if (end_counter - start_counter < 4)
|
||||
return 0.0;
|
||||
|
||||
start_timestamp = gdk_frame_timings_get_presentation_time (start);
|
||||
end_timestamp = gdk_frame_timings_get_presentation_time (end);
|
||||
if (start_timestamp == 0 || end_timestamp == 0)
|
||||
{
|
||||
start_timestamp = gdk_frame_timings_get_frame_time (start);
|
||||
end_timestamp = gdk_frame_timings_get_frame_time (end);
|
||||
}
|
||||
interval = gdk_frame_timings_get_refresh_interval (end);
|
||||
if (interval == 0)
|
||||
{
|
||||
interval = guess_refresh_interval (frame_clock);
|
||||
if (interval == 0)
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
return ((double) end_counter - start_counter) * G_USEC_PER_SEC / (end_timestamp - start_timestamp);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
_gdk_frame_clock_add_timings_to_profiler (GdkFrameClock *clock,
|
||||
GdkFrameTimings *timings)
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
gdk_profiler_add_mark (timings->frame_time * 1000,
|
||||
(timings->frame_end_time - timings->frame_time) * 1000,
|
||||
"frame", "");
|
||||
|
||||
if (timings->layout_start_time != 0)
|
||||
gdk_profiler_add_mark (timings->layout_start_time * 1000,
|
||||
(timings->paint_start_time - timings->layout_start_time) * 1000,
|
||||
"layout", "");
|
||||
|
||||
if (timings->paint_start_time != 0)
|
||||
gdk_profiler_add_mark (timings->paint_start_time * 1000,
|
||||
(timings->frame_end_time - timings->paint_start_time) * 1000,
|
||||
"paint", "");
|
||||
|
||||
if (timings->presentation_time != 0)
|
||||
gdk_profiler_add_mark (timings->presentation_time * 1000,
|
||||
0,
|
||||
"presentation", "");
|
||||
|
||||
gdk_profiler_set_counter (fps_counter,
|
||||
timings->frame_end_time * 1000,
|
||||
frame_clock_get_fps (clock));
|
||||
#endif
|
||||
}
|
||||
|
@@ -42,6 +42,9 @@ struct _GdkFrameClockIdlePrivate
|
||||
gint64 frame_time;
|
||||
gint64 min_next_frame_time;
|
||||
gint64 sleep_serial;
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
gint64 freeze_time;
|
||||
#endif
|
||||
|
||||
guint flush_idle_id;
|
||||
guint paint_idle_id;
|
||||
@@ -114,96 +117,6 @@ get_sleep_serial (void)
|
||||
return sleep_serial;
|
||||
}
|
||||
|
||||
static guint fps_counter = 0;
|
||||
|
||||
static void
|
||||
add_timings_to_profiler (GdkFrameTimings *timings)
|
||||
{
|
||||
gdk_profiler_add_mark (timings->frame_time * 1000,
|
||||
(timings->frame_end_time - timings->frame_time) * 1000,
|
||||
"frame", "");
|
||||
if (timings->layout_start_time != 0)
|
||||
gdk_profiler_add_mark (timings->layout_start_time * 1000,
|
||||
(timings->paint_start_time - timings->layout_start_time) * 1000,
|
||||
"layout", "");
|
||||
|
||||
if (timings->paint_start_time != 0)
|
||||
gdk_profiler_add_mark (timings->paint_start_time * 1000,
|
||||
(timings->frame_end_time - timings->paint_start_time) * 1000,
|
||||
"paint", "");
|
||||
}
|
||||
|
||||
static gint64
|
||||
guess_refresh_interval (GdkFrameClock *frame_clock)
|
||||
{
|
||||
gint64 interval;
|
||||
gint64 i;
|
||||
|
||||
interval = G_MAXINT64;
|
||||
|
||||
for (i = gdk_frame_clock_get_history_start (frame_clock);
|
||||
i < gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
i++)
|
||||
{
|
||||
GdkFrameTimings *t, *before;
|
||||
gint64 ts, before_ts;
|
||||
|
||||
t = gdk_frame_clock_get_timings (frame_clock, i);
|
||||
before = gdk_frame_clock_get_timings (frame_clock, i - 1);
|
||||
if (t == NULL || before == NULL)
|
||||
continue;
|
||||
|
||||
ts = gdk_frame_timings_get_frame_time (t);
|
||||
before_ts = gdk_frame_timings_get_frame_time (before);
|
||||
if (ts == 0 || before_ts == 0)
|
||||
continue;
|
||||
|
||||
interval = MIN (interval, ts - before_ts);
|
||||
}
|
||||
|
||||
if (interval == G_MAXINT64)
|
||||
return 0;
|
||||
|
||||
return interval;
|
||||
}
|
||||
|
||||
static double
|
||||
frame_clock_get_fps (GdkFrameClock *frame_clock)
|
||||
{
|
||||
GdkFrameTimings *start, *end;
|
||||
gint64 start_counter, end_counter;
|
||||
gint64 start_timestamp, end_timestamp;
|
||||
gint64 interval;
|
||||
|
||||
start_counter = gdk_frame_clock_get_history_start (frame_clock);
|
||||
end_counter = gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
start = gdk_frame_clock_get_timings (frame_clock, start_counter);
|
||||
for (end = gdk_frame_clock_get_timings (frame_clock, end_counter);
|
||||
end_counter > start_counter && end != NULL && !gdk_frame_timings_get_complete (end);
|
||||
end = gdk_frame_clock_get_timings (frame_clock, end_counter))
|
||||
end_counter--;
|
||||
if (end_counter - start_counter < 4)
|
||||
return 0.0;
|
||||
|
||||
start_timestamp = gdk_frame_timings_get_presentation_time (start);
|
||||
end_timestamp = gdk_frame_timings_get_presentation_time (end);
|
||||
if (start_timestamp == 0 || end_timestamp == 0)
|
||||
{
|
||||
start_timestamp = gdk_frame_timings_get_frame_time (start);
|
||||
end_timestamp = gdk_frame_timings_get_frame_time (end);
|
||||
}
|
||||
|
||||
interval = gdk_frame_timings_get_refresh_interval (end);
|
||||
if (interval == 0)
|
||||
{
|
||||
interval = guess_refresh_interval (frame_clock);
|
||||
if (interval == 0)
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
return ((double) end_counter - start_counter) * G_USEC_PER_SEC / (end_timestamp - start_timestamp);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_frame_clock_idle_init (GdkFrameClockIdle *frame_clock_idle)
|
||||
{
|
||||
@@ -214,11 +127,6 @@ gdk_frame_clock_idle_init (GdkFrameClockIdle *frame_clock_idle)
|
||||
|
||||
priv->frame_time = g_get_monotonic_time (); /* more sane than zero */
|
||||
priv->freeze_count = 0;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (fps_counter == 0)
|
||||
fps_counter = gdk_profiler_define_counter ("fps", "Frames per Second");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -556,12 +464,11 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
/* the ::after-paint phase doesn't get repeated on freeze/thaw,
|
||||
*/
|
||||
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (GDK_DEBUG_CHECK (FRAMES) || gdk_profiler_is_running ())
|
||||
timings->frame_end_time = g_get_monotonic_time ();
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
}
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (GDK_DEBUG_CHECK (FRAMES) || gdk_profiler_is_running ())
|
||||
timings->frame_end_time = g_get_monotonic_time ();
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
|
||||
case GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS:
|
||||
@@ -570,20 +477,6 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (gdk_profiler_is_running ())
|
||||
{
|
||||
add_timings_to_profiler (timings);
|
||||
gdk_profiler_set_counter (fps_counter, timings->frame_end_time * 1000, frame_clock_get_fps (clock));
|
||||
}
|
||||
|
||||
if (GDK_DEBUG_CHECK (FRAMES))
|
||||
{
|
||||
if (timings && timings->complete)
|
||||
_gdk_frame_clock_debug_print_timings (clock, timings);
|
||||
}
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
if (priv->requested & GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS)
|
||||
{
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS;
|
||||
@@ -668,6 +561,14 @@ gdk_frame_clock_idle_freeze (GdkFrameClock *clock)
|
||||
GdkFrameClockIdle *clock_idle = GDK_FRAME_CLOCK_IDLE (clock);
|
||||
GdkFrameClockIdlePrivate *priv = clock_idle->priv;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (priv->freeze_count == 0)
|
||||
{
|
||||
if (gdk_profiler_is_running ())
|
||||
priv->freeze_time = g_get_monotonic_time ();
|
||||
}
|
||||
#endif
|
||||
|
||||
priv->freeze_count++;
|
||||
maybe_stop_idle (clock_idle);
|
||||
}
|
||||
@@ -692,6 +593,20 @@ gdk_frame_clock_idle_thaw (GdkFrameClock *clock)
|
||||
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
|
||||
|
||||
priv->sleep_serial = get_sleep_serial ();
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (gdk_profiler_is_running ())
|
||||
{
|
||||
if (priv->freeze_time != 0)
|
||||
{
|
||||
gint64 thaw_time = g_get_monotonic_time ();
|
||||
gdk_profiler_add_mark (priv->freeze_time * 1000,
|
||||
(thaw_time - priv->freeze_time) * 1000,
|
||||
"freeze", "");
|
||||
priv->freeze_time = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#define __GDK_FRAME_CLOCK_PRIVATE_H__
|
||||
|
||||
#include <gdk/gdkframeclock.h>
|
||||
#include <gdk/gdkprofilerprivate.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -110,6 +111,8 @@ void _gdk_frame_clock_thaw (GdkFrameClock *clock);
|
||||
void _gdk_frame_clock_begin_frame (GdkFrameClock *clock);
|
||||
void _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
|
||||
GdkFrameTimings *timings);
|
||||
void _gdk_frame_clock_add_timings_to_profiler (GdkFrameClock *frame_clock,
|
||||
GdkFrameTimings *timings);
|
||||
|
||||
GdkFrameTimings *_gdk_frame_timings_new (gint64 frame_counter);
|
||||
gboolean _gdk_frame_timings_steal (GdkFrameTimings *timings,
|
||||
|
@@ -310,6 +310,12 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context,
|
||||
}
|
||||
|
||||
damage = GDK_GL_CONTEXT_GET_CLASS (context)->get_damage (context);
|
||||
|
||||
if (context->old_updated_area[1])
|
||||
cairo_region_destroy (context->old_updated_area[1]);
|
||||
context->old_updated_area[1] = context->old_updated_area[0];
|
||||
context->old_updated_area[0] = cairo_region_copy (region);
|
||||
|
||||
cairo_region_union (region, damage);
|
||||
cairo_region_destroy (damage);
|
||||
|
||||
@@ -341,11 +347,6 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
|
||||
GDK_DRAW_CONTEXT_GET_CLASS (GDK_DRAW_CONTEXT (shared))->end_frame (GDK_DRAW_CONTEXT (shared), painted);
|
||||
return;
|
||||
}
|
||||
|
||||
if (context->old_updated_area[1])
|
||||
cairo_region_destroy (context->old_updated_area[1]);
|
||||
context->old_updated_area[1] = context->old_updated_area[0];
|
||||
context->old_updated_area[0] = cairo_region_reference (painted);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -28,9 +28,9 @@
|
||||
#define __GDK_INTERNALS_H__
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include "gdksurfaceimpl.h"
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkeventsprivate.h"
|
||||
#include "gdksurfaceprivate.h"
|
||||
#include "gdkenumtypes.h"
|
||||
#include "gdkdragprivate.h"
|
||||
|
||||
@@ -42,8 +42,6 @@ G_BEGIN_DECLS
|
||||
|
||||
/* Debugging support */
|
||||
|
||||
typedef struct _GdkSurfaceAttr GdkSurfaceAttr;
|
||||
|
||||
typedef enum {
|
||||
GDK_DEBUG_MISC = 1 << 0,
|
||||
GDK_DEBUG_EVENTS = 1 << 1,
|
||||
@@ -118,102 +116,6 @@ typedef enum
|
||||
|
||||
typedef struct _GdkSurfacePaint GdkSurfacePaint;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_INPUT_OUTPUT,
|
||||
GDK_INPUT_ONLY
|
||||
} GdkSurfaceSurfaceClass;
|
||||
|
||||
|
||||
struct _GdkSurfaceAttr
|
||||
{
|
||||
gint x, y;
|
||||
gint width;
|
||||
gint height;
|
||||
GdkSurfaceSurfaceClass wclass;
|
||||
GdkSurfaceType surface_type;
|
||||
};
|
||||
|
||||
struct _GdkSurface
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GdkDisplay *display;
|
||||
|
||||
GdkSurfaceImpl *impl; /* window-system-specific delegate object */
|
||||
|
||||
GdkSurface *parent;
|
||||
GdkSurface *transient_for;
|
||||
|
||||
gpointer widget;
|
||||
|
||||
gint x;
|
||||
gint y;
|
||||
|
||||
guint8 surface_type;
|
||||
|
||||
guint8 resize_count;
|
||||
|
||||
GList *children;
|
||||
GList children_list_node;
|
||||
|
||||
GdkGLContext *gl_paint_context;
|
||||
|
||||
cairo_region_t *update_area;
|
||||
guint update_freeze_count;
|
||||
/* This is the update_area that was in effect when the current expose
|
||||
started. It may be smaller than the expose area if we'e painting
|
||||
more than we have to, but it represents the "true" damage. */
|
||||
cairo_region_t *active_update_area;
|
||||
|
||||
GdkSurfaceState old_state;
|
||||
GdkSurfaceState state;
|
||||
|
||||
guint8 alpha;
|
||||
guint8 fullscreen_mode;
|
||||
|
||||
guint input_only : 1;
|
||||
guint pass_through : 1;
|
||||
guint modal_hint : 1;
|
||||
|
||||
guint destroyed : 2;
|
||||
|
||||
guint accept_focus : 1;
|
||||
guint focus_on_map : 1;
|
||||
guint support_multidevice : 1;
|
||||
guint viewable : 1; /* mapped and all parents mapped */
|
||||
guint in_update : 1;
|
||||
guint frame_clock_events_paused : 1;
|
||||
|
||||
/* The GdkSurface that has the impl, ref:ed if another surface.
|
||||
* This ref is required to keep the wrapper of the impl surface alive
|
||||
* for as long as any GdkSurface references the impl. */
|
||||
GdkSurface *impl_surface;
|
||||
|
||||
guint update_and_descendants_freeze_count;
|
||||
|
||||
gint abs_x, abs_y; /* Absolute offset in impl */
|
||||
gint width, height;
|
||||
gint shadow_top;
|
||||
gint shadow_left;
|
||||
gint shadow_right;
|
||||
gint shadow_bottom;
|
||||
|
||||
GdkCursor *cursor;
|
||||
GHashTable *device_cursor;
|
||||
|
||||
cairo_region_t *input_shape;
|
||||
|
||||
GList *devices_inside;
|
||||
|
||||
GdkFrameClock *frame_clock; /* NULL to use from parent or default */
|
||||
|
||||
GSList *draw_contexts;
|
||||
GdkDrawContext *paint_context;
|
||||
|
||||
cairo_region_t *opaque_region;
|
||||
};
|
||||
|
||||
#define GDK_SURFACE_TYPE(d) ((((GdkSurface *)(d)))->surface_type)
|
||||
#define GDK_SURFACE_DESTROYED(d) (((GdkSurface *)(d))->destroyed)
|
||||
|
||||
@@ -250,9 +152,6 @@ void _gdk_windowing_event_data_copy (const GdkEvent *src,
|
||||
GdkEvent *dst);
|
||||
void _gdk_windowing_event_data_free (GdkEvent *event);
|
||||
|
||||
void gdk_surface_set_state (GdkSurface *surface,
|
||||
GdkSurfaceState new_state);
|
||||
|
||||
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
|
||||
GdkRectangle *extents);
|
||||
void gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
@@ -278,9 +177,6 @@ cairo_region_t *gdk_cairo_region_from_clip (cairo_t *cr);
|
||||
* Interfaces used by windowing code *
|
||||
*************************************/
|
||||
|
||||
GdkSurface* gdk_surface_new (GdkDisplay *display,
|
||||
GdkSurface *parent,
|
||||
GdkSurfaceAttr *attributes);
|
||||
void _gdk_surface_destroy (GdkSurface *surface,
|
||||
gboolean foreign_destroy);
|
||||
void gdk_surface_invalidate_rect (GdkSurface *surface,
|
||||
@@ -315,20 +211,6 @@ void _gdk_windowing_got_event (GdkDisplay *display,
|
||||
|
||||
#define GDK_SURFACE_IS_MAPPED(surface) (((surface)->state & GDK_SURFACE_STATE_WITHDRAWN) == 0)
|
||||
|
||||
GdkSurface * _gdk_surface_find_child_at (GdkSurface *surface,
|
||||
double x, double y);
|
||||
GdkSurface * _gdk_surface_find_descendant_at (GdkSurface *toplevel,
|
||||
double x, double y,
|
||||
double *found_x,
|
||||
double *found_y);
|
||||
|
||||
GdkEvent * _gdk_make_event (GdkSurface *surface,
|
||||
GdkEventType type,
|
||||
GdkEvent *event_in_queue,
|
||||
gboolean before_event);
|
||||
gboolean _gdk_surface_event_parent_of (GdkSurface *parent,
|
||||
GdkSurface *child);
|
||||
|
||||
void _gdk_synthesize_crossing_events (GdkDisplay *display,
|
||||
GdkSurface *src,
|
||||
GdkSurface *dest,
|
||||
@@ -346,9 +228,6 @@ void _gdk_display_set_surface_under_pointer (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkSurface *surface);
|
||||
|
||||
gboolean _gdk_surface_has_impl (GdkSurface *surface);
|
||||
GdkSurface * _gdk_surface_get_impl_surface (GdkSurface *surface);
|
||||
|
||||
void gdk_surface_destroy_notify (GdkSurface *surface);
|
||||
|
||||
void gdk_synthesize_surface_state (GdkSurface *surface,
|
||||
@@ -364,8 +243,39 @@ GdkGrabStatus gdk_device_grab (GdkDevice *device,
|
||||
guint32 time_);
|
||||
void gdk_device_ungrab (GdkDevice *device,
|
||||
guint32 time_);
|
||||
void gdk_device_get_position (GdkDevice *device,
|
||||
double *x,
|
||||
double *y);
|
||||
|
||||
|
||||
void gdk_surface_get_root_coords (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y,
|
||||
gint *root_x,
|
||||
gint *root_y);
|
||||
void gdk_surface_get_origin (GdkSurface *surface,
|
||||
gint *x,
|
||||
gint *y);
|
||||
|
||||
|
||||
void gdk_surface_get_geometry (GdkSurface *surface,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height);
|
||||
|
||||
void gdk_surface_move (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
void gdk_surface_move_resize (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
GdkGLContext *gdk_surface_get_shared_data_gl_context (GdkSurface *surface);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_INTERNALS_H__ */
|
||||
|
@@ -185,7 +185,7 @@ gdk_keymap_class_init (GdkKeymapClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkKeymapClass, direction_changed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
/**
|
||||
@@ -201,7 +201,7 @@ gdk_keymap_class_init (GdkKeymapClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkKeymapClass, keys_changed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
|
||||
@@ -219,7 +219,7 @@ gdk_keymap_class_init (GdkKeymapClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkKeymapClass, state_changed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
}
|
||||
|
@@ -1,2 +1,4 @@
|
||||
BOOLEAN:BOXED
|
||||
BOOLEAN:OBJECT
|
||||
BOOLEAN:POINTER
|
||||
VOID:POINTER,POINTER,BOOLEAN,BOOLEAN
|
||||
|
@@ -266,7 +266,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
|
@@ -161,7 +161,7 @@ gdk_paintable_default_init (GdkPaintableInterface *iface)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -182,7 +182,7 @@ gdk_paintable_default_init (GdkPaintableInterface *iface)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
|
@@ -30,18 +30,18 @@
|
||||
#include "gdkprofilerprivate.h"
|
||||
#include "gdkframeclockprivate.h"
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
#ifdef HAVE_SYSPROF_CAPTURE
|
||||
|
||||
#include "capture/sp-capture-writer.h"
|
||||
#include <sysprof-capture.h>
|
||||
|
||||
static SpCaptureWriter *writer = NULL;
|
||||
static SysprofCaptureWriter *writer = NULL;
|
||||
static gboolean running = FALSE;
|
||||
|
||||
static void
|
||||
profiler_stop (void)
|
||||
{
|
||||
if (writer)
|
||||
sp_capture_writer_unref (writer);
|
||||
sysprof_capture_writer_unref (writer);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -50,7 +50,7 @@ gdk_profiler_start (int fd)
|
||||
if (writer)
|
||||
return;
|
||||
|
||||
sp_clock_init ();
|
||||
sysprof_clock_init ();
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
@@ -58,11 +58,11 @@ gdk_profiler_start (int fd)
|
||||
|
||||
filename = g_strdup_printf ("gtk.%d.syscap", getpid ());
|
||||
g_print ("Writing profiling data to %s\n", filename);
|
||||
writer = sp_capture_writer_new (filename, 16*1024);
|
||||
writer = sysprof_capture_writer_new (filename, 16*1024);
|
||||
g_free (filename);
|
||||
}
|
||||
else if (fd > 2)
|
||||
writer = sp_capture_writer_new_from_fd (fd, 16*1024);
|
||||
writer = sysprof_capture_writer_new_from_fd (fd, 16*1024);
|
||||
|
||||
if (writer)
|
||||
running = TRUE;
|
||||
@@ -91,11 +91,11 @@ gdk_profiler_add_mark (gint64 start,
|
||||
if (!running)
|
||||
return;
|
||||
|
||||
sp_capture_writer_add_mark (writer,
|
||||
start,
|
||||
-1, getpid (),
|
||||
duration,
|
||||
"gtk", name, message);
|
||||
sysprof_capture_writer_add_mark (writer,
|
||||
start,
|
||||
-1, getpid (),
|
||||
duration,
|
||||
"gtk", name, message);
|
||||
}
|
||||
|
||||
static guint
|
||||
@@ -103,24 +103,24 @@ define_counter (const char *name,
|
||||
const char *description,
|
||||
int type)
|
||||
{
|
||||
SpCaptureCounter counter;
|
||||
SysprofCaptureCounter counter;
|
||||
|
||||
if (!writer)
|
||||
return 0;
|
||||
|
||||
counter.id = (guint) sp_capture_writer_request_counter (writer, 1);
|
||||
counter.id = (guint) sysprof_capture_writer_request_counter (writer, 1);
|
||||
counter.type = type;
|
||||
counter.value.vdbl = 0;
|
||||
g_strlcpy (counter.category, "gtk", sizeof counter.category);
|
||||
g_strlcpy (counter.name, name, sizeof counter.name);
|
||||
g_strlcpy (counter.description, description, sizeof counter.name);
|
||||
|
||||
sp_capture_writer_define_counters (writer,
|
||||
SP_CAPTURE_CURRENT_TIME,
|
||||
-1,
|
||||
getpid (),
|
||||
&counter,
|
||||
1);
|
||||
sysprof_capture_writer_define_counters (writer,
|
||||
SYSPROF_CAPTURE_CURRENT_TIME,
|
||||
-1,
|
||||
getpid (),
|
||||
&counter,
|
||||
1);
|
||||
|
||||
return counter.id;
|
||||
}
|
||||
@@ -129,14 +129,14 @@ guint
|
||||
gdk_profiler_define_counter (const char *name,
|
||||
const char *description)
|
||||
{
|
||||
return define_counter (name, description, SP_CAPTURE_COUNTER_DOUBLE);
|
||||
return define_counter (name, description, SYSPROF_CAPTURE_COUNTER_DOUBLE);
|
||||
}
|
||||
|
||||
guint
|
||||
gdk_profiler_define_int_counter (const char *name,
|
||||
const char *description)
|
||||
{
|
||||
return define_counter (name, description, SP_CAPTURE_COUNTER_INT64);
|
||||
return define_counter (name, description, SYSPROF_CAPTURE_COUNTER_INT64);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -144,16 +144,16 @@ gdk_profiler_set_counter (guint id,
|
||||
gint64 time,
|
||||
double val)
|
||||
{
|
||||
SpCaptureCounterValue value;
|
||||
SysprofCaptureCounterValue value;
|
||||
|
||||
if (!running)
|
||||
return;
|
||||
|
||||
value.vdbl = val;
|
||||
sp_capture_writer_set_counters (writer,
|
||||
time,
|
||||
-1, getpid (),
|
||||
&id, &value, 1);
|
||||
sysprof_capture_writer_set_counters (writer,
|
||||
time,
|
||||
-1, getpid (),
|
||||
&id, &value, 1);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -161,16 +161,16 @@ gdk_profiler_set_int_counter (guint id,
|
||||
gint64 time,
|
||||
gint64 val)
|
||||
{
|
||||
SpCaptureCounterValue value;
|
||||
SysprofCaptureCounterValue value;
|
||||
|
||||
if (!running)
|
||||
return;
|
||||
|
||||
value.v64 = val;
|
||||
sp_capture_writer_set_counters (writer,
|
||||
time,
|
||||
-1, getpid (),
|
||||
&id, &value, 1);
|
||||
sysprof_capture_writer_set_counters (writer,
|
||||
time,
|
||||
-1, getpid (),
|
||||
&id, &value, 1);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@@ -24,6 +24,17 @@
|
||||
|
||||
#include "gtk/css/gtkcssparserprivate.h"
|
||||
|
||||
#define _GDK_RGBA_DECODE(c) ((unsigned)(((c) >= 'A' && (c) <= 'F') ? ((c)-'A'+10) : \
|
||||
((c) >= 'a' && (c) <= 'f') ? ((c)-'a'+10) : \
|
||||
((c) >= '0' && (c) <= '9') ? ((c)-'0') : \
|
||||
-1))
|
||||
#define _GDK_RGBA_SELECT_COLOR(_str, index3, index6) _GDK_RGBA_DECODE (sizeof(_str) <= 4 ? (_str)[index3] : (_str)[index6])
|
||||
#define GDK_RGBA(str) ((GdkRGBA) {\
|
||||
((_GDK_RGBA_SELECT_COLOR(str, 0, 0) << 4) | _GDK_RGBA_SELECT_COLOR(str, 0, 1)) / 255., \
|
||||
((_GDK_RGBA_SELECT_COLOR(str, 1, 2) << 4) | _GDK_RGBA_SELECT_COLOR(str, 1, 3)) / 255., \
|
||||
((_GDK_RGBA_SELECT_COLOR(str, 2, 4) << 4) | _GDK_RGBA_SELECT_COLOR(str, 2, 5)) / 255., \
|
||||
((sizeof(str) % 4 == 1) ? ((_GDK_RGBA_SELECT_COLOR(str, 3, 6) << 4) | _GDK_RGBA_SELECT_COLOR(str, 3, 7)) : 0xFF) / 255 })
|
||||
|
||||
|
||||
gboolean gdk_rgba_parser_parse (GtkCssParser *parser,
|
||||
GdkRGBA *rgba);
|
||||
|
@@ -129,7 +129,7 @@ gdk_seat_class_init (GdkSeatClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkSeatClass, device_added),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
GDK_TYPE_DEVICE);
|
||||
|
||||
@@ -147,7 +147,7 @@ gdk_seat_class_init (GdkSeatClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkSeatClass, device_removed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
GDK_TYPE_DEVICE);
|
||||
|
||||
@@ -168,7 +168,7 @@ gdk_seat_class_init (GdkSeatClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__BOXED,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
GDK_TYPE_DEVICE_TOOL);
|
||||
|
||||
@@ -185,7 +185,7 @@ gdk_seat_class_init (GdkSeatClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__BOXED,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
GDK_TYPE_DEVICE_TOOL);
|
||||
|
||||
|
2889
gdk/gdksurface.c
2889
gdk/gdksurface.c
File diff suppressed because it is too large
Load Diff
135
gdk/gdksurface.h
135
gdk/gdksurface.h
@@ -42,16 +42,16 @@ typedef struct _GdkGeometry GdkGeometry;
|
||||
/**
|
||||
* GdkSurfaceType:
|
||||
* @GDK_SURFACE_TOPLEVEL: toplevel window (used to implement #GtkWindow)
|
||||
* @GDK_SURFACE_CHILD: child surface (used to implement e.g. #GtkEntry)
|
||||
* @GDK_SURFACE_TEMP: override redirect temporary surface (used to implement #GtkMenu)
|
||||
* @GDK_SURFACE_POPUP: popup window with semantics like xdg-popover
|
||||
*
|
||||
* Describes the kind of surface.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_SURFACE_TOPLEVEL,
|
||||
GDK_SURFACE_CHILD,
|
||||
GDK_SURFACE_TEMP
|
||||
GDK_SURFACE_TEMP,
|
||||
GDK_SURFACE_POPUP
|
||||
} GdkSurfaceType;
|
||||
|
||||
/* Size restriction enumeration.
|
||||
@@ -246,7 +246,7 @@ typedef enum
|
||||
GDK_SURFACE_EDGE_EAST,
|
||||
GDK_SURFACE_EDGE_SOUTH_WEST,
|
||||
GDK_SURFACE_EDGE_SOUTH,
|
||||
GDK_SURFACE_EDGE_SOUTH_EAST
|
||||
GDK_SURFACE_EDGE_SOUTH_EAST
|
||||
} GdkSurfaceEdge;
|
||||
|
||||
/**
|
||||
@@ -413,23 +413,6 @@ typedef struct _GdkSurfaceClass GdkSurfaceClass;
|
||||
#define GDK_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE, GdkSurfaceClass))
|
||||
|
||||
|
||||
struct _GdkSurfaceClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gdk_reserved1) (void);
|
||||
void (*_gdk_reserved2) (void);
|
||||
void (*_gdk_reserved3) (void);
|
||||
void (*_gdk_reserved4) (void);
|
||||
void (*_gdk_reserved5) (void);
|
||||
void (*_gdk_reserved6) (void);
|
||||
void (*_gdk_reserved7) (void);
|
||||
void (*_gdk_reserved8) (void);
|
||||
};
|
||||
|
||||
/* Surfaces
|
||||
*/
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_surface_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -437,13 +420,12 @@ GdkSurface * gdk_surface_new_toplevel (GdkDisplay *display,
|
||||
int width,
|
||||
int height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_surface_new_temp (GdkDisplay *display,
|
||||
const GdkRectangle *position);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_surface_new_popup (GdkDisplay *display,
|
||||
const GdkRectangle *position);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_surface_new_temp (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_surface_new_child (GdkSurface *parent,
|
||||
const GdkRectangle *position);
|
||||
GdkSurface *parent,
|
||||
gboolean autohide);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_destroy (GdkSurface *surface);
|
||||
@@ -452,6 +434,9 @@ GdkSurfaceType gdk_surface_get_surface_type (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_is_destroyed (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_surface_get_parent (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkDisplay * gdk_surface_get_display (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -461,20 +446,10 @@ void gdk_surface_hide (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_show_unraised (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_move (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_resize (GdkSurface *surface,
|
||||
gint width,
|
||||
gint height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_move_resize (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_move_to_rect (GdkSurface *surface,
|
||||
const GdkRectangle *rect,
|
||||
GdkGravity rect_anchor,
|
||||
@@ -510,39 +485,15 @@ void gdk_surface_input_shape_combine_region (GdkSurface *surface,
|
||||
const cairo_region_t *shape_region,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_set_child_input_shapes (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_merge_child_input_shapes (GdkSurface *surface);
|
||||
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_set_pass_through (GdkSurface *surface,
|
||||
gboolean pass_through);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_get_pass_through (GdkSurface *surface);
|
||||
|
||||
/*
|
||||
* Check if a surface has been shown, and whether all its
|
||||
* parents up to a toplevel have been shown, respectively.
|
||||
* Note that a surface that is_viewable below is not necessarily
|
||||
* viewable in the X sense.
|
||||
*/
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_is_visible (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_is_viewable (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_is_input_only (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurfaceState gdk_surface_get_state (GdkSurface *surface);
|
||||
|
||||
|
||||
/* GdkSurface */
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_has_native (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_set_type_hint (GdkSurface *surface,
|
||||
GdkSurfaceTypeHint hint);
|
||||
@@ -583,12 +534,6 @@ GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor *gdk_surface_get_device_cursor (GdkSurface *surface,
|
||||
GdkDevice *device);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_get_geometry (GdkSurface *surface,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
int gdk_surface_get_width (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
int gdk_surface_get_height (GdkSurface *surface);
|
||||
@@ -597,55 +542,20 @@ void gdk_surface_get_position (GdkSurface *surface,
|
||||
gint *x,
|
||||
gint *y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gint gdk_surface_get_origin (GdkSurface *surface,
|
||||
gint *x,
|
||||
gint *y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_get_root_coords (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y,
|
||||
gint *root_x,
|
||||
gint *root_y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_coords_to_parent (GdkSurface *surface,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble *parent_x,
|
||||
gdouble *parent_y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_coords_from_parent (GdkSurface *surface,
|
||||
gdouble parent_x,
|
||||
gdouble parent_y,
|
||||
gdouble *x,
|
||||
gdouble *y);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_get_root_origin (GdkSurface *surface,
|
||||
gint *x,
|
||||
gint *y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_get_frame_extents (GdkSurface *surface,
|
||||
GdkRectangle *rect);
|
||||
gboolean gdk_surface_translate_coordinates (GdkSurface *from,
|
||||
GdkSurface *to,
|
||||
double *x,
|
||||
double *y);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gint gdk_surface_get_scale_factor (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_surface_get_device_position (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
double *x,
|
||||
double *y,
|
||||
GdkModifierType *mask);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_surface_get_parent (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_surface_get_toplevel (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GList * gdk_surface_get_children (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GList * gdk_surface_peek_children (GdkSurface *surface);
|
||||
|
||||
void gdk_surface_get_device_position (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
double *x,
|
||||
double *y,
|
||||
GdkModifierType *mask);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_set_icon_list (GdkSurface *surface,
|
||||
GList *surfaces);
|
||||
@@ -737,7 +647,6 @@ void gdk_surface_begin_move_drag_for_device (GdkSurface *surface,
|
||||
gint y,
|
||||
guint32 timestamp);
|
||||
|
||||
/* Interface for dirty-region queueing */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_queue_expose (GdkSurface *surface);
|
||||
|
||||
@@ -754,14 +663,12 @@ void gdk_surface_constrain_size (GdkGeometry *geometry,
|
||||
gint *new_width,
|
||||
gint *new_height);
|
||||
|
||||
/* Multidevice support */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_set_support_multidevice (GdkSurface *surface,
|
||||
gboolean support_multidevice);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_get_support_multidevice (GdkSurface *surface);
|
||||
|
||||
/* Frame clock */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkFrameClock* gdk_surface_get_frame_clock (GdkSurface *surface);
|
||||
|
||||
|
@@ -1,338 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdksurfaceimpl.h"
|
||||
|
||||
#include "gdkinternals.h"
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GdkSurfaceImpl, gdk_surface_impl, G_TYPE_OBJECT);
|
||||
|
||||
static gboolean
|
||||
gdk_surface_impl_beep (GdkSurface *surface)
|
||||
{
|
||||
/* FALSE means surfaces can't beep, so the display will be
|
||||
* made to beep instead. */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkDisplay *
|
||||
get_display_for_surface (GdkSurface *primary,
|
||||
GdkSurface *secondary)
|
||||
{
|
||||
GdkDisplay *display = gdk_surface_get_display (primary);
|
||||
|
||||
if (display)
|
||||
return display;
|
||||
|
||||
display = gdk_surface_get_display (secondary);
|
||||
|
||||
if (display)
|
||||
return display;
|
||||
|
||||
g_warning ("no display for surface, using default");
|
||||
return gdk_display_get_default ();
|
||||
}
|
||||
|
||||
static GdkMonitor *
|
||||
get_monitor_for_rect (GdkDisplay *display,
|
||||
const GdkRectangle *rect)
|
||||
{
|
||||
gint biggest_area = G_MININT;
|
||||
GdkMonitor *best_monitor = NULL;
|
||||
GdkMonitor *monitor;
|
||||
GdkRectangle workarea;
|
||||
GdkRectangle intersection;
|
||||
gint x;
|
||||
gint y;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < gdk_display_get_n_monitors (display); i++)
|
||||
{
|
||||
monitor = gdk_display_get_monitor (display, i);
|
||||
gdk_monitor_get_workarea (monitor, &workarea);
|
||||
|
||||
if (gdk_rectangle_intersect (&workarea, rect, &intersection))
|
||||
{
|
||||
if (intersection.width * intersection.height > biggest_area)
|
||||
{
|
||||
biggest_area = intersection.width * intersection.height;
|
||||
best_monitor = monitor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (best_monitor)
|
||||
return best_monitor;
|
||||
|
||||
x = rect->x + rect->width / 2;
|
||||
y = rect->y + rect->height / 2;
|
||||
|
||||
return gdk_display_get_monitor_at_point (display, x, y);
|
||||
}
|
||||
|
||||
static gint
|
||||
get_anchor_x_sign (GdkGravity anchor)
|
||||
{
|
||||
switch (anchor)
|
||||
{
|
||||
case GDK_GRAVITY_STATIC:
|
||||
case GDK_GRAVITY_NORTH_WEST:
|
||||
case GDK_GRAVITY_WEST:
|
||||
case GDK_GRAVITY_SOUTH_WEST:
|
||||
return -1;
|
||||
|
||||
default:
|
||||
case GDK_GRAVITY_NORTH:
|
||||
case GDK_GRAVITY_CENTER:
|
||||
case GDK_GRAVITY_SOUTH:
|
||||
return 0;
|
||||
|
||||
case GDK_GRAVITY_NORTH_EAST:
|
||||
case GDK_GRAVITY_EAST:
|
||||
case GDK_GRAVITY_SOUTH_EAST:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
get_anchor_y_sign (GdkGravity anchor)
|
||||
{
|
||||
switch (anchor)
|
||||
{
|
||||
case GDK_GRAVITY_STATIC:
|
||||
case GDK_GRAVITY_NORTH_WEST:
|
||||
case GDK_GRAVITY_NORTH:
|
||||
case GDK_GRAVITY_NORTH_EAST:
|
||||
return -1;
|
||||
|
||||
default:
|
||||
case GDK_GRAVITY_WEST:
|
||||
case GDK_GRAVITY_CENTER:
|
||||
case GDK_GRAVITY_EAST:
|
||||
return 0;
|
||||
|
||||
case GDK_GRAVITY_SOUTH_WEST:
|
||||
case GDK_GRAVITY_SOUTH:
|
||||
case GDK_GRAVITY_SOUTH_EAST:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
maybe_flip_position (gint bounds_pos,
|
||||
gint bounds_size,
|
||||
gint rect_pos,
|
||||
gint rect_size,
|
||||
gint surface_size,
|
||||
gint rect_sign,
|
||||
gint surface_sign,
|
||||
gint offset,
|
||||
gboolean flip,
|
||||
gboolean *flipped)
|
||||
{
|
||||
gint primary;
|
||||
gint secondary;
|
||||
|
||||
*flipped = FALSE;
|
||||
primary = rect_pos + (1 + rect_sign) * rect_size / 2 + offset - (1 + surface_sign) * surface_size / 2;
|
||||
|
||||
if (!flip || (primary >= bounds_pos && primary + surface_size <= bounds_pos + bounds_size))
|
||||
return primary;
|
||||
|
||||
*flipped = TRUE;
|
||||
secondary = rect_pos + (1 - rect_sign) * rect_size / 2 - offset - (1 - surface_sign) * surface_size / 2;
|
||||
|
||||
if (secondary >= bounds_pos && secondary + surface_size <= bounds_pos + bounds_size)
|
||||
return secondary;
|
||||
|
||||
*flipped = FALSE;
|
||||
return primary;
|
||||
}
|
||||
|
||||
static GdkSurface *
|
||||
traverse_to_toplevel (GdkSurface *surface,
|
||||
gint x,
|
||||
gint y,
|
||||
gint *toplevel_x,
|
||||
gint *toplevel_y)
|
||||
{
|
||||
GdkSurface *parent;
|
||||
gdouble xf = x;
|
||||
gdouble yf = y;
|
||||
|
||||
while ((parent = surface->parent) != NULL)
|
||||
{
|
||||
gdk_surface_coords_to_parent (surface, xf, yf, &xf, &yf);
|
||||
surface = parent;
|
||||
}
|
||||
|
||||
*toplevel_x = (gint) xf;
|
||||
*toplevel_y = (gint) yf;
|
||||
return surface;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_impl_move_to_rect (GdkSurface *surface,
|
||||
const GdkRectangle *rect,
|
||||
GdkGravity rect_anchor,
|
||||
GdkGravity surface_anchor,
|
||||
GdkAnchorHints anchor_hints,
|
||||
gint rect_anchor_dx,
|
||||
gint rect_anchor_dy)
|
||||
{
|
||||
GdkSurface *transient_for_toplevel;
|
||||
GdkDisplay *display;
|
||||
GdkMonitor *monitor;
|
||||
GdkRectangle bounds;
|
||||
GdkRectangle root_rect = *rect;
|
||||
GdkRectangle flipped_rect;
|
||||
GdkRectangle final_rect;
|
||||
gboolean flipped_x;
|
||||
gboolean flipped_y;
|
||||
|
||||
/*
|
||||
* First translate the anchor rect to toplevel coordinates. This is needed
|
||||
* because not all backends will be able to get root coordinates for
|
||||
* non-toplevel surfaces.
|
||||
*/
|
||||
transient_for_toplevel = traverse_to_toplevel (surface->transient_for,
|
||||
root_rect.x,
|
||||
root_rect.y,
|
||||
&root_rect.x,
|
||||
&root_rect.y);
|
||||
|
||||
gdk_surface_get_root_coords (transient_for_toplevel,
|
||||
root_rect.x,
|
||||
root_rect.y,
|
||||
&root_rect.x,
|
||||
&root_rect.y);
|
||||
|
||||
display = get_display_for_surface (surface, surface->transient_for);
|
||||
monitor = get_monitor_for_rect (display, &root_rect);
|
||||
gdk_monitor_get_workarea (monitor, &bounds);
|
||||
|
||||
flipped_rect.width = surface->width - surface->shadow_left - surface->shadow_right;
|
||||
flipped_rect.height = surface->height - surface->shadow_top - surface->shadow_bottom;
|
||||
flipped_rect.x = maybe_flip_position (bounds.x,
|
||||
bounds.width,
|
||||
root_rect.x,
|
||||
root_rect.width,
|
||||
flipped_rect.width,
|
||||
get_anchor_x_sign (rect_anchor),
|
||||
get_anchor_x_sign (surface_anchor),
|
||||
rect_anchor_dx,
|
||||
anchor_hints & GDK_ANCHOR_FLIP_X,
|
||||
&flipped_x);
|
||||
flipped_rect.y = maybe_flip_position (bounds.y,
|
||||
bounds.height,
|
||||
root_rect.y,
|
||||
root_rect.height,
|
||||
flipped_rect.height,
|
||||
get_anchor_y_sign (rect_anchor),
|
||||
get_anchor_y_sign (surface_anchor),
|
||||
rect_anchor_dy,
|
||||
anchor_hints & GDK_ANCHOR_FLIP_Y,
|
||||
&flipped_y);
|
||||
|
||||
final_rect = flipped_rect;
|
||||
|
||||
if (anchor_hints & GDK_ANCHOR_SLIDE_X)
|
||||
{
|
||||
if (final_rect.x + final_rect.width > bounds.x + bounds.width)
|
||||
final_rect.x = bounds.x + bounds.width - final_rect.width;
|
||||
|
||||
if (final_rect.x < bounds.x)
|
||||
final_rect.x = bounds.x;
|
||||
}
|
||||
|
||||
if (anchor_hints & GDK_ANCHOR_SLIDE_Y)
|
||||
{
|
||||
if (final_rect.y + final_rect.height > bounds.y + bounds.height)
|
||||
final_rect.y = bounds.y + bounds.height - final_rect.height;
|
||||
|
||||
if (final_rect.y < bounds.y)
|
||||
final_rect.y = bounds.y;
|
||||
}
|
||||
|
||||
if (anchor_hints & GDK_ANCHOR_RESIZE_X)
|
||||
{
|
||||
if (final_rect.x < bounds.x)
|
||||
{
|
||||
final_rect.width -= bounds.x - final_rect.x;
|
||||
final_rect.x = bounds.x;
|
||||
}
|
||||
|
||||
if (final_rect.x + final_rect.width > bounds.x + bounds.width)
|
||||
final_rect.width = bounds.x + bounds.width - final_rect.x;
|
||||
}
|
||||
|
||||
if (anchor_hints & GDK_ANCHOR_RESIZE_Y)
|
||||
{
|
||||
if (final_rect.y < bounds.y)
|
||||
{
|
||||
final_rect.height -= bounds.y - final_rect.y;
|
||||
final_rect.y = bounds.y;
|
||||
}
|
||||
|
||||
if (final_rect.y + final_rect.height > bounds.y + bounds.height)
|
||||
final_rect.height = bounds.y + bounds.height - final_rect.y;
|
||||
}
|
||||
|
||||
flipped_rect.x -= surface->shadow_left;
|
||||
flipped_rect.y -= surface->shadow_top;
|
||||
flipped_rect.width += surface->shadow_left + surface->shadow_right;
|
||||
flipped_rect.height += surface->shadow_top + surface->shadow_bottom;
|
||||
|
||||
final_rect.x -= surface->shadow_left;
|
||||
final_rect.y -= surface->shadow_top;
|
||||
final_rect.width += surface->shadow_left + surface->shadow_right;
|
||||
final_rect.height += surface->shadow_top + surface->shadow_bottom;
|
||||
|
||||
if (final_rect.width != surface->width || final_rect.height != surface->height)
|
||||
gdk_surface_move_resize (surface, final_rect.x, final_rect.y, final_rect.width, final_rect.height);
|
||||
else
|
||||
gdk_surface_move (surface, final_rect.x, final_rect.y);
|
||||
|
||||
g_signal_emit_by_name (surface,
|
||||
"moved-to-rect",
|
||||
&flipped_rect,
|
||||
&final_rect,
|
||||
flipped_x,
|
||||
flipped_y);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_impl_class_init (GdkSurfaceImplClass *impl_class)
|
||||
{
|
||||
impl_class->beep = gdk_surface_impl_beep;
|
||||
impl_class->move_to_rect = gdk_surface_impl_move_to_rect;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_impl_init (GdkSurfaceImpl *impl)
|
||||
{
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
* Copyright (C) 2019 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -15,37 +15,87 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
/* Uninstalled header defining types and functions internal to GDK */
|
||||
|
||||
#ifndef __GDK_SURFACE_IMPL_H__
|
||||
#define __GDK_SURFACE_IMPL_H__
|
||||
#ifndef __GDK_SURFACE_PRIVATE_H__
|
||||
#define __GDK_SURFACE_PRIVATE_H__
|
||||
|
||||
#include <gdk/gdksurface.h>
|
||||
#include <gdk/gdkproperty.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include "gdkenumtypes.h"
|
||||
#include "gdksurface.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_SURFACE_IMPL (gdk_surface_impl_get_type ())
|
||||
#define GDK_SURFACE_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImpl))
|
||||
#define GDK_SURFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImplClass))
|
||||
#define GDK_IS_SURFACE_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL))
|
||||
#define GDK_IS_SURFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL))
|
||||
#define GDK_SURFACE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImplClass))
|
||||
|
||||
typedef struct _GdkSurfaceImpl GdkSurfaceImpl;
|
||||
typedef struct _GdkSurfaceImplClass GdkSurfaceImplClass;
|
||||
|
||||
struct _GdkSurfaceImpl
|
||||
struct _GdkSurface
|
||||
{
|
||||
GObject parent;
|
||||
GObject parent_instance;
|
||||
|
||||
GdkDisplay *display;
|
||||
|
||||
GdkSurface *transient_for; /* for toplevels */
|
||||
GdkSurface *parent; /* for popups */
|
||||
GList *children; /* popups */
|
||||
|
||||
gpointer widget;
|
||||
|
||||
gint x;
|
||||
gint y;
|
||||
|
||||
guint8 surface_type;
|
||||
|
||||
guint8 resize_count;
|
||||
|
||||
GdkGLContext *gl_paint_context;
|
||||
|
||||
cairo_region_t *update_area;
|
||||
guint update_freeze_count;
|
||||
/* This is the update_area that was in effect when the current expose
|
||||
started. It may be smaller than the expose area if we'e painting
|
||||
more than we have to, but it represents the "true" damage. */
|
||||
cairo_region_t *active_update_area;
|
||||
|
||||
GdkSurfaceState old_state;
|
||||
GdkSurfaceState state;
|
||||
|
||||
guint8 alpha;
|
||||
guint8 fullscreen_mode;
|
||||
|
||||
guint modal_hint : 1;
|
||||
|
||||
guint destroyed : 2;
|
||||
|
||||
guint accept_focus : 1;
|
||||
guint focus_on_map : 1;
|
||||
guint support_multidevice : 1;
|
||||
guint viewable : 1; /* mapped and all parents mapped */
|
||||
guint in_update : 1;
|
||||
guint frame_clock_events_paused : 1;
|
||||
guint autohide : 1;
|
||||
|
||||
guint update_and_descendants_freeze_count;
|
||||
|
||||
gint width, height;
|
||||
gint shadow_top;
|
||||
gint shadow_left;
|
||||
gint shadow_right;
|
||||
gint shadow_bottom;
|
||||
|
||||
GdkCursor *cursor;
|
||||
GHashTable *device_cursor;
|
||||
|
||||
cairo_region_t *input_shape;
|
||||
|
||||
GList *devices_inside;
|
||||
|
||||
GdkFrameClock *frame_clock; /* NULL to use from parent or default */
|
||||
|
||||
GSList *draw_contexts;
|
||||
GdkDrawContext *paint_context;
|
||||
|
||||
cairo_region_t *opaque_region;
|
||||
};
|
||||
|
||||
struct _GdkSurfaceImplClass
|
||||
struct _GdkSurfaceClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
@@ -100,18 +150,12 @@ struct _GdkSurfaceImplClass
|
||||
/* Called to do the windowing system specific part of gdk_surface_destroy(),
|
||||
*
|
||||
* surface: The window being destroyed
|
||||
* recursing: If TRUE, then this is being called because a parent
|
||||
* was destroyed. This generally means that the call to the windowing
|
||||
* system to destroy the surface can be omitted, since it will be
|
||||
* destroyed as a result of the parent being destroyed.
|
||||
* Unless @foreign_destroy
|
||||
* foreign_destroy: If TRUE, the surface or a parent was destroyed by some
|
||||
* external agency. The surface has already been destroyed and no
|
||||
* windowing system calls should be made. (This may never happen
|
||||
* for some windowing systems.)
|
||||
*/
|
||||
void (* destroy) (GdkSurface *surface,
|
||||
gboolean recursing,
|
||||
gboolean foreign_destroy);
|
||||
|
||||
|
||||
@@ -210,9 +254,9 @@ struct _GdkSurfaceImplClass
|
||||
gboolean (* supports_edge_constraints)(GdkSurface *surface);
|
||||
};
|
||||
|
||||
/* Interface Functions */
|
||||
GType gdk_surface_impl_get_type (void) G_GNUC_CONST;
|
||||
void gdk_surface_set_state (GdkSurface *surface,
|
||||
GdkSurfaceState new_state);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_SURFACE_IMPL_H__ */
|
||||
#endif /* __GDK_SURFACE_PRIVATE_H__ */
|
@@ -475,7 +475,7 @@ gdk_vulkan_context_class_init (GdkVulkanContextClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
@@ -1126,7 +1126,7 @@ gdk_vulkan_context_class_init (GdkVulkanContextClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
|
@@ -44,17 +44,9 @@ gdk_public_sources = files([
|
||||
'gdktexture.c',
|
||||
'gdkvulkancontext.c',
|
||||
'gdksurface.c',
|
||||
'gdksurfaceimpl.c',
|
||||
'gdkprofiler.c'
|
||||
])
|
||||
|
||||
if not win32_enabled
|
||||
gdk_public_sources += files([
|
||||
'capture/sp-capture-writer.c',
|
||||
'capture/sp-clock.c'
|
||||
])
|
||||
endif
|
||||
|
||||
gdk_public_headers = files([
|
||||
'gdk-autocleanup.h',
|
||||
'gdk.h',
|
||||
@@ -189,6 +181,12 @@ gdk_deps = [
|
||||
vulkan_dep,
|
||||
]
|
||||
|
||||
if profiler_enabled
|
||||
if profiler_dep.found()
|
||||
gdk_deps += [profiler_dep]
|
||||
endif
|
||||
endif
|
||||
|
||||
# add generated gdk sources
|
||||
gdk_sources += [
|
||||
gdkconfig,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user