Compare commits
747 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d3b614836f | |||
| 5a0d1a79c5 | |||
| 6fa4aef811 | |||
| 442adf6359 | |||
| 4744058832 | |||
| cf94da2ca1 | |||
| 800c712738 | |||
| 1eb3b34bce | |||
| 788478dff9 | |||
| bd643e0e1a | |||
| 608c25453b | |||
| f5d96f7110 | |||
| 99d849412b | |||
| 60e185e496 | |||
| 6e9db05601 | |||
| 45cfb405c0 | |||
| d51c9e0337 | |||
| 46b6c2f024 | |||
| 048bbb0e6d | |||
| 17fce05123 | |||
| 7197758600 | |||
| 955c798ab1 | |||
| cd8576ec19 | |||
| d31896bdba | |||
| 0fac139057 | |||
| 9b83858d9a | |||
| 56133a1feb | |||
| 17f48e3a9e | |||
| 7543e7b279 | |||
| e0e46a4f6b | |||
| 7651061920 | |||
| 6d5f2ff87e | |||
| da8fdab87b | |||
| acfc4f8910 | |||
| 5ff39b207b | |||
| ecfcb3e2cc | |||
| 1e39790c49 | |||
| 4f7abe3762 | |||
| 268efd1475 | |||
| df7b275de8 | |||
| beb28dd3e9 | |||
| f5c5e9385e | |||
| 8bc523ef59 | |||
| 32aa33e8d1 | |||
| ebc379287f | |||
| a7173d097f | |||
| 95b075b8eb | |||
| a30a54a521 | |||
| 2d1c7b8937 | |||
| 49cf85509a | |||
| 61286d5927 | |||
| ef6d5ddf27 | |||
| 632accd9cc | |||
| ed9202bf67 | |||
| b591cacc39 | |||
| 733f70ea84 | |||
| e0353b37a8 | |||
| 69c30fda5c | |||
| 360b516ef4 | |||
| 8a5092d1d9 | |||
| 7887badaa1 | |||
| c9d0bd8a72 | |||
| 85a539ce6d | |||
| c42146d88c | |||
| c7e7e35083 | |||
| 45528440e6 | |||
| 72b9d2861c | |||
| 4e4ccb76cd | |||
| a77571c42e | |||
| 0d024c2df8 | |||
| c8826ba8c7 | |||
| 98a8c66970 | |||
| c6de20496c | |||
| 92c2e99dda | |||
| e2ce0700a6 | |||
| 55fd3a762c | |||
| 6a618bf48c | |||
| d50dd1d33c | |||
| bac7408be4 | |||
| 5108a27e6c | |||
| e14cf55b31 | |||
| 00631af967 | |||
| 79ac0caa98 | |||
| 3f4bed4d8f | |||
| fc855eea7a | |||
| 047bb15cd7 | |||
| 21e3d4f2f7 | |||
| 4aca13e39e | |||
| 95aa4769f6 | |||
| c8d9e5b564 | |||
| 8b95515c0c | |||
| d9b02ea4a3 | |||
| 5c5c8bdd81 | |||
| 5536d9bcde | |||
| 8338b7e4cd | |||
| 710f332082 | |||
| 36fedb0c4b | |||
| 90555e06be | |||
| a353e77db4 | |||
| 8a8c6c0722 | |||
| 9a84d8a261 | |||
| 0c20ba7dcb | |||
| 7dd466ad74 | |||
| c0c777077a | |||
| ae4aaf7354 | |||
| 592a0d46b4 | |||
| cdcd3ca359 | |||
| 585af218a3 | |||
| eedbec2066 | |||
| 713d3834f6 | |||
| e2949e7bf7 | |||
| d0973fdb78 | |||
| 5f701cf4c9 | |||
| 1ddace0a5f | |||
| 818d2e238b | |||
| 48415955f0 | |||
| 433120ae5e | |||
| a91c88768e | |||
| ee01ee249f | |||
| af6eab850e | |||
| 964abf7423 | |||
| 52a90758f9 | |||
| 4df13b7262 | |||
| 1e3e544bfd | |||
| 5442293ce7 | |||
| 7e405c286f | |||
| 41e9eaf64f | |||
| 0ecd08ed04 | |||
| 5d0d1e524e | |||
| d859cf19f6 | |||
| 22ad7b7782 | |||
| ec729d0649 | |||
| 063f79b594 | |||
| 2fdb266c0d | |||
| f60b2a11c5 | |||
| f229f96d69 | |||
| 41bf293efd | |||
| 61eabc4778 | |||
| 56631d02bd | |||
| c756cef80a | |||
| d781599b0d | |||
| 1f3f933edf | |||
| 21189b9f7e | |||
| 5f9e6ec2dc | |||
| 650c9f3b7e | |||
| 90a5fa80af | |||
| 7fde5213b0 | |||
| 9372cbdbf8 | |||
| e417b18373 | |||
| c78e7e7f17 | |||
| aaa335b9e8 | |||
| 8c6395d8a1 | |||
| 10a44e8f7a | |||
| 3c34ca3405 | |||
| 0ac24904bd | |||
| 5a01208f55 | |||
| 053b65a21a | |||
| fdc01f80af | |||
| 0e44722fd8 | |||
| dd7a851f69 | |||
| 45c0461f9b | |||
| dd721acb84 | |||
| e4bf60224b | |||
| c41231cc0f | |||
| e2882e4845 | |||
| d9a433daf7 | |||
| 03a30e462e | |||
| 5f26876acb | |||
| 2eb874a8b0 | |||
| c160340e6c | |||
| 113e1d1dc0 | |||
| 824fa0314d | |||
| ef9ac24e95 | |||
| 6fbc439fd7 | |||
| 3656c21030 | |||
| 9930e6dcaa | |||
| 4aa0d16865 | |||
| 95e8ae6e75 | |||
| 2aa3eea781 | |||
| bdaef1f88d | |||
| 264cab2b52 | |||
| 2873195644 | |||
| cc22325612 | |||
| 120abd9a6e | |||
| 1a3bdefb00 | |||
| 18a2a6a90e | |||
| d8cc9d9a51 | |||
| ffa49723a2 | |||
| 276a510b4b | |||
| e6e511eb46 | |||
| fcdec5ac41 | |||
| 3c997239e9 | |||
| 3f3725d97b | |||
| 992c5f0dd6 | |||
| 69a0b31d2d | |||
| 00f618ea1a | |||
| 5a5e74bbe2 | |||
| 89e12495b6 | |||
| 574c774e4e | |||
| 42e1fad138 | |||
| f66060c422 | |||
| 37d0159a84 | |||
| 969b9c6552 | |||
| b519b642bd | |||
| 5ea3a1028d | |||
| 869f300f0a | |||
| 7a73ec1bb2 | |||
| bb41cfe9d9 | |||
| cacda8086e | |||
| d8ba193e9a | |||
| fce2565673 | |||
| 76b3fee093 | |||
| 16d79e8883 | |||
| efaabdad0a | |||
| fdbb93d78c | |||
| 75d37acb25 | |||
| 495f764b3d | |||
| 0eb2fb01fd | |||
| 398697eb2f | |||
| f0ae8da993 | |||
| ad30262fef | |||
| 5f14630b76 | |||
| dbbab0791d | |||
| fb50015519 | |||
| eb8f60f141 | |||
| afd9709aff | |||
| 47191ce173 | |||
| 7a1eabaf62 | |||
| 43a2676c3f | |||
| bfd4933aa3 | |||
| b0313c7bcf | |||
| c7451bbf3b | |||
| 8c7623de84 | |||
| dae447728d | |||
| 8765970ba1 | |||
| 0b4c37624a | |||
| f83c903ed8 | |||
| 6e001acbf9 | |||
| 228e51b319 | |||
| 55b7838b4f | |||
| 2b5a49c285 | |||
| 689363a782 | |||
| 2401a6cb8e | |||
| 14e394d3d7 | |||
| e776c665b0 | |||
| 1fee63d097 | |||
| ef22be9bb7 | |||
| 4da281d20b | |||
| e095918128 | |||
| 1f81c83fd8 | |||
| a8cc4787d2 | |||
| 83976c47f8 | |||
| fd945be50b | |||
| c9ad936011 | |||
| d5cd05a0f4 | |||
| 778865f316 | |||
| 3f1dc87188 | |||
| c8d4eefa71 | |||
| 0814cd9f8b | |||
| 3406bbd128 | |||
| 8d6d6dcca3 | |||
| b673490a1b | |||
| 4cf6edda55 | |||
| d58c750db5 | |||
| 850143b7a0 | |||
| c40ba85ace | |||
| bbe9ef20da | |||
| 887b7356c3 | |||
| e36b57e7f9 | |||
| abe7187cfb | |||
| 86f66d26fe | |||
| 4c69dabb6e | |||
| d1dcac85f3 | |||
| eedff39413 | |||
| 8aecf2c06a | |||
| 5f980cd8de | |||
| 52e3b88382 | |||
| 168a49426e | |||
| 60a11333af | |||
| 0f79cb3d11 | |||
| a680631345 | |||
| f7b1ba0943 | |||
| 08d44648ea | |||
| 72a6459d73 | |||
| 5f40f58c36 | |||
| ac9ac55555 | |||
| 3013997e23 | |||
| f1fe70e4ad | |||
| 17f9eed14e | |||
| fc6f22c3ce | |||
| 96a3b23736 | |||
| 631e2f4c9b | |||
| 0555ef20a4 | |||
| 3a2bf9d878 | |||
| a703437796 | |||
| 506d59f526 | |||
| 77487fef2f | |||
| e75310a445 | |||
| f7813deb26 | |||
| e41a8cf6fc | |||
| b86356bc1c | |||
| 4d075cf202 | |||
| 8b6457732f | |||
| 1376c6b1b7 | |||
| eec161ab3f | |||
| 041ccd7f87 | |||
| e35d91d18f | |||
| 9ca9fccace | |||
| f88a5dc8c7 | |||
| f733fa88f5 | |||
| 23641e3103 | |||
| bd031b89c1 | |||
| 182dd3c1ea | |||
| a46d4e51f7 | |||
| 70c3241bd3 | |||
| 32326f826f | |||
| 4590501854 | |||
| 385e6beafe | |||
| c16fa45bfe | |||
| fea13fcfc1 | |||
| 2002613012 | |||
| a51378dda8 | |||
| 433c20e59d | |||
| e2a0780543 | |||
| a1f7c459b7 | |||
| ec8a29b0c2 | |||
| 40c129f906 | |||
| f32ec2e4be | |||
| 1aa3000ae6 | |||
| a55000613a | |||
| 21536775d7 | |||
| 1c3475d58a | |||
| 6ae1dc73c7 | |||
| 579c56ffd7 | |||
| 8b1648fe5b | |||
| aa47269273 | |||
| a8c79c2da1 | |||
| 1c099ec784 | |||
| 183257f9e1 | |||
| 0144861dca | |||
| 86ff51b842 | |||
| 98452efea2 | |||
| 1bad7865d3 | |||
| 2893a71a3e | |||
| 318c97c959 | |||
| 35486e7990 | |||
| 7b6a6c9421 | |||
| 9464415121 | |||
| 0f26b26f1d | |||
| 4e66cca58d | |||
| 911f3fb6d2 | |||
| 15845b53cd | |||
| 5ee7445048 | |||
| 247f2c9192 | |||
| fc13ff501d | |||
| e14c0bb394 | |||
| 33851dbe24 | |||
| 10f3d330be | |||
| f73db86a63 | |||
| 9fb44a3c67 | |||
| 3b3a623520 | |||
| cc31235d2e | |||
| 0f309c9dcf | |||
| 6440263ef3 | |||
| 7d96770453 | |||
| cf5f6759f0 | |||
| c2864a81a4 | |||
| 727bdd1929 | |||
| 298974b9da | |||
| 01e6811776 | |||
| 51bfa10eed | |||
| d58317728e | |||
| 6d7f5d4431 | |||
| 45288ec40c | |||
| 82753bc72b | |||
| 01b4720ec8 | |||
| 4af0379aae | |||
| d0f4e73999 | |||
| 8abc6e06b2 | |||
| 7eb3b6c71f | |||
| 57d24f173a | |||
| 4ed98878c6 | |||
| 5ec56d2e6e | |||
| 47ce01116b | |||
| 4455266c5b | |||
| 05ab0f2227 | |||
| 1fad6b049b | |||
| a3995d8c86 | |||
| caf709bb81 | |||
| cc2f2dd9b8 | |||
| 4cc4e18d56 | |||
| 57cafc277b | |||
| 5c2c659122 | |||
| 4cbc0191cb | |||
| 7b28b1c9ba | |||
| aebb38fad8 | |||
| ca9d15df92 | |||
| c84f544fc3 | |||
| 84776a95f7 | |||
| 173a3a9eb8 | |||
| cf0c9eb158 | |||
| 23f6ff3cec | |||
| d7b64c63e0 | |||
| a8f4269157 | |||
| e3ef5d6fd2 | |||
| 3f5d462305 | |||
| ce915dc6f0 | |||
| 8889565735 | |||
| f5d9644591 | |||
| 4f5db65a06 | |||
| c8a6b8786a | |||
| 0b0c6a6477 | |||
| d3aa9df876 | |||
| f678e48a08 | |||
| 38b315d0be | |||
| 74ba42a026 | |||
| a6ae8f6d96 | |||
| 55dddbc54a | |||
| 2e68e4fc09 | |||
| 0f4bf3d8a0 | |||
| f7ede4edca | |||
| c5c21bb1cf | |||
| 57751fa391 | |||
| 50e73dc6c7 | |||
| 213274c128 | |||
| 062f450709 | |||
| 9ea894a56d | |||
| e9a0e243f5 | |||
| cfaec2d2f5 | |||
| e46d23d819 | |||
| 9dab00310d | |||
| c044220f62 | |||
| 8821d488c5 | |||
| 1a1c30adfa | |||
| ed25153f2d | |||
| 998feeb2bc | |||
| a4a38dff0d | |||
| d644b2260f | |||
| 111f72e891 | |||
| 52e91f1f74 | |||
| 142368f095 | |||
| 1e961001af | |||
| f3f0fc6bb2 | |||
| 2e093eafbf | |||
| 44c8df62f2 | |||
| 672a67d0af | |||
| 8a7bd5cc00 | |||
| 4f2feb97c2 | |||
| 15af0e789b | |||
| bcbec384da | |||
| 2c04c5f08b | |||
| 3a337156d1 | |||
| 9843837593 | |||
| c38095faed | |||
| 0d380f43d6 | |||
| 103e11c937 | |||
| 582adcab1a | |||
| c26b2c9209 | |||
| 2eacaf2dd2 | |||
| ef62a872f5 | |||
| f99cbdf49f | |||
| ccf6507f6a | |||
| c184bd4675 | |||
| 1ae5c2a138 | |||
| e0040acefc | |||
| f5da87dde8 | |||
| eaa872f6c3 | |||
| 43ad7c9714 | |||
| 0a6755b57c | |||
| 14e0283413 | |||
| e36bfb45cd | |||
| 8d06b84670 | |||
| d123ea579f | |||
| 525676435d | |||
| db8cdd6392 | |||
| 44539d98e9 | |||
| b4a288a592 | |||
| 0939857e70 | |||
| 7de9995f7d | |||
| e7c16a5e82 | |||
| 98904b8910 | |||
| e5e9d87171 | |||
| 417e0894e7 | |||
| 706a7064a0 | |||
| a74c5a1f39 | |||
| 7a80c3b004 | |||
| fdeb4f8c16 | |||
| 017775f288 | |||
| 3d43a9b084 | |||
| 236d08c3c5 | |||
| 62a26eb3c8 | |||
| 5d7e268aac | |||
| 8f3e9d1b05 | |||
| 3b3726ae57 | |||
| 535723ce86 | |||
| 7eae4985e8 | |||
| 6717242d26 | |||
| 87970ea2d0 | |||
| 038aac6275 | |||
| d0147a6f2c | |||
| a8f11835c5 | |||
| ceeed1c48d | |||
| 892c6bd6f9 | |||
| 493aa4e9b3 | |||
| ea21c4563b | |||
| abfc9cd4eb | |||
| d1118071dd | |||
| 3534225c76 | |||
| b09fbadddf | |||
| 291e4e107d | |||
| 8fcf3a8e88 | |||
| e1ff15549b | |||
| 9f3dfa2031 | |||
| 5f5fc1d530 | |||
| 3a19c76017 | |||
| 5018c7f7cb | |||
| 75ed941ef1 | |||
| c96945b390 | |||
| 3d45d53714 | |||
| 81fe943472 | |||
| 0a6443ebaf | |||
| 508d31fe70 | |||
| 975d9d4314 | |||
| e991e4333d | |||
| 0a31609201 | |||
| f4e44e9e6e | |||
| 7b58ca4623 | |||
| 2f2edbd620 | |||
| 5624da20e3 | |||
| 9f1d651e0b | |||
| ff9532db27 | |||
| 74531123ae | |||
| 5f11eaa168 | |||
| 30738fbfdd | |||
| 9a6aa8db68 | |||
| 735cf98af1 | |||
| 3715fec02d | |||
| 615e4332ef | |||
| 7b20bb917f | |||
| a5846645d1 | |||
| d2c0f37a69 | |||
| 326f0aad5d | |||
| dffceb1a17 | |||
| a8dc098699 | |||
| 6194c90f74 | |||
| e8f9e7d472 | |||
| bee90aa8c8 | |||
| ee99ca6610 | |||
| 0c77879bd0 | |||
| 6bbedfe5f3 | |||
| 6128082f20 | |||
| 4222e8d713 | |||
| 2f833d4f44 | |||
| 69d9746708 | |||
| f6870e5b79 | |||
| 3c29212ce3 | |||
| 025b801663 | |||
| 940415b2eb | |||
| d5a21e47e3 | |||
| dcf80f3df5 | |||
| e78c3e2c8c | |||
| a73c858f4b | |||
| 6bdaa95164 | |||
| ccbb51dff1 | |||
| 42280f6c4e | |||
| 4e974edde8 | |||
| 9dcb33ad34 | |||
| 94b680c2cd | |||
| 3f4bd447f8 | |||
| 39097ea2da | |||
| f46c31f2fb | |||
| 6291899681 | |||
| 41b53ca603 | |||
| 1331740dd6 | |||
| c9420aa1a3 | |||
| cc16a6ca6c | |||
| 0a200e29ca | |||
| e34bb3d483 | |||
| 140a64eea4 | |||
| e82093fc14 | |||
| 6b0d389bfd | |||
| 395db3afb6 | |||
| a3d68af950 | |||
| 14d166145a | |||
| 5cdb9752a7 | |||
| 6e68237191 | |||
| 8abf82fcf4 | |||
| 05460f4982 | |||
| 3c50c0988a | |||
| c39bd623f6 | |||
| 7295c8f12b | |||
| 100623e455 | |||
| be19ee29c2 | |||
| 3897041f4a | |||
| 15dbadf389 | |||
| 0bf474e324 | |||
| f93795d272 | |||
| 93e61c1f24 | |||
| d120346992 | |||
| 5a0dc74ded | |||
| 0c02bc4239 | |||
| a3dfffa8b8 | |||
| 0004e667ab | |||
| 2dfc03bdb5 | |||
| c53f4bb342 | |||
| ba63f95a4a | |||
| 62da080bd0 | |||
| ba6522d3f2 | |||
| 1914e65591 | |||
| f3bd78a3cf | |||
| 916d9e4a52 | |||
| 112e74ed64 | |||
| 5e4672092a | |||
| dadc37e64d | |||
| 919bdff7ac | |||
| d1fd8267ef | |||
| b858d45e3c | |||
| fbad4f6c03 | |||
| e3fa5592be | |||
| cff37ce26e | |||
| 66be6a018c | |||
| 3526f2081b | |||
| dd8db0f5cb | |||
| bcfa41cec6 | |||
| 9a2327a35e | |||
| 75bcecb363 | |||
| f2cd7f151e | |||
| cfdbd59963 | |||
| 978afce04a | |||
| a00842fa99 | |||
| 40049581bc | |||
| c79ccfd6f1 | |||
| 79afd7c8d7 | |||
| 1f8b0852a4 | |||
| a03583d14f | |||
| c0573272f3 | |||
| f634684eeb | |||
| 72a809be0a | |||
| 051eedcea1 | |||
| 9752ab1711 | |||
| 82b7d21f6e | |||
| f7d7d345da | |||
| 4bc09a6a17 | |||
| 10d0dad2cf | |||
| 99c65b1587 | |||
| 7866d4ba21 | |||
| fee46bda00 | |||
| af7e73f9df | |||
| 3b83e4ee5c | |||
| c750cea4e5 | |||
| 2e83e7d335 | |||
| 80226ca926 | |||
| b22919220b | |||
| 3b18ea71c3 | |||
| c9d9c9158f | |||
| 2b6a4ba890 | |||
| 23a4affb6f | |||
| 40e0973709 | |||
| 2fbc77fce1 | |||
| a2f550d91b | |||
| 0e34c87211 | |||
| 54c6c7ae87 | |||
| 91467a45fc | |||
| 39453478ab | |||
| c543ddab3a | |||
| dd7c65a95a | |||
| a6f935bb77 | |||
| d941e5f0c0 | |||
| 8d1227a97c | |||
| 9744e86e04 | |||
| b547c0319a | |||
| 93aeb63f0c | |||
| a0bf0a0f70 | |||
| 4d9d655b4e | |||
| 23948d6a3a | |||
| d3c147a62d | |||
| 763aa4db94 | |||
| 6556e7e08d | |||
| e683e915b8 | |||
| f7ee61c833 | |||
| 7afac9670b | |||
| 7d1e79ef4b | |||
| 202116c60c | |||
| 5c46db1d77 | |||
| cc529c2423 | |||
| d5531da7f8 | |||
| 8495c0c7ad | |||
| db5cbce4d5 | |||
| 5b36bd704b | |||
| 59637c95a6 | |||
| b3d90fe51b | |||
| 6a214c9bcd | |||
| eb88ce429c | |||
| 2a615e2e45 | |||
| 7eac2bc4c3 | |||
| 64fea1be04 | |||
| d2838a2408 | |||
| 8b5d30d439 | |||
| 07722ae2dd | |||
| af4031d9fe | |||
| 11015a49ae | |||
| d26c8e0536 | |||
| d6a467d48e | |||
| a2da26de04 | |||
| 7b2e526c3a | |||
| b46cef1809 | |||
| 09551bf37a | |||
| 52c913156f | |||
| 7e9372bafa | |||
| d0fb80d31b | |||
| 95d76d0132 | |||
| 619aeb643f | |||
| cdd2651db0 | |||
| 3b08ba24b3 | |||
| 91d9ae1cc4 | |||
| 3829554f3a | |||
| c1ae4a2baf | |||
| da3cb153bc | |||
| 563230b89d | |||
| 4bbcc4a397 | |||
| 64fb9a6eb2 | |||
| 558c6ea6b5 | |||
| 63efdca223 | |||
| 61b636b8a4 | |||
| aa3020a39e | |||
| 6d3c61856b | |||
| 811c4c699f | |||
| 059e33ecea | |||
| a43e0177cf | |||
| d39424fc1c | |||
| c2330e7fd1 | |||
| 7182ae4f45 | |||
| 0192f3fe2d | |||
| 05a9006715 | |||
| 0403d94d43 | |||
| 4866f0cec4 | |||
| faa1909474 | |||
| 3fc0c2a8ea | |||
| 67b4f8ea75 | |||
| b3e1bb1654 | |||
| e356841957 | |||
| c7930417b4 | |||
| 9b5e70c9c2 | |||
| 60f0445233 | |||
| 972136803a | |||
| 60c7f22310 | |||
| 5cd7a5282e |
+5
-1
@@ -9,9 +9,13 @@ GTK+ requires the following packages:
|
||||
GdkPixbuf @GDK_PIXBUF_REQUIRED_VERSION@, ATK @ATK_REQUIRED_VERSION@
|
||||
and cairo @CAIRO_REQUIRED_VERSION@.
|
||||
|
||||
- libepoxy, for cross-platform OpenGL support.
|
||||
It can be found here: https://github.com/anholt/libepoxy
|
||||
|
||||
- Each GDK backend has its own backend-specific requirements. For
|
||||
the X11 backend, X11 R6 and XInput version 2 (as well as a number
|
||||
of other extensions) are required.
|
||||
of other extensions) are required. The Wayland backend requires
|
||||
(obviously) the Wayland libraries.
|
||||
|
||||
- gobject-introspection @INTROSPECTION_REQUIRED_VERSION@ or newer.
|
||||
|
||||
|
||||
+4
-2
@@ -33,11 +33,11 @@ MAINTAINERCLEANFILES = \
|
||||
|
||||
|
||||
## Copy .pc files to target-specific names
|
||||
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc: gtk+-3.0.pc
|
||||
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc gtk+-mir-3.0.pc: gtk+-3.0.pc
|
||||
rm -f $@ && \
|
||||
cp gtk+-3.0.pc $@
|
||||
|
||||
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc gdk-wayland-3.0.pc: gdk-3.0.pc
|
||||
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc gdk-wayland-3.0.pc gdk-mir-3.0.pc: gdk-3.0.pc
|
||||
rm -f $@ && \
|
||||
cp gdk-3.0.pc $@
|
||||
|
||||
@@ -59,12 +59,14 @@ DISTCLEANFILES = \
|
||||
gtk+-quartz-3.0.pc \
|
||||
gtk+-broadway-3.0.pc \
|
||||
gtk+-wayland-3.0.pc \
|
||||
gtk+-mir-3.0.pc \
|
||||
gdk-3.0.pc \
|
||||
gdk-x11-3.0.pc \
|
||||
gdk-win32-3.0.pc \
|
||||
gdk-quartz-3.0.pc \
|
||||
gdk-broadway-3.0.pc \
|
||||
gdk-wayland-3.0.pc \
|
||||
gdk-mir-3.0.pc \
|
||||
gail-3.0.pc \
|
||||
config.lt
|
||||
|
||||
|
||||
@@ -1,3 +1,141 @@
|
||||
Overview of Changes in GTK+ 3.15.1
|
||||
==================================
|
||||
|
||||
* An experimental mir backend has been added.
|
||||
Use --enable-mir-backend to build it.
|
||||
|
||||
* Inspector:
|
||||
- Show more information
|
||||
- Use a separate display connection
|
||||
|
||||
* Deprecations:
|
||||
- GtkStyleProperties
|
||||
|
||||
* Bugs fixed:
|
||||
707695 GtkLevelBar Colour CSS
|
||||
737561 quartz: gtk+ 3.14.0 fails to build on 10.6.8, 'NSFullScreen...
|
||||
738650 fix separator with iconic section and more
|
||||
738886 Out of bounds access in MyEnhancedXkbTranslateKeyCode
|
||||
738955 Client-side decoration window menus appear at wrong positio...
|
||||
738982 Add support for ATK_STATE_HAS_TOOLTIP
|
||||
739001 Fix Build of broadwayd on Visual Studio
|
||||
739005 gtkstatusicon.c won't build with both X11 and Quartz backen...
|
||||
739111 GtkFontChooserDialog fixes
|
||||
739150 Dragging bookmark crashes nautilus
|
||||
|
||||
Translation updates:
|
||||
Czech
|
||||
Hungarian
|
||||
Serbian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.0
|
||||
==================================
|
||||
|
||||
* GDK supports rendering windows using OpenGL; currently
|
||||
this is implemented for X11 and Wayland using libepoxy
|
||||
|
||||
* GtkGLArea: A new widget for rendering with OpenGL
|
||||
|
||||
* GtkSidebar: A new switcher for GtkStack that looks like
|
||||
a sidebar
|
||||
|
||||
* Better typography: In many places, we now use proper Unicode
|
||||
characters for dashes, quotes, multiplication signs and the
|
||||
like, instead of ASCII approximations
|
||||
|
||||
* Theming:
|
||||
- Context menus use the default font instead of inheriting from
|
||||
the widget they are attached to
|
||||
- Theming engines are no longer used
|
||||
- Backdrop style has been fine-tuned to make the difference to
|
||||
the active window more evident without affecting readability
|
||||
|
||||
* Inspector:
|
||||
- Show nested tree models
|
||||
- Add a checkbox to disable the warning dialog
|
||||
- Rearrange the UI to gain space
|
||||
- Show object counts
|
||||
|
||||
* GtkTextView has a monospace property
|
||||
|
||||
* GtkPaned has a wide-handle property
|
||||
|
||||
* GtkPrintUnixDialog
|
||||
- Has improved appearance without headerbars
|
||||
- Better rendering of sheet icons
|
||||
- No more missing icons
|
||||
|
||||
* GtkScrolledWindow
|
||||
- A new policy, GTK_POLICY_EXTERNAL, which allows scrolling
|
||||
without showing a scrollbar
|
||||
- Scroll events can now overshoot as well
|
||||
- The new signal ::edge-overshot is emitted when the scrolled
|
||||
window is fully overshot
|
||||
- Scrollbars will be overlayed as narrow indicators when
|
||||
there is no mouse
|
||||
|
||||
* Deprecations:
|
||||
- gdk_window_set_static_gravities
|
||||
- gdk_window_set_composited
|
||||
- gtk_style_context_get_background_color
|
||||
- gtk_style_context_get_border_color
|
||||
- gtk_settings_set_string/long/double_property
|
||||
- gtk_settings_install_property
|
||||
|
||||
* Bugs fixed:
|
||||
119189 Add OpenGL support to GTK+
|
||||
154709 don't use the cursor for preview
|
||||
582799 GtkContainer should parse a list of widgets for a focus chain
|
||||
671138 About dialog contains scary warranty disclaimer in copyright...
|
||||
672946 Add gtk_css_provider_load_resource_from_file
|
||||
681185 Document precedence between tooltip-markup and tooltip-text
|
||||
724096 search-bar: don't show the widget until we're ready to reveal
|
||||
725441 Print Dialog: Add support for PPD-less printing on IPP print...
|
||||
730730 scrolling is broken when sharing adjustments
|
||||
730893 Dialogs use headerbars even when DialogsUseHeader is unset
|
||||
733157 Remove redundant checks for NULL
|
||||
735192 Use better typography for paper names
|
||||
735293 No vertical stack switcher component available (Sidebar)
|
||||
735841 EmptyBoxes: instructions_label's alignment is off
|
||||
737670 GtkCalendar days cannot be selected if vertical size is grea...
|
||||
737679 Bookmarks are visually duplicated in sidebar
|
||||
737777 Applications crash randomly while printing with a password-s...
|
||||
737929 Long tooltips extend too far horizontally without wrapping
|
||||
737952 Documentation missing for GtkTextView's new draw-layer funct...
|
||||
737981 Strange frame in GtkScrolledWindow
|
||||
737983 gtkplacessidebar: Open $HOME after unmounting or ejecting
|
||||
737985 Unnecessary "GtkScrolledWindow .frame"
|
||||
737986 Transparent icon background rendered black on XFCE
|
||||
738083 GtkMenuButton is not disabled even if corresponding GAction is
|
||||
738111 GtkListBox should allow for setting "placeholder" via GtkBui...
|
||||
738158 Flat context menu button
|
||||
738272 inspector: Add a tab for object counts
|
||||
738533 Show overshoot on scroll events
|
||||
738534 Add ::edge-hit signal
|
||||
738591 Can't select file after showing header context menu
|
||||
738636 GtkStackSwitcher focus overlap border
|
||||
738670 GL Context on NVIDIA
|
||||
738860 GtkPaned: Add a "wide-handle" property
|
||||
738873 wayland backend aborts entire program if XDG_RUNTIME_DIR unset
|
||||
738912 wayland: Don't try to create a subsurface again
|
||||
|
||||
* Translation updates
|
||||
Czech
|
||||
French
|
||||
German
|
||||
Hebrew
|
||||
Indonesian
|
||||
Italian
|
||||
Kazakh
|
||||
Korean
|
||||
Persian
|
||||
Polish
|
||||
Scottish Gaelic
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.14.0 to 3.14.1
|
||||
============================================
|
||||
|
||||
|
||||
@@ -73,6 +73,12 @@ Patches should be in unified diff form. (The -up option to GNU diff)
|
||||
Even better are git-formatted patches. (Use git format-patch)
|
||||
|
||||
|
||||
Release notes for 3.16
|
||||
======================
|
||||
|
||||
* GTK+ now includes an OpenGL rendering widget. To support GL on various
|
||||
platforms, GTK+ uses libepoxy.
|
||||
|
||||
Release notes for 3.14
|
||||
======================
|
||||
|
||||
@@ -99,6 +105,14 @@ Release notes for 3.14
|
||||
to be problematic. This combination is using code paths in cairo and
|
||||
graphics drivers which are rarely tested and likely buggy.
|
||||
|
||||
* GtkTextView is now using a pixel-cache internally, and is drawing
|
||||
a background underneath the text. This can cause problems for applications
|
||||
which assumed that they could draw things below and above the text
|
||||
by chaining up in the ::draw implementation of their GtkTextView subclass.
|
||||
As a short-term workaround, you can make the application apply a
|
||||
custom theme to the text view with a transparent background. For
|
||||
a proper fix, use the new ::draw_layer vfunc.
|
||||
|
||||
Release notes for 3.12
|
||||
======================
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ The recommended build order for these dependencies:
|
||||
as described in the README.txt file in the build/win32/vs10 folder)
|
||||
-zlib
|
||||
-libpng
|
||||
-(for GDK-Pixbuf, if not using GDI+) IJG JPEG
|
||||
-(for GDK-Pixbuf, if not using GDI+) IJG JPEG or libjpeg-turbo
|
||||
-(for GDK-Pixbuf, if not using GDI+) libtiff
|
||||
[libtiff requires zlib and IJG JPEG]
|
||||
[libtiff requires zlib and IJG JPEG or libjpeg-turbo]
|
||||
-(for GDK-Pixbuf, if not using GDI+) jasper [jpeg-2000 library]
|
||||
-(optional for GLib) PCRE (version 8.12 or later, use of CMake to
|
||||
build PCRE is recommended-see build/win32/vs10/README.txt of GLib)
|
||||
@@ -81,6 +81,11 @@ built DLLs go into <root>\vs10\<PlatformName>\bin, built LIBs into
|
||||
project files higher in the stack are supposed to look for them, not
|
||||
from a specific GLib source tree.
|
||||
|
||||
Please note, as GTK+ uses the Adwaita theme for all platforms by default,
|
||||
most icons used are not included with GTK+ (which *are* needed), so please see
|
||||
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack (under the
|
||||
GTK+ section) on how to get those icons set up for use with GTK+.
|
||||
|
||||
*About the dependencies marked with *: These dependencies are optional
|
||||
as those are not compulsory components for building and running GTK+
|
||||
itself, but note that they are needed for people running and building
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\gdk;..\..\..\gdk\broadway;..\crypt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\..\gdk;..\..\..\gdk\broadway;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;$(GdkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
@@ -95,7 +95,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\gdk;..\..\..\gdk\broadway;..\crypt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\..\gdk;..\..\..\gdk\broadway;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>$(GdkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
@@ -120,7 +120,7 @@
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\gdk;..\..\..\gdk\broadway;..\crypt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\..\gdk;..\..\..\gdk\broadway;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;$(GdkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
@@ -143,7 +143,7 @@
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\gdk;..\..\..\gdk\broadway;..\crypt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\..\gdk;..\..\..\gdk\broadway;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>$(GdkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
@@ -163,8 +163,8 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\crypt\crypt3.c" />
|
||||
<ClCompile Include="..\..\..\gdk\broadway\broadwayd.c" />
|
||||
<ClCompile Include="..\..\..\gdk\broadway\broadway-buffer.c" />
|
||||
<ClCompile Include="..\..\..\gdk\broadway\broadway-output.c" />
|
||||
<ClCompile Include="..\..\..\gdk\broadway\broadway-server.c" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\crypt\crypt3.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\gdk\broadway\broadwayd.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\gdk\broadway\broadway-buffer.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\gdk\broadway\broadway-output.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\gdk\broadway\broadway-server.c"><Filter>Sources</Filter></ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<ItemDefinitionGroup>
|
||||
<Link>
|
||||
<AdditionalOptions>/EXPORT:gdk_win32_display_manager_get_type</AdditionalOptions>
|
||||
</Link
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
if "$(Configuration)" == "Release" goto END
|
||||
|
||||
@@ -33,7 +33,7 @@ echo $(Configuration) > ..\..\..\MSVC_$(Configuration)
|
||||
:DONE_GDKCONFIG_H
|
||||
</GenGdkConfigHWin32>
|
||||
<GenGdkConfigHBroadway>
|
||||
if exist ..\..\..\MSVC_$(Configuration) goto DONE_GDKCONFIG_H
|
||||
if exist ..\..\..\MSVC_$(Configuration)_Broadway goto DONE_GDKCONFIG_H
|
||||
|
||||
|
||||
if exist ..\..\..\gdk\gdkconfig.h del ..\..\..\gdk\gdkconfig.h
|
||||
@@ -53,7 +53,7 @@ copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\gdk\gdkconfig.h
|
||||
|
||||
copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\GDK_BROADWAY_BUILD
|
||||
|
||||
echo $(Configuration) > ..\..\..\MSVC_$(Configuration)
|
||||
echo $(Configuration) > ..\..\..\MSVC_$(Configuration)_Broadway
|
||||
|
||||
:DONE_GDKCONFIG_H
|
||||
</GenGdkConfigHBroadway>
|
||||
|
||||
@@ -53,6 +53,7 @@ copy ..\..\..\gdk\gdkdisplaymanager.h $(CopyDir)\include\gtk-3.0\gdk\gdkdisplaym
|
||||
copy ..\..\..\gdk\gdkdnd.h $(CopyDir)\include\gtk-3.0\gdk\gdkdnd.h
|
||||
copy ..\..\..\gdk\gdkevents.h $(CopyDir)\include\gtk-3.0\gdk\gdkevents.h
|
||||
copy ..\..\..\gdk\gdkframetimings.h $(CopyDir)\include\gtk-3.0\gdk\gdkframetimings.h
|
||||
copy ..\..\..\gdk\gdkglcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkglcontext.h
|
||||
copy ..\..\..\gdk\gdkkeys.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeys.h
|
||||
copy ..\..\..\gdk\gdkkeysyms.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeysyms.h
|
||||
copy ..\..\..\gdk\gdkkeysyms-compat.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeysyms-compat.h
|
||||
@@ -172,6 +173,7 @@ copy ..\..\..\gtk\gtkgesturerotate.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturero
|
||||
copy ..\..\..\gtk\gtkgesturesingle.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturesingle.h
|
||||
copy ..\..\..\gtk\gtkgestureswipe.h $(CopyDir)\include\gtk-3.0\gtk\gtkgestureswipe.h
|
||||
copy ..\..\..\gtk\gtkgesturezoom.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturezoom.h
|
||||
copy ..\..\..\gtk\gtkglarea.h $(CopyDir)\include\gtk-3.0\gtk\gtkglarea.h
|
||||
copy ..\..\..\gtk\gtkgrid.h $(CopyDir)\include\gtk-3.0\gtk\gtkgrid.h
|
||||
copy ..\..\..\gtk\gtkheaderbar.h $(CopyDir)\include\gtk-3.0\gtk\gtkheaderbar.h
|
||||
copy ..\..\..\gtk\gtkicontheme.h $(CopyDir)\include\gtk-3.0\gtk\gtkicontheme.h
|
||||
@@ -226,6 +228,7 @@ copy ..\..\..\gtk\gtkrecentchoosermenu.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecen
|
||||
copy ..\..\..\gtk\gtkrecentchooserwidget.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentchooserwidget.h
|
||||
copy ..\..\..\gtk\gtkrecentfilter.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentfilter.h
|
||||
copy ..\..\..\gtk\gtkrecentmanager.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentmanager.h
|
||||
copy ..\..\..\gtk\gtkrender.h $(CopyDir)\include\gtk-3.0\gtk\gtkrender.h
|
||||
copy ..\..\..\gtk\gtkrevealer.h $(CopyDir)\include\gtk-3.0\gtk\gtkrevealer.h
|
||||
copy ..\..\..\gtk\gtkscale.h $(CopyDir)\include\gtk-3.0\gtk\gtkscale.h
|
||||
copy ..\..\..\gtk\gtkscalebutton.h $(CopyDir)\include\gtk-3.0\gtk\gtkscalebutton.h
|
||||
@@ -240,6 +243,7 @@ copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-3.0\gtk\gtksepar
|
||||
copy ..\..\..\gtk\gtkseparatortoolitem.h $(CopyDir)\include\gtk-3.0\gtk\gtkseparatortoolitem.h
|
||||
copy ..\..\..\gtk\gtksettings.h $(CopyDir)\include\gtk-3.0\gtk\gtksettings.h
|
||||
copy ..\..\..\gtk\gtkshow.h $(CopyDir)\include\gtk-3.0\gtk\gtkshow.h
|
||||
copy ..\..\..\gtk\gtksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtksidebar.h
|
||||
copy ..\..\..\gtk\gtksizegroup.h $(CopyDir)\include\gtk-3.0\gtk\gtksizegroup.h
|
||||
copy ..\..\..\gtk\gtksizerequest.h $(CopyDir)\include\gtk-3.0\gtk\gtksizerequest.h
|
||||
copy ..\..\..\gtk\gtksocket.h $(CopyDir)\include\gtk-3.0\gtk\gtksocket.h
|
||||
@@ -407,9 +411,10 @@ $(CopyDir)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
|
||||
<GtkDoInstallBroadwayHeaders>
|
||||
copy ..\..\..\gdk\broadway\gdkbroadway.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
copy ..\..\..\gdk\broadway\gdkbroadwaywindow.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
copy ..\..\..\gdk\broadway\gdkbroadwaycursor.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
copy ..\..\..\gdk\broadway\gdkbroadwaydisplay.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
copy ..\..\..\gdk\broadway\gdkbroadwayvisual.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
copy ..\..\..\gdk\broadway\gdkbroadwaywindow.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
</GtkDoInstallBroadwayHeaders>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -190,6 +190,7 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\event_axes.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\expander.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\gestures.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\glarea.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\headerbar.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\hypertext.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\iconview.c" />
|
||||
@@ -213,6 +214,7 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\rotated_text.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\search_entry.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\search_entry2.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\sidebar.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\sizegroup.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\spinner.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\stack.c" />
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\event_axes.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\expander.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\gestures.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\glarea.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\headerbar.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\hypertext.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\iconview.c"><Filter>Source Files</Filter></ClCompile>
|
||||
@@ -55,6 +56,7 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\rotated_text.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\search_entry.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\search_entry2.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\sidebar.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\sizegroup.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\spinner.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\stack.c"><Filter>Source Files</Filter></ClCompile>
|
||||
|
||||
@@ -58,9 +58,9 @@ The recommended build order for these dependencies:
|
||||
as described in the README.txt file in the build/win32/vs9 folder)
|
||||
-zlib
|
||||
-libpng
|
||||
-(for GDK-Pixbuf, if not using GDI+) IJG JPEG
|
||||
-(for GDK-Pixbuf, if not using GDI+) IJG JPEG or libjpeg-turbo
|
||||
-(for GDK-Pixbuf, if not using GDI+) libtiff
|
||||
[libtiff requires zlib and IJG JPEG]
|
||||
[libtiff requires zlib and IJG JPEG or libjpeg-turbo]
|
||||
-(for GDK-Pixbuf, if not using GDI+) jasper [jpeg-2000 library])
|
||||
-(optional for GLib) PCRE (version 8.12 or later, use of CMake to
|
||||
build PCRE is recommended-see build/win32/vs9/README.txt of GLib)
|
||||
@@ -80,6 +80,11 @@ built DLLs go into <root>\vs9\<PlatformName>\bin, built LIBs into
|
||||
project files higher in the stack are supposed to look for them, not
|
||||
from a specific GLib source tree.
|
||||
|
||||
Please note, as GTK+ uses the Adwaita theme for all platforms by default,
|
||||
most icons used are not included with GTK+ (which *are* needed), so please see
|
||||
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack (under the
|
||||
GTK+ section) on how to get those icons set up for use with GTK+.
|
||||
|
||||
*About the dependencies marked with *: These dependencies are optional
|
||||
as those are not compulsory components for building and running GTK+
|
||||
itself, but note that they are needed for people running and building
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\broadway;..\crypt"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\broadway"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -62,7 +62,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\broadway;..\crypt"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\broadway"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="$(GdkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
@@ -95,7 +95,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\broadway;..\crypt"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\broadway"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -127,7 +127,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\broadway;..\crypt"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\broadway"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="$(GdkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
@@ -157,8 +157,8 @@
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
</Filter>
|
||||
<File RelativePath="..\crypt\crypt3.c" />
|
||||
<File RelativePath="..\..\..\gdk\broadway\broadwayd.c" />
|
||||
<File RelativePath="..\..\..\gdk\broadway\broadway-buffer.c" />
|
||||
<File RelativePath="..\..\..\gdk\broadway\broadway-output.c" />
|
||||
<File RelativePath="..\..\..\gdk\broadway\broadway-server.c" />
|
||||
<Filter
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="gdk_pixbuf-2.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib gio-2.0.lib gmodule-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib"
|
||||
AdditionalDependencies="gdk_pixbuf-2.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib gio-2.0.lib gmodule-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib epoxy.lib"
|
||||
AdditionalLibraryDirectories="$(GlibEtcInstallRoot)\lib"
|
||||
/>
|
||||
<UserMacro
|
||||
|
||||
@@ -36,7 +36,7 @@ echo $(ConfigurationName) > ..\..\..\MSVC_$(ConfigurationName)

|
||||
<UserMacro
|
||||
Name="GenGdkConfigHBroadway"
|
||||
Value="
|
||||
if exist ..\..\..\MSVC_$(ConfigurationName) goto DONE_GDKCONFIG_H

|
||||
if exist ..\..\..\MSVC_$(ConfigurationName)_Broadway goto DONE_GDKCONFIG_H

|
||||
|
||||
if exist ..\..\..\gdk\gdkconfig.h del ..\..\..\gdk\gdkconfig.h

|
||||
if exist ..\..\..\GDK_WIN32ONLY_BUILD del ..\..\..\GDK_WIN32ONLY_BUILD

|
||||
@@ -50,7 +50,7 @@ if "$(ConfigurationName)" == "Debug_Broadway" del ..\..\..\M
|
||||
copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\gdk\gdkconfig.h

|
||||
copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\GDK_BROADWAY_BUILD

|
||||
|
||||
echo $(ConfigurationName) > ..\..\..\MSVC_$(ConfigurationName)

|
||||
echo $(ConfigurationName) > ..\..\..\MSVC_$(ConfigurationName)_Broadway

|
||||
:DONE_GDKCONFIG_H

|
||||
"
|
||||
/>
|
||||
|
||||
@@ -55,6 +55,7 @@ copy ..\..\..\gdk\gdkdisplaymanager.h $(CopyDir)\include\gtk-3.0\gdk\gdkdisplaym
|
||||
copy ..\..\..\gdk\gdkdnd.h $(CopyDir)\include\gtk-3.0\gdk\gdkdnd.h

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

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

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

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

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

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

|
||||
@@ -174,6 +175,7 @@ copy ..\..\..\gtk\gtkgesturerotate.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturero
|
||||
copy ..\..\..\gtk\gtkgesturesingle.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturesingle.h

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

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

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

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

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

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

|
||||
@@ -228,6 +230,7 @@ copy ..\..\..\gtk\gtkrecentchoosermenu.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecen
|
||||
copy ..\..\..\gtk\gtkrecentchooserwidget.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentchooserwidget.h

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

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

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

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

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

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

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

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

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

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

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

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

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

|
||||
@@ -412,9 +416,10 @@ $(CopyDir)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
&
|
||||
Value="
|
||||
copy ..\..\..\gdk\broadway\gdkbroadway.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk

|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway

|
||||
copy ..\..\..\gdk\broadway\gdkbroadwaywindow.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway

|
||||
copy ..\..\..\gdk\broadway\gdkbroadwaycursor.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway

|
||||
copy ..\..\..\gdk\broadway\gdkbroadwaydisplay.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway

|
||||
copy ..\..\..\gdk\broadway\gdkbroadwayvisual.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway

|
||||
copy ..\..\..\gdk\broadway\gdkbroadwaywindow.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway

|
||||
"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
||||
|
||||
@@ -181,6 +181,7 @@
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\event_axes.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\expander.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\gestures.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\glarea.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\headerbar.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\hypertext.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\iconview.c" />
|
||||
@@ -204,6 +205,7 @@
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\rotated_text.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\search_entry.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\search_entry2.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\sidebar.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\sizegroup.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\spinner.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\stack.c" />
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
|
||||
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
|
||||
|
||||
/* Define to 1 if you have the `cairo_surface_set_device_scale' function. */
|
||||
/* #undef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE */
|
||||
|
||||
/* define if we have colord */
|
||||
/* #undef HAVE_COLORD */
|
||||
|
||||
|
||||
+68
-20
@@ -9,9 +9,9 @@
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [14])
|
||||
m4_define([gtk_minor_version], [15])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_interface_age], [1])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -41,13 +41,15 @@ AC_CANONICAL_HOST
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.41.2])
|
||||
m4_define([glib_required_version], [2.43.0])
|
||||
m4_define([pango_required_version], [1.36.7])
|
||||
m4_define([atk_required_version], [2.12.0])
|
||||
m4_define([cairo_required_version], [1.12.0])
|
||||
m4_define([atk_required_version], [2.15.1])
|
||||
m4_define([cairo_required_version], [1.14.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.30.0])
|
||||
m4_define([introspection_required_version], [1.39.0])
|
||||
m4_define([wayland_required_version], [1.5.91])
|
||||
m4_define([mirclient_required_version], [0.9.0])
|
||||
m4_define([epoxy_required_version], [1.0])
|
||||
GLIB_REQUIRED_VERSION=glib_required_version
|
||||
PANGO_REQUIRED_VERSION=pango_required_version
|
||||
ATK_REQUIRED_VERSION=atk_required_version
|
||||
@@ -308,6 +310,10 @@ AC_ARG_ENABLE(xdamage,
|
||||
[AS_HELP_STRING([--enable-xdamage],
|
||||
[support X Damage extension [default=maybe]])],,
|
||||
[enable_xdamage="maybe"])
|
||||
AC_ARG_ENABLE(xpresent,
|
||||
[AS_HELP_STRING([--enable-xpresent],
|
||||
[support X Present extension [default=maybe]])],,
|
||||
[enable_xpresent="maybe"])
|
||||
|
||||
AC_ARG_ENABLE(x11-backend,
|
||||
[AS_HELP_STRING([--enable-x11-backend],
|
||||
@@ -329,6 +335,10 @@ AC_ARG_ENABLE(wayland-backend,
|
||||
[AS_HELP_STRING([--enable-wayland-backend],
|
||||
[enable the wayland gdk backend])],
|
||||
[backend_set=yes])
|
||||
AC_ARG_ENABLE(mir-backend,
|
||||
[AS_HELP_STRING([--enable-mir-backend],
|
||||
[enable the Mir gdk backend])],
|
||||
[backend_set=yes])
|
||||
|
||||
if test -z "$backend_set"; then
|
||||
if test "$platform_win32" = yes; then
|
||||
@@ -336,6 +346,7 @@ if test -z "$backend_set"; then
|
||||
else
|
||||
enable_x11_backend=yes
|
||||
enable_wayland_backend=maybe
|
||||
enable_mir_backend=no
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -349,7 +360,8 @@ backend_immodules=
|
||||
have_gio_unix=no
|
||||
GDK_BACKENDS=
|
||||
GDK_EXTRA_LIBS=
|
||||
GDK_EXTRA_CFLAGS=
|
||||
# expoxy.pc has Cflags: -I${includedir}, but pkg-config swallows that :-(
|
||||
GDK_EXTRA_CFLAGS="-I${prefix}/include"
|
||||
GDK_WINDOWING=
|
||||
PANGO_PACKAGES="pango pangocairo"
|
||||
|
||||
@@ -426,7 +438,7 @@ fi
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version"
|
||||
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version wayland-egl"
|
||||
if test "$enable_wayland_backend" = "maybe" ; then
|
||||
AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
|
||||
PKG_CHECK_EXISTS($WAYLAND_DEPENDENCIES, [have_wayland_deps=yes], [have_wayland_deps=no])
|
||||
@@ -457,6 +469,30 @@ else
|
||||
AM_CONDITIONAL(USE_WAYLAND, false)
|
||||
fi
|
||||
|
||||
MIR_DEPENDENCIES="mirclient >= mirclient_required_version"
|
||||
if test "$enable_mir_backend" = "maybe" ; then
|
||||
PKG_CHECK_EXISTS($MIR_DEPENDENCIES, [have_mir_deps=yes], [have_mir_deps=no])
|
||||
AC_MSG_CHECKING([for MIR_DEPENDENCIES])
|
||||
if test "$have_mir_deps" = "no" ; then
|
||||
enable_mir_backend=no
|
||||
else
|
||||
enable_mir_backend=yes
|
||||
fi
|
||||
AC_MSG_RESULT($enable_mir_backend)
|
||||
fi
|
||||
|
||||
if test "$enable_mir_backend" = "yes"; then
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
GDK_BACKENDS="$GDK_BACKENDS mir"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_MIR"
|
||||
MIR_PACKAGES="$MIR_DEPENDENCIES"
|
||||
|
||||
AM_CONDITIONAL(USE_MIR, true)
|
||||
else
|
||||
AM_CONDITIONAL(USE_MIR, false)
|
||||
fi
|
||||
|
||||
# strip leading space
|
||||
GDK_BACKENDS=${GDK_BACKENDS#* }
|
||||
|
||||
@@ -1254,6 +1290,18 @@ if test "x$enable_x11_backend" = xyes; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$enable_xpresent" != xno; then
|
||||
if $PKG_CONFIG --exists xcb-present ; then
|
||||
AC_DEFINE(HAVE_PRESENT, 1, [Have the Present X extension])
|
||||
|
||||
X_PACKAGES="$X_PACKAGES xcb-present"
|
||||
X_EXTENSIONS="$X_EXTENSIONS Present"
|
||||
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcb-present"
|
||||
elif test x"$enable_xpresent" = xyes; then
|
||||
AC_MSG_ERROR([Present support requested but xcb-present not found])
|
||||
fi
|
||||
fi
|
||||
|
||||
if $have_base_x_pc ; then
|
||||
GDK_EXTRA_LIBS="$x_extra_libs"
|
||||
else
|
||||
@@ -1311,22 +1359,11 @@ else
|
||||
LIBS="$gtk_save_LIBS"
|
||||
fi
|
||||
|
||||
# Check for cairo_set_device_scale, as we don't want to depend hard on
|
||||
# this until there is a stable release with it
|
||||
CAIRO_CFLAGS=`$PKG_CONFIG --cflags cairo`
|
||||
CAIRO_LIBS=`$PKG_CONFIG --libs cairo`
|
||||
CFLAGS="$CFLAGS $CAIRO_CFLAGS"
|
||||
gtk_save_LIBS="$LIBS"
|
||||
LIBS="$CAIRO_LIBS $LIBS"
|
||||
AC_CHECK_FUNCS(cairo_surface_set_device_scale)
|
||||
LIBS="$gtk_save_LIBS"
|
||||
|
||||
|
||||
CFLAGS="$saved_cflags"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version"
|
||||
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends"
|
||||
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version"
|
||||
if test "x$enable_x11_backend" = xyes; then
|
||||
GDK_PRIVATE_PACKAGES="$GDK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
@@ -1363,7 +1400,7 @@ fi
|
||||
PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
|
||||
|
||||
GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version"
|
||||
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES"
|
||||
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES"
|
||||
if test "x$enable_x11_backend" = xyes; then
|
||||
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
@@ -1670,6 +1707,16 @@ if test "$have_colord" = "yes"; then
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_COLORD, test "x$have_colord" = "xyes")
|
||||
|
||||
##################################################
|
||||
# Check for libcanberra (only used in examples)
|
||||
##################################################
|
||||
|
||||
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra-gtk3,
|
||||
have_libcanberra=yes, have_libcanberra=no)
|
||||
if test "$have_libcanberra" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBCANBERRA, 1, [define if we have libcanberra])
|
||||
fi
|
||||
|
||||
##################################################
|
||||
# Checks for gtk-doc and docbook-tools
|
||||
##################################################
|
||||
@@ -1903,6 +1950,7 @@ gdk/win32/rc/Makefile
|
||||
gdk/win32/rc/gdk.rc
|
||||
gdk/quartz/Makefile
|
||||
gdk/wayland/Makefile
|
||||
gdk/mir/Makefile
|
||||
gdk/gdkversionmacros.h
|
||||
gtk/Makefile
|
||||
gtk/makefile.msc
|
||||
|
||||
@@ -25,6 +25,7 @@ demos = \
|
||||
event_axes.c \
|
||||
expander.c \
|
||||
gestures.c \
|
||||
glarea.c \
|
||||
headerbar.c \
|
||||
hypertext.c \
|
||||
iconview.c \
|
||||
@@ -48,6 +49,7 @@ demos = \
|
||||
rotated_text.c \
|
||||
search_entry.c \
|
||||
search_entry2.c \
|
||||
sidebar.c \
|
||||
sizegroup.c \
|
||||
spinner.c \
|
||||
stack.c \
|
||||
@@ -73,6 +75,7 @@ LDADDS = \
|
||||
$(top_builddir)/gtk/libgtk-3.la \
|
||||
$(top_builddir)/gdk/libgdk-3.la \
|
||||
$(GTK_DEP_LIBS) \
|
||||
$(GDK_DEP_LIBS) \
|
||||
-lm
|
||||
|
||||
bin_PROGRAMS = gtk3-demo gtk3-demo-application
|
||||
|
||||
@@ -20,12 +20,7 @@ draw_callback (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gpointer data)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
GdkRGBA rgba;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &rgba);
|
||||
gdk_cairo_set_source_rgba (cr, &rgba);
|
||||
gdk_cairo_set_source_rgba (cr, &color);
|
||||
cairo_paint (cr);
|
||||
|
||||
return TRUE;
|
||||
@@ -39,7 +34,6 @@ response_cb (GtkDialog *dialog,
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
|
||||
gtk_widget_override_background_color (da, 0, &color);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
@@ -105,8 +99,6 @@ do_colorsel (GtkWidget *do_widget)
|
||||
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 200, 200);
|
||||
/* set the color */
|
||||
gtk_widget_override_background_color (da, 0, &color);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
|
||||
@@ -259,18 +259,21 @@ G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY,
|
||||
static void
|
||||
mask_entry_set_background (MaskEntry *entry)
|
||||
{
|
||||
static const GdkRGBA error_color = { 1.0, 0.9, 0.9, 1.0 };
|
||||
|
||||
if (entry->mask)
|
||||
{
|
||||
if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0))
|
||||
{
|
||||
gtk_widget_override_color (GTK_WIDGET (entry), 0, &error_color);
|
||||
PangoAttrList *attrs;
|
||||
|
||||
attrs = pango_attr_list_new ();
|
||||
pango_attr_list_insert (attrs, pango_attr_foreground_new (65535, 32767, 32767));
|
||||
gtk_entry_set_attributes (GTK_ENTRY (entry), attrs);
|
||||
pango_attr_list_unref (attrs);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_override_color (GTK_WIDGET (entry), 0, NULL);
|
||||
gtk_entry_set_attributes (GTK_ENTRY (entry), NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
<file>expander.c</file>
|
||||
<file>flowbox.c</file>
|
||||
<file>gestures.c</file>
|
||||
<file>glarea.c</file>
|
||||
<file>headerbar.c</file>
|
||||
<file>hypertext.c</file>
|
||||
<file>iconview.c</file>
|
||||
@@ -118,6 +119,7 @@
|
||||
<file>search_entry.c</file>
|
||||
<file>search_entry2.c</file>
|
||||
<file>sizegroup.c</file>
|
||||
<file>sidebar.c</file>
|
||||
<file>stack.c</file>
|
||||
<file>spinner.c</file>
|
||||
<file>textview.c</file>
|
||||
|
||||
@@ -12,18 +12,31 @@
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static gboolean
|
||||
draw_color (GtkWidget *drawingarea,
|
||||
cairo_t *cr,
|
||||
const char *color_name)
|
||||
{
|
||||
GdkRGBA rgba;
|
||||
|
||||
if (gdk_rgba_parse (&rgba, color_name))
|
||||
{
|
||||
gdk_cairo_set_source_rgba (cr, &rgba);
|
||||
cairo_paint (cr);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
color_swatch_new (const gchar *color)
|
||||
{
|
||||
GtkWidget *button, *area;
|
||||
GdkRGBA rgba;
|
||||
|
||||
gdk_rgba_parse (&rgba, color);
|
||||
|
||||
button = gtk_button_new ();
|
||||
area = gtk_drawing_area_new ();
|
||||
g_signal_connect (area, "draw", G_CALLBACK (draw_color), (gpointer) color);
|
||||
gtk_widget_set_size_request (area, 24, 24);
|
||||
gtk_widget_override_background_color (area, 0, &rgba);
|
||||
gtk_container_add (GTK_CONTAINER (button), area);
|
||||
gtk_widget_show_all (button);
|
||||
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
/* OpenGL Area
|
||||
*
|
||||
* GtkGLArea is a widget that allows custom drawing using OpenGL calls.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
static GtkWidget *demo_window = NULL;
|
||||
|
||||
/* the GtkGLArea widget */
|
||||
static GtkWidget *gl_area = NULL;
|
||||
|
||||
enum {
|
||||
X_AXIS,
|
||||
Y_AXIS,
|
||||
Z_AXIS,
|
||||
|
||||
N_AXIS
|
||||
};
|
||||
|
||||
/* Rotation angles on each axis */
|
||||
static float rotation_angles[N_AXIS] = { 0.0 };
|
||||
|
||||
/* The object we are drawing */
|
||||
static void
|
||||
draw_triangle (void)
|
||||
{
|
||||
glColor3f (1.0f, 0.85f, 0.35f);
|
||||
glBegin (GL_TRIANGLES);
|
||||
{
|
||||
glVertex3f ( 0.0, 0.6, 0.0);
|
||||
glVertex3f (-0.2, -0.3, 0.0);
|
||||
glVertex3f ( 0.2, -0.3, 0.0);
|
||||
}
|
||||
glEnd ();
|
||||
}
|
||||
|
||||
/* The main rendering callback */
|
||||
static gboolean
|
||||
render (GtkGLArea *area,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
glClearColor (0.5, 0.5, 0.5, 1.0);
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glLoadIdentity ();
|
||||
glRotatef (rotation_angles[X_AXIS], 1, 0, 0);
|
||||
glRotatef (rotation_angles[Y_AXIS], 0, 1, 0);
|
||||
glRotatef (rotation_angles[Z_AXIS], 0, 0, 1);
|
||||
|
||||
draw_triangle ();
|
||||
|
||||
glFlush ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_axis_value_change (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
{
|
||||
int axis = GPOINTER_TO_INT (data);
|
||||
|
||||
g_assert (axis >= 0 && axis < N_AXIS);
|
||||
|
||||
/* Update the rotation angle */
|
||||
rotation_angles[axis] = gtk_adjustment_get_value (adjustment);
|
||||
|
||||
/* Update the contents of the GL drawing area */
|
||||
gtk_widget_queue_draw (gl_area);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_axis_slider (int axis)
|
||||
{
|
||||
GtkWidget *box, *label, *slider;
|
||||
GtkAdjustment *adj;
|
||||
const char *text;
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case X_AXIS:
|
||||
text = "X axis";
|
||||
break;
|
||||
|
||||
case Y_AXIS:
|
||||
text = "Y axis";
|
||||
break;
|
||||
|
||||
case Z_AXIS:
|
||||
text = "Z axis";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
gtk_widget_show (label);
|
||||
|
||||
adj = gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 12.0, 0.0);
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (on_axis_value_change),
|
||||
GINT_TO_POINTER (axis));
|
||||
slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adj);
|
||||
gtk_container_add (GTK_CONTAINER (box), slider);
|
||||
gtk_widget_set_hexpand (slider, TRUE);
|
||||
gtk_widget_show (slider);
|
||||
|
||||
gtk_widget_show (box);
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
static void
|
||||
close_window (GtkWidget *widget)
|
||||
{
|
||||
/* Reset the state */
|
||||
demo_window = NULL;
|
||||
gl_area = NULL;
|
||||
|
||||
rotation_angles[X_AXIS] = 0.0;
|
||||
rotation_angles[Y_AXIS] = 0.0;
|
||||
rotation_angles[Z_AXIS] = 0.0;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
create_glarea_window (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *window, *box, *button, *controls;
|
||||
int i;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkGLArea - Golden Triangle");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
gtk_box_set_spacing (GTK_BOX (box), 6);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
gl_area = gtk_gl_area_new ();
|
||||
gtk_widget_set_hexpand (gl_area, TRUE);
|
||||
gtk_widget_set_vexpand (gl_area, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), gl_area);
|
||||
|
||||
/* the main "draw" call for GtkGLArea */
|
||||
g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
|
||||
|
||||
controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (box), controls);
|
||||
gtk_widget_set_hexpand (controls, TRUE);
|
||||
|
||||
for (i = 0; i < N_AXIS; i++)
|
||||
gtk_container_add (GTK_CONTAINER (controls), create_axis_slider (i));
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
gtk_widget_set_hexpand (button, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
do_glarea (GtkWidget *do_widget)
|
||||
{
|
||||
if (demo_window == NULL)
|
||||
demo_window = create_glarea_window (do_widget);
|
||||
|
||||
if (!gtk_widget_get_visible (demo_window))
|
||||
gtk_widget_show_all (demo_window);
|
||||
else
|
||||
gtk_widget_destroy (demo_window);
|
||||
|
||||
return demo_window;
|
||||
}
|
||||
@@ -239,8 +239,8 @@ do_hypertext (GtkWidget *do_widget)
|
||||
GtkWidget *sw;
|
||||
GtkTextBuffer *buffer;
|
||||
|
||||
hand_cursor = gdk_cursor_new (GDK_HAND2);
|
||||
regular_cursor = gdk_cursor_new (GDK_XTERM);
|
||||
hand_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (do_widget), GDK_HAND2);
|
||||
regular_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (do_widget), GDK_XTERM);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
|
||||
+47
-18
@@ -772,19 +772,53 @@ load_file (const gchar *demoname,
|
||||
case 3:
|
||||
/* Reading program body */
|
||||
gtk_text_buffer_insert (source_buffer, &start, p, -1);
|
||||
gtk_text_buffer_insert (source_buffer, &start, "\n", 1);
|
||||
if (lines[i+1] != NULL)
|
||||
gtk_text_buffer_insert (source_buffer, &start, "\n", 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_strfreev (lines);
|
||||
|
||||
fontify (source_buffer);
|
||||
|
||||
g_strfreev (lines);
|
||||
gtk_text_buffer_create_tag (source_buffer, "top-margin",
|
||||
"pixels-above-lines", 20,
|
||||
NULL);
|
||||
gtk_text_buffer_get_start_iter (source_buffer, &start);
|
||||
end = start;
|
||||
gtk_text_iter_forward_word_end (&end);
|
||||
gtk_text_buffer_apply_tag_by_name (source_buffer, "top-margin", &start, &end);
|
||||
|
||||
gtk_text_buffer_create_tag (source_buffer, "bottom-margin",
|
||||
"pixels-below-lines", 20,
|
||||
NULL);
|
||||
gtk_text_buffer_get_end_iter (source_buffer, &end);
|
||||
start = end;
|
||||
gtk_text_iter_backward_word_start (&start);
|
||||
gtk_text_buffer_apply_tag_by_name (source_buffer, "bottom-margin", &start, &end);
|
||||
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (source_view), source_buffer);
|
||||
g_object_unref (source_buffer);
|
||||
|
||||
gtk_text_buffer_create_tag (info_buffer, "top-margin",
|
||||
"pixels-above-lines", 20,
|
||||
NULL);
|
||||
gtk_text_buffer_get_start_iter (info_buffer, &start);
|
||||
end = start;
|
||||
gtk_text_iter_forward_word_end (&end);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "top-margin", &start, &end);
|
||||
|
||||
gtk_text_buffer_create_tag (info_buffer, "bottom-margin",
|
||||
"pixels-below-lines", 20,
|
||||
NULL);
|
||||
gtk_text_buffer_get_end_iter (info_buffer, &end);
|
||||
start = end;
|
||||
gtk_text_iter_backward_word_start (&start);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "bottom-margin", &start, &end);
|
||||
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (info_view), info_buffer);
|
||||
g_object_unref (info_buffer);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (source_view), source_buffer);
|
||||
g_object_unref (source_buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -821,7 +855,6 @@ create_text (GtkWidget **view,
|
||||
{
|
||||
GtkWidget *scrolled_window;
|
||||
GtkWidget *text_view;
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
@@ -831,7 +864,10 @@ create_text (GtkWidget **view,
|
||||
GTK_SHADOW_NONE);
|
||||
|
||||
*view = text_view = gtk_text_view_new ();
|
||||
g_object_set (text_view, "margin", 20, NULL);
|
||||
g_object_set (text_view,
|
||||
"left-margin", 20,
|
||||
"right-margin", 20,
|
||||
NULL);
|
||||
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
@@ -840,22 +876,15 @@ create_text (GtkWidget **view,
|
||||
|
||||
if (is_source)
|
||||
{
|
||||
font_desc = pango_font_description_from_string ("monospace");
|
||||
gtk_widget_override_font (text_view, font_desc);
|
||||
pango_font_description_free (font_desc);
|
||||
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view),
|
||||
GTK_WRAP_NONE);
|
||||
gtk_text_view_set_monospace (GTK_TEXT_VIEW (text_view), TRUE);
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Make it a bit nicer for text. */
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view),
|
||||
GTK_WRAP_WORD);
|
||||
gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (text_view),
|
||||
2);
|
||||
gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (text_view),
|
||||
2);
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
|
||||
gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (text_view), 2);
|
||||
gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (text_view), 2);
|
||||
}
|
||||
|
||||
return scrolled_window;
|
||||
|
||||
+33
-32
@@ -70,36 +70,41 @@
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">0</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="width_request">120</property>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="min_content_width">150</property>
|
||||
<style>
|
||||
<class name="sidebar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview">
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="width_request">120</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">treestore</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection">
|
||||
<property name="mode">browse</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="min_content_width">150</property>
|
||||
<style>
|
||||
<class name="sidebar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
|
||||
<property name="title" translatable="yes">column</property>
|
||||
<object class="GtkTreeView" id="treeview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">treestore</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection">
|
||||
<property name="mode">browse</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||
<attributes>
|
||||
<attribute name="style">4</attribute>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
|
||||
<property name="title" translatable="yes">column</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||
<attributes>
|
||||
<attribute name="style">4</attribute>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
@@ -128,10 +133,8 @@
|
||||
<object class="GtkTextView" id="info-textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_start">20</property>
|
||||
<property name="margin_end">20</property>
|
||||
<property name="margin_top">20</property>
|
||||
<property name="margin_bottom">20</property>
|
||||
<property name="left-margin">20</property>
|
||||
<property name="right-margin">20</property>
|
||||
<property name="pixels_above_lines">2</property>
|
||||
<property name="pixels_below_lines">2</property>
|
||||
<property name="editable">False</property>
|
||||
@@ -165,10 +168,8 @@
|
||||
<object class="GtkTextView" id="source-textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_start">20</property>
|
||||
<property name="margin_end">20</property>
|
||||
<property name="margin_top">20</property>
|
||||
<property name="margin_bottom">20</property>
|
||||
<property name="left-margin">20</property>
|
||||
<property name="right-margin">20</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="cursor_visible">False</property>
|
||||
</object>
|
||||
|
||||
@@ -573,7 +573,6 @@ do_offscreen_window (GtkWidget *do_widget)
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *bin, *vbox, *scale, *button;
|
||||
GdkRGBA black;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
@@ -583,8 +582,6 @@ do_offscreen_window (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
gdk_rgba_parse (&black, "black");
|
||||
gtk_widget_override_background_color (window, 0, &black);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
|
||||
@@ -181,8 +181,6 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
PangoLayout *layout;
|
||||
PangoAttrList *attrs;
|
||||
|
||||
const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
@@ -195,18 +193,15 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
/* Add a drawing area */
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_container_add (GTK_CONTAINER (box), drawing_area);
|
||||
|
||||
/* This overrides the background color from the theme */
|
||||
gtk_widget_override_background_color (drawing_area, 0, &white);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (drawing_area),
|
||||
GTK_STYLE_CLASS_VIEW);
|
||||
|
||||
g_signal_connect (drawing_area, "draw",
|
||||
G_CALLBACK (rotated_text_draw), NULL);
|
||||
|
||||
/* And a label */
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/* Sidebar
|
||||
*
|
||||
* GtkSidebar provides an automatic sidebar widget to control navigation
|
||||
* of a GtkStack object. This widget automatically updates it content
|
||||
* based on what is presently available in the GtkStack object, and
|
||||
* using the "title" child property to set the display labels.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_sidebar (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *sidebar;
|
||||
GtkWidget *stack;
|
||||
GtkWidget *box;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *header;
|
||||
const gchar* pages[] = {
|
||||
"Welcome to GTK+",
|
||||
"GtkSidebar Widget",
|
||||
"Automatic navigation",
|
||||
"Consistent appearance",
|
||||
"Scrolling",
|
||||
"Page 6",
|
||||
"Page 7",
|
||||
"Page 8",
|
||||
"Page 9",
|
||||
NULL
|
||||
};
|
||||
const gchar *c = NULL;
|
||||
guint i;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_widget_set_size_request (window, 500, 350);
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW(window), header);
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Sidebar demo");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
sidebar = gtk_sidebar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0);
|
||||
|
||||
stack = gtk_stack_new ();
|
||||
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
|
||||
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
|
||||
/* Separator between sidebar and stack */
|
||||
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
gtk_box_pack_start (GTK_BOX(box), widget, FALSE, FALSE, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (box), stack, TRUE, TRUE, 0);
|
||||
|
||||
for (i=0; (c = *(pages+i)) != NULL; i++ )
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
widget = gtk_image_new_from_icon_name ("help-about", GTK_ICON_SIZE_MENU);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (widget), 256);
|
||||
}
|
||||
else
|
||||
{
|
||||
widget = gtk_label_new (c);
|
||||
}
|
||||
gtk_stack_add_named (GTK_STACK (stack), widget, c);
|
||||
gtk_container_child_set (GTK_CONTAINER (stack), widget, "title", c, NULL);
|
||||
}
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -539,26 +539,18 @@ recursive_attach_view (int depth,
|
||||
GtkTextView *view,
|
||||
GtkTextChildAnchor *anchor)
|
||||
{
|
||||
GtkWidget *child_view;
|
||||
GtkWidget *event_box;
|
||||
GdkRGBA color;
|
||||
GtkWidget *child_view, *frame;
|
||||
|
||||
if (depth > 4)
|
||||
return;
|
||||
|
||||
child_view = gtk_text_view_new_with_buffer (gtk_text_view_get_buffer (view));
|
||||
|
||||
/* Event box is to add a black border around each child view */
|
||||
event_box = gtk_event_box_new ();
|
||||
gdk_rgba_parse (&color, "black");
|
||||
gtk_widget_override_background_color (event_box, 0, &color);
|
||||
/* Frame is to add a black border around each child view */
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_container_add (GTK_CONTAINER (frame), child_view);
|
||||
|
||||
gtk_widget_set_halign (child_view, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (child_view, GTK_ALIGN_FILL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (event_box), child_view);
|
||||
|
||||
gtk_text_view_add_child_at_anchor (view, event_box, anchor);
|
||||
gtk_text_view_add_child_at_anchor (view, frame, anchor);
|
||||
|
||||
recursive_attach_view (depth + 1, GTK_TEXT_VIEW (child_view), anchor);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,6 @@ do_transparent (GtkWidget *do_widget)
|
||||
GtkWidget *sw;
|
||||
GtkWidget *overlay;
|
||||
GtkWidget *entry;
|
||||
GdkRGBA transparent = {0, 0, 0, 0};
|
||||
GtkCssProvider *provider;
|
||||
gchar *css;
|
||||
|
||||
@@ -218,8 +217,6 @@ do_transparent (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (overlay), sw);
|
||||
gtk_container_add (GTK_CONTAINER (window), overlay);
|
||||
|
||||
gtk_widget_override_background_color (overlay, 0, &transparent);
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
provider = gtk_css_provider_new ();
|
||||
css = g_strdup_printf ("* { border-width: 0px %dpx %dpx 0px; }",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "iconbrowserapp.h"
|
||||
#include "iconbrowserwin.h"
|
||||
#include <gtk/gtk.h>
|
||||
@@ -51,7 +52,7 @@ enum {
|
||||
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static void
|
||||
search_text_changed (GtkEntry *entry)
|
||||
search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
{
|
||||
const gchar *text;
|
||||
|
||||
@@ -59,6 +60,8 @@ search_text_changed (GtkEntry *entry)
|
||||
|
||||
if (text[0] == '\0')
|
||||
return;
|
||||
|
||||
gtk_tree_model_filter_refilter (win->filter_model);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -191,6 +194,8 @@ selected_context_changed (GtkListBox *list, IconBrowserWindow *win)
|
||||
if (row == NULL)
|
||||
return;
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (win->search), FALSE);
|
||||
|
||||
label = gtk_bin_get_child (GTK_BIN (row));
|
||||
win->current_context = g_object_get_data (G_OBJECT (label), "context");
|
||||
gtk_tree_model_filter_refilter (win->filter_model);
|
||||
@@ -671,11 +676,13 @@ populate (IconBrowserWindow *win)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
key_press_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
GtkSearchBar *bar)
|
||||
key_press_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
return gtk_search_bar_handle_event (bar, event);
|
||||
IconBrowserWindow *win = data;
|
||||
|
||||
return gtk_search_bar_handle_event (GTK_SEARCH_BAR (win->searchbar), event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -687,8 +694,13 @@ icon_visible_func (GtkTreeModel *model,
|
||||
gchar *context;
|
||||
gchar *name;
|
||||
gint column;
|
||||
gboolean search;
|
||||
const gchar *search_text;
|
||||
gboolean visible;
|
||||
|
||||
search = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (win->search));
|
||||
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
|
||||
|
||||
if (win->symbolic)
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
@@ -698,8 +710,12 @@ icon_visible_func (GtkTreeModel *model,
|
||||
column, &name,
|
||||
CONTEXT_COLUMN, &context,
|
||||
-1);
|
||||
|
||||
visible = name != NULL && win->current_context != NULL && g_strcmp0 (context, win->current_context->id) == 0;
|
||||
if (!name)
|
||||
visible = FALSE;
|
||||
else if (search)
|
||||
visible = strstr (name, search_text) != NULL;
|
||||
else
|
||||
visible = win->current_context != NULL && g_strcmp0 (context, win->current_context->id) == 0;
|
||||
|
||||
g_free (name);
|
||||
g_free (context);
|
||||
@@ -726,6 +742,13 @@ symbolic_toggled (GtkToggleButton *toggle, IconBrowserWindow *win)
|
||||
gtk_widget_queue_draw (win->list);
|
||||
}
|
||||
|
||||
static void
|
||||
search_mode_toggled (GObject *searchbar, GParamSpec *pspec, IconBrowserWindow *win)
|
||||
{
|
||||
if (gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (searchbar)))
|
||||
gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list));
|
||||
}
|
||||
|
||||
static void
|
||||
icon_browser_window_init (IconBrowserWindow *win)
|
||||
{
|
||||
@@ -733,16 +756,13 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
|
||||
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
|
||||
|
||||
g_object_bind_property (win->search, "active",
|
||||
win->searchbar, "search-mode-enabled",
|
||||
G_BINDING_BIDIRECTIONAL);
|
||||
|
||||
// gtk_tree_view_set_search_entry (GTK_TREE_VIEW (win->list), GTK_ENTRY (win->searchentry));
|
||||
g_signal_connect (win, "key-press-event", G_CALLBACK (key_press_event_cb), win->searchbar);
|
||||
|
||||
gtk_tree_model_filter_set_visible_func (win->filter_model, icon_visible_func, win, NULL);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (win->details), GTK_WINDOW (win));
|
||||
|
||||
|
||||
g_signal_connect (win->searchbar, "notify::search-mode-enabled",
|
||||
G_CALLBACK (search_mode_toggled), win);
|
||||
|
||||
symbolic_toggled (GTK_TOGGLE_BUTTON (win->symbolic_radio), win);
|
||||
|
||||
populate (win);
|
||||
@@ -778,6 +798,7 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selected_context_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), symbolic_toggled);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), key_press_event_cb);
|
||||
}
|
||||
|
||||
IconBrowserWindow *
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<property name="title" translatable="yes">Icon Browser</property>
|
||||
<property name="default-width">600</property>
|
||||
<property name="default-height">800</property>
|
||||
<signal name="key-press-event" handler="key_press_event_cb"/>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<property name="visible">True</property>
|
||||
@@ -47,7 +48,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<property name="visible">False</property>
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
@@ -83,10 +84,11 @@
|
||||
<child>
|
||||
<object class="GtkSearchBar" id="searchbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="search-mode-enabled" bind-source="search" bind-property="active" bind-flags="bidirectional"/>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="searchentry">
|
||||
<signal name="search-changed" handler="search_text_changed"/>
|
||||
<property name="visible">True</property>
|
||||
<signal name="search-changed" handler="search_text_changed"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -18,12 +18,14 @@ gtk3_widget_factory_DEPENDENCIES = \
|
||||
gtk3_widget_factory_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GTK_DEP_CFLAGS)
|
||||
$(GTK_DEP_CFLAGS) \
|
||||
$(LIBCANBERRA_CFLAGS)
|
||||
|
||||
gtk3_widget_factory_LDADD = \
|
||||
$(top_builddir)/gdk/libgdk-3.la \
|
||||
$(top_builddir)/gtk/libgtk-3.la \
|
||||
$(GTK_DEP_LIBS)
|
||||
$(GTK_DEP_LIBS) \
|
||||
$(LIBCANBERRA_LIBS)
|
||||
|
||||
widget_factory_resources.c: widget-factory.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/widget-factory.gresource.xml)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
|
||||
|
||||
@@ -19,7 +19,12 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#ifdef HAVE_LIBCANBERRA
|
||||
#include <canberra-gtk.h>
|
||||
#endif
|
||||
|
||||
static void
|
||||
change_theme_state (GSimpleAction *action,
|
||||
@@ -234,7 +239,134 @@ on_entry_icon_release (GtkEntry *entry,
|
||||
pulse_it (GTK_WIDGET (entry));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define EPSILON (1e-10)
|
||||
|
||||
static gboolean
|
||||
on_scale_button_query_tooltip (GtkWidget *button,
|
||||
gint x,
|
||||
gint y,
|
||||
gboolean keyboard_mode,
|
||||
GtkTooltip *tooltip,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkScaleButton *scale_button = GTK_SCALE_BUTTON (button);
|
||||
GtkAdjustment *adjustment;
|
||||
gdouble val;
|
||||
gchar *str;
|
||||
AtkImage *image;
|
||||
|
||||
image = ATK_IMAGE (gtk_widget_get_accessible (button));
|
||||
|
||||
adjustment = gtk_scale_button_get_adjustment (scale_button);
|
||||
val = gtk_scale_button_get_value (scale_button);
|
||||
|
||||
if (val < (gtk_adjustment_get_lower (adjustment) + EPSILON))
|
||||
{
|
||||
str = g_strdup (_("Muted"));
|
||||
}
|
||||
else if (val >= (gtk_adjustment_get_upper (adjustment) - EPSILON))
|
||||
{
|
||||
str = g_strdup (_("Full Volume"));
|
||||
}
|
||||
else
|
||||
{
|
||||
gint percent;
|
||||
|
||||
percent = (gint) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5);
|
||||
|
||||
str = g_strdup_printf (C_("volume percentage", "%d %%"), percent);
|
||||
}
|
||||
|
||||
gtk_tooltip_set_text (tooltip, str);
|
||||
atk_image_set_image_description (image, str);
|
||||
g_free (str);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_scale_button_value_changed (GtkScaleButton *button,
|
||||
gdouble value,
|
||||
gpointer user_data)
|
||||
{
|
||||
gtk_widget_trigger_tooltip_query (GTK_WIDGET (button));
|
||||
}
|
||||
|
||||
static void
|
||||
on_record_button_toggled (GtkToggleButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_widget_get_style_context (GTK_WIDGET (button));
|
||||
if (gtk_toggle_button_get_active (button))
|
||||
gtk_style_context_remove_class (context, "destructive-action");
|
||||
else
|
||||
gtk_style_context_add_class (context, "destructive-action");
|
||||
}
|
||||
|
||||
static void
|
||||
on_page_combo_changed (GtkComboBox *combo,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *from;
|
||||
GtkWidget *to;
|
||||
|
||||
from = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_from_spin"));
|
||||
to = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_to_spin"));
|
||||
|
||||
switch (gtk_combo_box_get_active (combo))
|
||||
{
|
||||
case 0: /* Range */
|
||||
gtk_widget_set_sensitive (from, TRUE);
|
||||
gtk_widget_set_sensitive (to, TRUE);
|
||||
break;
|
||||
case 1: /* All */
|
||||
gtk_widget_set_sensitive (from, FALSE);
|
||||
gtk_widget_set_sensitive (to, FALSE);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 1);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 99);
|
||||
break;
|
||||
case 2: /* Current */
|
||||
gtk_widget_set_sensitive (from, FALSE);
|
||||
gtk_widget_set_sensitive (to, FALSE);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 7);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 7);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_range_from_changed (GtkSpinButton *from)
|
||||
{
|
||||
GtkSpinButton *to;
|
||||
gint v1, v2;
|
||||
|
||||
to = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (from), "range_to_spin"));
|
||||
|
||||
v1 = gtk_spin_button_get_value_as_int (from);
|
||||
v2 = gtk_spin_button_get_value_as_int (to);
|
||||
|
||||
if (v1 > v2)
|
||||
gtk_spin_button_set_value (to, v1);
|
||||
}
|
||||
|
||||
static void
|
||||
on_range_to_changed (GtkSpinButton *to)
|
||||
{
|
||||
GtkSpinButton *from;
|
||||
gint v1, v2;
|
||||
|
||||
from = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (to), "range_from_spin"));
|
||||
|
||||
v1 = gtk_spin_button_get_value_as_int (from);
|
||||
v2 = gtk_spin_button_get_value_as_int (to);
|
||||
|
||||
if (v1 > v2)
|
||||
gtk_spin_button_set_value (from, v2);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -446,6 +578,82 @@ update_title_header (GtkListBoxRow *row,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *box, *row, *label, *swatch;
|
||||
GdkRGBA rgba;
|
||||
const gchar *color;
|
||||
gchar *text;
|
||||
GtkWidget *silver;
|
||||
GtkWidget *gold;
|
||||
|
||||
silver = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "Silver"));
|
||||
gold = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "Gold"));
|
||||
|
||||
if (pos == GTK_POS_TOP)
|
||||
{
|
||||
if (silver)
|
||||
{
|
||||
gtk_container_remove (GTK_CONTAINER (widget), silver);
|
||||
g_object_set_data (G_OBJECT (widget), "Silver", NULL);
|
||||
}
|
||||
if (gold)
|
||||
{
|
||||
gtk_container_remove (GTK_CONTAINER (widget), gold);
|
||||
g_object_set_data (G_OBJECT (widget), "Gold", NULL);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBCANBERRA
|
||||
if (silver || gold)
|
||||
ca_gtk_play_for_widget (widget, 0, "event.id", "message", NULL);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (gold)
|
||||
return;
|
||||
else if (silver)
|
||||
color = "Gold";
|
||||
else
|
||||
color = "Silver";
|
||||
|
||||
row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);
|
||||
text = g_strconcat ("<b>", color, "</b>", NULL);
|
||||
label = gtk_label_new (text);
|
||||
g_free (text);
|
||||
g_object_set (label,
|
||||
"use-markup", TRUE,
|
||||
"halign", GTK_ALIGN_START,
|
||||
"valign", GTK_ALIGN_CENTER,
|
||||
"margin", 6,
|
||||
"xalign", 0.0,
|
||||
NULL);
|
||||
gtk_box_pack_start (GTK_BOX (row), label, TRUE, TRUE, 0);
|
||||
gdk_rgba_parse (&rgba, color);
|
||||
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
|
||||
"rgba", &rgba,
|
||||
"selectable", FALSE,
|
||||
"halign", GTK_ALIGN_END,
|
||||
"valign", GTK_ALIGN_CENTER,
|
||||
"margin", 6,
|
||||
"height-request", 24,
|
||||
NULL);
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (box), swatch);
|
||||
gtk_box_pack_start (GTK_BOX (row), box, FALSE, FALSE, 0);
|
||||
gtk_widget_show_all (row);
|
||||
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
|
||||
row = gtk_widget_get_parent (row);
|
||||
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
|
||||
g_object_set_data (G_OBJECT (widget), color, row);
|
||||
#ifdef HAVE_LIBCANBERRA
|
||||
ca_gtk_play_for_widget (widget, 0, "event.id", "complete", NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
populate_colors (GtkWidget *widget)
|
||||
{
|
||||
@@ -493,6 +701,7 @@ populate_colors (GtkWidget *widget)
|
||||
};
|
||||
gint i;
|
||||
GtkWidget *row, *box, *label, *swatch;
|
||||
GtkWidget *sw;
|
||||
GdkRGBA rgba;
|
||||
|
||||
gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_title_header, NULL, NULL);
|
||||
@@ -529,6 +738,9 @@ populate_colors (GtkWidget *widget)
|
||||
}
|
||||
|
||||
gtk_list_box_invalidate_headers (GTK_LIST_BOX (widget));
|
||||
|
||||
sw = gtk_widget_get_ancestor (widget, GTK_TYPE_SCROLLED_WINDOW);
|
||||
g_signal_connect (sw, "edge-overshot", G_CALLBACK (overshot), widget);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -549,7 +761,7 @@ background_loaded_cb (GObject *source,
|
||||
pixbuf = gdk_pixbuf_new_from_stream_finish (res, &error);
|
||||
if (error)
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
g_warning ("Error loading '%s': %s", bd->filename, error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
@@ -788,6 +1000,92 @@ toggle_selection_mode (GtkSwitch *sw,
|
||||
gtk_list_box_set_activate_on_single_click (listbox, !gtk_switch_get_active (sw));
|
||||
}
|
||||
|
||||
static void
|
||||
handle_insert (GtkWidget *button, GtkWidget *textview)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
const gchar *id;
|
||||
const gchar *text;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
|
||||
if (strcmp (id, "toolbutton1") == 0)
|
||||
text = "⌘";
|
||||
else if (strcmp (id, "toolbutton2") == 0)
|
||||
text = "⚽";
|
||||
else if (strcmp (id, "toolbutton3") == 0)
|
||||
text = "⤢";
|
||||
else if (strcmp (id, "toolbutton4") == 0)
|
||||
text = "☆";
|
||||
else
|
||||
text = "";
|
||||
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
|
||||
gtk_text_buffer_insert_at_cursor (buffer, text, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_cutcopypaste (GtkWidget *button, GtkWidget *textview)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkClipboard *clipboard;
|
||||
const gchar *id;
|
||||
|
||||
clipboard = gtk_widget_get_clipboard (textview, GDK_SELECTION_CLIPBOARD);
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
|
||||
if (strcmp (id, "cutbutton") == 0)
|
||||
gtk_text_buffer_cut_clipboard (buffer, clipboard, TRUE);
|
||||
else if (strcmp (id, "copybutton") == 0)
|
||||
gtk_text_buffer_copy_clipboard (buffer, clipboard);
|
||||
else if (strcmp (id, "pastebutton") == 0)
|
||||
gtk_text_buffer_paste_clipboard (buffer, clipboard, NULL, TRUE);
|
||||
else if (strcmp (id, "deletebutton") == 0)
|
||||
gtk_text_buffer_delete_selection (buffer, TRUE, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
clipboard_owner_change (GtkClipboard *clipboard, GdkEvent *event, GtkWidget *button)
|
||||
{
|
||||
const gchar *id;
|
||||
gboolean has_text;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
has_text = gtk_clipboard_wait_is_text_available (clipboard);
|
||||
|
||||
if (strcmp (id, "pastebutton") == 0)
|
||||
gtk_widget_set_sensitive (button, has_text);
|
||||
}
|
||||
|
||||
static void
|
||||
textbuffer_notify_selection (GObject *object, GParamSpec *pspec, GtkWidget *button)
|
||||
{
|
||||
const gchar *id;
|
||||
gboolean has_selection;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
has_selection = gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (object));
|
||||
|
||||
if (strcmp (id, "cutbutton") == 0 ||
|
||||
strcmp (id, "copybutton") == 0 ||
|
||||
strcmp (id, "deletebutton") == 0)
|
||||
gtk_widget_set_sensitive (button, has_selection);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
osd_frame_button_press (GtkWidget *frame, GdkEventButton *event, gpointer data)
|
||||
{
|
||||
GtkWidget *osd;
|
||||
gboolean visible;
|
||||
|
||||
osd = g_object_get_data (G_OBJECT (frame), "osd");
|
||||
visible = gtk_widget_get_visible (osd);
|
||||
gtk_widget_set_visible (osd, !visible);
|
||||
|
||||
return GDK_EVENT_STOP;
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GApplication *app)
|
||||
{
|
||||
@@ -795,9 +1093,11 @@ activate (GApplication *app)
|
||||
GtkWindow *window;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *widget2;
|
||||
GtkWidget *widget3;
|
||||
GtkWidget *stack;
|
||||
GtkWidget *dialog;
|
||||
GtkAdjustment *adj;
|
||||
GtkCssProvider *provider;
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "dark", NULL, NULL, "false", change_theme_state },
|
||||
{ "search", activate_search, NULL, NULL, NULL },
|
||||
@@ -817,8 +1117,23 @@ activate (GApplication *app)
|
||||
|
||||
g_type_ensure (my_text_view_get_type ());
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px; }", -1, NULL);
|
||||
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||
g_object_unref (provider);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/WidgetFactory/widget-factory.ui");
|
||||
gtk_builder_add_callback_symbol (builder, "on_entry_icon_release", (GCallback)on_entry_icon_release);
|
||||
gtk_builder_add_callback_symbol (builder, "on_scale_button_value_changed", (GCallback)on_scale_button_value_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_scale_button_query_tooltip", (GCallback)on_scale_button_query_tooltip);
|
||||
gtk_builder_add_callback_symbol (builder, "on_record_button_toggled", (GCallback)on_record_button_toggled);
|
||||
gtk_builder_add_callback_symbol (builder, "on_page_combo_changed", (GCallback)on_page_combo_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_range_from_changed", (GCallback)on_range_from_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_range_to_changed", (GCallback)on_range_to_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "osd_frame_button_press", (GCallback)osd_frame_button_press);
|
||||
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
|
||||
window = (GtkWindow *)gtk_builder_get_object (builder, "window");
|
||||
@@ -924,12 +1239,51 @@ activate (GApplication *app)
|
||||
|
||||
populate_colors ((GtkWidget *)gtk_builder_get_object (builder, "munsell"));
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
|
||||
widget3 = (GtkWidget *)gtk_builder_get_object (builder, "range_to_spin");
|
||||
g_object_set_data (G_OBJECT (widget), "range_from_spin", widget2);
|
||||
g_object_set_data (G_OBJECT (widget3), "range_from_spin", widget2);
|
||||
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
|
||||
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
|
||||
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "quitmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "deletemenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "searchmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "darkmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "aboutmenuitem")));
|
||||
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton1");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_insert), widget2);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton2");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_insert), widget2);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton3");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_insert), widget2);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton4");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_insert), widget2);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "cutbutton");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_cutcopypaste), widget2);
|
||||
g_signal_connect (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget2)), "notify::has-selection",
|
||||
G_CALLBACK (textbuffer_notify_selection), widget);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "copybutton");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_cutcopypaste), widget2);
|
||||
g_signal_connect (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget2)), "notify::has-selection",
|
||||
G_CALLBACK (textbuffer_notify_selection), widget);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "deletebutton");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_cutcopypaste), widget2);
|
||||
g_signal_connect (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget2)), "notify::has-selection",
|
||||
G_CALLBACK (textbuffer_notify_selection), widget);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "pastebutton");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_cutcopypaste), widget2);
|
||||
g_signal_connect (gtk_widget_get_clipboard (widget2, GDK_SELECTION_CLIPBOARD), "owner-change",
|
||||
G_CALLBACK (clipboard_owner_change), widget);
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "osd_frame");
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "totem_like_osd");
|
||||
g_object_set_data (G_OBJECT (widget), "osd", widget2);
|
||||
|
||||
gtk_widget_show_all (GTK_WIDGET (window));
|
||||
|
||||
g_object_unref (builder);
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
</menu>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100</property>
|
||||
<property name="lower">1</property>
|
||||
<property name="value">50</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
@@ -93,6 +94,20 @@
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="pg_adjustment">
|
||||
<property name="upper">99</property>
|
||||
<property name="lower">1</property>
|
||||
<property name="value">2</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="pg_adjustment2">
|
||||
<property name="upper">99</property>
|
||||
<property name="lower">1</property>
|
||||
<property name="value">4</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkListStore" id="liststore1">
|
||||
<columns>
|
||||
<!-- column-name Cool -->
|
||||
@@ -154,7 +169,7 @@ Morbi massa libero, congue vitae scelerisque vel, ultricies vel nisl.
|
||||
Vestibulum in tortor diam, quis aliquet quam. Praesent ut justo neque, tempus rutrum est.
|
||||
Duis eu lectus quam. Vivamus eget metus a mauris molestie venenatis pulvinar eleifend nisi.
|
||||
Nulla facilisi. Pellentesque at dolor sit amet purus dapibus pulvinar molestie quis neque.
|
||||
Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</object>
|
||||
<object class="GtkTextBuffer" id="textbuffer2">
|
||||
<property name="text">* Translation updates:
|
||||
@@ -1587,6 +1602,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="buffer">textbuffer1</property>
|
||||
<property name="wrap_mode">2</property>
|
||||
<property name="left_margin">10</property>
|
||||
<property name="right_margin">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2053,6 +2070,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="visible">True</property>
|
||||
<property name="row-spacing">6</property>
|
||||
<property name="column-spacing">6</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkVolumeButton">
|
||||
@@ -2069,13 +2087,19 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVolumeButton">
|
||||
<object class="GtkScaleButton" id="mic-button">
|
||||
<property name="visible">True</property>
|
||||
<property name="has-tooltip">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="icons">microphone-sensitivity-muted-symbolic
|
||||
microphone-sensitivity-high-symbolic
|
||||
microphone-sensitivity-low-symbolic
|
||||
microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="use-symbolic">True</property>
|
||||
<property name="value">.5</property>
|
||||
<property name="halign">center</property>
|
||||
<signal name="query-tooltip" handler="on_scale_button_query_tooltip" swapped="no"/>
|
||||
<signal name="value-changed" handler="on_scale_button_value_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
@@ -2083,9 +2107,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
@@ -2118,6 +2139,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="buffer">textbuffer2</property>
|
||||
<property name="left_margin">10</property>
|
||||
<property name="right_margin">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2880,6 +2903,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="buffer">textbuffer1</property>
|
||||
<property name="wrap_mode">2</property>
|
||||
<property name="left_margin">10</property>
|
||||
<property name="right_margin">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -3001,6 +3026,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="expanded">True</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow3">
|
||||
<property name="visible">True</property>
|
||||
@@ -3192,6 +3218,662 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="icon_name">pan-down-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="record_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<signal name="toggled" handler="on_record_button_toggled"/>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
<class name="image-button"/>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="icon_name">media-record-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Record</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="grid_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="draw-indicator">False</property>
|
||||
<property name="active">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">view-grid-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="list_button">
|
||||
<property name="active">True</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="draw-indicator">False</property>
|
||||
<property name="group">grid_button</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">view-list-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
<class name="circular-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">emblem-system-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkSidebar">
|
||||
<property name="visible">True</property>
|
||||
<property name="stack">sidebar_stack</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="sidebar_stack">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">First Name</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">Last Name</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">id</property>
|
||||
<property name="title">Identity</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkComboBoxText">
|
||||
<property name="visible">True</property>
|
||||
<property name="active">9</property>
|
||||
<items>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
<item>7</item>
|
||||
<item>8</item>
|
||||
<item>9</item>
|
||||
<item>10</item>
|
||||
<item>11</item>
|
||||
<item>12</item>
|
||||
<item>13</item>
|
||||
<item>14</item>
|
||||
<item>15</item>
|
||||
<item>16</item>
|
||||
<item>17</item>
|
||||
<item>18</item>
|
||||
<item>19</item>
|
||||
<item>20</item>
|
||||
<item>21</item>
|
||||
<item>22</item>
|
||||
<item>23</item>
|
||||
<item>24</item>
|
||||
<item>25</item>
|
||||
<item>26</item>
|
||||
<item>27</item>
|
||||
<item>28</item>
|
||||
<item>29</item>
|
||||
<item>30</item>
|
||||
<item>31</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText">
|
||||
<property name="visible">True</property>
|
||||
<property name="active">9</property>
|
||||
<items>
|
||||
<item>January</item>
|
||||
<item>February</item>
|
||||
<item>March</item>
|
||||
<item>April</item>
|
||||
<item>May</item>
|
||||
<item>June</item>
|
||||
<item>July</item>
|
||||
<item>August</item>
|
||||
<item>September</item>
|
||||
<item>October</item>
|
||||
<item>November</item>
|
||||
<item>December</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">Year</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">bd</property>
|
||||
<property name="title">Birthdate</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">Street</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">City</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">Province</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">ad</property>
|
||||
<property name="title">Address</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="page_combo">
|
||||
<property name="visible">True</property>
|
||||
<property name="active">0</property>
|
||||
<signal name="changed" handler="on_page_combo_changed"/>
|
||||
<items>
|
||||
<item>Range</item>
|
||||
<item>All</item>
|
||||
<item>Current</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="range_from_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="adjustment">pg_adjustment</property>
|
||||
<signal name="value-changed" handler="on_range_from_changed"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="range_to_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="adjustment">pg_adjustment2</property>
|
||||
<signal name="value-changed" handler="on_range_to_changed"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">Print</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">pg</property>
|
||||
<property name="title">Pages</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="icon-size">1</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">document-open-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton2">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">send-to-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton3">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">view-fullscreen-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton4">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">star-new-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="hscrollbar-policy">automatic</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="tooltextview">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">6</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton" id="cutbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">edit-cut-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="copybutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">edit-copy-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="pastebutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">edit-paste-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="deletebutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="valign">end</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">edit-delete-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkOverlay">
|
||||
<property name="visible">True</property>
|
||||
<child type="overlay">
|
||||
<object class="GtkToolbar" id="totem_like_osd">
|
||||
<property name="no-show-all">True</property>
|
||||
<property name="opacity">0.9</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">end</property>
|
||||
<style>
|
||||
<class name="osd"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="visible">True</property>
|
||||
<property name="draw-value">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkVolumeButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="use-symbolic">True</property>
|
||||
<property name="value">.5</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="osd_frame">
|
||||
<property name="visible">True</property>
|
||||
<signal name="button-press-event" handler="osd_frame_button_press"/>
|
||||
<child>
|
||||
<object class="GtkPaned">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="wide-handle">True</property>
|
||||
<child>
|
||||
<object class="GtkNotebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="show-border">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="height-request">120</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="show-border">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 3</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner">
|
||||
<property name="visible">True</property>
|
||||
@@ -3296,7 +3978,9 @@ bad things might happen.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Details</property>
|
||||
<property name="label">_Details</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">details_entry</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -3309,7 +3993,7 @@ bad things might happen.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<object class="GtkEntry" id="details_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">baseline</property>
|
||||
@@ -3326,7 +4010,9 @@ bad things might happen.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">More Details</property>
|
||||
<property name="label">More D_etails</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">more_details_entry</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -3339,7 +4025,7 @@ bad things might happen.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<object class="GtkEntry" id="more_details_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">baseline</property>
|
||||
@@ -3356,7 +4042,9 @@ bad things might happen.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Level</property>
|
||||
<property name="label">_Level</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">level_scale</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -3369,7 +4057,7 @@ bad things might happen.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<object class="GtkScale" id="level_scale">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">baseline</property>
|
||||
@@ -3388,7 +4076,9 @@ bad things might happen.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Mode</property>
|
||||
<property name="label">_Mode</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">mode_switch</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -3401,7 +4091,7 @@ bad things might happen.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch">
|
||||
<object class="GtkSwitch" id="mode_switch">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
@@ -3459,7 +4149,7 @@ bad things might happen.</property>
|
||||
<action-widget response="cancel">cancel_selection_dialog</action-widget>
|
||||
<action-widget response="ok" default="true">select_selection_dialog</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</object>
|
||||
<object class="GtkSizeGroup">
|
||||
<property name="mode">vertical</property>
|
||||
<widgets>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<xi:include href="xml/windows.xml" />
|
||||
<xi:include href="xml/gdkframeclock.xml" />
|
||||
<xi:include href="xml/gdkframetimings.xml" />
|
||||
<xi:include href="xml/gdkglcontext.xml" />
|
||||
<xi:include href="xml/events.xml" />
|
||||
<xi:include href="xml/event_structs.xml" />
|
||||
<xi:include href="xml/keys.xml" />
|
||||
@@ -92,6 +93,10 @@
|
||||
<title>Index of new symbols in 3.14</title>
|
||||
<xi:include href="xml/api-index-3.14.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-16" role="3.16">
|
||||
<title>Index of new symbols in 3.16</title>
|
||||
<xi:include href="xml/api-index-3.16.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
||||
@@ -394,6 +394,8 @@ gdk_window_constrain_size
|
||||
gdk_window_beep
|
||||
gdk_window_get_scale_factor
|
||||
gdk_window_set_opaque_region
|
||||
gdk_window_create_gl_context
|
||||
gdk_window_mark_paint_from_clip
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_window_get_clip_region
|
||||
@@ -617,6 +619,7 @@ gdk_cairo_rectangle
|
||||
gdk_cairo_region
|
||||
gdk_cairo_region_create_from_surface
|
||||
gdk_cairo_surface_create_from_pixbuf
|
||||
gdk_cairo_draw_from_gl
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -1004,6 +1007,7 @@ gdk_x11_display_error_trap_pop
|
||||
gdk_x11_display_error_trap_pop_ignored
|
||||
gdk_x11_display_set_cursor_theme
|
||||
gdk_x11_display_set_window_scale
|
||||
gdk_x11_display_get_glx_version
|
||||
gdk_x11_register_standard_event_type
|
||||
gdk_x11_screen_get_screen_number
|
||||
gdk_x11_screen_get_xscreen
|
||||
@@ -1123,6 +1127,11 @@ GDK_X11_KEYMAP_CLASS
|
||||
GDK_IS_X11_KEYMAP
|
||||
GDK_IS_X11_KEYMAP_CLASS
|
||||
GDK_X11_KEYMAP_GET_CLASS
|
||||
GDK_TYPE_X11_GL_CONTEXT
|
||||
GDK_X11_GL_CONTEXT
|
||||
GDK_X11_GL_CONTEXT_CLASS
|
||||
GDK_IS_X11_GL_CONTEXT
|
||||
GDK_IS_X11_GL_CONTEXT_CLASS
|
||||
GDK_TYPE_X11_SCREEN
|
||||
GDK_X11_SCREEN
|
||||
GDK_X11_SCREEN_CLASS
|
||||
@@ -1273,3 +1282,27 @@ gdk_frame_timings_get_predicted_presentation_time
|
||||
<SUBSECTION Private>
|
||||
gdk_frame_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gdkglcontext</FILE>
|
||||
GdkGLContext
|
||||
gdk_gl_context_get_window
|
||||
gdk_gl_context_make_current
|
||||
gdk_gl_context_clear_current
|
||||
gdk_gl_context_get_current
|
||||
GDK_GL_ERROR
|
||||
GDK_TYPE_GL_ERROR
|
||||
GDK_TYPE_GL_PROFILE
|
||||
GdkGLProfile
|
||||
GdkGLError
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_GL_CONTEXT
|
||||
GDK_IS_GL_CONTEXT
|
||||
GDK_TYPE_GL_CONTEXT
|
||||
GDK_GL_CONTEXT_CLASS
|
||||
GDK_GL_CONTEXT_GET_CLASS
|
||||
GDK_IS_GL_CONTEXT_CLASS
|
||||
gdk_gl_context_get_type
|
||||
gdk_gl_error_quark
|
||||
</SECTION>
|
||||
|
||||
@@ -8,6 +8,7 @@ gdk_display_get_type
|
||||
gdk_display_manager_get_type
|
||||
gdk_drag_context_get_type
|
||||
gdk_frame_clock_get_type
|
||||
gdk_gl_context_get_type
|
||||
gdk_keymap_get_type
|
||||
gdk_screen_get_type
|
||||
gdk_visual_get_type
|
||||
|
||||
@@ -84,6 +84,7 @@ IGNORE_HFILES= \
|
||||
gtktextbufferserializ.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktextdisplay.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextlayout.h \
|
||||
gtktextmarkprivate.h \
|
||||
@@ -145,6 +146,7 @@ content_files = \
|
||||
osx.sgml \
|
||||
broadway.xml \
|
||||
wayland.xml \
|
||||
mir.xml \
|
||||
question_index.sgml \
|
||||
resources.sgml \
|
||||
text_widget.sgml \
|
||||
@@ -152,6 +154,7 @@ content_files = \
|
||||
windows.sgml \
|
||||
x11.sgml \
|
||||
gtk3-demo.xml \
|
||||
gtk3-demo-application.xml \
|
||||
gtk3-widget-factory.xml \
|
||||
gtk3-icon-browser.xml \
|
||||
gtk-query-immodules-3.0.xml \
|
||||
@@ -204,6 +207,7 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/font-button.png \
|
||||
$(srcdir)/images/fontchooser.png \
|
||||
$(srcdir)/images/frame.png \
|
||||
$(srcdir)/images/glarea.png \
|
||||
$(srcdir)/images/headerbar.png \
|
||||
$(srcdir)/images/icon-view.png \
|
||||
$(srcdir)/images/image.png \
|
||||
@@ -235,6 +239,7 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/search-bar.png \
|
||||
$(srcdir)/images/search-entry.png \
|
||||
$(srcdir)/images/separator.png \
|
||||
$(srcdir)/images/sidebar.png \
|
||||
$(srcdir)/images/spinbutton.png \
|
||||
$(srcdir)/images/spinner.png \
|
||||
$(srcdir)/images/stack.png \
|
||||
@@ -339,6 +344,7 @@ man_MANS = \
|
||||
gtk-encode-symbolic-svg.1 \
|
||||
gtk-launch.1 \
|
||||
gtk3-demo.1 \
|
||||
gtk3-demo-application.1 \
|
||||
gtk3-widget-factory.1 \
|
||||
gtk3-icon-browser.1 \
|
||||
broadwayd.1
|
||||
|
||||
@@ -254,6 +254,19 @@ How to compile GTK+ itself
|
||||
drawing.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="https://github.com/anholt/libepoxy">libepoxy</ulink>
|
||||
is a library that abstracts the differences between different
|
||||
OpenGL libraries. GTK+ uses it for cross-platform GL support.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <ulink url="http://wayland.freedesktop.org">Wayland</ulink> libraries
|
||||
are needed to build GTK+ with the Wayland backend.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <ulink url="http://www.freedesktop.org/wiki/Software/shared-mime-info">shared-mime-info</ulink>
|
||||
@@ -394,6 +407,11 @@ How to compile GTK+ itself
|
||||
<arg choice="plain">--disable-wayland-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">--enable-mir-backend</arg>
|
||||
<arg choice="plain">--disable-mir-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">--enable-introspection=[no/auto/yes]</arg>
|
||||
</group>
|
||||
@@ -595,8 +613,10 @@ How to compile GTK+ itself
|
||||
<systemitem>--disable-quartz-backend</systemitem>,
|
||||
<systemitem>--enable-broadway-backend</systemitem>,
|
||||
<systemitem>--disable-broadway-backend</systemitem>,
|
||||
<systemitem>--enable-wayland-backend</systemitem>, and
|
||||
<systemitem>--disable-wayland-backend</systemitem></title>
|
||||
<systemitem>--enable-wayland-backend</systemitem>,
|
||||
<systemitem>--disable-wayland-backend</systemitem>
|
||||
<systemitem>--enable-mir-backend</systemitem>, and
|
||||
<systemitem>--disable-mir-backend</systemitem></title>
|
||||
|
||||
<para>
|
||||
Enables specific backends for GDK. If none of these options
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<xi:include href="xml/gtkflowbox.xml" />
|
||||
<xi:include href="xml/gtkstack.xml" />
|
||||
<xi:include href="xml/gtkstackswitcher.xml" />
|
||||
<xi:include href="xml/gtksidebar.xml" />
|
||||
<xi:include href="xml/gtkactionbar.xml" />
|
||||
<xi:include href="xml/gtkheaderbar.xml" />
|
||||
<xi:include href="xml/gtkoverlay.xml" />
|
||||
@@ -113,6 +114,7 @@
|
||||
<xi:include href="xml/gtkscalebutton.xml" />
|
||||
<xi:include href="xml/gtkvolumebutton.xml" />
|
||||
<xi:include href="xml/gtklockbutton.xml" />
|
||||
<xi:include href="xml/gtkmodelbutton.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="NumericEntry">
|
||||
@@ -190,6 +192,7 @@
|
||||
<xi:include href="xml/gtktoggletoolbutton.xml" />
|
||||
<xi:include href="xml/gtkradiotoolbutton.xml" />
|
||||
<xi:include href="xml/gtkpopover.xml" />
|
||||
<xi:include href="xml/gtkpopovermenu.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="SelectorWidgets">
|
||||
@@ -241,6 +244,7 @@
|
||||
<xi:include href="xml/gtkadjustment.xml" />
|
||||
<xi:include href="xml/gtkcalendar.xml" />
|
||||
<xi:include href="xml/gtkdrawingarea.xml" />
|
||||
<xi:include href="xml/gtkglarea.xml" />
|
||||
<xi:include href="xml/gtkeventbox.xml" />
|
||||
<xi:include href="xml/gtkhandlebox.xml" />
|
||||
<xi:include href="xml/gtkimcontextsimple.xml" />
|
||||
@@ -394,6 +398,7 @@
|
||||
<part>
|
||||
<title>GTK+ Tools</title>
|
||||
<xi:include href="gtk3-demo.xml" />
|
||||
<xi:include href="gtk3-demo-application.xml" />
|
||||
<xi:include href="gtk3-widget-factory.xml" />
|
||||
<xi:include href="gtk3-icon-browser.xml" />
|
||||
<xi:include href="gtk-query-immodules-3.0.xml" />
|
||||
@@ -413,6 +418,7 @@
|
||||
<xi:include href="osx.sgml" />
|
||||
<xi:include href="broadway.xml" />
|
||||
<xi:include href="wayland.xml" />
|
||||
<xi:include href="mir.xml" />
|
||||
</part>
|
||||
|
||||
<xi:include href="glossary.xml" />
|
||||
@@ -457,6 +463,10 @@
|
||||
<title>Index of new symbols in 3.14</title>
|
||||
<xi:include href="xml/api-index-3.14.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-16" role="3.16">
|
||||
<title>Index of new symbols in 3.16</title>
|
||||
<xi:include href="xml/api-index-3.16.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk3-demo-application">
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk3-demo-application</title>
|
||||
<productname>GTK+</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Matthias</firstname>
|
||||
<surname>Clasen</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk3-demo-application</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="manual">User Commands</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk3-demo-application</refname>
|
||||
<refpurpose>Demonstrate GtkApplication</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>gtk3-demo-application</command>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>gtk3-demo-application</command> is an example application
|
||||
used by <command>gtk3-demo</command>. There is no need to call it
|
||||
manually.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
@@ -2085,6 +2085,8 @@ gtk_label_set_markup
|
||||
gtk_label_set_markup_with_mnemonic
|
||||
gtk_label_set_pattern
|
||||
gtk_label_set_justify
|
||||
gtk_label_set_xalign
|
||||
gtk_label_set_yalign
|
||||
gtk_label_set_ellipsize
|
||||
gtk_label_set_width_chars
|
||||
gtk_label_set_max_width_chars
|
||||
@@ -2102,6 +2104,8 @@ gtk_label_set_selectable
|
||||
gtk_label_set_text_with_mnemonic
|
||||
gtk_label_get_attributes
|
||||
gtk_label_get_justify
|
||||
gtk_label_get_xalign
|
||||
gtk_label_get_yalign
|
||||
gtk_label_get_ellipsize
|
||||
gtk_label_get_width_chars
|
||||
gtk_label_get_max_width_chars
|
||||
@@ -2589,6 +2593,8 @@ gtk_paned_get_child2
|
||||
gtk_paned_set_position
|
||||
gtk_paned_get_position
|
||||
gtk_paned_get_handle_window
|
||||
gtk_paned_set_wide_handle
|
||||
gtk_paned_get_wide_handle
|
||||
<SUBSECTION Standard>
|
||||
GTK_PANED
|
||||
GTK_IS_PANED
|
||||
@@ -3148,6 +3154,8 @@ gtk_scrolled_window_set_kinetic_scrolling
|
||||
gtk_scrolled_window_get_kinetic_scrolling
|
||||
gtk_scrolled_window_set_capture_button_press
|
||||
gtk_scrolled_window_get_capture_button_press
|
||||
gtk_scrolled_window_set_overlay_scrolling
|
||||
gtk_scrolled_window_get_overlay_scrolling
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_SCROLLED_WINDOW
|
||||
@@ -3539,6 +3547,7 @@ gtk_tearoff_menu_item_get_type
|
||||
<FILE>gtktextbuffer</FILE>
|
||||
<TITLE>GtkTextBuffer</TITLE>
|
||||
GtkTextBuffer
|
||||
GtkTextBufferClass
|
||||
gtk_text_buffer_new
|
||||
gtk_text_buffer_get_line_count
|
||||
gtk_text_buffer_get_char_count
|
||||
@@ -3625,9 +3634,9 @@ GTK_TYPE_TEXT_BUFFER
|
||||
GTK_TEXT_BUFFER_CLASS
|
||||
GTK_IS_TEXT_BUFFER_CLASS
|
||||
GTK_TEXT_BUFFER_GET_CLASS
|
||||
gtk_text_buffer_get_type
|
||||
<SUBSECTION Private>
|
||||
GtkTextBufferPrivate
|
||||
gtk_text_buffer_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -3779,6 +3788,7 @@ GTK_IS_TEXT_TAG_CLASS
|
||||
GTK_TEXT_TAG_GET_CLASS
|
||||
GTK_TYPE_TEXT_ATTRIBUTES
|
||||
<SUBSECTION Private>
|
||||
GtkTextTagPrivate
|
||||
gtk_text_tag_get_type
|
||||
gtk_text_attributes_get_type
|
||||
</SECTION>
|
||||
@@ -3810,6 +3820,8 @@ gtk_text_tag_table_get_type
|
||||
<FILE>gtktextview</FILE>
|
||||
<TITLE>GtkTextView</TITLE>
|
||||
GtkTextView
|
||||
GtkTextViewClass
|
||||
GtkTextViewLayer
|
||||
GtkTextWindowType
|
||||
GtkWrapMode
|
||||
gtk_text_view_new
|
||||
@@ -3882,6 +3894,8 @@ gtk_text_view_set_input_purpose
|
||||
gtk_text_view_get_input_purpose
|
||||
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_PRIORITY_VALIDATE
|
||||
<SUBSECTION Standard>
|
||||
GTK_TEXT_VIEW
|
||||
@@ -5733,6 +5747,7 @@ gtk_window_get_application
|
||||
gtk_window_set_application
|
||||
gtk_window_set_has_user_ref_count
|
||||
gtk_window_set_titlebar
|
||||
gtk_window_get_titlebar
|
||||
gtk_window_set_interactive_debugging
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -5994,6 +6009,7 @@ GTK_STYLE_CLASS_IMAGE
|
||||
GTK_STYLE_CLASS_INFO
|
||||
GTK_STYLE_CLASS_INLINE_TOOLBAR
|
||||
GTK_STYLE_CLASS_INSERTION_CURSOR
|
||||
GTK_STYLE_CLASS_LABEL
|
||||
GTK_STYLE_CLASS_LEFT
|
||||
GTK_STYLE_CLASS_LEVEL_BAR
|
||||
GTK_STYLE_CLASS_LINKED
|
||||
@@ -6004,11 +6020,13 @@ GTK_STYLE_CLASS_MENU
|
||||
GTK_STYLE_CLASS_MENUBAR
|
||||
GTK_STYLE_CLASS_MENUITEM
|
||||
GTK_STYLE_CLASS_MESSAGE_DIALOG
|
||||
GTK_STYLE_CLASS_MONOSPACE
|
||||
GTK_STYLE_CLASS_NEEDS_ATTENTION
|
||||
GTK_STYLE_CLASS_NOTEBOOK
|
||||
GTK_STYLE_CLASS_OSD
|
||||
GTK_STYLE_CLASS_OVERSHOOT
|
||||
GTK_STYLE_CLASS_PANE_SEPARATOR
|
||||
GTK_STYLE_CLASS_PAPER
|
||||
GTK_STYLE_CLASS_POPUP
|
||||
GTK_STYLE_CLASS_PRIMARY_TOOLBAR
|
||||
GTK_STYLE_CLASS_PROGRESSBAR
|
||||
@@ -6028,6 +6046,7 @@ GTK_STYLE_CLASS_SIDEBAR
|
||||
GTK_STYLE_CLASS_SLIDER
|
||||
GTK_STYLE_CLASS_SPINBUTTON
|
||||
GTK_STYLE_CLASS_SPINNER
|
||||
GTK_STYLE_CLASS_STATUSBAR
|
||||
GTK_STYLE_CLASS_SUBTITLE
|
||||
GTK_STYLE_CLASS_SUGGESTED_ACTION
|
||||
GTK_STYLE_CLASS_TITLE
|
||||
@@ -6039,6 +6058,7 @@ GTK_STYLE_CLASS_TROUGH
|
||||
GTK_STYLE_CLASS_VERTICAL
|
||||
GTK_STYLE_CLASS_VIEW
|
||||
GTK_STYLE_CLASS_WARNING
|
||||
GTK_STYLE_CLASS_WIDE
|
||||
GTK_STYLE_REGION_COLUMN
|
||||
GTK_STYLE_REGION_COLUMN_HEADER
|
||||
GTK_STYLE_REGION_ROW
|
||||
@@ -6153,6 +6173,7 @@ gtk_css_provider_get_named
|
||||
gtk_css_provider_load_from_data
|
||||
gtk_css_provider_load_from_file
|
||||
gtk_css_provider_load_from_path
|
||||
gtk_css_provider_load_from_resource
|
||||
gtk_css_provider_new
|
||||
gtk_css_provider_to_string
|
||||
GTK_CSS_PROVIDER_ERROR
|
||||
@@ -7131,6 +7152,7 @@ GTK_PAPER_NAME_EXECUTIVE
|
||||
GTK_PAPER_NAME_LEGAL
|
||||
gtk_paper_size_new
|
||||
gtk_paper_size_new_from_ppd
|
||||
gtk_paper_size_new_from_ipp
|
||||
gtk_paper_size_new_custom
|
||||
gtk_paper_size_copy
|
||||
gtk_paper_size_free
|
||||
@@ -7141,6 +7163,7 @@ gtk_paper_size_get_display_name
|
||||
gtk_paper_size_get_ppd_name
|
||||
gtk_paper_size_get_width
|
||||
gtk_paper_size_get_height
|
||||
gtk_paper_size_is_ipp
|
||||
gtk_paper_size_is_custom
|
||||
gtk_paper_size_set_size
|
||||
gtk_paper_size_get_default_top_margin
|
||||
@@ -7824,6 +7847,10 @@ gtk_stack_get_visible_child_name
|
||||
gtk_stack_set_visible_child_full
|
||||
gtk_stack_set_homogeneous
|
||||
gtk_stack_get_homogeneous
|
||||
gtk_stack_set_hhomogeneous
|
||||
gtk_stack_get_hhomogeneous
|
||||
gtk_stack_set_vhomogeneous
|
||||
gtk_stack_get_vhomogeneous
|
||||
gtk_stack_set_transition_duration
|
||||
gtk_stack_get_transition_duration
|
||||
GtkStackTransitionType
|
||||
@@ -7929,6 +7956,22 @@ gtk_popover_set_modal
|
||||
gtk_popover_get_modal
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkpopovermenu</FILE>
|
||||
<TITLE>GtkPopoverMenu</TITLE>
|
||||
GtkPopoverMenu
|
||||
gtk_popover_menu_new
|
||||
gtk_popover_menu_open_submenu
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmodelbutton</FILE>
|
||||
<TITLE>GtkModelButton</TITLE>
|
||||
GtkModelButton
|
||||
GtkButtonRole
|
||||
gtk_model_button_new
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkeventcontroller</FILE>
|
||||
<TITLE>GtkEventController</TITLE>
|
||||
@@ -8153,3 +8196,46 @@ GTK_GESTURE_ZOOM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_gesture_zoom_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtksidebar</FILE>
|
||||
GtkSidebar
|
||||
GtkSidebarClass
|
||||
gtk_sidebar_new
|
||||
gtk_sidebar_set_stack
|
||||
gtk_sidebar_get_stack
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_SIDEBAR
|
||||
GTK_SIDEBAR
|
||||
GTK_SIDEBAR_CLASS
|
||||
GTK_IS_SIDEBAR
|
||||
GTK_IS_SIDEBAR_CLASS
|
||||
GTK_SIDEBAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkSidebarPrivate
|
||||
gtk_sidebar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkglarea</FILE>
|
||||
GtkGLArea
|
||||
GtkGLAreaClass
|
||||
gtk_gl_area_new
|
||||
gtk_gl_area_get_context
|
||||
<SUBSECTION>
|
||||
gtk_gl_area_set_has_alpha
|
||||
gtk_gl_area_get_has_alpha
|
||||
gtk_gl_area_set_has_depth_buffer
|
||||
gtk_gl_area_get_has_depth_buffer
|
||||
gtk_gl_area_make_current
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_GL_AREA
|
||||
GTK_GL_AREA
|
||||
GTK_GL_AREA_CLASS
|
||||
GTK_IS_GL_AREA
|
||||
GTK_IS_GL_AREA_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_gl_area_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -90,6 +90,7 @@ gtk_gesture_rotate_get_type
|
||||
gtk_gesture_single_get_type
|
||||
gtk_gesture_swipe_get_type
|
||||
gtk_gesture_zoom_get_type
|
||||
gtk_gl_area_get_type
|
||||
gtk_grid_get_type
|
||||
gtk_handle_box_get_type
|
||||
gtk_hbox_get_type
|
||||
@@ -125,6 +126,7 @@ gtk_menu_shell_get_type
|
||||
gtk_menu_tool_button_get_type
|
||||
gtk_message_dialog_get_type
|
||||
gtk_misc_get_type
|
||||
gtk_model_button_get_type
|
||||
gtk_mount_operation_get_type
|
||||
gtk_notebook_get_type
|
||||
gtk_numerable_icon_get_type
|
||||
@@ -138,6 +140,7 @@ gtk_paper_size_get_type
|
||||
gtk_places_sidebar_get_type
|
||||
@ENABLE_ON_X11@gtk_plug_get_type
|
||||
gtk_popover_get_type
|
||||
gtk_popover_menu_get_type
|
||||
@DISABLE_ON_W32@gtk_printer_get_type
|
||||
gtk_print_context_get_type
|
||||
@DISABLE_ON_W32@gtk_print_job_get_type
|
||||
@@ -170,6 +173,7 @@ gtk_separator_get_type
|
||||
gtk_separator_menu_item_get_type
|
||||
gtk_separator_tool_item_get_type
|
||||
gtk_settings_get_type
|
||||
gtk_sidebar_get_type
|
||||
gtk_size_group_get_type
|
||||
@ENABLE_ON_X11@gtk_socket_get_type
|
||||
gtk_spin_button_get_type
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-mir">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ with Mir</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Using GTK+ with Mir</refname>
|
||||
<refpurpose>
|
||||
Mir-specific aspects of using GTK+
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Using GTK+ with Mir</title>
|
||||
|
||||
<para>
|
||||
The GDK Mir backend provides support for running GTK+ applications
|
||||
under Mir based display servers. To run your application in this way,
|
||||
select the Mir backend by setting <literal>GDK_BACKEND=mir</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Currently, the Mir backend does not use any additional commandline
|
||||
options or environment variables.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
@@ -399,6 +399,10 @@ nevertheless.
|
||||
<term>misc</term>
|
||||
<listitem><para>Miscellaneous information</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>nogl</term>
|
||||
<listitem><para>Turn off OpenGL. GDK will behave as if OpenGL support was not available.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>nograbs</term>
|
||||
<listitem><para>Turn off all pointer and keyboard grabs</para></listitem>
|
||||
@@ -487,6 +491,11 @@ nevertheless.
|
||||
<listitem><para>Selects the Wayland backend for connecting to Wayland display servers</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>mir</term>
|
||||
<listitem><para>Selects the Mir backend for connecting to Mir display servers</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
Since 3.10, this environment variable can contain a comma-separated list
|
||||
of backend names, which are tried in order. The list may also contain
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
<link linkend="GtkScale">
|
||||
<inlinegraphic fileref="scales.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkGLArea">
|
||||
<inlinegraphic fileref="glarea.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -141,6 +144,9 @@
|
||||
<link linkend="GtkStackSwitcher">
|
||||
<inlinegraphic fileref="stackswitcher.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkSidebar">
|
||||
<inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkTreeView">
|
||||
<inlinegraphic fileref="list-and-tree.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
|
||||
@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
|
||||
-I$(top_builddir)/gdk \
|
||||
-I$(top_srcdir)/gdk \
|
||||
-I$(top_srcdir)/gdk/x11 \
|
||||
-I$(top_srcdir)/tests \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GTK_DEP_CFLAGS)
|
||||
|
||||
@@ -30,7 +31,9 @@ doc_shooter_SOURCES= \
|
||||
shadow.h \
|
||||
shooter.c \
|
||||
widgets.c \
|
||||
widgets.h
|
||||
widgets.h \
|
||||
$(top_srcdir)/tests/gtkgears.c \
|
||||
$(top_srcdir)/tests/gtkgears.h
|
||||
|
||||
clean-local:
|
||||
for file in *.png; do \
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <X11/Xatom.h>
|
||||
#include <gdkx.h>
|
||||
#include "widgets.h"
|
||||
#include "gtkgears.h"
|
||||
|
||||
#define SMALL_WIDTH 240
|
||||
#define SMALL_HEIGHT 75
|
||||
@@ -1385,6 +1386,41 @@ create_stack_switcher (void)
|
||||
return new_widget_info ("stackswitcher", vbox, ASIS);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_sidebar (void)
|
||||
{
|
||||
GtkWidget *stack;
|
||||
GtkWidget *sidebar;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *view;
|
||||
GtkWidget *frame;
|
||||
|
||||
stack = gtk_stack_new ();
|
||||
gtk_widget_set_size_request (stack, 120, 120);
|
||||
view = gtk_label_new ("Sidebar");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (view), "view");
|
||||
gtk_widget_set_halign (view, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (view, GTK_ALIGN_FILL);
|
||||
gtk_widget_show (view);
|
||||
gtk_stack_add_titled (GTK_STACK (stack), view, "page1", "Page 1");
|
||||
view = gtk_text_view_new ();
|
||||
gtk_widget_show (view);
|
||||
gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2");
|
||||
|
||||
sidebar = gtk_sidebar_new ();
|
||||
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), sidebar, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gtk_separator_new (GTK_ORIENTATION_VERTICAL), FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), stack, TRUE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
||||
|
||||
return new_widget_info ("sidebar", frame, ASIS);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_list_box (void)
|
||||
{
|
||||
@@ -1480,6 +1516,24 @@ create_flow_box (void)
|
||||
return info;
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_gl_area (void)
|
||||
{
|
||||
WidgetInfo *info;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *gears;
|
||||
|
||||
widget = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
|
||||
|
||||
gears = gtk_gears_new ();
|
||||
gtk_container_add (GTK_CONTAINER (widget), gears);
|
||||
|
||||
info = new_widget_info ("glarea", widget, MEDIUM);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
GList *
|
||||
get_all_widgets (void)
|
||||
{
|
||||
@@ -1544,6 +1598,8 @@ get_all_widgets (void)
|
||||
retval = g_list_prepend (retval, create_search_entry ());
|
||||
retval = g_list_prepend (retval, create_level_bar ());
|
||||
retval = g_list_prepend (retval, create_info_bar ());
|
||||
retval = g_list_prepend (retval, create_gl_area ());
|
||||
retval = g_list_prepend (retval, create_sidebar ());
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,9 @@ plugin_action (GAction *action,
|
||||
|
||||
gdk_rgba_parse (&color, g_action_get_name (action));
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_widget_override_color (text, 0, &color);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+11
-1
@@ -13,7 +13,7 @@ INTROSPECTION_COMPILER_ARGS = \
|
||||
|
||||
SUBDIRS = $(GDK_BACKENDS) .
|
||||
|
||||
DIST_SUBDIRS = win32 x11 quartz broadway wayland
|
||||
DIST_SUBDIRS = win32 x11 quartz broadway wayland mir
|
||||
|
||||
CLEANFILES =
|
||||
|
||||
@@ -71,6 +71,7 @@ gdk_public_h_sources = \
|
||||
gdkdnd.h \
|
||||
gdkevents.h \
|
||||
gdkframetimings.h \
|
||||
gdkglcontext.h \
|
||||
gdkkeys.h \
|
||||
gdkkeysyms.h \
|
||||
gdkkeysyms-compat.h \
|
||||
@@ -98,6 +99,7 @@ gdk_h_sources = \
|
||||
$(deprecated_h_sources)
|
||||
|
||||
gdk_private_headers = \
|
||||
gdk-private.h \
|
||||
gdkapplaunchcontextprivate.h \
|
||||
gdkcursorprivate.h \
|
||||
gdkdevicemanagerprivate.h \
|
||||
@@ -107,6 +109,7 @@ gdk_private_headers = \
|
||||
gdkdndprivate.h \
|
||||
gdkframeclockidle.h \
|
||||
gdkframeclockprivate.h \
|
||||
gdkglcontextprivate.h \
|
||||
gdkscreenprivate.h \
|
||||
gdkinternals.h \
|
||||
gdkintl.h \
|
||||
@@ -119,6 +122,7 @@ deprecated_c_sources = \
|
||||
|
||||
gdk_c_sources = \
|
||||
$(deprecated_c_sources) \
|
||||
gdk-private.c \
|
||||
gdk.c \
|
||||
gdkapplaunchcontext.c \
|
||||
gdkcairo.c \
|
||||
@@ -131,6 +135,8 @@ gdk_c_sources = \
|
||||
gdkdnd.c \
|
||||
gdkevents.c \
|
||||
gdkframetimings.c \
|
||||
gdkgl.c \
|
||||
gdkglcontext.c \
|
||||
gdkglobals.c \
|
||||
gdkkeys.c \
|
||||
gdkkeyuni.c \
|
||||
@@ -201,6 +207,10 @@ if USE_WAYLAND
|
||||
libgdk_3_la_LIBADD += wayland/libgdk-wayland.la
|
||||
endif
|
||||
|
||||
if USE_MIR
|
||||
libgdk_3_la_LIBADD += mir/libgdk-mir.la
|
||||
endif
|
||||
|
||||
if HAVE_INTROSPECTION
|
||||
|
||||
introspection_files = \
|
||||
|
||||
@@ -1387,8 +1387,7 @@ broadway_server_destroy_window (BroadwayServer *server,
|
||||
g_hash_table_remove (server->id_ht,
|
||||
GINT_TO_POINTER (id));
|
||||
|
||||
if (window->cached_surface_name != NULL)
|
||||
g_free (window->cached_surface_name);
|
||||
g_free (window->cached_surface_name);
|
||||
if (window->cached_surface != NULL)
|
||||
cairo_surface_destroy (window->cached_surface);
|
||||
|
||||
@@ -1748,8 +1747,7 @@ broadway_server_open_surface (BroadwayServer *server,
|
||||
cairo_surface_set_user_data (surface, &shm_cairo_key,
|
||||
data, shm_data_unmap);
|
||||
|
||||
if (window->cached_surface_name != NULL)
|
||||
g_free (window->cached_surface_name);
|
||||
g_free (window->cached_surface_name);
|
||||
window->cached_surface_name = g_strdup (name);
|
||||
|
||||
if (window->cached_surface != NULL)
|
||||
|
||||
@@ -140,7 +140,7 @@ _gdk_broadway_server_new (const char *display, GError **error)
|
||||
else
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
_("broadway display type not supported '%s'"), display);
|
||||
_("Broadway display type not supported: %s"), display);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ gdk_broadway_device_window_at_position (GdkDevice *device,
|
||||
GdkWindow *root_window;
|
||||
GdkWindow *window;
|
||||
|
||||
screen = gdk_screen_get_default ();
|
||||
screen = gdk_display_get_default_screen (gdk_device_get_display (device));
|
||||
root_window = gdk_screen_get_root_window (screen);
|
||||
|
||||
gdk_broadway_device_query_state (device, root_window, NULL, &window, NULL, NULL, win_x, win_y, mask);
|
||||
|
||||
@@ -330,19 +330,6 @@ gdk_broadway_display_get_next_serial (GdkDisplay *display)
|
||||
return _gdk_broadway_server_get_next_serial (broadway_display->server);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_event_data_copy (GdkDisplay *display,
|
||||
const GdkEvent *src,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_event_data_free (GdkDisplay *display,
|
||||
GdkEvent *event)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_broadway_display_show_keyboard (GdkBroadwayDisplay *display)
|
||||
{
|
||||
@@ -398,8 +385,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
display_class->after_process_all_updates = _gdk_broadway_display_after_process_all_updates;
|
||||
display_class->get_next_serial = gdk_broadway_display_get_next_serial;
|
||||
display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete;
|
||||
display_class->event_data_copy = gdk_broadway_display_event_data_copy;
|
||||
display_class->event_data_free = gdk_broadway_display_event_data_free;
|
||||
display_class->create_window_impl = _gdk_broadway_display_create_window_impl;
|
||||
display_class->get_keymap = _gdk_broadway_display_get_keymap;
|
||||
display_class->get_selection_owner = _gdk_broadway_display_get_selection_owner;
|
||||
|
||||
@@ -92,14 +92,31 @@ gdk_event_source_check (GSource *source)
|
||||
void
|
||||
_gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
{
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
GdkBroadwayDisplay *display_broadway = GDK_BROADWAY_DISPLAY (display);
|
||||
GdkDisplay *display;
|
||||
GdkBroadwayDisplay *display_broadway;
|
||||
GdkBroadwayDeviceManager *device_manager;
|
||||
GdkScreen *screen;
|
||||
GdkWindow *window;
|
||||
GdkEvent *event = NULL;
|
||||
GList *node;
|
||||
GSList *list, *d;
|
||||
|
||||
display = NULL;
|
||||
|
||||
list = gdk_display_manager_list_displays (gdk_display_manager_get ());
|
||||
for (d = list; d; d = d->next)
|
||||
{
|
||||
if (GDK_IS_BROADWAY_DISPLAY (d->data))
|
||||
{
|
||||
display = d->data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_slist_free (list);
|
||||
|
||||
g_assert (display != NULL);
|
||||
|
||||
display_broadway = GDK_BROADWAY_DISPLAY (display);
|
||||
device_manager = GDK_BROADWAY_DEVICE_MANAGER (gdk_display_get_device_manager (display));
|
||||
|
||||
switch (message->base.type) {
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "gdkwindow-broadway.h"
|
||||
#include "gdkscreen-broadway.h"
|
||||
|
||||
#include "gdkbroadwaydisplay.h"
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
#include "gdkdisplay-broadway.h"
|
||||
@@ -81,6 +83,28 @@ G_DEFINE_TYPE (GdkWindowImplBroadway,
|
||||
gdk_window_impl_broadway,
|
||||
GDK_TYPE_WINDOW_IMPL)
|
||||
|
||||
static GdkDisplay *
|
||||
find_broadway_display (void)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GSList *list, *l;
|
||||
|
||||
display = NULL;
|
||||
|
||||
list = gdk_display_manager_list_displays (gdk_display_manager_get ());
|
||||
for (l = list; l; l = l->next)
|
||||
{
|
||||
if (GDK_IS_BROADWAY_DISPLAY (l->data))
|
||||
{
|
||||
display = l->data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_slist_free (list);
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
static void
|
||||
update_dirty_windows_and_sync (void)
|
||||
{
|
||||
@@ -88,7 +112,8 @@ update_dirty_windows_and_sync (void)
|
||||
GdkBroadwayDisplay *display;
|
||||
gboolean updated_surface;
|
||||
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
|
||||
display = GDK_BROADWAY_DISPLAY (find_broadway_display ());
|
||||
g_assert (display != NULL);
|
||||
|
||||
updated_surface = FALSE;
|
||||
for (l = display->toplevels; l != NULL; l = l->next)
|
||||
@@ -120,7 +145,7 @@ flush_idle (gpointer data)
|
||||
{
|
||||
flush_id = 0;
|
||||
|
||||
gdk_display_flush (gdk_display_get_default ());
|
||||
gdk_display_flush (find_broadway_display ());
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -987,13 +1012,6 @@ gdk_broadway_window_end_paint (GdkWindow *window)
|
||||
impl->dirty = TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_broadway_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct _MoveResizeData MoveResizeData;
|
||||
|
||||
struct _MoveResizeData
|
||||
@@ -1129,12 +1147,7 @@ finish_drag (MoveResizeData *mv_resize)
|
||||
mv_resize->moveresize_emulation_window = NULL;
|
||||
g_object_unref (mv_resize->moveresize_window);
|
||||
mv_resize->moveresize_window = NULL;
|
||||
|
||||
if (mv_resize->moveresize_pending_event)
|
||||
{
|
||||
g_free (mv_resize->moveresize_pending_event);
|
||||
mv_resize->moveresize_pending_event = NULL;
|
||||
}
|
||||
g_clear_pointer (&mv_resize->moveresize_pending_event, g_free);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1514,7 +1527,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
|
||||
impl_class->get_device_state = gdk_window_broadway_get_device_state;
|
||||
impl_class->shape_combine_region = gdk_window_broadway_shape_combine_region;
|
||||
impl_class->input_shape_combine_region = gdk_window_broadway_input_shape_combine_region;
|
||||
impl_class->set_static_gravities = gdk_window_broadway_set_static_gravities;
|
||||
impl_class->destroy = _gdk_broadway_window_destroy;
|
||||
impl_class->destroy_foreign = gdk_broadway_window_destroy_foreign;
|
||||
impl_class->get_shape = gdk_broadway_window_get_shape;
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
my $ARRAYNAME = $ARGV[0];
|
||||
print "static const char $ARRAYNAME\[\] = \"";
|
||||
my $first = 0;
|
||||
print "static const char $ARRAYNAME\[\] = {";
|
||||
|
||||
for ($i = 1; $i <= $#ARGV; $i = $i + 1) {
|
||||
my $FILENAME = $ARGV[$i];
|
||||
open FILE, $FILENAME or die "Cannot open $FILENAME";
|
||||
while (my $line = <FILE>) {
|
||||
foreach my $c (split //, $line) {
|
||||
printf ("\\x%02x", ord ($c));
|
||||
if ($first == 1) {
|
||||
printf (",\n");
|
||||
}
|
||||
printf ("0x%02x", ord ($c));
|
||||
$first = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\";\n";
|
||||
print "};\n";
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "config.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
GdkPrivateVTable *
|
||||
gdk__private__ (void)
|
||||
{
|
||||
static GdkPrivateVTable table = {
|
||||
gdk_device_grab_info,
|
||||
gdk_display_open_default,
|
||||
gdk_add_option_entries,
|
||||
gdk_pre_parse,
|
||||
gdk_gl_get_flags,
|
||||
gdk_gl_set_flags,
|
||||
gdk_window_freeze_toplevel_updates,
|
||||
gdk_window_thaw_toplevel_updates,
|
||||
gdk_display_get_rendering_mode,
|
||||
gdk_display_set_rendering_mode,
|
||||
gdk_display_get_debug_updates,
|
||||
gdk_display_set_debug_updates
|
||||
};
|
||||
|
||||
return &table;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
#ifndef __GDK__PRIVATE_H__
|
||||
#define __GDK__PRIVATE_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include "gdk/gdkinternals.h"
|
||||
|
||||
#define GDK_PRIVATE_CALL(symbol) (gdk__private__ ()->symbol)
|
||||
|
||||
GdkDisplay * gdk_display_open_default (void);
|
||||
|
||||
gboolean gdk_device_grab_info (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events);
|
||||
|
||||
void gdk_add_option_entries (GOptionGroup *group);
|
||||
|
||||
void gdk_pre_parse (void);
|
||||
|
||||
GdkGLFlags gdk_gl_get_flags (void);
|
||||
void gdk_gl_set_flags (GdkGLFlags flags);
|
||||
|
||||
void gdk_window_freeze_toplevel_updates (GdkWindow *window);
|
||||
void gdk_window_thaw_toplevel_updates (GdkWindow *window);
|
||||
|
||||
GdkRenderingMode gdk_display_get_rendering_mode (GdkDisplay *display);
|
||||
void gdk_display_set_rendering_mode (GdkDisplay *display,
|
||||
GdkRenderingMode mode);
|
||||
|
||||
gboolean gdk_display_get_debug_updates (GdkDisplay *display);
|
||||
void gdk_display_set_debug_updates (GdkDisplay *display,
|
||||
gboolean debug_updates);
|
||||
|
||||
typedef struct {
|
||||
/* add all private functions here, initialize them in gdk-private.c */
|
||||
gboolean (* gdk_device_grab_info) (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events);
|
||||
|
||||
GdkDisplay *(* gdk_display_open_default) (void);
|
||||
|
||||
void (* gdk_add_option_entries) (GOptionGroup *group);
|
||||
void (* gdk_pre_parse) (void);
|
||||
|
||||
GdkGLFlags (* gdk_gl_get_flags) (void);
|
||||
void (* gdk_gl_set_flags) (GdkGLFlags flags);
|
||||
|
||||
void (* gdk_window_freeze_toplevel_updates) (GdkWindow *window);
|
||||
void (* gdk_window_thaw_toplevel_updates) (GdkWindow *window);
|
||||
|
||||
GdkRenderingMode (* gdk_display_get_rendering_mode) (GdkDisplay *display);
|
||||
void (* gdk_display_set_rendering_mode) (GdkDisplay *display,
|
||||
GdkRenderingMode mode);
|
||||
|
||||
gboolean (* gdk_display_get_debug_updates) (GdkDisplay *display);
|
||||
void (* gdk_display_set_debug_updates) (GdkDisplay *display,
|
||||
gboolean debug_updates);
|
||||
} GdkPrivateVTable;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkPrivateVTable * gdk__private__ (void);
|
||||
|
||||
#endif /* __GDK__PRIVATE_H__ */
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkintl.h"
|
||||
|
||||
#include "gdk-private.h"
|
||||
|
||||
#ifndef HAVE_XCONVERTCASE
|
||||
#include "gdkkeysyms.h"
|
||||
#endif
|
||||
@@ -134,6 +136,15 @@ static GMutex gdk_threads_mutex;
|
||||
static GCallback gdk_threads_lock = NULL;
|
||||
static GCallback gdk_threads_unlock = NULL;
|
||||
|
||||
static const GDebugKey gdk_gl_keys[] = {
|
||||
{"disable", GDK_GL_DISABLE},
|
||||
{"always", GDK_GL_ALWAYS},
|
||||
{"software-draw", GDK_GL_SOFTWARE_DRAW_GL | GDK_GL_SOFTWARE_DRAW_SURFACE},
|
||||
{"software-draw-gl", GDK_GL_SOFTWARE_DRAW_GL},
|
||||
{"software-draw-surface", GDK_GL_SOFTWARE_DRAW_SURFACE},
|
||||
{"texture-rectangle", GDK_GL_TEXTURE_RECTANGLE},
|
||||
};
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static const GDebugKey gdk_debug_keys[] = {
|
||||
{"events", GDK_DEBUG_EVENTS},
|
||||
@@ -148,7 +159,8 @@ static const GDebugKey gdk_debug_keys[] = {
|
||||
{"draw", GDK_DEBUG_DRAW},
|
||||
{"eventloop", GDK_DEBUG_EVENTLOOP},
|
||||
{"frames", GDK_DEBUG_FRAMES},
|
||||
{"settings", GDK_DEBUG_SETTINGS}
|
||||
{"settings", GDK_DEBUG_SETTINGS},
|
||||
{"opengl", GDK_DEBUG_OPENGL},
|
||||
};
|
||||
|
||||
static gboolean
|
||||
@@ -229,23 +241,33 @@ static const GOptionEntry gdk_args[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
void
|
||||
gdk_add_option_entries (GOptionGroup *group)
|
||||
{
|
||||
g_option_group_add_entries (group, gdk_args);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_add_option_entries_libgtk_only:
|
||||
* @group: An option group.
|
||||
*
|
||||
* Appends gdk option entries to the passed in option group. This is
|
||||
* not public API and must not be used by applications.
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside
|
||||
* of GTK+
|
||||
*/
|
||||
void
|
||||
gdk_add_option_entries_libgtk_only (GOptionGroup *group)
|
||||
{
|
||||
g_option_group_add_entries (group, gdk_args);
|
||||
gdk_add_option_entries (group);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_pre_parse_libgtk_only (void)
|
||||
gdk_pre_parse (void)
|
||||
{
|
||||
const char *rendering_mode;
|
||||
const gchar *gl_string;
|
||||
|
||||
gdk_initialized = TRUE;
|
||||
|
||||
@@ -266,6 +288,12 @@ gdk_pre_parse_libgtk_only (void)
|
||||
}
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
gl_string = getenv("GDK_GL");
|
||||
if (gl_string != NULL)
|
||||
_gdk_gl_flags = g_parse_debug_string (gl_string,
|
||||
(GDebugKey *) gdk_gl_keys,
|
||||
G_N_ELEMENTS (gdk_gl_keys));
|
||||
|
||||
if (getenv ("GDK_NATIVE_WINDOWS"))
|
||||
{
|
||||
g_warning ("The GDK_NATIVE_WINDOWS environment variable is not supported in GTK3.\n"
|
||||
@@ -285,6 +313,20 @@ gdk_pre_parse_libgtk_only (void)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_pre_parse_libgtk_only:
|
||||
*
|
||||
* Prepare for parsing command line arguments for GDK. This is not
|
||||
* public API and should not be used in application code.
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside
|
||||
* of GTK+
|
||||
*/
|
||||
void
|
||||
gdk_pre_parse_libgtk_only (void)
|
||||
{
|
||||
gdk_pre_parse ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_parse_args:
|
||||
@@ -313,7 +355,7 @@ gdk_parse_args (int *argc,
|
||||
if (gdk_initialized)
|
||||
return;
|
||||
|
||||
gdk_pre_parse_libgtk_only ();
|
||||
gdk_pre_parse ();
|
||||
|
||||
option_context = g_option_context_new (NULL);
|
||||
g_option_context_set_ignore_unknown_options (option_context, TRUE);
|
||||
@@ -372,8 +414,8 @@ gdk_get_display_arg_name (void)
|
||||
return _gdk_display_arg_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_open_default_libgtk_only:
|
||||
/*< private >
|
||||
* gdk_display_open_default:
|
||||
*
|
||||
* Opens the default display specified by command line arguments or
|
||||
* environment variables, sets it as the default display, and returns
|
||||
@@ -383,9 +425,9 @@ gdk_get_display_arg_name (void)
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the default display, if it
|
||||
* could be opened, otherwise %NULL.
|
||||
**/
|
||||
*/
|
||||
GdkDisplay *
|
||||
gdk_display_open_default_libgtk_only (void)
|
||||
gdk_display_open_default (void)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
|
||||
@@ -400,6 +442,27 @@ gdk_display_open_default_libgtk_only (void)
|
||||
return display;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_open_default_libgtk_only:
|
||||
*
|
||||
* Opens the default display specified by command line arguments or
|
||||
* environment variables, sets it as the default display, and returns
|
||||
* it. gdk_parse_args() must have been called first. If the default
|
||||
* display has previously been set, simply returns that. An internal
|
||||
* function that should not be used by applications.
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the default display, if it
|
||||
* could be opened, otherwise %NULL.
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside
|
||||
* of GTK+
|
||||
*/
|
||||
GdkDisplay *
|
||||
gdk_display_open_default_libgtk_only (void)
|
||||
{
|
||||
return gdk_display_open_default ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_init_check:
|
||||
* @argc: (inout): the number of command line arguments.
|
||||
@@ -422,7 +485,7 @@ gdk_init_check (int *argc,
|
||||
{
|
||||
gdk_parse_args (argc, argv);
|
||||
|
||||
return gdk_display_open_default_libgtk_only () != NULL;
|
||||
return gdk_display_open_default () != NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <gdk/gdkevents.h>
|
||||
#include <gdk/gdkframeclock.h>
|
||||
#include <gdk/gdkframetimings.h>
|
||||
#include <gdk/gdkglcontext.h>
|
||||
#include <gdk/gdkkeys.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gdk/gdkmain.h>
|
||||
|
||||
+36
-1
@@ -285,7 +285,7 @@ gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
|
||||
cairo_surface_t *surface;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
||||
g_return_val_if_fail (scale > 0, NULL);
|
||||
g_return_val_if_fail (scale >= 0, NULL);
|
||||
g_return_val_if_fail (for_window == NULL || GDK_IS_WINDOW (for_window), NULL);
|
||||
|
||||
if (gdk_pixbuf_get_n_channels (pixbuf) == 3)
|
||||
@@ -525,3 +525,38 @@ gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
|
||||
|
||||
return region;
|
||||
}
|
||||
|
||||
cairo_region_t *
|
||||
gdk_cairo_region_from_clip (cairo_t *cr)
|
||||
{
|
||||
cairo_rectangle_list_t *rectangles;
|
||||
cairo_region_t *region;
|
||||
int i;
|
||||
|
||||
rectangles = cairo_copy_clip_rectangle_list (cr);
|
||||
|
||||
if (rectangles->status != CAIRO_STATUS_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
region = cairo_region_create ();
|
||||
for (i = 0; i < rectangles->num_rectangles; i++)
|
||||
{
|
||||
cairo_rectangle_int_t clip_rect;
|
||||
cairo_rectangle_t *rect;
|
||||
|
||||
rect = &rectangles->rectangles[i];
|
||||
|
||||
/* Here we assume clip rects are ints for direct targets, which
|
||||
is true for cairo */
|
||||
clip_rect.x = (int)rect->x;
|
||||
clip_rect.y = (int)rect->y;
|
||||
clip_rect.width = (int)rect->width;
|
||||
clip_rect.height = (int)rect->height;
|
||||
|
||||
cairo_region_union_rectangle (region, &clip_rect);
|
||||
}
|
||||
|
||||
cairo_rectangle_list_destroy (rectangles);
|
||||
|
||||
return region;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,17 @@ GDK_AVAILABLE_IN_3_10
|
||||
cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
|
||||
int scale,
|
||||
GdkWindow *for_window);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
GdkWindow *window,
|
||||
int source,
|
||||
int source_type,
|
||||
int buffer_scale,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
+3
-3
@@ -192,11 +192,13 @@ gdk_cursor_unref (GdkCursor *cursor)
|
||||
* To make the cursor invisible, use %GDK_BLANK_CURSOR.
|
||||
*
|
||||
* Returns: a new #GdkCursor
|
||||
*
|
||||
* Deprecated: 3.16: Use gdk_cursor_new_for_display() instead.
|
||||
*/
|
||||
GdkCursor*
|
||||
gdk_cursor_new (GdkCursorType cursor_type)
|
||||
{
|
||||
return gdk_cursor_new_for_display (gdk_display_get_default(), cursor_type);
|
||||
return gdk_cursor_new_for_display (gdk_display_get_default (), cursor_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -448,9 +450,7 @@ gdk_cursor_get_image (GdkCursor *cursor)
|
||||
h = cairo_image_surface_get_height (surface);
|
||||
|
||||
x_scale = y_scale = 1;
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_get_device_scale (surface, &x_scale, &y_scale);
|
||||
#endif
|
||||
|
||||
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, w, h);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ GType gdk_cursor_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor* gdk_cursor_new_for_display (GdkDisplay *display,
|
||||
GdkCursorType cursor_type);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
|
||||
+8
-7
@@ -313,8 +313,7 @@ gdk_device_set_property (GObject *object,
|
||||
device->manager = g_value_get_object (value);
|
||||
break;
|
||||
case PROP_NAME:
|
||||
if (device->name)
|
||||
g_free (device->name);
|
||||
g_free (device->name);
|
||||
|
||||
device->name = g_value_dup_string (value);
|
||||
break;
|
||||
@@ -689,6 +688,7 @@ gdk_device_get_name (GdkDevice *device)
|
||||
* @device: a #GdkDevice
|
||||
*
|
||||
* Determines whether the pointer follows device motion.
|
||||
* This is not meaningful for keyboard devices, which don't have a pointer.
|
||||
*
|
||||
* Returns: %TRUE if the pointer follows device motion
|
||||
*
|
||||
@@ -698,7 +698,6 @@ gboolean
|
||||
gdk_device_get_has_cursor (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, FALSE);
|
||||
|
||||
return device->has_cursor;
|
||||
}
|
||||
@@ -1261,6 +1260,8 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
|
||||
* or the window becomes unviewable. This overrides any previous grab on the device
|
||||
* by this client.
|
||||
*
|
||||
* Note that @device and @window need to be on the same display.
|
||||
*
|
||||
* Device grabs are used for operations which need complete control over the
|
||||
* given device events (either pointer or keyboard). For example in GTK+ this
|
||||
* is used for Drag and Drop operations, popup menus and such.
|
||||
@@ -1292,8 +1293,9 @@ gdk_device_grab (GdkDevice *device,
|
||||
GdkGrabStatus res;
|
||||
GdkWindow *native;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_SUCCESS);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_SUCCESS);
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (gdk_window_get_display (window) == gdk_device_get_display (device), GDK_GRAB_FAILED);
|
||||
|
||||
native = gdk_window_get_toplevel (window);
|
||||
|
||||
@@ -1477,8 +1479,7 @@ void
|
||||
_gdk_device_set_keys (GdkDevice *device,
|
||||
guint num_keys)
|
||||
{
|
||||
if (device->keys)
|
||||
g_free (device->keys);
|
||||
g_free (device->keys);
|
||||
|
||||
device->num_keys = num_keys;
|
||||
device->keys = g_new0 (GdkDeviceKey, num_keys);
|
||||
|
||||
+1
-1
@@ -265,7 +265,7 @@ void gdk_device_warp (GdkDevice *device,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
|
||||
+101
-7
@@ -24,6 +24,8 @@
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdisplaymanagerprivate.h"
|
||||
#include "gdkevents.h"
|
||||
@@ -110,6 +112,19 @@ gdk_display_real_opened (GdkDisplay *display)
|
||||
_gdk_display_manager_add_display (gdk_display_manager_get (), display);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_real_event_data_copy (GdkDisplay *display,
|
||||
const GdkEvent *src,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_real_event_data_free (GdkDisplay *display,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_class_init (GdkDisplayClass *class)
|
||||
{
|
||||
@@ -123,6 +138,8 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
|
||||
class->opened = gdk_display_real_opened;
|
||||
class->make_default = gdk_display_real_make_default;
|
||||
class->event_data_copy = gdk_display_real_event_data_copy;
|
||||
class->event_data_free = gdk_display_real_event_data_free;
|
||||
|
||||
/**
|
||||
* GdkDisplay::opened:
|
||||
@@ -206,6 +223,8 @@ gdk_display_init (GdkDisplay *display)
|
||||
|
||||
display->multiple_click_info = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) g_free);
|
||||
|
||||
display->rendering_mode = _gdk_rendering_mode;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1278,8 +1297,8 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_grab_info_libgtk_only:
|
||||
/*< private >
|
||||
* gdk_device_grab_info:
|
||||
* @display: the display for which to get the grab information
|
||||
* @device: device to get the grab information from
|
||||
* @grab_window: (out) (transfer none): location to store current grab window
|
||||
@@ -1292,12 +1311,12 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
|
||||
*
|
||||
* Returns: %TRUE if this application currently has the
|
||||
* keyboard grabbed.
|
||||
**/
|
||||
*/
|
||||
gboolean
|
||||
gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events)
|
||||
gdk_device_grab_info (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events)
|
||||
{
|
||||
GdkDeviceGrabInfo *info;
|
||||
|
||||
@@ -1319,6 +1338,33 @@ gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_grab_info_libgtk_only:
|
||||
* @display: the display for which to get the grab information
|
||||
* @device: device to get the grab information from
|
||||
* @grab_window: (out) (transfer none): location to store current grab window
|
||||
* @owner_events: (out): location to store boolean indicating whether
|
||||
* the @owner_events flag to gdk_keyboard_grab() or
|
||||
* gdk_pointer_grab() was %TRUE.
|
||||
*
|
||||
* Determines information about the current keyboard grab.
|
||||
* This is not public API and must not be used by applications.
|
||||
*
|
||||
* Returns: %TRUE if this application currently has the
|
||||
* keyboard grabbed.
|
||||
*
|
||||
* Deprecated: 3.16: The symbol was never meant to be used outside
|
||||
* of GTK+
|
||||
*/
|
||||
gboolean
|
||||
gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events)
|
||||
{
|
||||
return gdk_device_grab_info (display, device, grab_window, owner_events);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_pointer_is_grabbed:
|
||||
* @display: a #GdkDisplay
|
||||
@@ -1714,6 +1760,9 @@ gdk_display_supports_input_shapes (GdkDisplay *display)
|
||||
* Returns: %TRUE if windows may be composited.
|
||||
*
|
||||
* Since: 2.12
|
||||
*
|
||||
* Deprecated: 3.16: Compositing is an outdated technology that
|
||||
* only ever worked on X11.
|
||||
*/
|
||||
gboolean
|
||||
gdk_display_supports_composite (GdkDisplay *display)
|
||||
@@ -2225,3 +2274,48 @@ gdk_error_trap_pop (void)
|
||||
{
|
||||
return gdk_error_trap_pop_internal (TRUE);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_display_make_gl_context_current:
|
||||
* @display: a #GdkDisplay
|
||||
* @context: (optional): a #GdkGLContext, or %NULL
|
||||
*
|
||||
* Makes the given @context the current GL context, or unsets
|
||||
* the current GL context if @context is %NULL.
|
||||
*/
|
||||
gboolean
|
||||
gdk_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
return GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current (display, context);
|
||||
}
|
||||
|
||||
GdkRenderingMode
|
||||
gdk_display_get_rendering_mode (GdkDisplay *display)
|
||||
{
|
||||
return display->rendering_mode;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_set_rendering_mode (GdkDisplay *display,
|
||||
GdkRenderingMode mode)
|
||||
{
|
||||
display->rendering_mode = mode;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_set_debug_updates (GdkDisplay *display,
|
||||
gboolean debug_updates)
|
||||
{
|
||||
display->debug_updates = debug_updates;
|
||||
display->debug_updates_set = TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_get_debug_updates (GdkDisplay *display)
|
||||
{
|
||||
if (display->debug_updates_set)
|
||||
return display->debug_updates;
|
||||
else
|
||||
return _gdk_debug_updates;
|
||||
}
|
||||
|
||||
+2
-2
@@ -123,7 +123,7 @@ void gdk_display_warp_pointer (GdkDisplay *disp
|
||||
gint y);
|
||||
#endif /* GDK_MULTIDEVICE_SAFE */
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GdkDisplay *gdk_display_open_default_libgtk_only (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -159,7 +159,7 @@ GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_supports_shapes (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_supports_input_shapes (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
gboolean gdk_display_supports_composite (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_display_notify_startup_complete (GdkDisplay *display,
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
#include "wayland/gdkprivate-wayland.h"
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_MIR
|
||||
#include "mir/gdkmir-private.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SECTION:gdkdisplaymanager
|
||||
* @Short_description: Maintains a list of all open GdkDisplays
|
||||
@@ -272,6 +276,9 @@ static GdkBackend gdk_backends[] = {
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
{ "wayland", _gdk_wayland_display_open },
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_MIR
|
||||
{ "mir", _gdk_mir_display_open },
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_BROADWAY
|
||||
{ "broadway", _gdk_broadway_display_open },
|
||||
#endif
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkcursor.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -116,6 +117,14 @@ struct _GdkDisplay
|
||||
|
||||
guint double_click_time; /* Maximum time between clicks in msecs */
|
||||
guint double_click_distance; /* Maximum distance between clicks in pixels */
|
||||
|
||||
guint has_gl_extension_texture_non_power_of_two : 1;
|
||||
guint has_gl_extension_texture_rectangle : 1;
|
||||
|
||||
guint debug_updates : 1;
|
||||
guint debug_updates_set : 1;
|
||||
|
||||
GdkRenderingMode rendering_mode;
|
||||
};
|
||||
|
||||
struct _GdkDisplayClass
|
||||
@@ -225,6 +234,9 @@ struct _GdkDisplayClass
|
||||
gchar * (*utf8_to_string_target) (GdkDisplay *display,
|
||||
const gchar *text);
|
||||
|
||||
gboolean (*make_gl_context_current) (GdkDisplay *display,
|
||||
GdkGLContext *context);
|
||||
|
||||
/* Signals */
|
||||
void (*opened) (GdkDisplay *display);
|
||||
void (*closed) (GdkDisplay *display,
|
||||
@@ -303,6 +315,9 @@ void _gdk_display_create_window_impl (GdkDisplay *display
|
||||
gint attributes_mask);
|
||||
GdkWindow * _gdk_display_create_window (GdkDisplay *display);
|
||||
|
||||
gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkGLContext *context);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_DISPLAY_PRIVATE_H__ */
|
||||
|
||||
+15
-9
@@ -461,6 +461,15 @@ gdk_event_peek (void)
|
||||
return event;
|
||||
}
|
||||
|
||||
static GdkDisplay *
|
||||
event_get_display (const GdkEvent *event)
|
||||
{
|
||||
if (event->any.window)
|
||||
return gdk_window_get_display (event->any.window);
|
||||
else
|
||||
return gdk_display_get_default ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_event_put:
|
||||
* @event: a #GdkEvent.
|
||||
@@ -476,10 +485,7 @@ gdk_event_put (const GdkEvent *event)
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
if (event->any.window)
|
||||
display = gdk_window_get_display (event->any.window);
|
||||
else
|
||||
display = gdk_display_get_default ();
|
||||
display = event_get_display (event);
|
||||
|
||||
gdk_display_put_event (display, event);
|
||||
}
|
||||
@@ -713,7 +719,7 @@ gdk_event_copy (const GdkEvent *event)
|
||||
}
|
||||
|
||||
if (gdk_event_is_allocated (event))
|
||||
_gdk_display_event_data_copy (gdk_display_get_default (), event, new_event);
|
||||
_gdk_display_event_data_copy (event_get_display (event), event, new_event);
|
||||
|
||||
return new_event;
|
||||
}
|
||||
@@ -734,9 +740,6 @@ gdk_event_free (GdkEvent *event)
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
if (event->any.window)
|
||||
g_object_unref (event->any.window);
|
||||
|
||||
switch (event->any.type)
|
||||
{
|
||||
case GDK_KEY_PRESS:
|
||||
@@ -804,10 +807,13 @@ gdk_event_free (GdkEvent *event)
|
||||
break;
|
||||
}
|
||||
|
||||
display = gdk_display_get_default ();
|
||||
display = event_get_display (event);
|
||||
if (display)
|
||||
_gdk_display_event_data_free (display, event);
|
||||
|
||||
if (event->any.window)
|
||||
g_object_unref (event->any.window);
|
||||
|
||||
g_hash_table_remove (event_hash, event);
|
||||
g_slice_free (GdkEventPrivate, (GdkEventPrivate*) event);
|
||||
}
|
||||
|
||||
+746
@@ -0,0 +1,746 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2014 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
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkcairo.h"
|
||||
#include "gdkglcontextprivate.h"
|
||||
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
#include <math.h>
|
||||
|
||||
static cairo_user_data_key_t direct_key;
|
||||
|
||||
void
|
||||
gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
|
||||
GdkWindow *window)
|
||||
{
|
||||
cairo_surface_set_user_data (surface, &direct_key,
|
||||
g_object_ref (window), g_object_unref);
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_vertex_type_name (int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GL_VERTEX_SHADER:
|
||||
return "vertex";
|
||||
case GL_GEOMETRY_SHADER:
|
||||
return "geometry";
|
||||
case GL_FRAGMENT_SHADER:
|
||||
return "fragment";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static guint
|
||||
create_shader (int type, const char const *code)
|
||||
{
|
||||
guint shader;
|
||||
int status;
|
||||
|
||||
shader = glCreateShader (type);
|
||||
glShaderSource (shader, 1, &code, NULL);
|
||||
glCompileShader (shader);
|
||||
|
||||
glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
|
||||
if (status == GL_FALSE)
|
||||
{
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetShaderiv (shader, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc (log_len + 1);
|
||||
glGetShaderInfoLog (shader, log_len, NULL, buffer);
|
||||
|
||||
g_warning ("Compile failure in %s shader:\n%s\n", get_vertex_type_name (type), buffer);
|
||||
g_free (buffer);
|
||||
|
||||
glDeleteShader (shader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
static guint
|
||||
make_program (const char const *vertex_shader_code, const char const *fragment_shader_code)
|
||||
{
|
||||
guint program, vertex_shader, fragment_shader;
|
||||
int status;
|
||||
|
||||
vertex_shader = create_shader (GL_VERTEX_SHADER, vertex_shader_code);
|
||||
if (vertex_shader == 0)
|
||||
return 0;
|
||||
|
||||
fragment_shader = create_shader (GL_FRAGMENT_SHADER, fragment_shader_code);
|
||||
if (fragment_shader == 0)
|
||||
{
|
||||
glDeleteShader (vertex_shader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
program = glCreateProgram ();
|
||||
glAttachShader (program, vertex_shader);
|
||||
glAttachShader (program, fragment_shader);
|
||||
|
||||
glLinkProgram (program);
|
||||
|
||||
glDeleteShader (vertex_shader);
|
||||
glDeleteShader (fragment_shader);
|
||||
|
||||
glGetProgramiv (program, GL_LINK_STATUS, &status);
|
||||
if (status == GL_FALSE)
|
||||
{
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetProgramiv (program, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc (log_len + 1);
|
||||
glGetProgramInfoLog (program, log_len, NULL, buffer);
|
||||
g_warning ("Linker failure: %s\n", buffer);
|
||||
g_free (buffer);
|
||||
|
||||
glDeleteProgram (program);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return program;
|
||||
}
|
||||
|
||||
static void
|
||||
bind_vao (GdkGLContextPaintData *paint_data)
|
||||
{
|
||||
if (paint_data->vertex_array_object == 0)
|
||||
{
|
||||
glGenVertexArrays (1, &paint_data->vertex_array_object);
|
||||
/* ATM we only use one VAO, so always bind it */
|
||||
glBindVertexArray (paint_data->vertex_array_object);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
use_texture_2d_program (GdkGLContextPaintData *paint_data,
|
||||
guint *position_location,
|
||||
guint *uv_location,
|
||||
guint *map_location)
|
||||
{
|
||||
const char *vertex_shader_code =
|
||||
"#version 120\n"
|
||||
"uniform sampler2D map;"
|
||||
"attribute vec2 position;\n"
|
||||
"attribute vec2 uv;\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = vec4(position, 0, 1);\n"
|
||||
" vUv = uv;\n"
|
||||
"}\n";
|
||||
const char *fragment_shader_code =
|
||||
"#version 120\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"uniform sampler2D map;\n"
|
||||
"void main() {\n"
|
||||
" gl_FragColor = texture2D (map, vUv);\n"
|
||||
"}\n";
|
||||
|
||||
if (paint_data->texture_quad_program == 0)
|
||||
{
|
||||
paint_data->texture_quad_program = make_program (vertex_shader_code, fragment_shader_code);
|
||||
paint_data->texture_quad_program_position_location = glGetAttribLocation (paint_data->texture_quad_program, "position");
|
||||
paint_data->texture_quad_program_uv_location = glGetAttribLocation (paint_data->texture_quad_program, "uv");
|
||||
paint_data->texture_quad_program_map_location = glGetUniformLocation (paint_data->texture_quad_program, "map");
|
||||
}
|
||||
|
||||
if (paint_data->current_program != paint_data->texture_quad_program)
|
||||
{
|
||||
glUseProgram (paint_data->texture_quad_program);
|
||||
paint_data->current_program = paint_data->texture_quad_program;
|
||||
}
|
||||
|
||||
*position_location = paint_data->texture_quad_program_position_location;
|
||||
*uv_location = paint_data->texture_quad_program_uv_location;
|
||||
*map_location = paint_data->texture_quad_program_map_location;
|
||||
}
|
||||
|
||||
static void
|
||||
use_texture_rect_program (GdkGLContextPaintData *paint_data,
|
||||
guint *position_location,
|
||||
guint *uv_location,
|
||||
guint *map_location)
|
||||
{
|
||||
const char *vertex_shader_code =
|
||||
"#version 120\n"
|
||||
"uniform sampler2DRect map;"
|
||||
"attribute vec2 position;\n"
|
||||
"attribute vec2 uv;\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = vec4(position, 0, 1);\n"
|
||||
" vUv = uv;\n"
|
||||
"}\n";
|
||||
const char *fragment_shader_code =
|
||||
"#version 120\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"uniform sampler2DRect map;\n"
|
||||
"void main() {\n"
|
||||
" gl_FragColor = texture2DRect (map, vUv);\n"
|
||||
"}\n";
|
||||
|
||||
if (paint_data->texture_quad_rect_program == 0)
|
||||
{
|
||||
paint_data->texture_quad_rect_program = make_program (vertex_shader_code, fragment_shader_code);
|
||||
paint_data->texture_quad_rect_program_position_location = glGetAttribLocation (paint_data->texture_quad_rect_program, "position");
|
||||
paint_data->texture_quad_rect_program_uv_location = glGetAttribLocation (paint_data->texture_quad_rect_program, "uv");
|
||||
paint_data->texture_quad_rect_program_map_location = glGetUniformLocation (paint_data->texture_quad_rect_program, "map");
|
||||
}
|
||||
|
||||
if (paint_data->current_program != paint_data->texture_quad_rect_program)
|
||||
{
|
||||
glUseProgram (paint_data->texture_quad_rect_program);
|
||||
paint_data->current_program = paint_data->texture_quad_rect_program;
|
||||
}
|
||||
|
||||
*position_location = paint_data->texture_quad_rect_program_position_location;
|
||||
*uv_location = paint_data->texture_quad_rect_program_uv_location;
|
||||
*map_location = paint_data->texture_quad_rect_program_map_location;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gdk_gl_texture_quad (GdkGLContext *paint_context,
|
||||
guint texture_target,
|
||||
float x1, float y1,
|
||||
float x2, float y2,
|
||||
float u1, float v1,
|
||||
float u2, float v2)
|
||||
{
|
||||
GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context);
|
||||
GdkWindow *window = gdk_gl_context_get_window (paint_context);
|
||||
int window_scale = gdk_window_get_scale_factor (window);
|
||||
float w = gdk_window_get_width (window) * window_scale;
|
||||
float h = gdk_window_get_height (window) * window_scale;
|
||||
float vertex_buffer_data[] = {
|
||||
(x2 * 2) / w - 1, (y1 * 2) / h - 1,
|
||||
(x2 * 2) / w - 1, (y2 * 2) / h - 1,
|
||||
(x1 * 2) / w - 1, (y2 * 2) / h - 1,
|
||||
(x1 * 2) / w - 1, (y1 * 2) / h - 1,
|
||||
};
|
||||
float uv_buffer_data[] = {
|
||||
u2, v1,
|
||||
u2, v2,
|
||||
u1, v2,
|
||||
u1, v1,
|
||||
};
|
||||
guint position_location, uv_location, map_location;
|
||||
|
||||
bind_vao (paint_data);
|
||||
|
||||
if (paint_data->tmp_vertex_buffer == 0)
|
||||
glGenBuffers(1, &paint_data->tmp_vertex_buffer);
|
||||
|
||||
if (paint_data->tmp_uv_buffer == 0)
|
||||
glGenBuffers(1, &paint_data->tmp_uv_buffer);
|
||||
|
||||
if (texture_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||
use_texture_rect_program (paint_data, &position_location, &uv_location, &map_location);
|
||||
else
|
||||
use_texture_2d_program (paint_data, &position_location, &uv_location, &map_location);
|
||||
|
||||
glActiveTexture (GL_TEXTURE0);
|
||||
glUniform1i(map_location, 0); /* Use texture unit 0 */
|
||||
|
||||
glEnableVertexAttribArray (0);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_vertex_buffer);
|
||||
glBufferData (GL_ARRAY_BUFFER, sizeof(vertex_buffer_data), vertex_buffer_data, GL_STREAM_DRAW);
|
||||
glVertexAttribPointer (position_location, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||
glEnableVertexAttribArray (1);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_uv_buffer);
|
||||
glBufferData (GL_ARRAY_BUFFER, sizeof(uv_buffer_data), uv_buffer_data, GL_STREAM_DRAW);
|
||||
glVertexAttribPointer (uv_location, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||
glDrawArrays (GL_TRIANGLE_FAN, 0, 4);
|
||||
glDisableVertexAttribArray (0);
|
||||
glDisableVertexAttribArray (1);
|
||||
}
|
||||
|
||||
|
||||
/* x,y,width,height describes a rectangle in the gl render buffer
|
||||
coordinate space, and its top left corner is drawn at the current
|
||||
position according to the cairo translation. */
|
||||
|
||||
/**
|
||||
* gdk_cairo_draw_from_gl:
|
||||
* @cr: a cairo context
|
||||
* @window: The window we're rendering for (not necessarily into)
|
||||
* @source: The GL ID of the source buffer
|
||||
* @source_type: The type of the @source
|
||||
* @buffer_scale: The scale-factor that the @source buffer is allocated for
|
||||
* @x: The source x position in @source to start copying from in GL coordinates
|
||||
* @y: The source y position in @source to start copying from in GL coordinates
|
||||
* @width: The width of the region to draw
|
||||
* @height: The height of the region to draw
|
||||
*
|
||||
* This is the main way to draw GL content in GTK+. It takes a render buffer ID
|
||||
* (@source_type == #GL_RENDERBUFFER) or a texture id (@source_type == #GL_TEXTURE)
|
||||
* and draws it onto @cr with an OVER operation, respecting the current clip.
|
||||
* The top left corner of the rectangle specified by @x, @y, @width and @height
|
||||
* will be drawn at the current (0,0) position of the cairo_t.
|
||||
*
|
||||
* This will work for *all* cairo_t, as long as @window is realized, but the
|
||||
* fallback implementation that reads back the pixels from the buffer may be
|
||||
* used in the general case. In the case of direct drawing to a window with
|
||||
* no special effects applied to @cr it will however use a more efficient
|
||||
* approach.
|
||||
*
|
||||
* For #GL_RENDERBUFFER the code will always fall back to software for buffers
|
||||
* with alpha components, so make sure you use #GL_TEXTURE if using alpha.
|
||||
*
|
||||
* Calling this may change the current GL context.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
GdkWindow *window,
|
||||
int source,
|
||||
int source_type,
|
||||
int buffer_scale,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GdkGLContext *paint_context;
|
||||
cairo_surface_t *image;
|
||||
cairo_matrix_t matrix;
|
||||
int dx, dy, window_scale;
|
||||
gboolean trivial_transform;
|
||||
cairo_surface_t *group_target;
|
||||
GdkWindow *direct_window, *impl_window;
|
||||
guint framebuffer;
|
||||
int alpha_size = 0;
|
||||
cairo_region_t *clip_region;
|
||||
GdkGLContextPaintData *paint_data;
|
||||
|
||||
impl_window = window->impl_window;
|
||||
|
||||
window_scale = gdk_window_get_scale_factor (impl_window);
|
||||
|
||||
paint_context = gdk_window_get_paint_gl_context (window, NULL);
|
||||
if (paint_context == NULL)
|
||||
{
|
||||
g_warning ("gdk_cairo_draw_gl_render_buffer failed - no paint context");
|
||||
return;
|
||||
}
|
||||
|
||||
clip_region = gdk_cairo_region_from_clip (cr);
|
||||
|
||||
gdk_gl_context_make_current (paint_context);
|
||||
paint_data = gdk_gl_context_get_paint_data (paint_context);
|
||||
|
||||
if (paint_data->tmp_framebuffer == 0)
|
||||
glGenFramebuffersEXT (1, &paint_data->tmp_framebuffer);
|
||||
|
||||
if (source_type == GL_RENDERBUFFER)
|
||||
{
|
||||
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, source);
|
||||
glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
|
||||
}
|
||||
else if (source_type == GL_TEXTURE)
|
||||
{
|
||||
glBindTexture (GL_TEXTURE_2D, source);
|
||||
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &alpha_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Unsupported gl source type %d\n", source_type);
|
||||
return;
|
||||
}
|
||||
|
||||
group_target = cairo_get_group_target (cr);
|
||||
direct_window = cairo_surface_get_user_data (group_target, &direct_key);
|
||||
|
||||
cairo_get_matrix (cr, &matrix);
|
||||
|
||||
dx = matrix.x0;
|
||||
dy = matrix.y0;
|
||||
|
||||
/* Trivial == integer-only translation */
|
||||
trivial_transform =
|
||||
(double)dx == matrix.x0 && (double)dy == matrix.y0 &&
|
||||
matrix.xx == 1.0 && matrix.xy == 0.0 &&
|
||||
matrix.yx == 0.0 && matrix.yy == 1.0;
|
||||
|
||||
/* For direct paint of non-alpha renderbuffer, we can
|
||||
just do a bitblit */
|
||||
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_GL) == 0 &&
|
||||
source_type == GL_RENDERBUFFER &&
|
||||
alpha_size == 0 &&
|
||||
direct_window != NULL &&
|
||||
direct_window->current_paint.use_gl &&
|
||||
trivial_transform &&
|
||||
clip_region != NULL)
|
||||
{
|
||||
int unscaled_window_height;
|
||||
int i;
|
||||
|
||||
/* Create a framebuffer with the source renderbuffer and
|
||||
make it the current target for reads */
|
||||
framebuffer = paint_data->tmp_framebuffer;
|
||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
|
||||
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_RENDERBUFFER_EXT, source);
|
||||
glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, 0);
|
||||
|
||||
/* Translate to impl coords */
|
||||
cairo_region_translate (clip_region, dx, dy);
|
||||
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
|
||||
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
|
||||
glDrawBuffer (GL_BACK);
|
||||
|
||||
#define FLIP_Y(_y) (unscaled_window_height - (_y))
|
||||
|
||||
for (i = 0; i < cairo_region_num_rectangles (clip_region); i++)
|
||||
{
|
||||
cairo_rectangle_int_t clip_rect, dest;
|
||||
|
||||
cairo_region_get_rectangle (clip_region, i, &clip_rect);
|
||||
clip_rect.x *= window_scale;
|
||||
clip_rect.y *= window_scale;
|
||||
clip_rect.width *= window_scale;
|
||||
clip_rect.height *= window_scale;
|
||||
|
||||
glScissor (clip_rect.x, FLIP_Y (clip_rect.y + clip_rect.height),
|
||||
clip_rect.width, clip_rect.height);
|
||||
|
||||
dest.x = dx * window_scale;
|
||||
dest.y = dy * window_scale;
|
||||
dest.width = width * window_scale / buffer_scale;
|
||||
dest.height = height * window_scale / buffer_scale;
|
||||
|
||||
if (gdk_rectangle_intersect (&clip_rect, &dest, &dest))
|
||||
{
|
||||
int clipped_src_x = x + (dest.x - dx * window_scale);
|
||||
int clipped_src_y = y + (height - dest.height - (dest.y - dy * window_scale));
|
||||
glBlitFramebufferEXT(clipped_src_x, clipped_src_y,
|
||||
(clipped_src_x + dest.width), (clipped_src_y + dest.height),
|
||||
dest.x, FLIP_Y(dest.y + dest.height),
|
||||
dest.x + dest.width, FLIP_Y(dest.y),
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
if (impl_window->current_paint.flushed_region)
|
||||
{
|
||||
cairo_rectangle_int_t flushed_rect;
|
||||
|
||||
flushed_rect.x = dest.x / window_scale;
|
||||
flushed_rect.y = dest.y / window_scale;
|
||||
flushed_rect.width = (dest.x + dest.width + window_scale - 1) / window_scale - flushed_rect.x;
|
||||
flushed_rect.height = (dest.y + dest.height + window_scale - 1) / window_scale - flushed_rect.y;
|
||||
|
||||
cairo_region_union_rectangle (impl_window->current_paint.flushed_region,
|
||||
&flushed_rect);
|
||||
cairo_region_subtract_rectangle (impl_window->current_paint.need_blend_region,
|
||||
&flushed_rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glDisable (GL_SCISSOR_TEST);
|
||||
|
||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
|
||||
|
||||
#undef FLIP_Y
|
||||
|
||||
}
|
||||
/* For direct paint of alpha or non-alpha textures we can use texturing */
|
||||
else if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_GL) == 0 &&
|
||||
source_type == GL_TEXTURE &&
|
||||
direct_window != NULL &&
|
||||
direct_window->current_paint.use_gl &&
|
||||
trivial_transform &&
|
||||
clip_region != NULL)
|
||||
{
|
||||
int unscaled_window_height;
|
||||
GLint texture_width;
|
||||
GLint texture_height;
|
||||
int i;
|
||||
|
||||
/* Translate to impl coords */
|
||||
cairo_region_translate (clip_region, dx, dy);
|
||||
|
||||
if (alpha_size != 0)
|
||||
{
|
||||
cairo_region_t *opaque_region, *blend_region;
|
||||
|
||||
opaque_region = cairo_region_copy (clip_region);
|
||||
cairo_region_subtract (opaque_region, impl_window->current_paint.flushed_region);
|
||||
cairo_region_subtract (opaque_region, impl_window->current_paint.need_blend_region);
|
||||
|
||||
if (!cairo_region_is_empty (opaque_region))
|
||||
gdk_gl_texture_from_surface (impl_window->current_paint.surface,
|
||||
opaque_region);
|
||||
|
||||
blend_region = cairo_region_copy (clip_region);
|
||||
cairo_region_intersect (blend_region, impl_window->current_paint.need_blend_region);
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
if (!cairo_region_is_empty (blend_region))
|
||||
gdk_gl_texture_from_surface (impl_window->current_paint.surface,
|
||||
blend_region);
|
||||
|
||||
cairo_region_destroy (opaque_region);
|
||||
cairo_region_destroy (blend_region);
|
||||
}
|
||||
|
||||
glBindTexture (GL_TEXTURE_2D, source);
|
||||
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &texture_width);
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &texture_height);
|
||||
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
|
||||
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
|
||||
|
||||
#define FLIP_Y(_y) (unscaled_window_height - (_y))
|
||||
|
||||
for (i = 0; i < cairo_region_num_rectangles (clip_region); i++)
|
||||
{
|
||||
cairo_rectangle_int_t clip_rect, dest;
|
||||
|
||||
cairo_region_get_rectangle (clip_region, i, &clip_rect);
|
||||
|
||||
clip_rect.x *= window_scale;
|
||||
clip_rect.y *= window_scale;
|
||||
clip_rect.width *= window_scale;
|
||||
clip_rect.height *= window_scale;
|
||||
|
||||
glScissor (clip_rect.x, FLIP_Y (clip_rect.y + clip_rect.height),
|
||||
clip_rect.width, clip_rect.height);
|
||||
|
||||
dest.x = dx * window_scale;
|
||||
dest.y = dy * window_scale;
|
||||
dest.width = width * window_scale / buffer_scale;
|
||||
dest.height = height * window_scale / buffer_scale;
|
||||
|
||||
if (gdk_rectangle_intersect (&clip_rect, &dest, &dest))
|
||||
{
|
||||
int clipped_src_x = x + (dest.x - dx * window_scale);
|
||||
int clipped_src_y = y + (height - dest.height - (dest.y - dy * window_scale));
|
||||
|
||||
gdk_gl_texture_quad (paint_context,
|
||||
GL_TEXTURE_2D,
|
||||
dest.x, FLIP_Y(dest.y),
|
||||
dest.x + dest.width, FLIP_Y(dest.y + dest.height),
|
||||
clipped_src_x / (float)texture_width, (clipped_src_y + dest.height) / (float)texture_height,
|
||||
(clipped_src_x + dest.width) / (float)texture_width, clipped_src_y / (float)texture_height);
|
||||
|
||||
if (impl_window->current_paint.flushed_region)
|
||||
{
|
||||
cairo_rectangle_int_t flushed_rect;
|
||||
|
||||
flushed_rect.x = dest.x / window_scale;
|
||||
flushed_rect.y = dest.y / window_scale;
|
||||
flushed_rect.width = (dest.x + dest.width + window_scale - 1) / window_scale - flushed_rect.x;
|
||||
flushed_rect.height = (dest.y + dest.height + window_scale - 1) / window_scale - flushed_rect.y;
|
||||
|
||||
cairo_region_union_rectangle (impl_window->current_paint.flushed_region,
|
||||
&flushed_rect);
|
||||
cairo_region_subtract_rectangle (impl_window->current_paint.need_blend_region,
|
||||
&flushed_rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (alpha_size != 0)
|
||||
glDisable (GL_BLEND);
|
||||
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
glDisable (GL_SCISSOR_TEST);
|
||||
|
||||
#undef FLIP_Y
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Software fallback */
|
||||
|
||||
/* TODO: avoid reading back non-required data due to dest clip */
|
||||
image = cairo_surface_create_similar_image (cairo_get_target (cr),
|
||||
(alpha_size == 0) ? CAIRO_FORMAT_RGB24 : CAIRO_FORMAT_ARGB32,
|
||||
width, height);
|
||||
|
||||
cairo_surface_set_device_scale (image, buffer_scale, buffer_scale);
|
||||
|
||||
framebuffer = paint_data->tmp_framebuffer;
|
||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
|
||||
|
||||
if (source_type == GL_RENDERBUFFER)
|
||||
{
|
||||
/* Create a framebuffer with the source renderbuffer and
|
||||
make it the current target for reads */
|
||||
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_RENDERBUFFER_EXT, source);
|
||||
}
|
||||
else
|
||||
{
|
||||
glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_TEXTURE_2D, source, 0);
|
||||
}
|
||||
|
||||
glPixelStorei (GL_PACK_ALIGNMENT, 4);
|
||||
glPixelStorei (GL_PACK_ROW_LENGTH, cairo_image_surface_get_stride (image) / 4);
|
||||
|
||||
glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
cairo_image_surface_get_data (image));
|
||||
|
||||
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
|
||||
|
||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
|
||||
|
||||
cairo_surface_mark_dirty (image);
|
||||
|
||||
/* Invert due to opengl having different origin */
|
||||
cairo_scale (cr, 1, -1);
|
||||
cairo_translate (cr, 0, -height / buffer_scale);
|
||||
|
||||
cairo_set_source_surface (cr, image, 0, 0);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_surface_destroy (image);
|
||||
}
|
||||
|
||||
if (clip_region)
|
||||
cairo_region_destroy (clip_region);
|
||||
}
|
||||
|
||||
/* This is always called with the paint context current */
|
||||
void
|
||||
gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
GdkGLContext *paint_context;
|
||||
cairo_surface_t *image;
|
||||
double device_x_offset, device_y_offset;
|
||||
cairo_rectangle_int_t rect, e;
|
||||
int n_rects, i;
|
||||
GdkWindow *window;
|
||||
int unscaled_window_height;
|
||||
unsigned int texture_id;
|
||||
int window_scale;
|
||||
double sx, sy;
|
||||
float umax, vmax;
|
||||
gboolean use_texture_rectangle;
|
||||
guint target;
|
||||
|
||||
paint_context = gdk_gl_context_get_current ();
|
||||
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
|
||||
paint_context &&
|
||||
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface &&
|
||||
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, surface, region))
|
||||
return;
|
||||
|
||||
/* Software fallback */
|
||||
use_texture_rectangle = gdk_gl_context_use_texture_rectangle (paint_context);
|
||||
|
||||
window = gdk_gl_context_get_window (paint_context);
|
||||
window_scale = gdk_window_get_scale_factor (window);
|
||||
gdk_window_get_unscaled_size (window, NULL, &unscaled_window_height);
|
||||
|
||||
sx = sy = 1;
|
||||
cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy);
|
||||
|
||||
cairo_surface_get_device_offset (surface,
|
||||
&device_x_offset, &device_y_offset);
|
||||
|
||||
glGenTextures (1, &texture_id);
|
||||
if (use_texture_rectangle)
|
||||
target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
else
|
||||
target = GL_TEXTURE_2D;
|
||||
|
||||
glBindTexture (target, texture_id);
|
||||
glEnable (target);
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
|
||||
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri (target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri (target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri (target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
n_rects = cairo_region_num_rectangles (region);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (region, i, &rect);
|
||||
|
||||
glScissor (rect.x * window_scale, unscaled_window_height - (rect.y + rect.height) * window_scale,
|
||||
rect.width * window_scale, rect.height * window_scale);
|
||||
|
||||
e = rect;
|
||||
e.x *= sx;
|
||||
e.y *= sy;
|
||||
e.x += (int)device_x_offset;
|
||||
e.y += (int)device_y_offset;
|
||||
e.width *= sx;
|
||||
e.height *= sy;
|
||||
image = cairo_surface_map_to_image (surface, &e);
|
||||
|
||||
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image)/4);
|
||||
glTexImage2D (target, 0, 4, e.width, e.height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
cairo_image_surface_get_data (image));
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
||||
|
||||
cairo_surface_unmap_image (surface, image);
|
||||
|
||||
#define FLIP_Y(_y) (unscaled_window_height - (_y))
|
||||
|
||||
if (use_texture_rectangle)
|
||||
{
|
||||
umax = rect.width * sx;
|
||||
vmax = rect.height * sy;
|
||||
}
|
||||
else
|
||||
{
|
||||
umax = 1.0;
|
||||
vmax = 1.0;
|
||||
}
|
||||
|
||||
gdk_gl_texture_quad (paint_context, target,
|
||||
rect.x * window_scale, FLIP_Y(rect.y),
|
||||
(rect.x + rect.width) * window_scale, FLIP_Y((rect.y + rect.height) * window_scale),
|
||||
0, 0,
|
||||
umax, vmax);
|
||||
}
|
||||
|
||||
glDisable (GL_SCISSOR_TEST);
|
||||
glDisable (target);
|
||||
glDeleteTextures (1, &texture_id);
|
||||
}
|
||||
@@ -0,0 +1,575 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontext.c: GL context abstraction
|
||||
*
|
||||
* Copyright © 2014 Emmanuele Bassi
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:gdkglcontext
|
||||
* @Title: GdkGLContext
|
||||
* @Short_description: OpenGL context
|
||||
*
|
||||
* #GdkGLContext is an object representing the platform-specific
|
||||
* OpenGL drawing context.
|
||||
*
|
||||
* #GdkGLContexts are created for a #GdkWindow using
|
||||
* gdk_window_create_gl_context(), and the context will match
|
||||
* the #GdkVisual of the window.
|
||||
*
|
||||
* A #GdkGLContext is not tied to any particular normal framebuffer.
|
||||
* For instance, it cannot draw to the #GdkWindow back buffer. The GDK
|
||||
* repaint system is in full control of the painting to that. Instead,
|
||||
* you can create render buffers or textures and use gdk_cairo_draw_from_gl()
|
||||
* in the draw function of your widget to draw them. Then GDK will handle
|
||||
* the integration of your rendering with that of other widgets.
|
||||
*
|
||||
* Support for #GdkGLContext is platform-specific, context creation
|
||||
* can fail, returning %NULL context.
|
||||
*
|
||||
* A #GdkGLContext has to be made "current" in order to start using
|
||||
* it, otherwise any OpenGL call will be ignored.
|
||||
*
|
||||
* ## Creating a new OpenGL context ##
|
||||
*
|
||||
* In order to create a new #GdkGLContext instance you need a
|
||||
* #GdkWindow, which you typically get during the realize call
|
||||
* of a widget.
|
||||
*
|
||||
* ## Using a GdkGLContext ##
|
||||
*
|
||||
* You will need to make the #GdkGLContext the current context
|
||||
* before issuing OpenGL calls; the system sends OpenGL commands to
|
||||
* whichever context is current. It is possible to have multiple
|
||||
* contexts, so you always need to ensure that the one which you
|
||||
* want to draw with is the current one before issuing commands:
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* gdk_gl_context_make_current (context);
|
||||
* ]|
|
||||
*
|
||||
* You can now perform your drawing using OpenGL commands.
|
||||
*
|
||||
* You can check which #GdkGLContext is the current one by using
|
||||
* gdk_gl_context_get_current(); you can also unset any #GdkGLContext
|
||||
* that is currently set by calling gdk_gl_context_clear_current().
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#include "gdkintl.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
typedef struct {
|
||||
GdkDisplay *display;
|
||||
GdkWindow *window;
|
||||
GdkGLContext *shared_context;
|
||||
GdkGLProfile profile;
|
||||
|
||||
guint realized : 1;
|
||||
guint use_texture_rectangle : 1;
|
||||
guint has_gl_framebuffer_blit : 1;
|
||||
guint has_frame_terminator : 1;
|
||||
|
||||
GdkGLContextPaintData *paint_data;
|
||||
} GdkGLContextPrivate;
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
|
||||
PROP_DISPLAY,
|
||||
PROP_WINDOW,
|
||||
PROP_PROFILE,
|
||||
PROP_SHARED_CONTEXT,
|
||||
|
||||
LAST_PROP
|
||||
};
|
||||
|
||||
static GParamSpec *obj_pspecs[LAST_PROP] = { NULL, };
|
||||
|
||||
G_DEFINE_QUARK (gdk-gl-error-quark, gdk_gl_error)
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdkGLContext, gdk_gl_context, G_TYPE_OBJECT)
|
||||
|
||||
static GPrivate thread_current_context = G_PRIVATE_INIT (g_object_unref);
|
||||
|
||||
static void
|
||||
gdk_gl_context_dispose (GObject *gobject)
|
||||
{
|
||||
GdkGLContext *context = GDK_GL_CONTEXT (gobject);
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
GdkGLContext *current;
|
||||
|
||||
current = g_private_get (&thread_current_context);
|
||||
if (current == context)
|
||||
g_private_replace (&thread_current_context, NULL);
|
||||
|
||||
g_clear_object (&priv->display);
|
||||
g_clear_object (&priv->window);
|
||||
g_clear_object (&priv->shared_context);
|
||||
|
||||
G_OBJECT_CLASS (gdk_gl_context_parent_class)->dispose (gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_finalize (GObject *gobject)
|
||||
{
|
||||
GdkGLContext *context = GDK_GL_CONTEXT (gobject);
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_clear_pointer (&priv->paint_data, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_set_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private ((GdkGLContext *) gobject);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DISPLAY:
|
||||
{
|
||||
GdkDisplay *display = g_value_get_object (value);
|
||||
|
||||
if (display)
|
||||
g_object_ref (display);
|
||||
|
||||
if (priv->display)
|
||||
g_object_unref (priv->display);
|
||||
|
||||
priv->display = display;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_WINDOW:
|
||||
{
|
||||
GdkWindow *window = g_value_get_object (value);
|
||||
|
||||
if (window)
|
||||
g_object_ref (window);
|
||||
|
||||
if (priv->window)
|
||||
g_object_unref (priv->window);
|
||||
|
||||
priv->window = window;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_SHARED_CONTEXT:
|
||||
{
|
||||
GdkGLContext *context = g_value_get_object (value);
|
||||
|
||||
if (context != NULL)
|
||||
priv->shared_context = g_object_ref (context);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_PROFILE:
|
||||
priv->profile = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_get_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private ((GdkGLContext *) gobject);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DISPLAY:
|
||||
g_value_set_object (value, priv->display);
|
||||
break;
|
||||
|
||||
case PROP_WINDOW:
|
||||
g_value_set_object (value, priv->window);
|
||||
break;
|
||||
|
||||
case PROP_SHARED_CONTEXT:
|
||||
g_value_set_object (value, priv->shared_context);
|
||||
break;
|
||||
|
||||
case PROP_PROFILE:
|
||||
g_value_set_enum (value, priv->profile);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
/**
|
||||
* GdkGLContext:display:
|
||||
*
|
||||
* The #GdkWindow the gl context is bound to.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
P_("Display"),
|
||||
P_("The GDK display the context is from"),
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:window:
|
||||
*
|
||||
* The #GdkWindow the gl context is bound to.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_WINDOW] =
|
||||
g_param_spec_object ("window",
|
||||
P_("Window"),
|
||||
P_("The GDK window bound to the GL context"),
|
||||
GDK_TYPE_WINDOW,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:profile:
|
||||
*
|
||||
* The #GdkGLProfile of the context
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_PROFILE] =
|
||||
g_param_spec_enum ("profile",
|
||||
P_("Profile"),
|
||||
P_("The GL profile the context was created for"),
|
||||
GDK_TYPE_GL_PROFILE,
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:shared-context:
|
||||
*
|
||||
* The #GdkGLContext that this context is sharing data with, or #NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_SHARED_CONTEXT] =
|
||||
g_param_spec_object ("shared-context",
|
||||
P_("Shared context"),
|
||||
P_("The GL context this context share data with"),
|
||||
GDK_TYPE_GL_CONTEXT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
gobject_class->set_property = gdk_gl_context_set_property;
|
||||
gobject_class->get_property = gdk_gl_context_get_property;
|
||||
gobject_class->dispose = gdk_gl_context_dispose;
|
||||
gobject_class->finalize = gdk_gl_context_finalize;
|
||||
|
||||
g_object_class_install_properties (gobject_class, LAST_PROP, obj_pspecs);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_init (GdkGLContext *self)
|
||||
{
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_gl_context_end_frame:
|
||||
* @context: a #GdkGLContext
|
||||
* @painted: The area that has been redrawn this frame
|
||||
* @damage: The area that we know is actually different from the last frame
|
||||
*
|
||||
* Copies the back buffer to the front buffer.
|
||||
*
|
||||
* This function may call `glFlush()` implicitly before returning; it
|
||||
* is not recommended to call `glFlush()` explicitly before calling
|
||||
* this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
GDK_GL_CONTEXT_GET_CLASS (context)->end_frame (context, painted, damage);
|
||||
}
|
||||
|
||||
GdkGLContextPaintData *
|
||||
gdk_gl_context_get_paint_data (GdkGLContext *context)
|
||||
{
|
||||
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
if (priv->paint_data == NULL)
|
||||
priv->paint_data = g_new0 (GdkGLContextPaintData, 1);
|
||||
|
||||
return priv->paint_data;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_gl_context_use_texture_rectangle (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
return priv->use_texture_rectangle;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_gl_context_has_framebuffer_blit (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
return priv->has_gl_framebuffer_blit;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_gl_context_has_frame_terminator (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
return priv->has_frame_terminator;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_realize (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
gboolean has_npot, has_texture_rectangle;
|
||||
|
||||
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
|
||||
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
|
||||
|
||||
priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
|
||||
priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
|
||||
|
||||
if (_gdk_gl_flags & GDK_GL_TEXTURE_RECTANGLE)
|
||||
priv->use_texture_rectangle = TRUE;
|
||||
else if (has_npot)
|
||||
priv->use_texture_rectangle = FALSE;
|
||||
else if (has_texture_rectangle)
|
||||
priv->use_texture_rectangle = TRUE;
|
||||
else
|
||||
g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
|
||||
|
||||
priv->realized = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_make_current:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Makes the @context the current one.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_make_current (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
GdkGLContext *current;
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
current = g_private_get (&thread_current_context);
|
||||
if (current == context)
|
||||
return;
|
||||
|
||||
if (gdk_display_make_gl_context_current (priv->display, context))
|
||||
{
|
||||
g_private_replace (&thread_current_context, g_object_ref (context));
|
||||
if (!priv->realized)
|
||||
gdk_gl_context_realize (context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_display:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkDisplay the @context is created for
|
||||
*
|
||||
* Returns: (transfer none): a #GdkDisplay or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkDisplay *
|
||||
gdk_gl_context_get_display (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
|
||||
|
||||
return priv->display;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_window:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkWindow used by the @context.
|
||||
*
|
||||
* Returns: (transfer none): a #GdkWindow or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkWindow *
|
||||
gdk_gl_context_get_window (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
|
||||
|
||||
return priv->window;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_profile:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkGLProfile that @context was created for.
|
||||
*
|
||||
* Returns: a #GdkGLProfile
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLProfile
|
||||
gdk_gl_context_get_profile (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_LEGACY);
|
||||
|
||||
return priv->profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_shared_context:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkGLContext that this @context share data with.
|
||||
*
|
||||
* Returns: (transfer none): a #GdkGLContext or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLContext *
|
||||
gdk_gl_context_get_shared_context (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
|
||||
|
||||
return priv->shared_context;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_clear_current:
|
||||
*
|
||||
* Clears the current #GdkGLContext.
|
||||
*
|
||||
* Any OpenGL call after this function returns will be ignored
|
||||
* until gdk_gl_context_make_current() is called.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_clear_current (void)
|
||||
{
|
||||
GdkGLContext *current;
|
||||
|
||||
current = g_private_get (&thread_current_context);
|
||||
if (current != NULL)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (current);
|
||||
|
||||
if (gdk_display_make_gl_context_current (priv->display, NULL))
|
||||
g_private_replace (&thread_current_context, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_current:
|
||||
*
|
||||
* Retrieves the current #GdkGLContext.
|
||||
*
|
||||
* Returns: (transfer none): the current #GdkGLContext, or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLContext *
|
||||
gdk_gl_context_get_current (void)
|
||||
{
|
||||
GdkGLContext *current;
|
||||
|
||||
current = g_private_get (&thread_current_context);
|
||||
|
||||
return current;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_get_flags:
|
||||
*
|
||||
* Returns the currently active GL flags.
|
||||
*
|
||||
* Returns: the GL flags
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLFlags
|
||||
gdk_gl_get_flags (void)
|
||||
{
|
||||
return _gdk_gl_flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_set_flags:
|
||||
* @flags: #GdkGLFlags to set
|
||||
*
|
||||
* Sets GL flags.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_set_flags (GdkGLFlags flags)
|
||||
{
|
||||
_gdk_gl_flags = flags;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontext.h: GL context abstraction
|
||||
*
|
||||
* Copyright © 2014 Emmanuele Bassi
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_GL_CONTEXT_H__
|
||||
#define __GDK_GL_CONTEXT_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_GL_CONTEXT (gdk_gl_context_get_type ())
|
||||
#define GDK_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_CONTEXT, GdkGLContext))
|
||||
#define GDK_IS_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_CONTEXT))
|
||||
|
||||
#define GDK_GL_ERROR (gdk_gl_error_quark ())
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GQuark gdk_gl_error_quark (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GType gdk_gl_context_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLProfile gdk_gl_context_get_profile (GdkGLContext *context);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_make_current (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_gl_context_get_current (void);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_clear_current (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_GL_CONTEXT_H__ */
|
||||
@@ -0,0 +1,77 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontextprivate.h: GL context abstraction
|
||||
*
|
||||
* Copyright © 2014 Emmanuele Bassi
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_GL_CONTEXT_PRIVATE_H__
|
||||
#define __GDK_GL_CONTEXT_PRIVATE_H__
|
||||
|
||||
#include "gdkglcontext.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GL_CONTEXT, GdkGLContextClass))
|
||||
#define GDK_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GL_CONTEXT))
|
||||
#define GDK_GL_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GL_CONTEXT, GdkGLContextClass))
|
||||
|
||||
typedef struct _GdkGLContextClass GdkGLContextClass;
|
||||
|
||||
struct _GdkGLContext
|
||||
{
|
||||
GObject parent_instance;
|
||||
};
|
||||
|
||||
struct _GdkGLContextClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
void (* end_frame) (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
gboolean (* texture_from_surface) (GdkGLContext *context,
|
||||
cairo_surface_t *surface,
|
||||
cairo_region_t *region);
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
guint vertex_array_object;
|
||||
guint tmp_framebuffer;
|
||||
guint tmp_vertex_buffer;
|
||||
guint tmp_uv_buffer;
|
||||
guint current_program;
|
||||
guint texture_quad_program;
|
||||
guint texture_quad_program_position_location;
|
||||
guint texture_quad_program_uv_location;
|
||||
guint texture_quad_program_map_location;
|
||||
guint texture_quad_rect_program;
|
||||
guint texture_quad_rect_program_position_location;
|
||||
guint texture_quad_rect_program_uv_location;
|
||||
guint texture_quad_rect_program_map_location;
|
||||
} GdkGLContextPaintData;
|
||||
|
||||
GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
|
||||
void gdk_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_GL_CONTEXT_PRIVATE_H__ */
|
||||
@@ -34,4 +34,5 @@ GList *_gdk_default_filters = NULL;
|
||||
gchar *_gdk_display_name = NULL;
|
||||
gchar *_gdk_display_arg_name = NULL;
|
||||
gboolean _gdk_disable_multidevice = FALSE;
|
||||
guint _gdk_gl_flags = 0;
|
||||
GdkRenderingMode _gdk_rendering_mode = GDK_RENDERING_MODE_SIMILAR;
|
||||
|
||||
+47
-4
@@ -84,7 +84,8 @@ typedef enum {
|
||||
GDK_DEBUG_DRAW = 1 << 9,
|
||||
GDK_DEBUG_EVENTLOOP = 1 << 10,
|
||||
GDK_DEBUG_FRAMES = 1 << 11,
|
||||
GDK_DEBUG_SETTINGS = 1 << 12
|
||||
GDK_DEBUG_SETTINGS = 1 << 12,
|
||||
GDK_DEBUG_OPENGL = 1 << 13,
|
||||
} GdkDebugFlag;
|
||||
|
||||
typedef enum {
|
||||
@@ -93,11 +94,21 @@ typedef enum {
|
||||
GDK_RENDERING_MODE_RECORDING
|
||||
} GdkRenderingMode;
|
||||
|
||||
typedef enum {
|
||||
GDK_GL_DISABLE = 1 << 0,
|
||||
GDK_GL_ALWAYS = 1 << 1,
|
||||
GDK_GL_SOFTWARE_DRAW_GL = 1 << 2,
|
||||
GDK_GL_SOFTWARE_DRAW_SURFACE = 1 << 3,
|
||||
GDK_GL_TEXTURE_RECTANGLE = 1 << 4
|
||||
} GdkGLFlags;
|
||||
|
||||
extern GList *_gdk_default_filters;
|
||||
extern GdkWindow *_gdk_parent_root;
|
||||
|
||||
extern guint _gdk_debug_flags;
|
||||
extern guint _gdk_gl_flags;
|
||||
extern GdkRenderingMode _gdk_rendering_mode;
|
||||
extern gboolean _gdk_debug_updates;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
@@ -208,18 +219,33 @@ struct _GdkWindow
|
||||
struct {
|
||||
cairo_region_t *region;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
/* Areas of region that have been copied to the back buffer already */
|
||||
cairo_region_t *flushed_region;
|
||||
/* Areas of region that have been copied to the back buffer but
|
||||
needs furter blending of surface data. These two regions are
|
||||
always non-intersecting. */
|
||||
cairo_region_t *need_blend_region;
|
||||
|
||||
gboolean surface_needs_composite;
|
||||
gboolean use_gl;
|
||||
} current_paint;
|
||||
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;
|
||||
/* We store the old expose areas to support buffer-age optimizations */
|
||||
cairo_region_t *old_updated_area[2];
|
||||
|
||||
GdkWindowState state;
|
||||
|
||||
guint8 alpha;
|
||||
guint8 fullscreen_mode;
|
||||
|
||||
guint guffaw_gravity : 1;
|
||||
guint input_only : 1;
|
||||
guint modal_hint : 1;
|
||||
guint composited : 1;
|
||||
@@ -320,8 +346,20 @@ void _gdk_windowing_event_data_free (GdkEvent *event);
|
||||
void _gdk_set_window_state (GdkWindow *window,
|
||||
GdkWindowState new_state);
|
||||
|
||||
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
|
||||
GdkRectangle *extents);
|
||||
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
|
||||
GdkRectangle *extents);
|
||||
void gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
cairo_region_t *region);
|
||||
void gdk_gl_texture_quad (GdkGLContext *paint_context,
|
||||
guint texture_target,
|
||||
float x1, float y1,
|
||||
float x2, float y2,
|
||||
float u1, float v1,
|
||||
float u2, float v2);
|
||||
void gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
|
||||
GdkWindow *window);
|
||||
cairo_region_t *gdk_cairo_region_from_clip (cairo_t *cr);
|
||||
|
||||
|
||||
/*************************************
|
||||
* Interfaces used by windowing code *
|
||||
@@ -335,6 +373,11 @@ void _gdk_window_destroy (GdkWindow *window,
|
||||
void _gdk_window_clear_update_area (GdkWindow *window);
|
||||
void _gdk_window_update_size (GdkWindow *window);
|
||||
gboolean _gdk_window_update_viewable (GdkWindow *window);
|
||||
GdkGLContext * gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
GError **error);
|
||||
void gdk_window_get_unscaled_size (GdkWindow *window,
|
||||
int *unscaled_width,
|
||||
int *unscaled_height);
|
||||
|
||||
void _gdk_window_process_updates_recurse (GdkWindow *window,
|
||||
cairo_region_t *expose_region);
|
||||
|
||||
+2
-2
@@ -49,9 +49,9 @@ void gdk_init (gint *argc,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_init_check (gint *argc,
|
||||
gchar ***argv);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
void gdk_pre_parse_libgtk_only (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
||||
@@ -515,13 +515,6 @@ gdk_offscreen_window_input_shape_combine_region (GdkWindow *window,
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_offscreen_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_get_geometry (GdkWindow *window,
|
||||
gint *x,
|
||||
@@ -703,7 +696,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
impl_class->get_device_state = gdk_offscreen_window_get_device_state;
|
||||
impl_class->shape_combine_region = gdk_offscreen_window_shape_combine_region;
|
||||
impl_class->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region;
|
||||
impl_class->set_static_gravities = gdk_offscreen_window_set_static_gravities;
|
||||
impl_class->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
|
||||
impl_class->destroy = gdk_offscreen_window_destroy;
|
||||
impl_class->destroy_foreign = NULL;
|
||||
|
||||
+24
-2
@@ -128,6 +128,8 @@ typedef struct _GdkWindow GdkWindow;
|
||||
typedef struct _GdkKeymap GdkKeymap;
|
||||
typedef struct _GdkAppLaunchContext GdkAppLaunchContext;
|
||||
|
||||
typedef struct _GdkGLContext GdkGLContext;
|
||||
|
||||
/**
|
||||
* GdkByteOrder:
|
||||
* @GDK_LSB_FIRST: The values are stored with the least-significant byte
|
||||
@@ -308,6 +310,7 @@ typedef enum
|
||||
* @GDK_GRAB_NOT_VIEWABLE: the grab window or the @confine_to window are not
|
||||
* viewable.
|
||||
* @GDK_GRAB_FROZEN: the resource is frozen by an active grab of another client.
|
||||
* @GDK_GRAB_FAILED: the grab failed for some other reason.
|
||||
*
|
||||
* Returned by gdk_device_grab(), gdk_pointer_grab() and gdk_keyboard_grab() to
|
||||
* indicate success or the reason for the failure of the grab attempt.
|
||||
@@ -318,7 +321,8 @@ typedef enum
|
||||
GDK_GRAB_ALREADY_GRABBED = 1,
|
||||
GDK_GRAB_INVALID_TIME = 2,
|
||||
GDK_GRAB_NOT_VIEWABLE = 3,
|
||||
GDK_GRAB_FROZEN = 4
|
||||
GDK_GRAB_FROZEN = 4,
|
||||
GDK_GRAB_FAILED = 5
|
||||
} GdkGrabStatus;
|
||||
|
||||
/**
|
||||
@@ -429,8 +433,26 @@ struct _GdkPoint
|
||||
gint y;
|
||||
};
|
||||
|
||||
/**
|
||||
* GdkGLProfile:
|
||||
* @GDK_GL_PROFILE_DEFAULT: ...
|
||||
* @GDK_GL_PROFILE_LEGACY: ...
|
||||
* @GDK_GL_PROFILE_3_2_CORE: ...
|
||||
*
|
||||
* ...
|
||||
*/
|
||||
typedef enum {
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
GDK_GL_PROFILE_LEGACY,
|
||||
GDK_GL_PROFILE_3_2_CORE
|
||||
} GdkGLProfile;
|
||||
|
||||
typedef enum {
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE
|
||||
} GdkGLError;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __GDK_TYPES_H__ */
|
||||
|
||||
@@ -132,6 +132,16 @@
|
||||
*/
|
||||
#define GDK_VERSION_3_14 (G_ENCODE_VERSION (3, 14))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_3_16:
|
||||
*
|
||||
* A macro that evaluates to the 3.16 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
#define GDK_VERSION_3_16 (G_ENCODE_VERSION (3, 16))
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
*/
|
||||
@@ -316,5 +326,19 @@
|
||||
# define GDK_AVAILABLE_IN_3_14 _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_16
|
||||
# define GDK_DEPRECATED_IN_3_16 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_16_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_16 _GDK_EXTERN
|
||||
# define GDK_DEPRECATED_IN_3_16_FOR(f) _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_16
|
||||
# define GDK_AVAILABLE_IN_3_16 GDK_UNAVAILABLE(3, 16)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_3_16 _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
||||
|
||||
+436
-94
@@ -39,9 +39,13 @@
|
||||
#include "gdkmarshalers.h"
|
||||
#include "gdkframeclockidle.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
/* for the use of round() */
|
||||
#include "fallback-c89.c"
|
||||
|
||||
@@ -185,6 +189,11 @@ static cairo_surface_t *gdk_window_ref_impl_surface (GdkWindow *window);
|
||||
static void gdk_window_set_frame_clock (GdkWindow *window,
|
||||
GdkFrameClock *clock);
|
||||
|
||||
static void draw_ugly_color (GdkWindow *window,
|
||||
const cairo_region_t *region,
|
||||
int color);
|
||||
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static gpointer parent_class = NULL;
|
||||
@@ -1024,9 +1033,35 @@ recompute_visible_regions (GdkWindow *private,
|
||||
recalculate_children);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_clear_old_updated_area (GdkWindow *window)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (window->old_updated_area[i])
|
||||
{
|
||||
cairo_region_destroy (window->old_updated_area[i]);
|
||||
window->old_updated_area[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_append_old_updated_area (GdkWindow *window,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
if (window->old_updated_area[1])
|
||||
cairo_region_destroy (window->old_updated_area[1]);
|
||||
window->old_updated_area[1] = window->old_updated_area[0];
|
||||
window->old_updated_area[0] = cairo_region_reference (region);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_window_update_size (GdkWindow *window)
|
||||
{
|
||||
gdk_window_clear_old_updated_area (window);
|
||||
recompute_visible_regions (window, FALSE);
|
||||
}
|
||||
|
||||
@@ -1335,8 +1370,7 @@ gdk_window_new (GdkWindow *parent,
|
||||
window->input_only = TRUE;
|
||||
}
|
||||
|
||||
if (window->parent)
|
||||
window->parent->children = g_list_prepend (window->parent->children, window);
|
||||
window->parent->children = g_list_prepend (window->parent->children, window);
|
||||
|
||||
if (window->parent->window_type == GDK_WINDOW_ROOT)
|
||||
{
|
||||
@@ -1362,8 +1396,7 @@ gdk_window_new (GdkWindow *parent,
|
||||
_gdk_display_create_window_impl (display, window, real_parent, screen, event_mask, attributes, attributes_mask);
|
||||
window->impl_window = window;
|
||||
|
||||
if (parent)
|
||||
parent->impl_window->native_children = g_list_prepend (parent->impl_window->native_children, window);
|
||||
parent->impl_window->native_children = g_list_prepend (parent->impl_window->native_children, window);
|
||||
|
||||
/* This will put the native window topmost in the native parent, which may
|
||||
* be wrong wrt other native windows in the non-native hierarchy, so restack */
|
||||
@@ -1386,6 +1419,18 @@ gdk_window_new (GdkWindow *parent,
|
||||
g_signal_connect (device_manager, "device-removed",
|
||||
G_CALLBACK (device_removed_cb), window);
|
||||
|
||||
|
||||
if ((_gdk_gl_flags & (GDK_GL_ALWAYS | GDK_GL_DISABLE)) == GDK_GL_ALWAYS)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (gdk_window_get_paint_gl_context (window, &error) == NULL)
|
||||
{
|
||||
g_warning ("Unable to force GL enabled: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
@@ -1712,9 +1757,8 @@ gdk_window_ensure_native (GdkWindow *window)
|
||||
NULL, 0);
|
||||
new_impl = window->impl;
|
||||
|
||||
if (parent)
|
||||
parent->impl_window->native_children =
|
||||
g_list_prepend (parent->impl_window->native_children, window);
|
||||
parent->impl_window->native_children =
|
||||
g_list_prepend (parent->impl_window->native_children, window);
|
||||
|
||||
window->impl = old_impl;
|
||||
change_impl (window, window, new_impl);
|
||||
@@ -1838,6 +1882,12 @@ gdk_window_free_current_paint (GdkWindow *window)
|
||||
cairo_region_destroy (window->current_paint.region);
|
||||
window->current_paint.region = NULL;
|
||||
|
||||
cairo_region_destroy (window->current_paint.flushed_region);
|
||||
window->current_paint.flushed_region = NULL;
|
||||
|
||||
cairo_region_destroy (window->current_paint.need_blend_region);
|
||||
window->current_paint.need_blend_region = NULL;
|
||||
|
||||
window->current_paint.surface_needs_composite = FALSE;
|
||||
}
|
||||
|
||||
@@ -1939,6 +1989,14 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
if (window->gl_paint_context)
|
||||
{
|
||||
/* Make sure to destroy if current */
|
||||
g_object_run_dispose (G_OBJECT (window->gl_paint_context));
|
||||
g_object_unref (window->gl_paint_context);
|
||||
window->gl_paint_context = NULL;
|
||||
}
|
||||
|
||||
if (window->frame_clock)
|
||||
{
|
||||
g_object_run_dispose (G_OBJECT (window->frame_clock));
|
||||
@@ -2665,6 +2723,80 @@ gdk_window_ref_impl_surface (GdkWindow *window)
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_window_get_impl_window (window));
|
||||
}
|
||||
|
||||
GdkGLContext *
|
||||
gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
|
||||
{
|
||||
if (_gdk_gl_flags & GDK_GL_DISABLE)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("GL support disabled via GDK_DEBUG"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (window->impl_window->gl_paint_context == NULL)
|
||||
{
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
TRUE,
|
||||
GDK_GL_PROFILE_3_2_CORE,
|
||||
NULL,
|
||||
error);
|
||||
if (window->impl_window->gl_paint_context == NULL &&
|
||||
g_error_matches (*error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE))
|
||||
{
|
||||
g_clear_error (error);
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
TRUE,
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
NULL,
|
||||
error);
|
||||
}
|
||||
}
|
||||
|
||||
return window->impl_window->gl_paint_context;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_create_gl_context:
|
||||
* @window: a #GdkWindow
|
||||
* @profile: the GL profile the context should target
|
||||
* @error: return location for an error
|
||||
*
|
||||
* Creates a new #GdkGLContext matching the
|
||||
* framebuffer format to the visual of the #GdkWindow. The context
|
||||
* is disconnected from any particular window or surface.
|
||||
*
|
||||
* If the creation of the #GdkGLContext failed, @error will be set.
|
||||
*
|
||||
* Returns: (transfer full): the newly created #GdkGLContext, or
|
||||
* %NULL on error
|
||||
*
|
||||
* Since: 3.16
|
||||
**/
|
||||
GdkGLContext *
|
||||
gdk_window_create_gl_context (GdkWindow *window,
|
||||
GdkGLProfile profile,
|
||||
GError **error)
|
||||
{
|
||||
GdkGLContext *paint_context;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
paint_context = gdk_window_get_paint_gl_context (window, error);
|
||||
if (paint_context == NULL)
|
||||
return NULL;
|
||||
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
FALSE,
|
||||
profile,
|
||||
paint_context,
|
||||
error);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_begin_paint_rect:
|
||||
* @window: a #GdkWindow
|
||||
@@ -2741,6 +2873,7 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
GdkWindowImplClass *impl_class;
|
||||
double sx, sy;
|
||||
gboolean needs_surface;
|
||||
cairo_content_t surface_content;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -2762,21 +2895,59 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
needs_surface = impl_class->begin_paint_region (window, region);
|
||||
|
||||
window->current_paint.region = cairo_region_copy (region);
|
||||
|
||||
cairo_region_intersect (window->current_paint.region, window->clip_region);
|
||||
cairo_region_get_extents (window->current_paint.region, &clip_box);
|
||||
|
||||
window->current_paint.flushed_region = cairo_region_create ();
|
||||
window->current_paint.need_blend_region = cairo_region_create ();
|
||||
|
||||
surface_content = gdk_window_get_content (window);
|
||||
|
||||
window->current_paint.use_gl = window->impl_window->gl_paint_context != NULL;
|
||||
|
||||
if (window->current_paint.use_gl)
|
||||
{
|
||||
GdkGLContext *context;
|
||||
|
||||
int ww = gdk_window_get_width (window) * gdk_window_get_scale_factor (window);
|
||||
int wh = gdk_window_get_height (window) * gdk_window_get_scale_factor (window);
|
||||
|
||||
context = gdk_window_get_paint_gl_context (window, NULL);
|
||||
if (context == NULL)
|
||||
{
|
||||
g_warning ("gl rendering failed, context: %p", context);
|
||||
window->current_paint.use_gl = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_gl_context_make_current (context);
|
||||
/* With gl we always need a surface to combine the gl
|
||||
drawing with the native drawing. */
|
||||
needs_surface = TRUE;
|
||||
/* Also, we need the surface to include alpha */
|
||||
surface_content = CAIRO_CONTENT_COLOR_ALPHA;
|
||||
|
||||
/* Initial setup */
|
||||
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glViewport (0, 0, ww, wh);
|
||||
}
|
||||
}
|
||||
|
||||
if (needs_surface)
|
||||
{
|
||||
window->current_paint.surface = gdk_window_create_similar_surface (window,
|
||||
gdk_window_get_content (window),
|
||||
surface_content,
|
||||
MAX (clip_box.width, 1),
|
||||
MAX (clip_box.height, 1));
|
||||
sx = sy = 1;
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy);
|
||||
#endif
|
||||
cairo_surface_set_device_offset (window->current_paint.surface, -clip_box.x*sx, -clip_box.y*sy);
|
||||
gdk_cairo_surface_mark_as_direct (window->current_paint.surface, window);
|
||||
|
||||
window->current_paint.surface_needs_composite = TRUE;
|
||||
}
|
||||
@@ -2790,18 +2961,88 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
gdk_window_clear_backing_region (window);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_mark_paint_from_clip:
|
||||
* @window: a #GdkWindow
|
||||
* @cr: a #cairo_t
|
||||
*
|
||||
* If you call this during a paint (e.g. between gdk_window_begin_paint_region()
|
||||
* and gdk_window_end_paint() then GDK will mark the current clip region of the
|
||||
* window as being drawn. This is required when mixing GL rendering via
|
||||
* gdk_cairo_draw_from_gl() and cairo rendering, as otherwise GDK has no way
|
||||
* of knowing when something paints over the GL-drawn regions.
|
||||
*
|
||||
* This is typically called automatically by GTK+ and you don't need
|
||||
* to care about this.
|
||||
*
|
||||
* Since: 3.16
|
||||
**/
|
||||
void
|
||||
gdk_window_mark_paint_from_clip (GdkWindow *window,
|
||||
cairo_t *cr)
|
||||
{
|
||||
cairo_region_t *clip_region;
|
||||
GdkWindow *impl_window = window->impl_window;
|
||||
|
||||
if (impl_window->current_paint.surface == NULL ||
|
||||
cairo_get_target (cr) != impl_window->current_paint.surface)
|
||||
return;
|
||||
|
||||
if (cairo_region_is_empty (impl_window->current_paint.flushed_region))
|
||||
return;
|
||||
|
||||
/* This here seems a bit weird, but basically, we're taking the current
|
||||
clip and applying also the flushed region, and the result is that the
|
||||
new clip is the intersection of these. This is the area where the newly
|
||||
drawn region overlaps a previosly flushed area, which is an area of the
|
||||
double buffer surface that need to be blended OVER the back buffer rather
|
||||
than SRCed. */
|
||||
cairo_save (cr);
|
||||
/* We set the identity matrix here so we get and apply regions in native
|
||||
window coordinates. */
|
||||
cairo_identity_matrix (cr);
|
||||
gdk_cairo_region (cr, impl_window->current_paint.flushed_region);
|
||||
cairo_clip (cr);
|
||||
|
||||
clip_region = gdk_cairo_region_from_clip (cr);
|
||||
if (clip_region == NULL)
|
||||
{
|
||||
/* Failed to represent clip as region, mark all as requiring
|
||||
blend */
|
||||
cairo_region_union (impl_window->current_paint.need_blend_region,
|
||||
impl_window->current_paint.flushed_region);
|
||||
cairo_region_destroy (impl_window->current_paint.flushed_region);
|
||||
impl_window->current_paint.flushed_region = cairo_region_create ();
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_region_subtract (impl_window->current_paint.flushed_region, clip_region);
|
||||
cairo_region_union (impl_window->current_paint.need_blend_region, clip_region);
|
||||
}
|
||||
cairo_region_destroy (clip_region);
|
||||
|
||||
/* Clear the area on the double buffer surface to transparent so we
|
||||
can start drawing from scratch the area "above" the flushed
|
||||
region */
|
||||
cairo_set_source_rgba (cr, 0, 0, 0, 0);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_end_paint:
|
||||
* @window: a #GdkWindow
|
||||
*
|
||||
* Indicates that the backing store created by the most recent call to
|
||||
* gdk_window_begin_paint_region() should be copied onscreen and
|
||||
* Indicates that the backing store created by the most recent call
|
||||
* to gdk_window_begin_paint_region() should be copied onscreen and
|
||||
* deleted, leaving the next-most-recent backing store or no backing
|
||||
* store at all as the active paint region. See
|
||||
* gdk_window_begin_paint_region() for full details. It is an error to
|
||||
* call this function without a matching
|
||||
* gdk_window_begin_paint_region() first.
|
||||
* gdk_window_begin_paint_region() for full details.
|
||||
*
|
||||
* It is an error to call this function without a matching
|
||||
* gdk_window_begin_paint_region() first.
|
||||
**/
|
||||
void
|
||||
gdk_window_end_paint (GdkWindow *window)
|
||||
@@ -2809,7 +3050,6 @@ gdk_window_end_paint (GdkWindow *window)
|
||||
GdkWindow *composited;
|
||||
GdkWindowImplClass *impl_class;
|
||||
GdkRectangle clip_box = { 0, };
|
||||
cairo_region_t *full_clip;
|
||||
cairo_t *cr;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -2832,38 +3072,51 @@ gdk_window_end_paint (GdkWindow *window)
|
||||
if (window->current_paint.surface_needs_composite)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
gboolean skip_alpha_blending;
|
||||
|
||||
cairo_region_get_extents (window->current_paint.region, &clip_box);
|
||||
full_clip = cairo_region_copy (window->clip_region);
|
||||
cairo_region_intersect (full_clip, window->current_paint.region);
|
||||
|
||||
surface = gdk_window_ref_impl_surface (window);
|
||||
cr = cairo_create (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
|
||||
gdk_cairo_region (cr, full_clip);
|
||||
cairo_clip (cr);
|
||||
|
||||
/* We can skip alpha blending for a fast composite case
|
||||
* if we have an impl window or we're a fully opaque window. */
|
||||
skip_alpha_blending = (gdk_window_has_impl (window) ||
|
||||
window->alpha == 255);
|
||||
|
||||
if (skip_alpha_blending)
|
||||
if (window->current_paint.use_gl)
|
||||
{
|
||||
cairo_region_t *opaque_region = cairo_region_copy (window->current_paint.region);
|
||||
cairo_region_subtract (opaque_region, window->current_paint.flushed_region);
|
||||
cairo_region_subtract (opaque_region, window->current_paint.need_blend_region);
|
||||
|
||||
gdk_gl_context_make_current (window->gl_paint_context);
|
||||
|
||||
if (!cairo_region_is_empty (opaque_region))
|
||||
gdk_gl_texture_from_surface (window->current_paint.surface,
|
||||
opaque_region);
|
||||
if (!cairo_region_is_empty (window->current_paint.need_blend_region))
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
gdk_gl_texture_from_surface (window->current_paint.surface,
|
||||
window->current_paint.need_blend_region);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
cairo_region_destroy (opaque_region);
|
||||
|
||||
gdk_gl_context_end_frame (window->gl_paint_context,
|
||||
window->current_paint.region,
|
||||
window->active_update_area);
|
||||
}
|
||||
else if (!impl_class->do_composite (window))
|
||||
{
|
||||
surface = gdk_window_ref_impl_surface (window);
|
||||
cr = cairo_create (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
|
||||
gdk_cairo_region (cr, window->current_paint.region);
|
||||
cairo_clip (cr);
|
||||
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_paint (cr);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
cairo_paint_with_alpha (cr, window->alpha / 255.0);
|
||||
}
|
||||
|
||||
cairo_destroy (cr);
|
||||
cairo_region_destroy (full_clip);
|
||||
cairo_destroy (cr);
|
||||
|
||||
cairo_surface_flush (surface);
|
||||
}
|
||||
}
|
||||
|
||||
gdk_window_free_current_paint (window);
|
||||
@@ -3063,11 +3316,15 @@ gdk_cairo_create (GdkWindow *window)
|
||||
cr = cairo_create (surface);
|
||||
|
||||
if (window->impl_window->current_paint.region != NULL)
|
||||
region = cairo_region_copy (window->impl_window->current_paint.region);
|
||||
{
|
||||
region = cairo_region_copy (window->impl_window->current_paint.region);
|
||||
cairo_region_translate (region, -window->abs_x, -window->abs_y);
|
||||
}
|
||||
else
|
||||
region = cairo_region_copy (window->clip_region);
|
||||
{
|
||||
region = cairo_region_copy (window->clip_region);
|
||||
}
|
||||
|
||||
cairo_region_translate (region, -window->abs_x, -window->abs_y);
|
||||
gdk_cairo_region (cr, region);
|
||||
cairo_region_destroy (region);
|
||||
cairo_clip (cr);
|
||||
@@ -3080,7 +3337,7 @@ gdk_cairo_create (GdkWindow *window)
|
||||
/* Code for dirty-region queueing
|
||||
*/
|
||||
static GSList *update_windows = NULL;
|
||||
static gboolean debug_updates = FALSE;
|
||||
gboolean _gdk_debug_updates = FALSE;
|
||||
|
||||
static inline gboolean
|
||||
gdk_window_is_ancestor (GdkWindow *window,
|
||||
@@ -3355,7 +3612,9 @@ gdk_window_process_updates_internal (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplClass *impl_class;
|
||||
GdkWindow *toplevel;
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
toplevel = gdk_window_get_toplevel (window);
|
||||
if (toplevel->geometry_dirty)
|
||||
{
|
||||
@@ -3374,18 +3633,34 @@ gdk_window_process_updates_internal (GdkWindow *window)
|
||||
*/
|
||||
if (window->update_area)
|
||||
{
|
||||
cairo_region_t *update_area = window->update_area;
|
||||
g_assert (window->active_update_area == NULL); /* No reentrancy */
|
||||
|
||||
window->active_update_area = window->update_area;
|
||||
window->update_area = NULL;
|
||||
|
||||
if (gdk_window_is_viewable (window))
|
||||
{
|
||||
cairo_region_t *expose_region;
|
||||
|
||||
/* Clip to part visible in impl window */
|
||||
cairo_region_intersect (update_area, window->clip_region);
|
||||
expose_region = cairo_region_copy (window->active_update_area);
|
||||
|
||||
if (debug_updates)
|
||||
/* Sometimes we can't just paint only the new area, as the windowing system
|
||||
requires more to be repainted. For instance, with opengl you typically
|
||||
repaint all of each frame each time and then swap the buffer, although
|
||||
there are extensions that allow us to reuse part of an old frame */
|
||||
if (GDK_WINDOW_IMPL_GET_CLASS (window->impl)->invalidate_for_new_frame)
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->invalidate_for_new_frame (window, expose_region);
|
||||
|
||||
/* Clip to part visible in impl window */
|
||||
cairo_region_intersect (expose_region, window->clip_region);
|
||||
|
||||
if (gdk_display_get_debug_updates (display))
|
||||
{
|
||||
cairo_region_t *swap_region = cairo_region_copy (expose_region);
|
||||
cairo_region_subtract (swap_region, window->active_update_area);
|
||||
draw_ugly_color (window, swap_region, 1);
|
||||
cairo_region_destroy (swap_region);
|
||||
|
||||
/* Make sure we see the red invalid area before redrawing. */
|
||||
gdk_display_sync (gdk_window_get_display (window));
|
||||
g_usleep (70000);
|
||||
@@ -3394,14 +3669,17 @@ gdk_window_process_updates_internal (GdkWindow *window)
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
if (impl_class->queue_antiexpose)
|
||||
impl_class->queue_antiexpose (window, update_area);
|
||||
impl_class->queue_antiexpose (window, expose_region);
|
||||
|
||||
expose_region = cairo_region_copy (update_area);
|
||||
impl_class->process_updates_recurse (window, expose_region);
|
||||
cairo_region_destroy (expose_region);
|
||||
}
|
||||
|
||||
cairo_region_destroy (update_area);
|
||||
gdk_window_append_old_updated_area (window, window->active_update_area);
|
||||
|
||||
cairo_region_destroy (expose_region);
|
||||
}
|
||||
|
||||
cairo_region_destroy (window->active_update_area);
|
||||
window->active_update_area = NULL;
|
||||
}
|
||||
|
||||
window->in_update = FALSE;
|
||||
@@ -3704,13 +3982,17 @@ gdk_window_set_invalidate_handler (GdkWindow *window,
|
||||
|
||||
static void
|
||||
draw_ugly_color (GdkWindow *window,
|
||||
const cairo_region_t *region)
|
||||
const cairo_region_t *region,
|
||||
int color)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (window);
|
||||
/* Draw ugly color all over the newly-invalid region */
|
||||
cairo_set_source_rgb (cr, 50000/65535., 10000/65535., 10000/65535.);
|
||||
if (color == 0)
|
||||
cairo_set_source_rgb (cr, 50000/65535., 10000/65535., 10000/65535.);
|
||||
else
|
||||
cairo_set_source_rgb (cr, 10000/65535., 50000/65535., 10000/65535.);
|
||||
gdk_cairo_region (cr, region);
|
||||
cairo_fill (cr);
|
||||
|
||||
@@ -3786,6 +4068,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
|
||||
{
|
||||
cairo_region_t *visible_region;
|
||||
cairo_rectangle_int_t r;
|
||||
GdkDisplay *display;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -3805,8 +4088,9 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
|
||||
|
||||
invalidate_impl_subwindows (window, region, child_func, user_data, 0, 0);
|
||||
|
||||
if (debug_updates)
|
||||
draw_ugly_color (window, visible_region);
|
||||
display = gdk_window_get_display (window);
|
||||
if (gdk_display_get_debug_updates (display))
|
||||
draw_ugly_color (window, visible_region, 0);
|
||||
|
||||
while (window != NULL &&
|
||||
!cairo_region_is_empty (visible_region))
|
||||
@@ -4099,9 +4383,17 @@ gdk_window_thaw_updates (GdkWindow *window)
|
||||
*
|
||||
* This function is not part of the GDK public API and is only
|
||||
* for use by GTK+.
|
||||
**/
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside of GTK+
|
||||
*/
|
||||
void
|
||||
gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window)
|
||||
{
|
||||
gdk_window_freeze_toplevel_updates (window);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_freeze_toplevel_updates (GdkWindow *window)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (window->window_type != GDK_WINDOW_CHILD);
|
||||
@@ -4119,9 +4411,17 @@ gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window)
|
||||
*
|
||||
* This function is not part of the GDK public API and is only
|
||||
* for use by GTK+.
|
||||
**/
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside of GTK+
|
||||
*/
|
||||
void
|
||||
gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window)
|
||||
{
|
||||
gdk_window_thaw_toplevel_updates (window);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_thaw_toplevel_updates (GdkWindow *window)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (window->window_type != GDK_WINDOW_CHILD);
|
||||
@@ -4161,7 +4461,7 @@ gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window)
|
||||
void
|
||||
gdk_window_set_debug_updates (gboolean setting)
|
||||
{
|
||||
debug_updates = setting;
|
||||
_gdk_debug_updates = setting;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5045,6 +5345,7 @@ gdk_window_hide (GdkWindow *window)
|
||||
impl_class->hide (window);
|
||||
}
|
||||
|
||||
gdk_window_clear_old_updated_area (window);
|
||||
recompute_visible_regions (window, FALSE);
|
||||
|
||||
/* all decendants became non-visible, we need to send visibility notify */
|
||||
@@ -5104,6 +5405,7 @@ gdk_window_withdraw (GdkWindow *window)
|
||||
}
|
||||
|
||||
recompute_visible_regions (window, FALSE);
|
||||
gdk_window_clear_old_updated_area (window);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5741,6 +6043,9 @@ gdk_window_set_cursor_internal (GdkWindow *window,
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
g_assert (gdk_window_get_display (window) == gdk_device_get_display (device));
|
||||
g_assert (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor));
|
||||
|
||||
if (window->window_type == GDK_WINDOW_ROOT ||
|
||||
window->window_type == GDK_WINDOW_FOREIGN)
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_device_cursor (window, device, cursor);
|
||||
@@ -5786,11 +6091,15 @@ gdk_window_get_cursor (GdkWindow *window)
|
||||
* @window: a #GdkWindow
|
||||
* @cursor: (allow-none): a cursor
|
||||
*
|
||||
* Sets the default mouse pointer for a #GdkWindow. Use gdk_cursor_new_for_display()
|
||||
* or gdk_cursor_new_from_pixbuf() to create the cursor. To make the cursor
|
||||
* invisible, use %GDK_BLANK_CURSOR. Passing %NULL for the @cursor argument
|
||||
* to gdk_window_set_cursor() means that @window will use the cursor of its
|
||||
* parent window. Most windows should use this default.
|
||||
* Sets the default mouse pointer for a #GdkWindow.
|
||||
*
|
||||
* Note that @cursor must be for the same display as @window.
|
||||
*
|
||||
* Use gdk_cursor_new_for_display() or gdk_cursor_new_from_pixbuf() to
|
||||
* create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR.
|
||||
* Passing %NULL for the @cursor argument to gdk_window_set_cursor() means
|
||||
* that @window will use the cursor of its parent window. Most windows
|
||||
* should use this default.
|
||||
*/
|
||||
void
|
||||
gdk_window_set_cursor (GdkWindow *window,
|
||||
@@ -6491,27 +6800,22 @@ gdk_window_merge_child_input_shapes (GdkWindow *window)
|
||||
* @window: a #GdkWindow
|
||||
* @use_static: %TRUE to turn on static gravity
|
||||
*
|
||||
* Set the bit gravity of the given window to static, and flag it so
|
||||
* all children get static subwindow gravity. This is used if you are
|
||||
* implementing scary features that involve deep knowledge of the
|
||||
* windowing system. Don’t worry about it unless you have to.
|
||||
* Used to set the bit gravity of the given window to static, and flag
|
||||
* it so all children get static subwindow gravity. This is used if you
|
||||
* are implementing scary features that involve deep knowledge of the
|
||||
* windowing system. Don’t worry about it.
|
||||
*
|
||||
* Returns: %TRUE if the server supports static gravity
|
||||
* Returns: %FALSE
|
||||
*
|
||||
* Deprecated: 3.16: static gravities haven't worked on anything but X11
|
||||
* for a long time.
|
||||
*/
|
||||
gboolean
|
||||
gdk_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static)
|
||||
{
|
||||
GdkWindowImplClass *impl_class;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
||||
|
||||
if (gdk_window_has_impl (window))
|
||||
{
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
return impl_class->set_static_gravities (window, use_static);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -6526,6 +6830,9 @@ gdk_window_set_static_gravities (GdkWindow *window,
|
||||
* Returns: %TRUE if the window is composited.
|
||||
*
|
||||
* Since: 2.22
|
||||
*
|
||||
* Deprecated: 3.16: Compositing is an outdated technology that
|
||||
* only ever worked on X11.
|
||||
**/
|
||||
gboolean
|
||||
gdk_window_get_composited (GdkWindow *window)
|
||||
@@ -6564,6 +6871,9 @@ gdk_window_get_composited (GdkWindow *window)
|
||||
* attempting to do so.
|
||||
*
|
||||
* Since: 2.12
|
||||
*
|
||||
* Deprecated: 3.16: Compositing is an outdated technology that
|
||||
* only ever worked on X11.
|
||||
*/
|
||||
void
|
||||
gdk_window_set_composited (GdkWindow *window,
|
||||
@@ -6586,12 +6896,14 @@ gdk_window_set_composited (GdkWindow *window,
|
||||
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
if (composited && (!gdk_display_supports_composite (display) || !impl_class->set_composited))
|
||||
{
|
||||
g_warning ("gdk_window_set_composited called but "
|
||||
"compositing is not supported");
|
||||
return;
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
impl_class->set_composited (window, composited);
|
||||
|
||||
@@ -7716,9 +8028,9 @@ gdk_pointer_grab (GdkWindow * window,
|
||||
gulong serial;
|
||||
GList *devices, *dev;
|
||||
|
||||
g_return_val_if_fail (window != NULL, 0);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
|
||||
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0);
|
||||
g_return_val_if_fail (window != NULL, GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), GDK_GRAB_FAILED);
|
||||
|
||||
/* We need a native window for confine to to work, ensure we have one */
|
||||
if (confine_to)
|
||||
@@ -7828,7 +8140,7 @@ gdk_keyboard_grab (GdkWindow *window,
|
||||
gulong serial;
|
||||
GList *devices, *dev;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
||||
|
||||
/* Non-viewable client side window => fail */
|
||||
if (!_gdk_window_has_impl (window) &&
|
||||
@@ -9139,6 +9451,7 @@ gdk_window_create_similar_surface (GdkWindow * window,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
cairo_surface_t *window_surface, *surface;
|
||||
double sx, sy;
|
||||
|
||||
@@ -9146,28 +9459,23 @@ gdk_window_create_similar_surface (GdkWindow * window,
|
||||
|
||||
window_surface = gdk_window_ref_impl_surface (window);
|
||||
sx = sy = 1;
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_get_device_scale (window_surface, &sx, &sy);
|
||||
#endif
|
||||
|
||||
switch (_gdk_rendering_mode)
|
||||
display = gdk_window_get_display (window);
|
||||
switch (display->rendering_mode)
|
||||
{
|
||||
case GDK_RENDERING_MODE_RECORDING:
|
||||
{
|
||||
cairo_rectangle_t rect = { 0, 0, width * sx, height *sy };
|
||||
surface = cairo_recording_surface_create (content, &rect);
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_set_device_scale (surface, sx, sy);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case GDK_RENDERING_MODE_IMAGE:
|
||||
surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
|
||||
content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
|
||||
width * sx, height * sy);
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_set_device_scale (surface, sx, sy);
|
||||
#endif
|
||||
break;
|
||||
case GDK_RENDERING_MODE_SIMILAR:
|
||||
default:
|
||||
@@ -9245,12 +9553,10 @@ gdk_window_create_similar_image_surface (GdkWindow * window,
|
||||
cairo_surface_destroy (window_surface);
|
||||
}
|
||||
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
if (scale == 0)
|
||||
scale = gdk_window_get_scale_factor (window);
|
||||
|
||||
cairo_surface_set_device_scale (surface, scale, scale);
|
||||
#endif
|
||||
|
||||
return surface;
|
||||
}
|
||||
@@ -10247,7 +10553,12 @@ gdk_window_configure_finished (GdkWindow *window)
|
||||
*
|
||||
* For toplevel windows this depends on support from the windowing system
|
||||
* that may not always be there. For instance, On X11, this works only on
|
||||
* X screens with a compositing manager running.
|
||||
* X screens with a compositing manager running. On Wayland, there is no
|
||||
* per-window opacity value that the compositor would apply. Instead, use
|
||||
* `gdk_window_set_opaque_region (window, NULL)` to tell the compositor
|
||||
* that the entire window is (potentially) non-opaque, and draw your content
|
||||
* with alpha, or use gtk_widget_set_opacity() to set an overall opacity
|
||||
* for your widgets.
|
||||
*
|
||||
* For child windows this function only works for non-native windows.
|
||||
*
|
||||
@@ -10733,6 +11044,37 @@ gdk_window_get_scale_factor (GdkWindow *window)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Returns the *real* unscaled size, which may be a fractional size
|
||||
in window scale coordinates. We need this to properly handle GL
|
||||
coordinates which are y-flipped in the real coordinates. */
|
||||
void
|
||||
gdk_window_get_unscaled_size (GdkWindow *window,
|
||||
int *unscaled_width,
|
||||
int *unscaled_height)
|
||||
{
|
||||
GdkWindowImplClass *impl_class;
|
||||
gint scale;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
if (window->impl_window == window)
|
||||
{
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
if (impl_class->get_unscaled_size)
|
||||
return impl_class->get_unscaled_size (window, unscaled_width, unscaled_height);
|
||||
}
|
||||
|
||||
scale = gdk_window_get_scale_factor (window);
|
||||
|
||||
if (unscaled_width)
|
||||
*unscaled_width = window->width * scale;
|
||||
|
||||
if (unscaled_height)
|
||||
*unscaled_height = window->height * scale;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gdk_window_set_opaque_region:
|
||||
* @window: a top-level or non-native #GdkWindow
|
||||
|
||||
+14
-5
@@ -627,9 +627,9 @@ void gdk_window_shape_combine_region (GdkWindow *window,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_set_child_shapes (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
gboolean gdk_window_get_composited (GdkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
void gdk_window_set_composited (GdkWindow *window,
|
||||
gboolean composited);
|
||||
|
||||
@@ -675,7 +675,7 @@ GdkWindowState gdk_window_get_state (GdkWindow *window);
|
||||
/* Set static bit gravity on the parent, and static
|
||||
* window gravity on all children.
|
||||
*/
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
gboolean gdk_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static);
|
||||
|
||||
@@ -739,6 +739,9 @@ cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_begin_paint_rect (GdkWindow *window,
|
||||
const GdkRectangle *rectangle);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_window_mark_paint_from_clip (GdkWindow *window,
|
||||
cairo_t *cr);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_begin_paint_region (GdkWindow *window,
|
||||
const cairo_region_t *region);
|
||||
@@ -1034,9 +1037,9 @@ void gdk_window_freeze_updates (GdkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_thaw_updates (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
void gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
void gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -1108,6 +1111,12 @@ GDK_AVAILABLE_IN_3_14
|
||||
gboolean gdk_window_show_window_menu (GdkWindow *window,
|
||||
GdkEvent *event);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_window_create_gl_context (GdkWindow *window,
|
||||
GdkGLProfile profile,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WINDOW_H__ */
|
||||
|
||||
@@ -46,11 +46,18 @@ gdk_window_impl_process_updates_recurse (GdkWindow *window,
|
||||
_gdk_window_process_updates_recurse (window, region);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_impl_do_composite (GdkWindow *window)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_impl_class_init (GdkWindowImplClass *impl_class)
|
||||
{
|
||||
impl_class->beep = gdk_window_impl_beep;
|
||||
impl_class->process_updates_recurse = gdk_window_impl_process_updates_recurse;
|
||||
impl_class->do_composite = gdk_window_impl_do_composite;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+11
-3
@@ -121,9 +121,6 @@ struct _GdkWindowImplClass
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
|
||||
gboolean (* set_static_gravities) (GdkWindow *window,
|
||||
gboolean use_static);
|
||||
|
||||
/* Called before processing updates for a window. This gives the windowing
|
||||
* layer a chance to save the region for later use in avoiding duplicate
|
||||
* exposes.
|
||||
@@ -282,6 +279,9 @@ struct _GdkWindowImplClass
|
||||
GdkAtom property);
|
||||
|
||||
gint (* get_scale_factor) (GdkWindow *window);
|
||||
void (* get_unscaled_size) (GdkWindow *window,
|
||||
int *unscaled_width,
|
||||
int *unscaled_height);
|
||||
|
||||
void (* set_opaque_region) (GdkWindow *window,
|
||||
cairo_region_t *region);
|
||||
@@ -292,6 +292,14 @@ struct _GdkWindowImplClass
|
||||
gint bottom);
|
||||
gboolean (* show_window_menu) (GdkWindow *window,
|
||||
GdkEvent *event);
|
||||
GdkGLContext *(*create_gl_context) (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLProfile profile,
|
||||
GdkGLContext *share,
|
||||
GError **error);
|
||||
void (*invalidate_for_new_frame)(GdkWindow *window,
|
||||
cairo_region_t *update_area);
|
||||
gboolean (*do_composite) (GdkWindow *window);
|
||||
};
|
||||
|
||||
/* Interface Functions */
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
libgdkincludedir = $(includedir)/gtk-3.0/gdk
|
||||
libgdkmirincludedir = $(includedir)/gtk-3.0/gdk/mir
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DG_LOG_DOMAIN=\"Gdk\" \
|
||||
-DGDK_COMPILATION \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/gdk \
|
||||
-I$(top_builddir)/gdk \
|
||||
$(GDK_HIDDEN_VISIBILITY_CFLAGS) \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GDK_DEP_CFLAGS)
|
||||
|
||||
LDADDS = $(GDK_DEP_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = \
|
||||
libgdk-mir.la
|
||||
|
||||
libgdk_mir_la_SOURCES = \
|
||||
gdkmircursor.c \
|
||||
gdkmirdevicemanager.c \
|
||||
gdkmirdisplay.c \
|
||||
gdkmireventsource.c \
|
||||
gdkmirglcontext.c \
|
||||
gdkmirkeyboard.c \
|
||||
gdkmirkeymap.c \
|
||||
gdkmirpointer.c \
|
||||
gdkmirscreen.c \
|
||||
gdkmirwindow.c \
|
||||
gdkmirwindowimpl.c \
|
||||
gdkmir-debug.c \
|
||||
gdkmir.h
|
||||
|
||||
libgdkinclude_HEADERS = \
|
||||
gdkmir.h
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
void
|
||||
_gdk_mir_print_modifiers (unsigned int modifiers)
|
||||
{
|
||||
g_printerr (" Modifiers");
|
||||
if ((modifiers & mir_key_modifier_alt) != 0)
|
||||
g_printerr (" alt");
|
||||
if ((modifiers & mir_key_modifier_alt_left) != 0)
|
||||
g_printerr (" alt-left");
|
||||
if ((modifiers & mir_key_modifier_alt_right) != 0)
|
||||
g_printerr (" alt-right");
|
||||
if ((modifiers & mir_key_modifier_shift) != 0)
|
||||
g_printerr (" shift");
|
||||
if ((modifiers & mir_key_modifier_shift_left) != 0)
|
||||
g_printerr (" shift-left");
|
||||
if ((modifiers & mir_key_modifier_shift_right) != 0)
|
||||
g_printerr (" shift-right");
|
||||
if ((modifiers & mir_key_modifier_sym) != 0)
|
||||
g_printerr (" sym");
|
||||
if ((modifiers & mir_key_modifier_function) != 0)
|
||||
g_printerr (" function");
|
||||
if ((modifiers & mir_key_modifier_ctrl) != 0)
|
||||
g_printerr (" ctrl");
|
||||
if ((modifiers & mir_key_modifier_ctrl_left) != 0)
|
||||
g_printerr (" ctrl-left");
|
||||
if ((modifiers & mir_key_modifier_ctrl_right) != 0)
|
||||
g_printerr (" ctrl-right");
|
||||
if ((modifiers & mir_key_modifier_meta) != 0)
|
||||
g_printerr (" meta");
|
||||
if ((modifiers & mir_key_modifier_meta_left) != 0)
|
||||
g_printerr (" meta-left");
|
||||
if ((modifiers & mir_key_modifier_meta_right) != 0)
|
||||
g_printerr (" meta-right");
|
||||
if ((modifiers & mir_key_modifier_caps_lock) != 0)
|
||||
g_printerr (" caps-lock");
|
||||
if ((modifiers & mir_key_modifier_num_lock) != 0)
|
||||
g_printerr (" num-lock");
|
||||
if ((modifiers & mir_key_modifier_scroll_lock) != 0)
|
||||
g_printerr (" scroll-lock");
|
||||
g_printerr ("\n");
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_key_event (const MirKeyEvent *event)
|
||||
{
|
||||
g_printerr ("KEY\n");
|
||||
g_printerr (" Device %i\n", event->device_id);
|
||||
g_printerr (" Source %i\n", event->source_id);
|
||||
g_printerr (" Action ");
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_key_action_down:
|
||||
g_printerr ("down");
|
||||
break;
|
||||
case mir_key_action_up:
|
||||
g_printerr ("up");
|
||||
break;
|
||||
case mir_key_action_multiple:
|
||||
g_printerr ("multiple");
|
||||
break;
|
||||
default:
|
||||
g_printerr ("%u", event->action);
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
g_printerr (" Flags");
|
||||
if ((event->flags & mir_key_flag_woke_here) != 0)
|
||||
g_printerr (" woke-here");
|
||||
if ((event->flags & mir_key_flag_soft_keyboard) != 0)
|
||||
g_printerr (" soft-keyboard");
|
||||
if ((event->flags & mir_key_flag_keep_touch_mode) != 0)
|
||||
g_printerr (" keep-touch-mode");
|
||||
if ((event->flags & mir_key_flag_from_system) != 0)
|
||||
g_printerr (" from-system");
|
||||
if ((event->flags & mir_key_flag_editor_action) != 0)
|
||||
g_printerr (" editor-action");
|
||||
if ((event->flags & mir_key_flag_canceled) != 0)
|
||||
g_printerr (" canceled");
|
||||
if ((event->flags & mir_key_flag_virtual_hard_key) != 0)
|
||||
g_printerr (" virtual-hard-key");
|
||||
if ((event->flags & mir_key_flag_long_press) != 0)
|
||||
g_printerr (" long-press");
|
||||
if ((event->flags & mir_key_flag_canceled_long_press) != 0)
|
||||
g_printerr (" canceled-long-press");
|
||||
if ((event->flags & mir_key_flag_tracking) != 0)
|
||||
g_printerr (" tracking");
|
||||
if ((event->flags & mir_key_flag_fallback) != 0)
|
||||
g_printerr (" fallback");
|
||||
g_printerr ("\n");
|
||||
_gdk_mir_print_modifiers (event->modifiers);
|
||||
g_printerr (" Key Code %i\n", event->key_code);
|
||||
g_printerr (" Scan Code %i\n", event->scan_code);
|
||||
g_printerr (" Repeat Count %i\n", event->repeat_count);
|
||||
g_printerr (" Down Time %lli\n", (long long int) event->down_time);
|
||||
g_printerr (" Event Time %lli\n", (long long int) event->event_time);
|
||||
g_printerr (" Is System Key %s\n", event->is_system_key ? "true" : "false");
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_motion_event (const MirMotionEvent *event)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
g_printerr ("MOTION\n");
|
||||
g_printerr (" Device %i\n", event->device_id);
|
||||
g_printerr (" Source %i\n", event->source_id);
|
||||
g_printerr (" Action ");
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_motion_action_down:
|
||||
g_printerr ("down");
|
||||
break;
|
||||
case mir_motion_action_up:
|
||||
g_printerr ("up");
|
||||
break;
|
||||
case mir_motion_action_move:
|
||||
g_printerr ("move");
|
||||
break;
|
||||
case mir_motion_action_cancel:
|
||||
g_printerr ("cancel");
|
||||
break;
|
||||
case mir_motion_action_outside:
|
||||
g_printerr ("outside");
|
||||
break;
|
||||
case mir_motion_action_pointer_down:
|
||||
g_printerr ("pointer-down");
|
||||
break;
|
||||
case mir_motion_action_pointer_up:
|
||||
g_printerr ("pointer-up");
|
||||
break;
|
||||
case mir_motion_action_hover_move:
|
||||
g_printerr ("hover-move");
|
||||
break;
|
||||
case mir_motion_action_scroll:
|
||||
g_printerr ("scroll");
|
||||
break;
|
||||
case mir_motion_action_hover_enter:
|
||||
g_printerr ("hover-enter");
|
||||
break;
|
||||
case mir_motion_action_hover_exit:
|
||||
g_printerr ("hover-exit");
|
||||
break;
|
||||
default:
|
||||
g_printerr ("%u", event->action);
|
||||
}
|
||||
g_printerr ("\n");
|
||||
g_printerr (" Flags");
|
||||
switch (event->flags)
|
||||
{
|
||||
case mir_motion_flag_window_is_obscured:
|
||||
g_printerr (" window-is-obscured");
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
_gdk_mir_print_modifiers (event->modifiers);
|
||||
g_printerr (" Edge Flags %i\n", event->edge_flags);
|
||||
g_printerr (" Button State");
|
||||
switch (event->button_state)
|
||||
{
|
||||
case mir_motion_button_primary:
|
||||
g_printerr (" primary");
|
||||
break;
|
||||
case mir_motion_button_secondary:
|
||||
g_printerr (" secondary");
|
||||
break;
|
||||
case mir_motion_button_tertiary:
|
||||
g_printerr (" tertiary");
|
||||
break;
|
||||
case mir_motion_button_back:
|
||||
g_printerr (" back");
|
||||
break;
|
||||
case mir_motion_button_forward:
|
||||
g_printerr (" forward");
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
g_printerr (" Offset (%f, %f)\n", event->x_offset, event->y_offset);
|
||||
g_printerr (" Precision (%f, %f)\n", event->x_precision, event->y_precision);
|
||||
g_printerr (" Down Time %lli\n", (long long int) event->down_time);
|
||||
g_printerr (" Event Time %lli\n", (long long int) event->event_time);
|
||||
g_printerr (" Pointer Coordinates\n");
|
||||
for (i = 0; i < event->pointer_count; i++)
|
||||
{
|
||||
g_printerr (" ID=%i location=(%f, %f) raw=(%f, %f) touch=(%f, %f) size=%f pressure=%f orientation=%f scroll=(%f, %f) tool=",
|
||||
event->pointer_coordinates[i].id,
|
||||
event->pointer_coordinates[i].x, event->pointer_coordinates[i].y,
|
||||
event->pointer_coordinates[i].raw_x, event->pointer_coordinates[i].raw_y,
|
||||
event->pointer_coordinates[i].touch_major, event->pointer_coordinates[i].touch_minor,
|
||||
event->pointer_coordinates[i].size,
|
||||
event->pointer_coordinates[i].pressure,
|
||||
event->pointer_coordinates[i].orientation,
|
||||
event->pointer_coordinates[i].hscroll, event->pointer_coordinates[i].vscroll);
|
||||
switch (event->pointer_coordinates[i].tool_type)
|
||||
{
|
||||
case mir_motion_tool_type_unknown:
|
||||
g_printerr ("unknown");
|
||||
break;
|
||||
case mir_motion_tool_type_finger:
|
||||
g_printerr ("finger");
|
||||
break;
|
||||
case mir_motion_tool_type_stylus:
|
||||
g_printerr ("stylus");
|
||||
break;
|
||||
case mir_motion_tool_type_mouse:
|
||||
g_printerr ("mouse");
|
||||
break;
|
||||
case mir_motion_tool_type_eraser:
|
||||
g_printerr ("eraser");
|
||||
break;
|
||||
default:
|
||||
g_printerr ("%u", event->pointer_coordinates[i].tool_type);
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_surface_event (const MirSurfaceEvent *event)
|
||||
{
|
||||
g_printerr ("SURFACE\n");
|
||||
g_printerr (" Surface %i\n", event->id);
|
||||
g_printerr (" Attribute ");
|
||||
switch (event->attrib)
|
||||
{
|
||||
case mir_surface_attrib_type:
|
||||
g_printerr ("type");
|
||||
break;
|
||||
case mir_surface_attrib_state:
|
||||
g_printerr ("state");
|
||||
break;
|
||||
case mir_surface_attrib_swapinterval:
|
||||
g_printerr ("swapinterval");
|
||||
break;
|
||||
case mir_surface_attrib_focus:
|
||||
g_printerr ("focus");
|
||||
break;
|
||||
default:
|
||||
g_printerr ("%u", event->attrib);
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
g_printerr (" Value %i\n", event->value);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_resize_event (const MirResizeEvent *event)
|
||||
{
|
||||
g_printerr ("RESIZE\n");
|
||||
g_printerr (" Surface %i\n", event->surface_id);
|
||||
g_printerr (" Size (%i, %i)\n", event->width, event->height);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_event (const MirEvent *event)
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case mir_event_type_key:
|
||||
_gdk_mir_print_key_event (&event->key);
|
||||
break;
|
||||
case mir_event_type_motion:
|
||||
_gdk_mir_print_motion_event (&event->motion);
|
||||
break;
|
||||
case mir_event_type_surface:
|
||||
_gdk_mir_print_surface_event (&event->surface);
|
||||
break;
|
||||
case mir_event_type_resize:
|
||||
_gdk_mir_print_resize_event (&event->resize);
|
||||
break;
|
||||
default:
|
||||
g_printerr ("EVENT %u\n", event->type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_PRIVATE_MIR_H__
|
||||
#define __GDK_PRIVATE_MIR_H__
|
||||
|
||||
#include <epoxy/egl.h>
|
||||
|
||||
#include "gdkmir.h"
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkscreen.h"
|
||||
#include "gdkdevicemanager.h"
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdkkeys.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
|
||||
typedef struct _GdkMirWindowImpl GdkMirWindowImpl;
|
||||
typedef struct _GdkMirWindowReference GdkMirWindowReference;
|
||||
typedef struct _GdkMirEventSource GdkMirEventSource;
|
||||
|
||||
#define GDK_TYPE_MIR_WINDOW_IMPL (gdk_mir_window_impl_get_type ())
|
||||
#define GDK_MIR_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_MIR_WINDOW_IMPL, GdkMirWindowImpl))
|
||||
#define GDK_IS_WINDOW_IMPL_MIR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_WINDOW_IMPL))
|
||||
|
||||
GType gdk_mir_window_impl_get_type (void);
|
||||
|
||||
|
||||
struct _GdkMirGLContext
|
||||
{
|
||||
GdkGLContext parent_instance;
|
||||
|
||||
EGLContext egl_context;
|
||||
EGLConfig egl_config;
|
||||
gboolean is_attached;
|
||||
};
|
||||
|
||||
struct _GdkMirGLContextClass
|
||||
{
|
||||
GdkGLContextClass parent_class;
|
||||
};
|
||||
|
||||
typedef struct _GdkMirGLContext GdkMirGLContext;
|
||||
typedef struct _GdkMirGLContextClass GdkMirGLContextClass;
|
||||
|
||||
#define GDK_MIR_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_MIR_GL_CONTEXT, GdkMirGLContext))
|
||||
|
||||
|
||||
GdkDisplay *_gdk_mir_display_open (const gchar *display_name);
|
||||
|
||||
GdkScreen *_gdk_mir_screen_new (GdkDisplay *display);
|
||||
|
||||
GdkDeviceManager *_gdk_mir_device_manager_new (GdkDisplay *display);
|
||||
|
||||
GdkDevice *_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manager);
|
||||
|
||||
GdkKeymap *_gdk_mir_keymap_new (void);
|
||||
|
||||
GdkDevice *_gdk_mir_keyboard_new (GdkDeviceManager *device_manager, const gchar *name);
|
||||
|
||||
GdkDevice *_gdk_mir_pointer_new (GdkDeviceManager *device_manager, const gchar *name);
|
||||
|
||||
void _gdk_mir_pointer_set_location (GdkDevice *pointer, gdouble x, gdouble y, GdkWindow *window, GdkModifierType mask);
|
||||
|
||||
GdkCursor *_gdk_mir_cursor_new_for_type (GdkDisplay *display, GdkCursorType type);
|
||||
|
||||
GdkCursor *_gdk_mir_cursor_new_for_name (GdkDisplay *display, const gchar *name);
|
||||
|
||||
const gchar *_gdk_mir_cursor_get_name (GdkCursor *cursor);
|
||||
|
||||
GdkWindowImpl *_gdk_mir_window_impl_new (void);
|
||||
|
||||
void _gdk_mir_window_impl_set_surface_state (GdkMirWindowImpl *impl, MirSurfaceState state);
|
||||
|
||||
void _gdk_mir_window_impl_set_surface_type (GdkMirWindowImpl *impl, MirSurfaceType type);
|
||||
|
||||
void _gdk_mir_window_impl_set_cursor_state (GdkMirWindowImpl *impl, gdouble x, gdouble y, gboolean cursor_inside, MirMotionButton button_state);
|
||||
|
||||
void _gdk_mir_window_impl_get_cursor_state (GdkMirWindowImpl *impl, gdouble *x, gdouble *y, gboolean *cursor_inside, MirMotionButton *button_state);
|
||||
|
||||
GdkMirEventSource *_gdk_mir_display_get_event_source (GdkDisplay *display);
|
||||
|
||||
GdkMirEventSource *_gdk_mir_event_source_new (GdkDisplay *display);
|
||||
|
||||
GdkMirWindowReference *_gdk_mir_event_source_get_window_reference (GdkWindow *window);
|
||||
|
||||
void _gdk_mir_window_reference_unref (GdkMirWindowReference *ref);
|
||||
|
||||
void _gdk_mir_event_source_queue (GdkMirWindowReference *window_ref, const MirEvent *event);
|
||||
|
||||
MirPixelFormat _gdk_mir_display_get_pixel_format (GdkDisplay *display, MirBufferUsage usage);
|
||||
|
||||
gboolean _gdk_mir_display_init_egl_display (GdkDisplay *display);
|
||||
|
||||
EGLDisplay _gdk_mir_display_get_egl_display (GdkDisplay *display);
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_khr_create_context (GdkDisplay *display);
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_buffer_age (GdkDisplay *display);
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_swap_buffers_with_damage (GdkDisplay *display);
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_surfaceless_context (GdkDisplay *display);
|
||||
|
||||
EGLSurface _gdk_mir_window_get_egl_surface (GdkWindow *window, EGLConfig config);
|
||||
|
||||
EGLSurface _gdk_mir_window_get_dummy_egl_surface (GdkWindow *window, EGLConfig config);
|
||||
|
||||
void _gdk_mir_print_modifiers (unsigned int modifiers);
|
||||
|
||||
void _gdk_mir_print_key_event (const MirKeyEvent *event);
|
||||
|
||||
void _gdk_mir_print_motion_event (const MirMotionEvent *event);
|
||||
|
||||
void _gdk_mir_print_surface_event (const MirSurfaceEvent *event);
|
||||
|
||||
void _gdk_mir_print_resize_event (const MirResizeEvent *event);
|
||||
|
||||
void _gdk_mir_print_event (const MirEvent *event);
|
||||
|
||||
#endif /* __GDK_PRIVATE_MIR_H__ */
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_MIR_H__
|
||||
#define __GDK_MIR_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <mir_toolkit/mir_client_library.h>
|
||||
|
||||
#define GDK_TYPE_MIR_DISPLAY (gdk_mir_display_get_type ())
|
||||
#define GDK_IS_MIR_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_DISPLAY))
|
||||
|
||||
#define GDK_TYPE_MIR_GL_CONTEXT (gdk_mir_gl_context_get_type ())
|
||||
#define GDK_MIR_IS_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_MIR_GL_CONTEXT))
|
||||
|
||||
#define GDK_TYPE_MIR_WINDOW (gdk_mir_window_get_type ())
|
||||
#define GDK_IS_MIR_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_WINDOW))
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GType gdk_mir_display_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
MirConnection *gdk_mir_display_get_mir_connection (GdkDisplay *display);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GType gdk_mir_window_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
MirSurface *gdk_mir_window_get_mir_surface (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GType gdk_mir_gl_context_get_type (void) G_GNUC_CONST;
|
||||
|
||||
#endif /* __GDK_MIR_H__ */
|
||||
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkcursorprivate.h"
|
||||
|
||||
#include "gdkmir.h"
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
typedef struct GdkMirCursor GdkMirCursor;
|
||||
typedef struct GdkMirCursorClass GdkMirCursorClass;
|
||||
|
||||
#define GDK_TYPE_MIR_CURSOR (gdk_mir_cursor_get_type ())
|
||||
#define GDK_MIR_CURSOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_MIR_CURSOR, GdkMirCursor))
|
||||
#define GDK_MIR_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_MIR_CURSOR, GdkMirCursorClass))
|
||||
#define GDK_IS_MIR_CURSOR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_CURSOR))
|
||||
#define GDK_IS_MIR_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_CURSOR))
|
||||
#define GDK_MIR_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_CURSOR, GdkMirCursorClass))
|
||||
|
||||
struct GdkMirCursor
|
||||
{
|
||||
GdkCursor parent_instance;
|
||||
|
||||
gchar *name;
|
||||
};
|
||||
|
||||
struct GdkMirCursorClass
|
||||
{
|
||||
GdkCursorClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkMirCursor, gdk_mir_cursor, GDK_TYPE_CURSOR)
|
||||
|
||||
static const gchar *
|
||||
get_cursor_name_for_cursor_type (GdkCursorType cursor_type)
|
||||
{
|
||||
switch (cursor_type)
|
||||
{
|
||||
case GDK_BLANK_CURSOR:
|
||||
return mir_disabled_cursor_name;
|
||||
case GDK_X_CURSOR:
|
||||
case GDK_ARROW:
|
||||
case GDK_CENTER_PTR:
|
||||
case GDK_DRAFT_LARGE:
|
||||
case GDK_DRAFT_SMALL:
|
||||
case GDK_LEFT_PTR:
|
||||
case GDK_RIGHT_PTR:
|
||||
case GDK_TOP_LEFT_ARROW:
|
||||
return mir_arrow_cursor_name;
|
||||
case GDK_CLOCK:
|
||||
case GDK_WATCH:
|
||||
return mir_busy_cursor_name;
|
||||
case GDK_XTERM:
|
||||
return mir_caret_cursor_name;
|
||||
case GDK_HAND1:
|
||||
case GDK_HAND2:
|
||||
return mir_pointing_hand_cursor_name;
|
||||
return mir_open_hand_cursor_name;
|
||||
case GDK_FLEUR:
|
||||
return mir_closed_hand_cursor_name;
|
||||
case GDK_LEFT_SIDE:
|
||||
case GDK_LEFT_TEE:
|
||||
case GDK_RIGHT_SIDE:
|
||||
case GDK_RIGHT_TEE:
|
||||
case GDK_SB_LEFT_ARROW:
|
||||
case GDK_SB_RIGHT_ARROW:
|
||||
return mir_horizontal_resize_cursor_name;
|
||||
case GDK_BASED_ARROW_DOWN:
|
||||
case GDK_BASED_ARROW_UP:
|
||||
case GDK_BOTTOM_SIDE:
|
||||
case GDK_BOTTOM_TEE:
|
||||
case GDK_DOUBLE_ARROW:
|
||||
case GDK_SB_DOWN_ARROW:
|
||||
case GDK_SB_UP_ARROW:
|
||||
case GDK_TOP_SIDE:
|
||||
case GDK_TOP_TEE:
|
||||
return mir_vertical_resize_cursor_name;
|
||||
case GDK_BOTTOM_LEFT_CORNER:
|
||||
case GDK_LL_ANGLE:
|
||||
case GDK_TOP_RIGHT_CORNER:
|
||||
case GDK_UR_ANGLE:
|
||||
return mir_diagonal_resize_bottom_to_top_cursor_name;
|
||||
case GDK_BOTTOM_RIGHT_CORNER:
|
||||
case GDK_LR_ANGLE:
|
||||
case GDK_SIZING:
|
||||
case GDK_TOP_LEFT_CORNER:
|
||||
case GDK_UL_ANGLE:
|
||||
return mir_diagonal_resize_top_to_bottom_cursor_name;
|
||||
return mir_omnidirectional_resize_cursor_name;
|
||||
case GDK_SB_V_DOUBLE_ARROW:
|
||||
return mir_vsplit_resize_cursor_name;
|
||||
case GDK_SB_H_DOUBLE_ARROW:
|
||||
return mir_hsplit_resize_cursor_name;
|
||||
default:
|
||||
return mir_default_cursor_name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GdkCursor *
|
||||
_gdk_mir_cursor_new_for_name (GdkDisplay *display, const gchar *name)
|
||||
{
|
||||
GdkMirCursor *cursor;
|
||||
|
||||
cursor = g_object_new (GDK_TYPE_MIR_CURSOR, "display", display, "cursor-type", GDK_CURSOR_IS_PIXMAP, NULL);
|
||||
cursor->name = g_strdup (name);
|
||||
|
||||
return GDK_CURSOR (cursor);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_mir_cursor_new_for_type (GdkDisplay *display, GdkCursorType type)
|
||||
{
|
||||
GdkMirCursor *cursor;
|
||||
|
||||
cursor = g_object_new (GDK_TYPE_MIR_CURSOR, "display", display, "cursor-type", type, NULL);
|
||||
cursor->name = g_strdup (get_cursor_name_for_cursor_type (type));
|
||||
|
||||
return GDK_CURSOR (cursor);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
_gdk_mir_cursor_get_name (GdkCursor *cursor)
|
||||
{
|
||||
GdkMirCursor *mir_cursor = GDK_MIR_CURSOR (cursor);
|
||||
|
||||
return mir_cursor->name;
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
gdk_mir_cursor_get_surface (GdkCursor *cursor,
|
||||
gdouble *x_hot,
|
||||
gdouble *y_hot)
|
||||
{
|
||||
g_printerr ("gdk_mir_cursor_get_surface\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_cursor_init (GdkMirCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_cursor_finalize (GObject *object)
|
||||
{
|
||||
GdkMirCursor *mir_cursor = GDK_MIR_CURSOR (object);
|
||||
|
||||
g_free (mir_cursor->name);
|
||||
|
||||
G_OBJECT_CLASS (gdk_mir_cursor_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_cursor_class_init (GdkMirCursorClass *klass)
|
||||
{
|
||||
GdkCursorClass *cursor_class = GDK_CURSOR_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
cursor_class->get_surface = gdk_mir_cursor_get_surface;
|
||||
object_class->finalize = gdk_mir_cursor_finalize;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdevicemanagerprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
|
||||
#include "gdkmir.h"
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
typedef struct GdkMirDeviceManager GdkMirDeviceManager;
|
||||
typedef struct GdkMirDeviceManagerClass GdkMirDeviceManagerClass;
|
||||
|
||||
#define GDK_TYPE_MIR_DEVICE_MANAGER (gdk_mir_device_manager_get_type ())
|
||||
#define GDK_MIR_DEVICE_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_MIR_DEVICE_MANAGER, GdkMirDeviceManager))
|
||||
#define GDK_MIR_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_MIR_DEVICE_MANAGER, GdkMirDeviceManagerClass))
|
||||
#define GDK_IS_MIR_DEVICE_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_DEVICE_MANAGER))
|
||||
#define GDK_IS_MIR_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_DEVICE_MANAGER))
|
||||
#define GDK_MIR_DEVICE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_DEVICE_MANAGER, GdkMirDeviceManagerClass))
|
||||
|
||||
struct GdkMirDeviceManager
|
||||
{
|
||||
GdkDeviceManager parent_instance;
|
||||
|
||||
GdkDevice *pointer;
|
||||
GdkDevice *keyboard;
|
||||
};
|
||||
|
||||
struct GdkMirDeviceManagerClass
|
||||
{
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkMirDeviceManager, gdk_mir_device_manager, GDK_TYPE_DEVICE_MANAGER)
|
||||
|
||||
GdkDeviceManager *
|
||||
_gdk_mir_device_manager_new (GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_MIR_DEVICE_MANAGER, "display", display, NULL);
|
||||
}
|
||||
|
||||
static GList *
|
||||
gdk_mir_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
//g_printerr ("gdk_mir_device_manager_list_devices (%u)\n", type);
|
||||
GdkMirDeviceManager *dm = GDK_MIR_DEVICE_MANAGER (device_manager);
|
||||
|
||||
if (type == GDK_DEVICE_TYPE_MASTER)
|
||||
{
|
||||
GList *devices;
|
||||
|
||||
devices = g_list_append (NULL, dm->keyboard);
|
||||
devices = g_list_append (devices, dm->pointer);
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
gdk_mir_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
{
|
||||
//g_printerr ("gdk_mir_device_manager_get_client_pointer\n");
|
||||
return GDK_MIR_DEVICE_MANAGER (device_manager)->pointer;
|
||||
}
|
||||
|
||||
GdkDevice *
|
||||
_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manager)
|
||||
{
|
||||
return GDK_MIR_DEVICE_MANAGER (device_manager)->keyboard;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_device_manager_init (GdkMirDeviceManager *device_manager)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_device_manager_constructed (GObject *object)
|
||||
{
|
||||
GdkMirDeviceManager *device_manager = GDK_MIR_DEVICE_MANAGER (object);
|
||||
|
||||
device_manager->keyboard = _gdk_mir_keyboard_new (GDK_DEVICE_MANAGER (device_manager), "Mir Keyboard");
|
||||
device_manager->pointer = _gdk_mir_pointer_new (GDK_DEVICE_MANAGER (device_manager), "Mir Pointer");
|
||||
_gdk_device_set_associated_device (device_manager->keyboard, device_manager->pointer);
|
||||
_gdk_device_set_associated_device (device_manager->pointer, device_manager->keyboard);
|
||||
|
||||
gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager))->core_pointer = device_manager->pointer;
|
||||
|
||||
G_OBJECT_CLASS (gdk_mir_device_manager_parent_class)->constructed (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_device_manager_class_init (GdkMirDeviceManagerClass *klass)
|
||||
{
|
||||
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
device_manager_class->list_devices = gdk_mir_device_manager_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_mir_device_manager_get_client_pointer;
|
||||
object_class->constructed = gdk_mir_device_manager_constructed;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user