Compare commits
662 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd70103f39 | |||
| 227d59c190 | |||
| 64812ce662 | |||
| 4fb6b9d579 | |||
| c1d36af3e8 | |||
| ba3e997dae | |||
| 33194ff5f4 | |||
| 5098f34234 | |||
| 0eaa177210 | |||
| bcfc53066a | |||
| dc00452d34 | |||
| 0a05a199c4 | |||
| b08a6750dc | |||
| 4cf9ac5b4d | |||
| 1782151092 | |||
| 201635a203 | |||
| 82647f274c | |||
| 89a645108d | |||
| f3b2632731 | |||
| c2ef54fa5f | |||
| 1cf85176e4 | |||
| 0d85671bc9 | |||
| db76c77b81 | |||
| 6ea712fe09 | |||
| e50c6e5837 | |||
| fc1450d55d | |||
| 556531b16f | |||
| 1335275548 | |||
| be3a1abc04 | |||
| d6bc1a99dc | |||
| ef4e7b2473 | |||
| fa3bb041eb | |||
| 3833ef5c35 | |||
| b3dd3a89d3 | |||
| 5d5d93e624 | |||
| 50656c74e3 | |||
| 6b939d57c7 | |||
| c8dd9895e4 | |||
| 538ec4efbb | |||
| cd45dfaa1d | |||
| a0b61a5a72 | |||
| 36c3eaea81 | |||
| f285ed1348 | |||
| ff267664b8 | |||
| bcbd7cce13 | |||
| ff0eb03201 | |||
| 148ea63dba | |||
| 909ca43c1a | |||
| 2a5272647d | |||
| 9306a73dfd | |||
| 504ec365a7 | |||
| 7db18bb726 | |||
| a3a245ab56 | |||
| 4d06d75dce | |||
| 680d7762ba | |||
| 630357beb3 | |||
| dfd311497d | |||
| d5b31c303c | |||
| 17883f3ce6 | |||
| 80428e7745 | |||
| 4ed5e6d526 | |||
| b7a05d1832 | |||
| c927f5e60d | |||
| 0330658a7f | |||
| 3a9ab87489 | |||
| 0b92348077 | |||
| b0fc43e958 | |||
| 8ae5e01225 | |||
| de4a8f8ddc | |||
| ee8db39393 | |||
| 119267d7c8 | |||
| 3783a0a54f | |||
| e9e3725ee7 | |||
| a141c66253 | |||
| 0dff033a64 | |||
| 4c1fa76520 | |||
| e997ac37a7 | |||
| 6dc5cdb981 | |||
| fe257d23dd | |||
| 3cbd9e9313 | |||
| da318411dc | |||
| 35cc52f418 | |||
| 33039c1452 | |||
| e8a365ce36 | |||
| 64e23c42bd | |||
| 8b57ad94c0 | |||
| b30445c927 | |||
| 19ff8cb026 | |||
| 9247bc8d6d | |||
| 46fe9c3f00 | |||
| caba7992b8 | |||
| 8432f54c51 | |||
| d2c35ec62a | |||
| 1b2be80f10 | |||
| 6b89f05a99 | |||
| 639e396147 | |||
| 24950ec144 | |||
| 629bb5a265 | |||
| c0e950f17b | |||
| c67559ad03 | |||
| 1041a186c7 | |||
| 35e2dfce08 | |||
| 73056e92d8 | |||
| b3303727ad | |||
| 7304e4227f | |||
| ffffa7361c | |||
| 531b449580 | |||
| 99425f15f5 | |||
| 1706608de3 | |||
| 36ef655061 | |||
| 143660eff6 | |||
| b10f2fc001 | |||
| 51ffd59884 | |||
| 85a55b2921 | |||
| 388ad4090c | |||
| a17e12c87d | |||
| 59dafa77dc | |||
| 3128bd0937 | |||
| bb86e61171 | |||
| 7beb83cea4 | |||
| 8263633478 | |||
| 68c38e0ffd | |||
| ef32192329 | |||
| 92309019e5 | |||
| 52eabce3c4 | |||
| 24ed2f8aa1 | |||
| eb537a6773 | |||
| 4b1315cedc | |||
| 75b8f7d3ae | |||
| 1212f263c3 | |||
| ae2c0b02c3 | |||
| 5d83f5eba5 | |||
| a33053db74 | |||
| 8413f22d90 | |||
| 61fab15139 | |||
| 22de1a7c65 | |||
| a18af0b980 | |||
| 894e887370 | |||
| 0fbdb3c73f | |||
| c4dec47536 | |||
| f48299c86e | |||
| 67eccabfca | |||
| 923e37e908 | |||
| 829cfe21e1 | |||
| 65a322c94d | |||
| 93df7c133e | |||
| 299cd7fec1 | |||
| 523283bb36 | |||
| 9fe9898045 | |||
| 96793999df | |||
| 80efec2a8c | |||
| 9441d96620 | |||
| 0df8e5e3f0 | |||
| a4a0019586 | |||
| 69b241c66d | |||
| e8f9085426 | |||
| 5559cbeb70 | |||
| 8e0088dcea | |||
| 839a347db1 | |||
| b19d76a156 | |||
| d995132ca5 | |||
| 61a73b3df6 | |||
| 7ef003f7d4 | |||
| aaf541903b | |||
| 6af58c6208 | |||
| 3be389fe96 | |||
| 5a5a24d4dc | |||
| 39779813ab | |||
| f743b2460a | |||
| cbfdfb8450 | |||
| 381d892079 | |||
| 7431550129 | |||
| a22afdb642 | |||
| 15bc2b787b | |||
| 177973bdfc | |||
| b1ca3163a6 | |||
| 2055066d92 | |||
| 449bc50b24 | |||
| 69e86f56be | |||
| 472ffe7539 | |||
| 0b0b960122 | |||
| 99b6a3df76 | |||
| cf87932bba | |||
| 984a16df2a | |||
| deb012bd34 | |||
| 5f7e8547f9 | |||
| ad87a23ffe | |||
| 637df00c87 | |||
| fe34ee4ff3 | |||
| 95dbbe2bda | |||
| e64cc4edeb | |||
| 151c6c2a78 | |||
| 036fa03550 | |||
| 291e8bd913 | |||
| 643c7c2060 | |||
| 837b998810 | |||
| bc57726d91 | |||
| add084329c | |||
| 7a6e782184 | |||
| 5f30ba46ea | |||
| 1f3a57691f | |||
| 4b7b8e513f | |||
| ed9cff6fbb | |||
| c8ee1927a5 | |||
| 56c488e690 | |||
| 5b20892a3d | |||
| a0508bc64c | |||
| d240b649e7 | |||
| 0f90c49440 | |||
| de1b75aabb | |||
| 908915c9da | |||
| 9408915114 | |||
| df95db7649 | |||
| b04186d272 | |||
| f909f3866f | |||
| 1b61e9dc2b | |||
| e85b9b3523 | |||
| 63d03344f9 | |||
| 2b1ec1b227 | |||
| 74c7588040 | |||
| 08bce451b7 | |||
| 48cc791fb2 | |||
| 2e00e16650 | |||
| 68e833dc1b | |||
| 8cc486ace5 | |||
| b447f59fe0 | |||
| c470e592a3 | |||
| 167413e7c3 | |||
| 07f2bb0b84 | |||
| 6750ffebc8 | |||
| 7b7f8f1e5d | |||
| 04fd3f14ac | |||
| 040d8d1414 | |||
| d50cd83fd0 | |||
| 94e80bbbed | |||
| f185967ba1 | |||
| 57a3de1bcd | |||
| b229aa8d5e | |||
| 4c86b6112e | |||
| 870fefbfaf | |||
| 8ea37e551b | |||
| ca43e7d3be | |||
| f77c10b0b0 | |||
| e566c96137 | |||
| 313e1b9c2f | |||
| ba4695e8e5 | |||
| 0a12113d9d | |||
| 248719c771 | |||
| 9a19752da4 | |||
| 39ff3a4822 | |||
| 6b1126ab54 | |||
| 7eedb7a0b3 | |||
| f000d83f00 | |||
| 8411cd3282 | |||
| 92c6be8ac0 | |||
| 1931a8db5d | |||
| bbf5e95c41 | |||
| 9f3d23a900 | |||
| 5c2c742c8d | |||
| a602ff82eb | |||
| e082783fbb | |||
| e2f79c33ff | |||
| e5aca4ac88 | |||
| 01bb46fefe | |||
| 70d2c392ca | |||
| fe0a89e251 | |||
| 09e4738682 | |||
| 190096f41e | |||
| 8ad3276a77 | |||
| 828c4f7aa5 | |||
| 0cdcfcca9f | |||
| ba22b91e31 | |||
| 83430719d1 | |||
| 15a797e8e9 | |||
| a0441bcb4c | |||
| cb4f39c7a8 | |||
| fa934294a7 | |||
| ee0bf98769 | |||
| e53efb120a | |||
| 8c1f5dbc03 | |||
| 2bb5e9e75a | |||
| 289948f1d3 | |||
| 3ffee3e6e5 | |||
| 2dc372a657 | |||
| 6d8fee9879 | |||
| 2dd2650215 | |||
| e6572c0939 | |||
| ec20658b51 | |||
| 76943117be | |||
| 6379f64a37 | |||
| aabe0b16cf | |||
| 2d96f39335 | |||
| 5d4af6ca80 | |||
| 3ebbee6958 | |||
| 08d42ed8fe | |||
| edc65ce1d2 | |||
| eb90ec7513 | |||
| c3f8b4226d | |||
| c44c026ee9 | |||
| e7127daf84 | |||
| 04aba4bde2 | |||
| 126133a927 | |||
| 9a33ab970f | |||
| 79453a952f | |||
| f5aa0fad6c | |||
| 2e78caa5a2 | |||
| 7044a9d027 | |||
| fe2cb223ea | |||
| 9dd2609525 | |||
| 1d34e445e9 | |||
| d3db379573 | |||
| 4e8d4ead22 | |||
| 87e7f3c0c1 | |||
| 9c054e3029 | |||
| 7c9f3072eb | |||
| 109ca57aa8 | |||
| af51a093fe | |||
| 599d6f0a2c | |||
| 4e3c3baac2 | |||
| f8cd486871 | |||
| 0fa5fb2894 | |||
| 76a752b69d | |||
| 9889445169 | |||
| 83518ec77c | |||
| b51edbe745 | |||
| 468a947285 | |||
| daf00f6f94 | |||
| 53bebef4bf | |||
| b23c114b95 | |||
| 3fe334c3a8 | |||
| f5d67c8b44 | |||
| 462a491fa7 | |||
| 21b1a03e1e | |||
| d1babc7775 | |||
| db0faed54c | |||
| f6a173d302 | |||
| 938795f922 | |||
| 9160cf1af7 | |||
| 28dda32acc | |||
| c5dc38c142 | |||
| 4815119eab | |||
| df32ea9960 | |||
| 624ac853ba | |||
| d405d997bd | |||
| f90b880ce8 | |||
| d316798685 | |||
| 2f772399ce | |||
| dc8965f9ea | |||
| 2eab767d4c | |||
| 5781ea200b | |||
| 2c6b8680c3 | |||
| 9414dc2cf6 | |||
| 087ff5f220 | |||
| 12b8b8bf7c | |||
| f773c8975d | |||
| 7edbc6b6ee | |||
| 576f2770c7 | |||
| 7835a51040 | |||
| 7a8a188b4c | |||
| 3394c2fbe5 | |||
| d170fb7983 | |||
| 87fb3d9e08 | |||
| c393ce993f | |||
| 54f851b5b5 | |||
| 62a5e11483 | |||
| 71df0c45ba | |||
| eee7bb2b2e | |||
| 87334d465c | |||
| 91302444cc | |||
| 58d7a0e2d7 | |||
| 3d71d992a6 | |||
| 998591adf6 | |||
| 2140a5b107 | |||
| f148059b7b | |||
| 94480795c7 | |||
| 9cd074b663 | |||
| 4b8a91bb85 | |||
| 100c6dc513 | |||
| 501f327b56 | |||
| 29efd9a753 | |||
| 966b619705 | |||
| ce07f4403b | |||
| 800fbc513f | |||
| 42f920c77b | |||
| fc246a9305 | |||
| c59386ba1d | |||
| 92b1c9150d | |||
| 78b42c67e6 | |||
| 5eccd0d20e | |||
| 11788b71e1 | |||
| 96e42fb1ee | |||
| 5438a7b608 | |||
| d154b115e5 | |||
| 9983f2e551 | |||
| 6247ef7a32 | |||
| 2c53b675c3 | |||
| 7485d64249 | |||
| a4186b6aa5 | |||
| b6139abb37 | |||
| 067cce5d63 | |||
| 541448732d | |||
| 239570abdd | |||
| 8633c6ffc6 | |||
| 935a3f7b65 | |||
| 987256968b | |||
| 9bc658f6ed | |||
| 2e9a0028fb | |||
| 442f7a9d26 | |||
| 029b7b6361 | |||
| 931ed06beb | |||
| cc895cc924 | |||
| ca9e029838 | |||
| e9d53fd675 | |||
| d0c4e2d762 | |||
| fe7af7a9e5 | |||
| bc01a0cbcf | |||
| 2194ee02e3 | |||
| b6d139f954 | |||
| 9dfadca46c | |||
| 0a037fa4fe | |||
| 4b85311951 | |||
| e193b20d50 | |||
| a9f0710686 | |||
| fb0c247e30 | |||
| b802beb0b1 | |||
| 686efe8145 | |||
| a86bbf759f | |||
| 453ac4a2ec | |||
| 39945324bc | |||
| a622ca52a0 | |||
| 05bc895378 | |||
| 1ae55844f7 | |||
| 21ef8f9ad9 | |||
| bffcae28d7 | |||
| 36b1586f86 | |||
| 5067f69ff1 | |||
| 8a9dabd683 | |||
| 47c66ad3bc | |||
| 7e978d3447 | |||
| d8453e7826 | |||
| 4343bc8d0a | |||
| 539545688c | |||
| c51d3805a7 | |||
| a7e91ca4ca | |||
| a17acc0572 | |||
| 30101c195c | |||
| 2bd8ea3084 | |||
| 6d84afc2f5 | |||
| 8f49f935df | |||
| bb7ff7b586 | |||
| 1c9cc0acf0 | |||
| 88977f73eb | |||
| 5585335dd9 | |||
| 189a35fe59 | |||
| b8a0ff9e04 | |||
| c81131ff21 | |||
| b26536162c | |||
| 06eb74410d | |||
| 8f125f9b93 | |||
| 26d5674b65 | |||
| 3dcb9d4bfc | |||
| 23d870de2f | |||
| 2de67d907b | |||
| e9da5b95de | |||
| 4aa4093b6e | |||
| 04bc35f060 | |||
| c8fdec0419 | |||
| 2a762bf6ca | |||
| ef3dc5fd42 | |||
| 9743d2e83c | |||
| eed0dd0944 | |||
| 2091807b24 | |||
| c31f02b455 | |||
| b5061249e7 | |||
| 58956ad7e2 | |||
| 38c309869d | |||
| ac4d89113b | |||
| 51b774f59a | |||
| 07d3c79945 | |||
| 84c77b7ca5 | |||
| 0d0f3a1e4c | |||
| 18b7ad4182 | |||
| 27f81d8918 | |||
| e40dcff11b | |||
| 4f37e160af | |||
| 905edf9478 | |||
| 74a104d73a | |||
| 149f5891fa | |||
| 29e8460604 | |||
| eaac92f621 | |||
| f01e0670f8 | |||
| c0d7fe2ad4 | |||
| e3cf8611b2 | |||
| f0d57f40f5 | |||
| 82956742c0 | |||
| 57ca68d591 | |||
| cf9edf9ff7 | |||
| 4285f21b3b | |||
| 6860f86724 | |||
| 43572af86e | |||
| cad18bbfe3 | |||
| 174c126b6e | |||
| a821df1577 | |||
| 99e2f97f30 | |||
| 4f0619de15 | |||
| 66882103cc | |||
| 7673c45fec | |||
| 675ead1d82 | |||
| b3e06e8302 | |||
| e9d18c8e07 | |||
| 01a3ad45b8 | |||
| 694bf7230e | |||
| f8d1cf58af | |||
| 69de358b38 | |||
| 312263233f | |||
| bd5431e620 | |||
| 95ccaa02de | |||
| 9d7ef2875d | |||
| 6972375688 | |||
| e4d9e5dd63 | |||
| bfadb65fb0 | |||
| 5c35215457 | |||
| 02b2810a0e | |||
| 7ed2cbcfce | |||
| 4b03789551 | |||
| 5db40e41b3 | |||
| bcb255593d | |||
| fc2cbf960c | |||
| 20dcd8a723 | |||
| ea7bd00e92 | |||
| d3e91fbba6 | |||
| 54573f1582 | |||
| 62a2dd6c78 | |||
| 699fc85a67 | |||
| e337bd8583 | |||
| facb5e7d60 | |||
| 37e71e4e28 | |||
| 1566b3af8a | |||
| 3dca3822fb | |||
| 51f9ce390f | |||
| 91663e0791 | |||
| b2d6bf1526 | |||
| 3871291ba3 | |||
| 9242d1414d | |||
| e4ac9609a2 | |||
| 753e30667f | |||
| 80a015529d | |||
| b48c8318a1 | |||
| b8fa675a6a | |||
| 969ff4c863 | |||
| 81cf73ae8a | |||
| 8273349eca | |||
| 50c7d672c1 | |||
| 0d51400b29 | |||
| f7daeec10f | |||
| 5d3e414994 | |||
| b86b00b387 | |||
| 1fa4359218 | |||
| a739d9fb80 | |||
| 2831ef6b19 | |||
| b7fd519822 | |||
| 4c14a043eb | |||
| a078bd09b0 | |||
| da2d84c0bf | |||
| 4c4f795da9 | |||
| e0e2c768dd | |||
| f76e9f5804 | |||
| cab66c128c | |||
| 6b9924db1c | |||
| 87487cea62 | |||
| ddf4cde3af | |||
| e9b593c2e6 | |||
| 324c3e4ced | |||
| f099bf1f58 | |||
| 1d3707ca56 | |||
| 3e9dabbdb8 | |||
| fa60b41c52 | |||
| 3750e4fb67 | |||
| 8928fd096e | |||
| 33a021868a | |||
| 1de99c2c95 | |||
| a763546c8f | |||
| 0cbf76ed47 | |||
| 00ec5fcd7a | |||
| a75065a458 | |||
| afbc052916 | |||
| 58f7b084b5 | |||
| a8fcc1c482 | |||
| 87075b3b97 | |||
| d1c3745b07 | |||
| 94f6a09585 | |||
| af09dd08c1 | |||
| dab1cacba7 | |||
| f746afc794 | |||
| 9889c4db88 | |||
| 1f50800129 | |||
| 132276fa75 | |||
| 779d3d58ea | |||
| 9de876c222 | |||
| 2abf1056c9 | |||
| 14724073a4 | |||
| c12194feae | |||
| d68d78de81 | |||
| ce9c3df4c8 | |||
| 4bc8dcede8 | |||
| 3659db3a4a | |||
| 71d7b97a90 | |||
| 7545e7211c | |||
| acca24e9c1 | |||
| 507bf6a85f | |||
| 750a96e4cc | |||
| b68bbbb892 | |||
| 1abc649b8c | |||
| f8b8bb4bf9 | |||
| 360820e9bf | |||
| 214d5efdd4 | |||
| 600ae2db92 | |||
| 5cb043d5dd | |||
| f289f667e7 | |||
| 89ac81e767 | |||
| 0c991c5645 | |||
| 901aa0d645 | |||
| 2336ebca5c | |||
| 9d4e82a0dc | |||
| b0e01bee7f | |||
| 944bf11cee | |||
| 3a4f027074 | |||
| a8bf73cfa7 | |||
| 4330bd6e52 | |||
| 6c9bfc5f39 | |||
| 9d4674a5ec | |||
| cd50594db8 | |||
| fcbbd763cd | |||
| 99de88c452 | |||
| 7c0624aa92 | |||
| b1397c64e4 | |||
| 1ba7e8eb15 | |||
| f584679cfa | |||
| 41342b23e5 | |||
| 3546feb389 | |||
| af37f76bc6 | |||
| e5b4a51b6b | |||
| 750fa5398e | |||
| e70ef71c3a | |||
| fb0968a99f | |||
| 4f0f6243c9 | |||
| 52e84a9ecc | |||
| a2a990aa0b | |||
| d99742e1cb | |||
| 5e62f81196 | |||
| d4b1f0cadf | |||
| 56edab3553 | |||
| 9a48091064 | |||
| 5e8045b14d | |||
| 7a69bdc5f0 | |||
| 21ebf5df86 | |||
| 24c1a4f24b | |||
| 462dc0643b | |||
| 9724366289 | |||
| c659d1a505 | |||
| e08d04b561 | |||
| a8ec02c930 |
@@ -1,3 +1,11 @@
|
||||
Overview of Changes from GTK+ 2.20.x to 2.90.0
|
||||
==============================================
|
||||
|
||||
* GtkExtendedLayout: Width-for-height geometry management
|
||||
|
||||
* gtk_icon_theme_load_symbolic: Support for 'symbolic' icons
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.19.7 to 2.20.0
|
||||
==============================================
|
||||
|
||||
|
||||
@@ -317,6 +317,7 @@ do_images (GtkWidget *do_widget)
|
||||
GtkWidget *align;
|
||||
GtkWidget *button;
|
||||
GdkPixbuf *pixbuf;
|
||||
GIcon *gicon;
|
||||
GError *error = NULL;
|
||||
char *filename;
|
||||
|
||||
@@ -415,6 +416,26 @@ do_images (GtkWidget *do_widget)
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), image);
|
||||
|
||||
/* Symbolic icon */
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
"<u>Symbolic themed icon</u>");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
/* The alignment keeps the frame from growing when users resize
|
||||
* the window
|
||||
*/
|
||||
align = gtk_alignment_new (0.5, 0.5, 0, 0);
|
||||
gtk_container_add (GTK_CONTAINER (align), frame);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
||||
|
||||
gicon = g_themed_icon_new_with_default_fallbacks ("battery-critical-charging-symbolic");
|
||||
image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_DIALOG);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), image);
|
||||
|
||||
/* Progressive */
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ enum
|
||||
COLUMN_SEVERITY,
|
||||
COLUMN_DESCRIPTION,
|
||||
COLUMN_PULSE,
|
||||
COLUMN_ICON,
|
||||
COLUMN_ACTIVE,
|
||||
COLUMN_SENSITIVE,
|
||||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
@@ -92,11 +94,24 @@ create_model (void)
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_BOOLEAN,
|
||||
G_TYPE_BOOLEAN);
|
||||
|
||||
/* add data to the list store */
|
||||
for (i = 0; i < G_N_ELEMENTS (data); i++)
|
||||
{
|
||||
gchar *icon_name;
|
||||
gboolean sensitive;
|
||||
|
||||
if (i == 1 || i == 3)
|
||||
icon_name = "battery-critical-charging-symbolic";
|
||||
else
|
||||
icon_name = NULL;
|
||||
if (i == 3)
|
||||
sensitive = FALSE;
|
||||
else
|
||||
sensitive = TRUE;
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter,
|
||||
COLUMN_FIXED, data[i].fixed,
|
||||
@@ -104,7 +119,9 @@ create_model (void)
|
||||
COLUMN_SEVERITY, data[i].severity,
|
||||
COLUMN_DESCRIPTION, data[i].description,
|
||||
COLUMN_PULSE, 0,
|
||||
COLUMN_ICON, icon_name,
|
||||
COLUMN_ACTIVE, FALSE,
|
||||
COLUMN_SENSITIVE, sensitive,
|
||||
-1);
|
||||
}
|
||||
|
||||
@@ -199,6 +216,19 @@ add_columns (GtkTreeView *treeview)
|
||||
NULL);
|
||||
gtk_tree_view_column_set_sort_column_id (column, COLUMN_PULSE);
|
||||
gtk_tree_view_append_column (treeview, column);
|
||||
|
||||
/* column for symbolic icon */
|
||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
g_object_set (G_OBJECT (renderer), "follow-state", TRUE, NULL);
|
||||
column = gtk_tree_view_column_new_with_attributes ("Symbolic icon",
|
||||
renderer,
|
||||
"icon-name",
|
||||
COLUMN_ICON,
|
||||
"sensitive",
|
||||
COLUMN_SENSITIVE,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_sort_column_id (column, COLUMN_ICON);
|
||||
gtk_tree_view_append_column (treeview, column);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -294,6 +294,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
<xi:include href="xml/gtktable.xml" />
|
||||
<xi:include href="xml/gtkexpander.xml" />
|
||||
<xi:include href="xml/gtkorientable.xml" />
|
||||
<xi:include href="xml/gtkextendedlayout.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="Ornaments">
|
||||
@@ -500,6 +501,14 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
<title>Index of new symbols in 2.20</title>
|
||||
<xi:include href="xml/api-index-2.20.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-22" role="2.22">
|
||||
<title>Index of new symbols in 2.20</title>
|
||||
<xi:include href="xml/api-index-2.22.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-0" role="3.0">
|
||||
<title>Index of new symbols in 3.0</title>
|
||||
<xi:include href="xml/api-index-3.0.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
||||
@@ -154,6 +154,7 @@ gtk_accel_label_accelerator_width
|
||||
<TITLE>GtkAccessible</TITLE>
|
||||
GtkAccessible
|
||||
gtk_accessible_connect_widget_destroyed
|
||||
gtk_accessible_get_widget
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_ACCESSIBLE
|
||||
@@ -1374,7 +1375,9 @@ GTK_ENTRY_BUFFER_CLASS
|
||||
GTK_IS_ENTRY_BUFFER_CLASS
|
||||
GTK_ENTRY_BUFFER_GET_CLASS
|
||||
GTK_ENTRY_BUFFER_MAX_SIZE
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkEntryBufferPrivate
|
||||
gtk_entry_buffer_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2658,8 +2661,8 @@ GTK_IS_INFO_BAR_CLASS
|
||||
GTK_INFO_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkInfoBarPrivate
|
||||
gtk_info_bar_get_type
|
||||
GtkMessageAreaPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -3618,6 +3621,7 @@ GtkSpinner
|
||||
gtk_spinner_new
|
||||
gtk_spinner_start
|
||||
gtk_spinner_stop
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_SPINNER
|
||||
GTK_IS_SPINNER
|
||||
@@ -3625,7 +3629,10 @@ GTK_TYPE_SPINNER
|
||||
GTK_SPINNER_CLASS
|
||||
GTK_IS_SPINER_CLASS
|
||||
GTK_SPINNER_GET_CLASS
|
||||
GTK_IS_SPINNER_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkSpinnerPrivate
|
||||
gtk_spinner_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4063,6 +4070,8 @@ gtk_text_view_new
|
||||
gtk_text_view_new_with_buffer
|
||||
gtk_text_view_set_buffer
|
||||
gtk_text_view_get_buffer
|
||||
gtk_text_view_get_hadjustment
|
||||
gtk_text_view_get_vadjustment
|
||||
gtk_text_view_scroll_to_mark
|
||||
gtk_text_view_scroll_to_iter
|
||||
gtk_text_view_scroll_mark_onscreen
|
||||
@@ -4512,6 +4521,7 @@ gtk_tool_item_group_set_item_position
|
||||
gtk_tool_item_group_set_label
|
||||
gtk_tool_item_group_set_label_widget
|
||||
gtk_tool_item_group_set_header_relief
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkToolItemGroupClass
|
||||
GTK_TOOL_ITEM_GROUP
|
||||
@@ -4520,7 +4530,9 @@ GTK_TYPE_TOOL_ITEM_GROUP
|
||||
GTK_TOOL_ITEM_GROUP_CLASS
|
||||
GTK_IS_TOOL_ITEM_GROUP_CLASS
|
||||
GTK_TOOL_ITEM_GROUP_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkToolItemGroupPrivate
|
||||
gtk_tool_item_group_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4663,6 +4675,7 @@ gtk_tree_path_append_index
|
||||
gtk_tree_path_prepend_index
|
||||
gtk_tree_path_get_depth
|
||||
gtk_tree_path_get_indices
|
||||
gtk_tree_path_get_indices_with_depth
|
||||
gtk_tree_path_free
|
||||
gtk_tree_path_copy
|
||||
gtk_tree_path_compare
|
||||
@@ -5661,6 +5674,7 @@ gtk_widget_modify_text
|
||||
gtk_widget_modify_base
|
||||
gtk_widget_modify_font
|
||||
gtk_widget_modify_cursor
|
||||
gtk_widget_modify_symbolic_color
|
||||
gtk_widget_create_pango_context
|
||||
gtk_widget_get_pango_context
|
||||
gtk_widget_create_pango_layout
|
||||
@@ -6684,6 +6698,7 @@ gtk_icon_info_get_base_size
|
||||
gtk_icon_info_get_filename
|
||||
gtk_icon_info_get_builtin_pixbuf
|
||||
gtk_icon_info_load_icon
|
||||
gtk_icon_info_load_symbolic
|
||||
gtk_icon_info_set_raw_coordinates
|
||||
gtk_icon_info_get_embedded_rect
|
||||
gtk_icon_info_get_attach_points
|
||||
@@ -6829,6 +6844,8 @@ GTK_IS_PRINT_OPERATION_PREVIEW
|
||||
GTK_PRINT_OPERATION_PREVIEW
|
||||
GTK_PRINT_OPERATION_PREVIEW_GET_IFACE
|
||||
GTK_TYPE_PRINT_OPERATION_PREVIEW
|
||||
GtkPrintOperationClass
|
||||
GtkPrintOperationPreviewIface
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_print_error_quark
|
||||
@@ -7089,10 +7106,20 @@ gtk_paper_size_to_key_file
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_PAPER_SIZE
|
||||
GTK_CUSTOM_PAPER_UNIX_DIALOG
|
||||
GTK_CUSTOM_PAPER_UNIX_DIALOG_CLASS
|
||||
GTK_CUSTOM_PAPER_UNIX_DIALOG_GET_CLASS
|
||||
GTK_IS_CUSTOM_PAPER_UNIX_DIALOG
|
||||
GTK_IS_CUSTOM_PAPER_UNIX_DIALOG_CLASS
|
||||
GTK_TYPE_CUSTOM_PAPER_UNIX_DIALOG
|
||||
GtkCustomPaperUnixDialog
|
||||
GtkCustomPaperUnixDialogClass
|
||||
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_paper_size_get_type
|
||||
gtk_custom_paper_unix_dialog_get_type
|
||||
GtkCustomPaperUnixDialogPrivate
|
||||
</SECTION>
|
||||
|
||||
|
||||
@@ -7260,6 +7287,7 @@ GTK_MOUNT_OPERATION_CLASS
|
||||
GTK_MOUNT_OPERATION_GET_CLASS
|
||||
GTK_TYPE_MOUNT_OPERATION
|
||||
<SUBSECTION Private>
|
||||
GtkMountOperationLookupContext
|
||||
gtk_mount_operation_get_type
|
||||
GtkMountOperationPrivate
|
||||
</SECTION>
|
||||
@@ -7283,3 +7311,26 @@ GTK_TYPE_ORIENTABLE
|
||||
<SUBSECTION Private>
|
||||
gtk_orientable_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkextendedlayout</FILE>
|
||||
<TITLE>GtkExtendedLayout</TITLE>
|
||||
GtkExtendedLayout
|
||||
GtkExtendedLayoutIface
|
||||
gtk_extended_layout_get_desired_height
|
||||
gtk_extended_layout_get_desired_size
|
||||
gtk_extended_layout_get_desired_width
|
||||
gtk_extended_layout_get_height_for_width
|
||||
gtk_extended_layout_get_width_for_height
|
||||
gtk_extended_layout_is_height_for_width
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_EXTENDED_LAYOUT
|
||||
GTK_EXTENDED_LAYOUT_CLASS
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE
|
||||
GTK_IS_EXTENDED_LAYOUT
|
||||
GTK_TYPE_EXTENDED_LAYOUT
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_extended_layout_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -54,6 +54,7 @@ gtk_entry_completion_get_type
|
||||
gtk_entry_get_type
|
||||
gtk_event_box_get_type
|
||||
gtk_expander_get_type
|
||||
gtk_extended_layout_get_type
|
||||
gtk_file_chooser_button_get_type
|
||||
gtk_file_chooser_dialog_get_type
|
||||
gtk_file_chooser_get_type
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
gtkbbox.sgml
|
||||
gtkbox.sgml
|
||||
gtkbuilder.sgml
|
||||
gtkhbox.sgml
|
||||
gtkmessagedialog.sgml
|
||||
gtktesting.sgml
|
||||
|
||||
@@ -1,210 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkButtonBox
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Base class for GtkHButtonBox and GtkVButtonBox
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The primary purpose of this class is to keep track of the various properties
|
||||
of #GtkHButtonBox and #GtkVButtonBox widgets.
|
||||
</para>
|
||||
<para>
|
||||
gtk_button_box_get_child_size() retrieves the minimum width and height
|
||||
for widgets in a given button box.
|
||||
</para>
|
||||
<para>
|
||||
The internal padding of buttons can be retrieved and changed per button box using
|
||||
gtk_button_box_get_child_ipadding() and gtk_button_box_set_child_ipadding()
|
||||
respectively.
|
||||
</para>
|
||||
<para>
|
||||
gtk_button_box_get_spacing() and gtk_button_box_set_spacing() retrieve and
|
||||
change default number of pixels between buttons, respectively.
|
||||
</para>
|
||||
<para>
|
||||
gtk_button_box_get_layout() and gtk_button_box_set_layout() retrieve and alter the method
|
||||
used to spread the buttons in a button box across the container, respectively.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The main purpose of GtkButtonBox is to make sure the children have all the same size.
|
||||
Therefore it ignores the homogeneous property which it inherited from GtkBox, and always
|
||||
behaves as if homogeneous was %TRUE.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>#GtkVButtonBox</term>
|
||||
<listitem><para>Vertical sub-class of #GtkButtonBox.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>#GtkHButtonBox</term>
|
||||
<listitem><para>Horizontal sub-class of #GtkButtonBox.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkButtonBox ##### -->
|
||||
<para>
|
||||
This is a read-only struct; no members should be modified directly.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkButtonBox:layout-style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkButtonBox:secondary ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkButtonBox:child-internal-pad-x ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkButtonBox:child-internal-pad-y ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkButtonBox:child-min-height ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkButtonBox:child-min-width ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### MACRO GTK_BUTTONBOX_DEFAULT ##### -->
|
||||
<para>
|
||||
Used internally only.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO gtk_button_box_get_spacing ##### -->
|
||||
<para>
|
||||
Retrieves how much space a button box is placing between each child button.
|
||||
</para>
|
||||
|
||||
@b: a #GtkButtonBox
|
||||
@Returns: the current spacing applied to the buttons in @widget
|
||||
@Deprecated: Use gtk_box_get_spacing() instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_box_get_layout ##### -->
|
||||
<para>
|
||||
Retrieves the method being used to arrange the buttons in a button box.
|
||||
</para>
|
||||
|
||||
@widget: a #GtkButtonBox.
|
||||
@Returns: the method used to layout buttons in @widget.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_box_get_child_size ##### -->
|
||||
<para>
|
||||
Retrieves the current width and height of all child widgets in a button box.
|
||||
@min_width and @min_height are filled with those values, respectively.
|
||||
</para>
|
||||
|
||||
@widget: a #GtkButtonBox.
|
||||
@min_width: the width of the buttons contained by @widget.
|
||||
@min_height: the height of the buttons contained by @widget.
|
||||
@Deprecated: Use the style properties
|
||||
<literal>"child-min-width/-height"</literal> instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_box_get_child_ipadding ##### -->
|
||||
<para>
|
||||
Gets the default number of pixels that pad the buttons in a given button box.
|
||||
</para>
|
||||
|
||||
@widget: a #GtkButtonBox.
|
||||
@ipad_x: the horizontal padding used by buttons in @widget.
|
||||
@ipad_y: the vertical padding used by buttons in @widget.
|
||||
@Deprecated: Use the style properties
|
||||
"<link linkend="GtkButtonBox--s-child-internal-pad-x">child-internal-pad-x</link>"
|
||||
and
|
||||
"<link linkend="GtkButtonBox--s-child-internal-pad-y">child-internal-pad-y</link>"
|
||||
instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_box_get_child_secondary ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### MACRO gtk_button_box_set_spacing ##### -->
|
||||
<para>
|
||||
Sets the amount of spacing between buttons in a given button box.
|
||||
</para>
|
||||
|
||||
@b: a #GtkButtonBox
|
||||
@s: the number of pixels of spacing
|
||||
@Deprecated: Use gtk_box_set_spacing() instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_box_set_layout ##### -->
|
||||
<para>
|
||||
Changes the way buttons are arranged in their container.
|
||||
</para>
|
||||
|
||||
@widget: a #GtkButtonBox.
|
||||
@layout_style: the new layout style.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_box_set_child_size ##### -->
|
||||
<para>
|
||||
Sets a new default size for the children of a given button box.
|
||||
</para>
|
||||
|
||||
@widget: a #GtkButtonBox
|
||||
@min_width: a default width for buttons in @widget
|
||||
@min_height: a default height for buttons in @widget
|
||||
@Deprecated: This is not supported anymore and can only be set through the theme
|
||||
changing the style properties:
|
||||
"<link linkend="GtkButtonBox--s-child-min-width">child-min-width</link>"
|
||||
and
|
||||
"<link linkend="GtkButtonBox--s-child-min-height">child-min-height</link>"
|
||||
instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_box_set_child_ipadding ##### -->
|
||||
<para>
|
||||
Changes the amount of internal padding used by all buttons in a given button
|
||||
box.
|
||||
</para>
|
||||
|
||||
@widget: a #GtkButtonBox.
|
||||
@ipad_x: the horizontal padding that should be used by each button in @widget.
|
||||
@ipad_y: the vertical padding that should be used by each button in @widget.
|
||||
@Deprecated: Use the style properties
|
||||
<literal>"child-internal-pad-x/-y"</literal> instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_box_set_child_secondary ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@child:
|
||||
@is_secondary:
|
||||
|
||||
|
||||
@@ -1,291 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkBox
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Base class for box containers
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
GtkBox is an abstract widget which encapsulates functionality for a
|
||||
particular kind of container, one that organizes a variable number of
|
||||
widgets into a rectangular area. GtkBox has a number of derived
|
||||
classes, e.g. #GtkHBox and #GtkVBox.
|
||||
</para>
|
||||
<para>
|
||||
The rectangular area of a GtkBox is organized into either a single row
|
||||
or a single column of child widgets depending upon whether the box is
|
||||
of type #GtkHBox or #GtkVBox, respectively. Thus, all children of a
|
||||
GtkBox are allocated one dimension in common, which is the height of a
|
||||
row, or the width of a column.
|
||||
</para>
|
||||
<para>
|
||||
GtkBox uses a notion of <emphasis>packing</emphasis>. Packing refers to
|
||||
adding widgets with reference to a particular position in a
|
||||
#GtkContainer. For a GtkBox, there are two reference positions: the
|
||||
<emphasis>start</emphasis> and the <emphasis>end</emphasis> of the box.
|
||||
For a #GtkVBox, the start is defined as the top of the box and the end is
|
||||
defined as the bottom. For a #GtkHBox the start is defined as the
|
||||
left side and the end is defined as the right side.
|
||||
</para>
|
||||
<para>
|
||||
Use repeated calls to gtk_box_pack_start() to pack widgets into a
|
||||
GtkBox from start to end. Use gtk_box_pack_end() to add widgets from
|
||||
end to start. You may intersperse these calls and add widgets from
|
||||
both ends of the same GtkBox.
|
||||
</para>
|
||||
<para>
|
||||
Use gtk_box_pack_start_defaults() or gtk_box_pack_end_defaults()
|
||||
to pack widgets into a GtkBox if you do not need to specify the
|
||||
#GtkBox:expand, #GtkBox:fill, or #GtkBox:padding child properties
|
||||
for the child to be added.
|
||||
</para>
|
||||
<para>
|
||||
Because GtkBox is a #GtkContainer, you may also use
|
||||
gtk_container_add() to insert widgets into the box, and they will be
|
||||
packed as if with gtk_box_pack_start_defaults(). Use
|
||||
gtk_container_remove() to remove widgets from the GtkBox.
|
||||
</para>
|
||||
<para>
|
||||
Use gtk_box_set_homogeneous() to specify whether or not all children
|
||||
of the GtkBox are forced to get the same amount of space.
|
||||
</para>
|
||||
<para>
|
||||
Use gtk_box_set_spacing() to determine how much space will be
|
||||
minimally placed between all children in the GtkBox.
|
||||
</para>
|
||||
<para>
|
||||
Use gtk_box_reorder_child() to move a GtkBox child to a different
|
||||
place in the box.
|
||||
</para>
|
||||
<para>
|
||||
Use gtk_box_set_child_packing() to reset the #GtkBox:expand,
|
||||
#GtkBox:fill and #GtkBox:padding child properties.
|
||||
Use gtk_box_query_child_packing() to query these fields.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GtkHBox</term>
|
||||
<listitem><para>a derived class that organizes widgets into a row.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GtkVBox</term>
|
||||
<listitem><para>a derived class that organizes widgets into a column.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GtkFrame</term>
|
||||
<listitem><para>a #GtkWidget useful for drawing a border around a GtkBox.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GtkTable</term>
|
||||
<listitem><para>a #GtkContainer for organizing widgets into a grid,
|
||||
rather than independent rows or columns.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GtkLayout</term>
|
||||
<listitem><para>a #GtkContainer for organizing widgets into arbitrary
|
||||
layouts.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkBox ##### -->
|
||||
<para>
|
||||
The #GtkBox-struct describes an instance of GtkBox and contains the
|
||||
following fields. (These fields should be considered read-only.
|
||||
They should never be set by an application.)
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkBox:homogeneous ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkBox:spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkBox:expand ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkBox:fill ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkBox:pack-type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkBox:padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkBox:position ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### STRUCT GtkBoxChild ##### -->
|
||||
<para>
|
||||
The #GtkBoxChild-struct holds a child widget of GtkBox and describes
|
||||
how the child is to be packed into the GtkBox. Use
|
||||
gtk_box_query_child_packing() and gtk_box_set_child_packing() to query
|
||||
and reset the <structfield>padding</structfield>,
|
||||
<structfield>expand</structfield>, <structfield>fill</structfield>,
|
||||
and <structfield>pack</structfield> fields.
|
||||
</para>
|
||||
<para>
|
||||
#GtkBoxChild-struct contains the following fields. (These fields
|
||||
should be considered read-only. They should never be directly set by an
|
||||
application.)
|
||||
</para>
|
||||
|
||||
@widget: the child widget, packed into the GtkBox.
|
||||
@padding: the number of extra pixels to put between this child and its
|
||||
neighbors, set when packed, zero by default.
|
||||
@expand: flag indicates whether extra space should be given to this
|
||||
child. Any extra space given to the parent GtkBox is divided up
|
||||
among all children with this attribute set to %TRUE; set when packed,
|
||||
%TRUE by default.
|
||||
@fill: flag indicates whether any extra space given to this child due
|
||||
to its @expand attribute being set is actually allocated to the child,
|
||||
rather than being used as padding around the widget; set when packed,
|
||||
%TRUE by default.
|
||||
@pack: one of #GtkPackType indicating whether the child is packed with
|
||||
reference to the start (top/left) or end (bottom/right) of the GtkBox.
|
||||
@is_secondary: %TRUE if the child is secondary
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_pack_start ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@child:
|
||||
@expand:
|
||||
@box
|
||||
@fill:
|
||||
@padding:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_pack_end ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@child:
|
||||
@expand:
|
||||
@fill:
|
||||
@padding:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_pack_start_defaults ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_pack_end_defaults ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_get_homogeneous ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_set_homogeneous ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@homogeneous:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_get_spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_set_spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@spacing:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_reorder_child ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@child:
|
||||
@position:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_query_child_packing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@child:
|
||||
@expand:
|
||||
@fill:
|
||||
@padding:
|
||||
@pack_type:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_box_set_child_packing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@box:
|
||||
@child:
|
||||
@expand:
|
||||
@fill:
|
||||
@padding:
|
||||
@pack_type:
|
||||
|
||||
|
||||
@@ -1,462 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkBuilder
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Build an interface from an XML UI definition
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A GtkBuilder is an auxiliary object that reads textual descriptions
|
||||
of a user interface and instantiates the described objects. To pass a
|
||||
description to a GtkBuilder, call gtk_builder_add_from_file() or
|
||||
gtk_builder_add_from_string(). These functions can be called multiple
|
||||
times; the builder merges the content of all descriptions.
|
||||
</para>
|
||||
<para>
|
||||
A GtkBuilder holds a reference to all objects that it has constructed
|
||||
and drops these references when it is finalized. This finalization can
|
||||
cause the destruction of non-widget objects or widgets which are not
|
||||
contained in a toplevel window. For toplevel windows constructed by a
|
||||
builder, it is the responsibility of the user to call gtk_widget_destroy()
|
||||
to get rid of them and all the widgets they contain.
|
||||
</para>
|
||||
<para>
|
||||
The functions gtk_builder_get_object() and gtk_builder_get_objects()
|
||||
can be used to access the widgets in the interface by the names assigned
|
||||
to them inside the UI description. Toplevel windows returned by these
|
||||
functions will stay around until the user explicitly destroys them
|
||||
with gtk_widget_destroy(). Other widgets will either be part of a
|
||||
larger hierarchy constructed by the builder (in which case you should
|
||||
not have to worry about their lifecycle), or without a parent, in which
|
||||
case they have to be added to some container to make use of them.
|
||||
Non-widget objects need to be reffed with g_object_ref() to keep them
|
||||
beyond the lifespan of the builder.
|
||||
</para>
|
||||
<para>
|
||||
The function gtk_builder_connect_signals() and variants thereof can be
|
||||
used to connect handlers to the named signals in the description.
|
||||
</para>
|
||||
|
||||
<refsect2 id="BUILDER-UI"><title>GtkBuilder UI Definitions</title>
|
||||
<para>
|
||||
GtkBuilder parses textual descriptions of user interfaces which
|
||||
are specified in an XML format which can be roughly described
|
||||
by the DTD below. We refer to these descriptions as
|
||||
<firstterm>GtkBuilder UI definitions</firstterm> or just
|
||||
<firstterm>UI definitions</firstterm> if the context is clear.
|
||||
Do not confuse GtkBuilder UI Definitions with
|
||||
<link linkend="XML-UI">GtkUIManager UI Definitions</link>,
|
||||
which are more limited in scope.
|
||||
</para>
|
||||
<para>
|
||||
<programlisting><![CDATA[
|
||||
<!ELEMENT interface (requires|object)* >
|
||||
<!ELEMENT object (property|signal|child|ANY)* >
|
||||
<!ELEMENT property PCDATA >
|
||||
<!ELEMENT signal EMPTY >
|
||||
<!ELEMENT requires EMPTY >
|
||||
<!ELEMENT child (object|ANY*) >
|
||||
|
||||
<!ATTLIST interface domain #IMPLIED >
|
||||
<!ATTLIST object id #REQUIRED
|
||||
class #REQUIRED
|
||||
type-func #IMPLIED
|
||||
constructor #IMPLIED >
|
||||
<!ATTLIST requires lib #REQUIRED
|
||||
version #REQUIRED >
|
||||
<!ATTLIST property name #REQUIRED
|
||||
translatable #IMPLIED
|
||||
comments #IMPLIED
|
||||
context #IMPLIED >
|
||||
<!ATTLIST signal name #REQUIRED
|
||||
handler #REQUIRED
|
||||
after #IMPLIED
|
||||
swapped #IMPLIED
|
||||
object #IMPLIED
|
||||
last_modification_time #IMPLIED >
|
||||
<!ATTLIST child type #IMPLIED
|
||||
internal-child #IMPLIED >
|
||||
]]></programlisting>
|
||||
</para>
|
||||
<para>
|
||||
The toplevel element is <interface>.
|
||||
It optionally takes a "domain" attribute, which will make
|
||||
the builder look for translated strings using dgettext() in the
|
||||
domain specified. This can also be done by calling
|
||||
gtk_builder_set_translation_domain() on the builder.
|
||||
Objects are described by <object> elements, which can
|
||||
contain <property> elements to set properties, <signal>
|
||||
elements which connect signals to handlers, and <child>
|
||||
elements, which describe child objects (most often widgets
|
||||
inside a container, but also e.g. actions in an action group,
|
||||
or columns in a tree model). A <child> element contains
|
||||
an <object> element which describes the child object.
|
||||
The target toolkit version(s) are described by <requires>
|
||||
elements, the "lib" attribute specifies the widget library in
|
||||
question (currently the only supported value is "gtk+") and the "version"
|
||||
attribute specifies the target version in the form "<major>.<minor>".
|
||||
The builder will error out if the version requirements are not met.
|
||||
</para>
|
||||
<para>
|
||||
Typically, the specific kind of object represented by an
|
||||
<object> element is specified by the "class" attribute.
|
||||
If the type has not been loaded yet, GTK+ tries to find the
|
||||
<function>_get_type()</function> from the class name by applying
|
||||
heuristics. This works in most cases, but if necessary, it is
|
||||
possible to specify the name of the <function>_get_type()</function>
|
||||
explictly with the "type-func" attribute. As a special case,
|
||||
GtkBuilder allows to use an object that has been constructed
|
||||
by a #GtkUIManager in another part of the UI definition by
|
||||
specifying the id of the #GtkUIManager in the "constructor"
|
||||
attribute and the name of the object in the "id" attribute.
|
||||
</para>
|
||||
<para>
|
||||
Objects must be given a name with the "id" attribute, which
|
||||
allows the application to retrieve them from the builder with
|
||||
gtk_builder_get_object(). An id is also necessary to use the
|
||||
object as property value in other parts of the UI definition.
|
||||
</para>
|
||||
<note><para>Prior to 2.20, GtkBuilder was setting the "name"
|
||||
property of constructed widgets to the "id" attribute. In GTK+
|
||||
2.20 or newer, you have to use gtk_buildable_get_name() instead
|
||||
of gtk_widget_get_name() to obtain the "id", or set the "name"
|
||||
property in your UI definition.
|
||||
</para></note>
|
||||
<para>
|
||||
Setting properties of objects is pretty straightforward with
|
||||
the <property> element: the "name" attribute specifies
|
||||
the name of the property, and the content of the element
|
||||
specifies the value. If the "translatable" attribute is
|
||||
set to a true value, GTK+ uses gettext() (or dgettext() if
|
||||
the builder has a translation domain set) to find a translation
|
||||
for the value. This happens before the value is parsed, so
|
||||
it can be used for properties of any type, but it is probably
|
||||
most useful for string properties. It is also possible to
|
||||
specify a context to disambiguate short strings, and comments
|
||||
which may help the translators.
|
||||
</para>
|
||||
<para>
|
||||
GtkBuilder can parse textual representations for the most
|
||||
common property types: characters, strings, integers, floating-point
|
||||
numbers, booleans (strings like "TRUE", "t", "yes", "y", "1" are
|
||||
interpreted as %TRUE, strings like "FALSE, "f", "no", "n", "0" are
|
||||
interpreted as %FALSE), enumerations (can be specified by their
|
||||
name, nick or integer value), flags (can be specified by their name,
|
||||
nick, integer value, optionally combined with "|", e.g.
|
||||
"GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by
|
||||
gdk_color_parse()). Objects can be referred to by their name.
|
||||
Pixbufs can be specified as a filename of an image file to load.
|
||||
In general, GtkBuilder allows forward references to objects —
|
||||
an object doesn't have to constructed before it can be referred to.
|
||||
The exception to this rule is that an object has to be constructed
|
||||
before it can be used as the value of a construct-only property.
|
||||
</para>
|
||||
<para>
|
||||
Signal handlers are set up with the <signal> element.
|
||||
The "name" attribute specifies the name of the signal, and the
|
||||
"handler" attribute specifies the function to connect to the signal.
|
||||
By default, GTK+ tries to find the handler using g_module_symbol(),
|
||||
but this can be changed by passing a custom #GtkBuilderConnectFunc
|
||||
to gtk_builder_connect_signals_full(). The remaining attributes,
|
||||
"after", "swapped" and "object", have the same meaning as the
|
||||
corresponding parameters of the g_signal_connect_object() or
|
||||
g_signal_connect_data() functions. A "last_modification_time" attribute
|
||||
is also allowed, but it does not have a meaning to the builder.
|
||||
</para>
|
||||
<para>
|
||||
Sometimes it is necessary to refer to widgets which have implicitly
|
||||
been constructed by GTK+ as part of a composite widget, to set
|
||||
properties on them or to add further children (e.g. the @vbox
|
||||
of a #GtkDialog). This can be achieved by setting the "internal-child"
|
||||
propery of the <child> element to a true value. Note that
|
||||
GtkBuilder still requires an <object> element for the internal
|
||||
child, even if it has already been constructed.
|
||||
</para>
|
||||
<para>
|
||||
A number of widgets have different places where a child can be
|
||||
added (e.g. tabs vs. page content in notebooks). This can be reflected
|
||||
in a UI definition by specifying the "type" attribute on a <child>
|
||||
The possible values for the "type" attribute are described in
|
||||
the sections describing the widget-specific portions of UI definitions.
|
||||
</para>
|
||||
<example>
|
||||
<title>A GtkBuilder UI Definition</title>
|
||||
<programlisting><![CDATA[
|
||||
<interface>
|
||||
<object class="GtkDialog" id="dialog1">
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="border-width">10</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="border-width">20</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="ok_button">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use-stock">TRUE</property>
|
||||
<signal name="clicked" handler="ok_button_clicked"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
]]></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Beyond this general structure, several object classes define
|
||||
their own XML DTD fragments for filling in the ANY placeholders
|
||||
in the DTD above. Note that a custom element in a <child>
|
||||
element gets parsed by the custom tag handler of the parent
|
||||
object, while a custom element in an <object> element
|
||||
gets parsed by the custom tag handler of the object.
|
||||
</para>
|
||||
<para>
|
||||
These XML fragments are explained in the documentation of the
|
||||
respective objects, see
|
||||
<link linkend="GtkWidget-BUILDER-UI">GtkWidget</link>,
|
||||
<link linkend="GtkLabel-BUILDER-UI">GtkLabel</link>,
|
||||
<link linkend="GtkWindow-BUILDER-UI">GtkWindow</link>,
|
||||
<link linkend="GtkContainer-BUILDER-UI">GtkContainer</link>,
|
||||
<link linkend="GtkDialog-BUILDER-UI">GtkDialog</link>,
|
||||
<link linkend="GtkCellLayout-BUILDER-UI">GtkCellLayout</link>,
|
||||
<link linkend="GtkColorSelectionDialog-BUILDER-UI">GtkColorSelectionDialog</link>,
|
||||
<link linkend="GtkFontSelectionDialog-BUILDER-UI">GtkFontSelectionDialog</link>,
|
||||
<link linkend="GtkComboBoxEntry-BUILDER-UI">GtkComboBoxEntry</link>,
|
||||
<link linkend="GtkExpander-BUILDER-UI">GtkExpander</link>,
|
||||
<link linkend="GtkFrame-BUILDER-UI">GtkFrame</link>,
|
||||
<link linkend="GtkListStore-BUILDER-UI">GtkListStore</link>,
|
||||
<link linkend="GtkTreeStore-BUILDER-UI">GtkTreeStore</link>,
|
||||
<link linkend="GtkNotebook-BUILDER-UI">GtkNotebook</link>,
|
||||
<link linkend="GtkSizeGroup-BUILDER-UI">GtkSizeGroup</link>,
|
||||
<link linkend="GtkTreeView-BUILDER-UI">GtkTreeView</link>,
|
||||
<link linkend="GtkUIManager-BUILDER-UI">GtkUIManager</link>,
|
||||
<link linkend="GtkActionGroup-BUILDER-UI">GtkActionGroup</link>.
|
||||
<link linkend="GtkMenuItem-BUILDER-UI">GtkMenuItem</link>,
|
||||
<link linkend="GtkAssistant-BUILDER-UI">GtkAssistant</link>,
|
||||
<link linkend="GtkScale-BUILDER-UI">GtkScale</link>.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkBuilder ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkBuilder:translation-domain ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkBuilderConnectFunc ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@object:
|
||||
@signal_name:
|
||||
@handler_name:
|
||||
@connect_object:
|
||||
@flags:
|
||||
@user_data:
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkBuilderError ##### -->
|
||||
<para>
|
||||
Error codes that identify various errors that can occur while
|
||||
using #GtkBuilder.
|
||||
</para>
|
||||
|
||||
@GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: A type-func attribute didn't name
|
||||
a function that returns a #GType.
|
||||
@GTK_BUILDER_ERROR_UNHANDLED_TAG: The input contained a tag that #GtkBuilder
|
||||
can't handle.
|
||||
@GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: An attribute that is required by
|
||||
#GtkBuilder was missing.
|
||||
@GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: #GtkBuilder found an attribute that
|
||||
it doesn't understand.
|
||||
@GTK_BUILDER_ERROR_INVALID_TAG: #GtkBuilder found a tag that
|
||||
it doesn't understand.
|
||||
@GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: A required property value was
|
||||
missing.
|
||||
@GTK_BUILDER_ERROR_INVALID_VALUE: #GtkBuilder couldn't parse
|
||||
some attribute value.
|
||||
@GTK_BUILDER_ERROR_VERSION_MISMATCH: The input file requires a newer version
|
||||
of GTK+.
|
||||
@GTK_BUILDER_ERROR_DUPLICATE_ID: An object id occurred twice.
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_add_from_file ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@filename:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_add_from_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@buffer:
|
||||
@length:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_add_objects_from_file ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@filename:
|
||||
@object_ids:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_add_objects_from_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@buffer:
|
||||
@length:
|
||||
@object_ids:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_get_object ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_get_objects ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_connect_signals ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@user_data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_connect_signals_full ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@func:
|
||||
@user_data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_set_translation_domain ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@domain:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_get_translation_domain ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_get_type_from_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@type_name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_value_from_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@pspec:
|
||||
@string:
|
||||
@value:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_builder_value_from_string_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@builder:
|
||||
@type:
|
||||
@string:
|
||||
@value:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_BUILDER_WARN_INVALID_CHILD_TYPE ##### -->
|
||||
<para>
|
||||
This macro should be used to emit a warning about and unexpected
|
||||
@type value in a #GtkBuildable add_child implementation.
|
||||
</para>
|
||||
|
||||
@object: the #GtkBuildable on which the warning ocurred
|
||||
@type: the unexpected type value
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_BUILDER_ERROR ##### -->
|
||||
<para>
|
||||
The #GError quark for #GtkBuilder errors
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
@@ -6,100 +6,107 @@ Base class for widgets which contain other widgets
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A GTK+ user interface is constructed by nesting widgets inside widgets.
|
||||
Container widgets are the inner nodes in the resulting tree of widgets:
|
||||
they contain other widgets. So, for example, you might have a #GtkWindow
|
||||
containing a #GtkFrame containing a GtkLabel. If you wanted an image instead
|
||||
of a textual label inside the frame, you might replace the #GtkLabel widget
|
||||
A GTK+ user interface is constructed by nesting widgets inside widgets.
|
||||
Container widgets are the inner nodes in the resulting tree of widgets:
|
||||
they contain other widgets. So, for example, you might have a #GtkWindow
|
||||
containing a #GtkFrame containing a GtkLabel. If you wanted an image instead
|
||||
of a textual label inside the frame, you might replace the #GtkLabel widget
|
||||
with a #GtkImage widget.
|
||||
</para>
|
||||
<para>
|
||||
There are two major kinds of container widgets in GTK+. Both are subclasses
|
||||
There are two major kinds of container widgets in GTK+. Both are subclasses
|
||||
of the abstract #GtkContainer base class.
|
||||
</para>
|
||||
<para>
|
||||
The first type of container widget has a single child widget and derives
|
||||
from #GtkBin. These containers are <firstterm>decorators</firstterm>, which
|
||||
add some kind of functionality to the child. For example, a #GtkButton makes
|
||||
its child into a clickable button; a #GtkFrame draws a frame around its child
|
||||
The first type of container widget has a single child widget and derives
|
||||
from #GtkBin. These containers are <firstterm>decorators</firstterm>, which
|
||||
add some kind of functionality to the child. For example, a #GtkButton makes
|
||||
its child into a clickable button; a #GtkFrame draws a frame around its child
|
||||
and a #GtkWindow places its child widget inside a top-level window.
|
||||
</para>
|
||||
<para>
|
||||
The second type of container can have more than one child; its purpose is to
|
||||
manage <firstterm>layout</firstterm>. This means that these containers assign
|
||||
sizes and positions to their children. For example, a #GtkHBox arranges its
|
||||
children in a horizontal row, and a #GtkTable arranges the widgets it contains
|
||||
in a two-dimensional grid.
|
||||
The second type of container can have more than one child; its purpose is to
|
||||
manage <firstterm>layout</firstterm>. This means that these containers assign
|
||||
sizes and positions to their children. For example, a #GtkHBox arranges its
|
||||
children in a horizontal row, and a #GtkTable arranges the widgets it contains
|
||||
in a two-dimensional grid.
|
||||
</para>
|
||||
<para>
|
||||
To fulfill its task, a layout container must negotiate the size requirements
|
||||
with its parent and its children. This negotiation is carried out in two
|
||||
phases, <firstterm>size requisition</firstterm> and <firstterm>size
|
||||
allocation</firstterm>.
|
||||
To fulfill its task, a layout container must negotiate the size requirements
|
||||
with its parent and its children. The basic form of this negotiation is
|
||||
carried out in two phases, <firstterm>size requisition</firstterm> and
|
||||
<firstterm>size allocation</firstterm>, which are implemented by the
|
||||
size_request() and size_allocate() virtual functions in #GtkWidget.
|
||||
</para>
|
||||
<para>
|
||||
GTK+ also supports a more complicated form of size negotiation called
|
||||
<firstterm>width-for-height</firstterm> (and its dual
|
||||
<firstterm>height-for-width</firstterm>). See #GtkExtendedLayout
|
||||
to learn more about width-for-height geometry management.
|
||||
</para>
|
||||
<refsect2 id="size-requisition"><title>Size Requisition</title>
|
||||
<para>
|
||||
The size requisition of a widget is it's desired width and height.
|
||||
The size requisition of a widget is it's desired width and height.
|
||||
This is represented by a #GtkRequisition.
|
||||
</para>
|
||||
<para>
|
||||
How a widget determines its desired size depends on the widget.
|
||||
A #GtkLabel, for example, requests enough space to display all its text.
|
||||
Container widgets generally base their size request on the requisitions
|
||||
of their children.
|
||||
How a widget determines its desired size depends on the widget.
|
||||
A #GtkLabel, for example, requests enough space to display all its text.
|
||||
Container widgets generally base their size request on the requisitions
|
||||
of their children.
|
||||
</para>
|
||||
<para>
|
||||
The size requisition phase of the widget layout process operates top-down.
|
||||
It starts at a top-level widget, typically a #GtkWindow. The top-level widget
|
||||
asks its child for its size requisition by calling gtk_widget_size_request().
|
||||
To determine its requisition, the child asks its own children for their
|
||||
requisitions and so on. Finally, the top-level widget will get a requisition
|
||||
back from its child.
|
||||
The size requisition phase of the widget layout process operates top-down.
|
||||
It starts at a top-level widget, typically a #GtkWindow. The top-level widget
|
||||
asks its child for its size requisition by calling gtk_widget_size_request().
|
||||
To determine its requisition, the child asks its own children for their
|
||||
requisitions and so on. Finally, the top-level widget will get a requisition
|
||||
back from its child.
|
||||
</para>
|
||||
</refsect2>
|
||||
<refsect2 id="size-allocation"><title>Size Allocation</title>
|
||||
<para>
|
||||
When the top-level widget has determined how much space its child would like
|
||||
to have, the second phase of the size negotiation, size allocation, begins.
|
||||
Depending on its configuration (see gtk_window_set_resizable()), the top-level
|
||||
widget may be able to expand in order to satisfy the size request or it may
|
||||
have to ignore the size request and keep its fixed size. It then tells its
|
||||
child widget how much space it gets by calling gtk_widget_size_allocate().
|
||||
The child widget divides the space among its children and tells each child
|
||||
how much space it got, and so on. Under normal circumstances, a #GtkWindow
|
||||
When the top-level widget has determined how much space its child would like
|
||||
to have, the second phase of the size negotiation, size allocation, begins.
|
||||
Depending on its configuration (see gtk_window_set_resizable()), the top-level
|
||||
widget may be able to expand in order to satisfy the size request or it may
|
||||
have to ignore the size request and keep its fixed size. It then tells its
|
||||
child widget how much space it gets by calling gtk_widget_size_allocate().
|
||||
The child widget divides the space among its children and tells each child
|
||||
how much space it got, and so on. Under normal circumstances, a #GtkWindow
|
||||
will always give its child the amount of space the child requested.
|
||||
</para>
|
||||
<para>
|
||||
A child's size allocation is represented by a #GtkAllocation. This struct
|
||||
contains not only a width and height, but also a position (i.e. X and Y
|
||||
A child's size allocation is represented by a #GtkAllocation. This struct
|
||||
contains not only a width and height, but also a position (i.e. X and Y
|
||||
coordinates), so that containers can tell their children not only how much
|
||||
space they have gotten, but also where they are positioned inside the space
|
||||
available to the container.
|
||||
space they have gotten, but also where they are positioned inside the space
|
||||
available to the container.
|
||||
</para>
|
||||
<para>
|
||||
Widgets are required to honor the size allocation they receive; a size
|
||||
Widgets are required to honor the size allocation they receive; a size
|
||||
request is only a request, and widgets must be able to cope with any size.
|
||||
</para>
|
||||
</refsect2>
|
||||
<refsect2 id="child-properties"><title>Child properties</title>
|
||||
<para>
|
||||
<structname>GtkContainer</structname> introduces <firstterm>child
|
||||
<structname>GtkContainer</structname> introduces <firstterm>child
|
||||
properties</firstterm> - these are object properties that are not specific
|
||||
to either the container or the contained widget, but rather to their relation.
|
||||
Typical examples of child properties are the position or pack-type of a widget
|
||||
which is contained in a #GtkBox.</para>
|
||||
<para>
|
||||
Use gtk_container_class_install_child_property() to install child properties
|
||||
Use gtk_container_class_install_child_property() to install child properties
|
||||
for a container class and gtk_container_class_find_child_property() or
|
||||
gtk_container_class_list_child_properties() to get information about existing
|
||||
child properties.
|
||||
</para>
|
||||
<para>
|
||||
To set the value of a child property, use gtk_container_child_set_property(),
|
||||
gtk_container_child_set() or gtk_container_child_set_valist().
|
||||
To obtain the value of a child property, use
|
||||
To set the value of a child property, use gtk_container_child_set_property(),
|
||||
gtk_container_child_set() or gtk_container_child_set_valist().
|
||||
To obtain the value of a child property, use
|
||||
gtk_container_child_get_property(), gtk_container_child_get() or
|
||||
gtk_container_child_get_valist(). To emit notification about child property
|
||||
gtk_container_child_get_valist(). To emit notification about child property
|
||||
changes, use gtk_widget_child_notify().
|
||||
</para>
|
||||
</refsect2>
|
||||
@@ -107,7 +114,7 @@ changes, use gtk_widget_child_notify().
|
||||
<refsect2 id="GtkContainer-BUILDER-UI">
|
||||
<title>GtkContainer as GtkBuildable</title>
|
||||
<para>
|
||||
The GtkContainer implementation of the GtkBuildable interface
|
||||
The GtkContainer implementation of the GtkBuildable interface
|
||||
supports a <packing> element for children, which can
|
||||
contain multiple <property> elements that specify
|
||||
child properties for the child.
|
||||
@@ -152,7 +159,7 @@ for regular properties.
|
||||
</para>
|
||||
|
||||
@container: the object which received the signal.
|
||||
@widget:
|
||||
@widget:
|
||||
|
||||
<!-- ##### SIGNAL GtkContainer::check-resize ##### -->
|
||||
<para>
|
||||
@@ -167,7 +174,7 @@ for regular properties.
|
||||
</para>
|
||||
|
||||
@container: the object which received the signal.
|
||||
@widget:
|
||||
@widget:
|
||||
|
||||
<!-- ##### SIGNAL GtkContainer::set-focus-child ##### -->
|
||||
<para>
|
||||
@@ -175,7 +182,7 @@ for regular properties.
|
||||
</para>
|
||||
|
||||
@container: the object which received the signal.
|
||||
@widget:
|
||||
@widget:
|
||||
|
||||
<!-- ##### ARG GtkContainer:border-width ##### -->
|
||||
<para>
|
||||
@@ -197,7 +204,7 @@ for regular properties.
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID ##### -->
|
||||
@@ -206,7 +213,7 @@ This macro should be used to emit a standard warning about unexpected
|
||||
properties in set_child_property() and get_child_property() implementations.
|
||||
</para>
|
||||
|
||||
@object: the #GObject on which set_child_property() or get_child_property()
|
||||
@object: the #GObject on which set_child_property() or get_child_property()
|
||||
was called
|
||||
@property_id: the numeric id of the property
|
||||
@pspec: the #GParamSpec of the property
|
||||
@@ -225,8 +232,8 @@ Does the same as gtk_container_set_border_width().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@widget:
|
||||
@container:
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_remove ##### -->
|
||||
@@ -234,8 +241,8 @@ Does the same as gtk_container_set_border_width().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@widget:
|
||||
@container:
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_add_with_properties ##### -->
|
||||
@@ -243,10 +250,10 @@ Does the same as gtk_container_set_border_width().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@widget:
|
||||
@first_prop_name:
|
||||
@Varargs:
|
||||
@container:
|
||||
@widget:
|
||||
@first_prop_name:
|
||||
@Varargs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_get_resize_mode ##### -->
|
||||
@@ -254,8 +261,8 @@ Does the same as gtk_container_set_border_width().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@Returns:
|
||||
@container:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_set_resize_mode ##### -->
|
||||
@@ -263,8 +270,8 @@ Does the same as gtk_container_set_border_width().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@resize_mode:
|
||||
@container:
|
||||
@resize_mode:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_check_resize ##### -->
|
||||
@@ -272,7 +279,7 @@ Does the same as gtk_container_set_border_width().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@container:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_foreach ##### -->
|
||||
@@ -280,9 +287,9 @@ Does the same as gtk_container_set_border_width().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@callback:
|
||||
@callback_data:
|
||||
@container:
|
||||
@callback:
|
||||
@callback_data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_foreach_full ##### -->
|
||||
@@ -290,11 +297,11 @@ Does the same as gtk_container_set_border_width().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@callback:
|
||||
@marshal:
|
||||
@callback_data:
|
||||
@notify:
|
||||
@container:
|
||||
@callback:
|
||||
@marshal:
|
||||
@callback_data:
|
||||
@notify:
|
||||
@Deprecated: Use gtk_container_foreach() instead.
|
||||
|
||||
|
||||
@@ -311,8 +318,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@Returns:
|
||||
@container:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_set_reallocate_redraws ##### -->
|
||||
@@ -320,8 +327,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@needs_redraws:
|
||||
@container:
|
||||
@needs_redraws:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_get_focus_child ##### -->
|
||||
@@ -329,8 +336,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@Returns:
|
||||
@container:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_set_focus_child ##### -->
|
||||
@@ -338,8 +345,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@child:
|
||||
@container:
|
||||
@child:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_get_focus_vadjustment ##### -->
|
||||
@@ -347,8 +354,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@Returns:
|
||||
@container:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_set_focus_vadjustment ##### -->
|
||||
@@ -356,8 +363,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@adjustment:
|
||||
@container:
|
||||
@adjustment:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_get_focus_hadjustment ##### -->
|
||||
@@ -365,8 +372,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@Returns:
|
||||
@container:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_set_focus_hadjustment ##### -->
|
||||
@@ -374,8 +381,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@adjustment:
|
||||
@container:
|
||||
@adjustment:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_resize_children ##### -->
|
||||
@@ -383,7 +390,7 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@container:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_child_type ##### -->
|
||||
@@ -391,8 +398,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@Returns:
|
||||
@container:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_child_get ##### -->
|
||||
@@ -400,10 +407,10 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@child:
|
||||
@first_prop_name:
|
||||
@Varargs:
|
||||
@container:
|
||||
@child:
|
||||
@first_prop_name:
|
||||
@Varargs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_child_set ##### -->
|
||||
@@ -411,10 +418,10 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@child:
|
||||
@first_prop_name:
|
||||
@Varargs:
|
||||
@container:
|
||||
@child:
|
||||
@first_prop_name:
|
||||
@Varargs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_child_get_property ##### -->
|
||||
@@ -422,10 +429,10 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@child:
|
||||
@property_name:
|
||||
@value:
|
||||
@container:
|
||||
@child:
|
||||
@property_name:
|
||||
@value:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_child_set_property ##### -->
|
||||
@@ -433,10 +440,10 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@child:
|
||||
@property_name:
|
||||
@value:
|
||||
@container:
|
||||
@child:
|
||||
@property_name:
|
||||
@value:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_child_get_valist ##### -->
|
||||
@@ -444,10 +451,10 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@child:
|
||||
@first_property_name:
|
||||
@var_args:
|
||||
@container:
|
||||
@child:
|
||||
@first_property_name:
|
||||
@var_args:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_child_set_valist ##### -->
|
||||
@@ -455,10 +462,10 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@child:
|
||||
@first_property_name:
|
||||
@var_args:
|
||||
@container:
|
||||
@child:
|
||||
@first_property_name:
|
||||
@var_args:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_forall ##### -->
|
||||
@@ -466,9 +473,9 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@callback:
|
||||
@callback_data:
|
||||
@container:
|
||||
@callback:
|
||||
@callback_data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_get_border_width ##### -->
|
||||
@@ -476,8 +483,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@Returns:
|
||||
@container:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_set_border_width ##### -->
|
||||
@@ -485,8 +492,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@border_width:
|
||||
@container:
|
||||
@border_width:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_propagate_expose ##### -->
|
||||
@@ -494,9 +501,9 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@child:
|
||||
@event:
|
||||
@container:
|
||||
@child:
|
||||
@event:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_get_focus_chain ##### -->
|
||||
@@ -504,9 +511,9 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@focusable_widgets:
|
||||
@Returns:
|
||||
@container:
|
||||
@focusable_widgets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_set_focus_chain ##### -->
|
||||
@@ -514,8 +521,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@focusable_widgets:
|
||||
@container:
|
||||
@focusable_widgets:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_unset_focus_chain ##### -->
|
||||
@@ -523,7 +530,7 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@container:
|
||||
@container:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_class_find_child_property ##### -->
|
||||
@@ -531,9 +538,9 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@cclass:
|
||||
@property_name:
|
||||
@Returns:
|
||||
@cclass:
|
||||
@property_name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_class_install_child_property ##### -->
|
||||
@@ -541,9 +548,9 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@cclass:
|
||||
@property_id:
|
||||
@pspec:
|
||||
@cclass:
|
||||
@property_id:
|
||||
@pspec:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_class_list_child_properties ##### -->
|
||||
@@ -551,8 +558,8 @@ Does the same as gtk_container_get_children().
|
||||
|
||||
</para>
|
||||
|
||||
@cclass:
|
||||
@n_properties:
|
||||
@Returns:
|
||||
@cclass:
|
||||
@n_properties:
|
||||
@Returns:
|
||||
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ the clipboard. Only labels that contain useful-to-copy information
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<refsect2 id="label-text-layout">
|
||||
<title>Text layout</title>
|
||||
|
||||
<para>
|
||||
@@ -155,11 +155,23 @@ Labels can automatically wrap text if you call
|
||||
gtk_label_set_line_wrap().
|
||||
</para>
|
||||
<para>
|
||||
gtk_label_set_justify() sets how the lines in a label align
|
||||
with one another. If you want to set how the label as a whole
|
||||
gtk_label_set_justify() sets how the lines in a label align
|
||||
with one another. If you want to set how the label as a whole
|
||||
aligns in its available space, see gtk_misc_set_alignment().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The #GtkLabel:width-chars and #GtkLabel:max-width-chars properties
|
||||
can be used to control the size allocation of ellipsized or wrapped
|
||||
labels. For ellipsizing labels, if either is specified (and less
|
||||
than the actual text size), it is used as the minimum width, and the actual
|
||||
text size is used as the natural width of the label. For wrapping labels,
|
||||
width-chars is used as the minimum width, if specified, and max-width-chars
|
||||
is used as the natural width. Even if max-width-chars specified, wrapping
|
||||
labels will be rewrapped to use all of the available width.
|
||||
</para>
|
||||
<note><para>Note that the interpretation of #GtkLabel:width-chars and
|
||||
#GtkLabel:max-width-chars has changed a bit with the introduction of
|
||||
width-for-height geometry management and #GtkExtendedLayout.</para></note>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
|
||||
@@ -412,6 +412,16 @@ compatibility reasons.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_get_indices_with_depth ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@depth:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_free ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -4,11 +4,10 @@ CC = gcc
|
||||
CFLAGS = -Wall \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
-DGDK_PIXBUF_DISABLE_DEPRECATED \
|
||||
-DGTK_DISABLE_DEPRECATED
|
||||
-DGDK_PIXBUF_DISABLE_DEPRECATED
|
||||
|
||||
scribble-xinput: scribble-xinput.c
|
||||
$(CC) scribble-xinput.c -o scribble-xinput $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
|
||||
$(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0` scribble-xinput.c -o scribble-xinput $(LDFLAGS) `pkg-config --libs gtk+-2.0`
|
||||
|
||||
clean:
|
||||
rm -f *.o scribble-xinput
|
||||
|
||||
@@ -221,9 +221,13 @@ gdk_pixbuf_loader_set_size (GdkPixbufLoader *loader,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkPixbufLoaderPrivate *priv = GDK_PIXBUF_LOADER (loader)->priv;
|
||||
GdkPixbufLoaderPrivate *priv;
|
||||
|
||||
g_return_if_fail (GDK_IS_PIXBUF_LOADER (loader));
|
||||
g_return_if_fail (width >= 0 && height >= 0);
|
||||
|
||||
priv = GDK_PIXBUF_LOADER (loader)->priv;
|
||||
|
||||
if (!priv->size_fixed)
|
||||
{
|
||||
priv->width = width;
|
||||
|
||||
@@ -212,6 +212,7 @@ gtk_public_h_sources = \
|
||||
gtkenums.h \
|
||||
gtkeventbox.h \
|
||||
gtkexpander.h \
|
||||
gtkextendedlayout.h \
|
||||
gtkfilechooser.h \
|
||||
gtkfilechooserbutton.h \
|
||||
gtkfilechooserdialog.h \
|
||||
@@ -251,6 +252,8 @@ gtk_public_h_sources = \
|
||||
gtkmenu.h \
|
||||
gtkmenubar.h \
|
||||
gtkmenuitem.h \
|
||||
gtkmenuproxy.h \
|
||||
gtkmenuproxymodule.h \
|
||||
gtkmenushell.h \
|
||||
gtkmenutoolbutton.h \
|
||||
gtkmessagedialog.h \
|
||||
@@ -466,6 +469,7 @@ gtk_base_c_sources = \
|
||||
gtkentrycompletion.c \
|
||||
gtkeventbox.c \
|
||||
gtkexpander.c \
|
||||
gtkextendedlayout.c \
|
||||
gtkfilechooser.c \
|
||||
gtkfilechooserbutton.c \
|
||||
gtkfilechooserdefault.c \
|
||||
@@ -518,6 +522,8 @@ gtk_base_c_sources = \
|
||||
gtkmenu.c \
|
||||
gtkmenubar.c \
|
||||
gtkmenuitem.c \
|
||||
gtkmenuproxy.c \
|
||||
gtkmenuproxymodule.c \
|
||||
gtkmenushell.c \
|
||||
gtkmenutoolbutton.c \
|
||||
gtkmessagedialog.c \
|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
#include <gtk/gtkcellview.h>
|
||||
#include <gtk/gtkcheckbutton.h>
|
||||
#include <gtk/gtkcheckmenuitem.h>
|
||||
#include <gtk/gtkmenuproxy.h>
|
||||
#include <gtk/gtkmenuproxymodule.h>
|
||||
#include <gtk/gtkclipboard.h>
|
||||
#include <gtk/gtkcolorbutton.h>
|
||||
#include <gtk/gtkcolorsel.h>
|
||||
@@ -83,6 +85,7 @@
|
||||
#include <gtk/gtkenums.h>
|
||||
#include <gtk/gtkeventbox.h>
|
||||
#include <gtk/gtkexpander.h>
|
||||
#include <gtk/gtkextendedlayout.h>
|
||||
#include <gtk/gtkfixed.h>
|
||||
#include <gtk/gtkfilechooser.h>
|
||||
#include <gtk/gtkfilechooserbutton.h>
|
||||
|
||||
@@ -1504,6 +1504,18 @@ gtk_expander_set_use_underline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GTK_EXTENDED_LAYOUT_H__)
|
||||
#if IN_FILE(__GTK_EXTENDED_LAYOUT_C__)
|
||||
gtk_extended_layout_get_type G_GNUC_CONST
|
||||
gtk_extended_layout_get_desired_height
|
||||
gtk_extended_layout_get_desired_size
|
||||
gtk_extended_layout_get_desired_width
|
||||
gtk_extended_layout_get_height_for_width
|
||||
gtk_extended_layout_get_width_for_height
|
||||
gtk_extended_layout_is_height_for_width
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GTK_FILE_CHOOSER_H__)
|
||||
#if IN_FILE(__GTK_FILE_CHOOSER_C__)
|
||||
gtk_file_chooser_add_filter
|
||||
@@ -1965,6 +1977,7 @@ gtk_icon_info_get_filename_utf8
|
||||
#endif
|
||||
gtk_icon_info_get_type G_GNUC_CONST
|
||||
gtk_icon_info_load_icon
|
||||
gtk_icon_info_load_symbolic
|
||||
gtk_icon_info_set_raw_coordinates
|
||||
gtk_icon_theme_add_builtin_icon
|
||||
#ifndef _WIN64
|
||||
@@ -4658,6 +4671,7 @@ gtk_tree_path_down
|
||||
gtk_tree_path_free
|
||||
gtk_tree_path_get_depth
|
||||
gtk_tree_path_get_indices
|
||||
gtk_tree_path_get_indices_with_depth
|
||||
gtk_tree_path_get_type G_GNUC_CONST
|
||||
gtk_tree_path_is_ancestor
|
||||
gtk_tree_path_is_descendant
|
||||
@@ -5169,6 +5183,7 @@ gtk_widget_modify_cursor
|
||||
gtk_widget_modify_font
|
||||
gtk_widget_modify_style
|
||||
gtk_widget_modify_text
|
||||
gtk_widget_modify_symbolic_color
|
||||
gtk_widget_new
|
||||
gtk_widget_path
|
||||
gtk_widget_pop_colormap
|
||||
|
||||
+112
-40
@@ -45,6 +45,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkalignment.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkalias.h"
|
||||
@@ -73,8 +74,6 @@ struct _GtkAlignmentPrivate
|
||||
guint padding_right;
|
||||
};
|
||||
|
||||
static void gtk_alignment_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static void gtk_alignment_set_property (GObject *object,
|
||||
@@ -86,7 +85,17 @@ static void gtk_alignment_get_property (GObject *object,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
G_DEFINE_TYPE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN)
|
||||
static void gtk_alignment_extended_layout_init (GtkExtendedLayoutIface *iface);
|
||||
static void gtk_alignment_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_alignment_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
|
||||
gtk_alignment_extended_layout_init))
|
||||
|
||||
static void
|
||||
gtk_alignment_class_init (GtkAlignmentClass *class)
|
||||
@@ -100,7 +109,6 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
|
||||
gobject_class->set_property = gtk_alignment_set_property;
|
||||
gobject_class->get_property = gtk_alignment_get_property;
|
||||
|
||||
widget_class->size_request = gtk_alignment_size_request;
|
||||
widget_class->size_allocate = gtk_alignment_size_allocate;
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
@@ -462,34 +470,6 @@ gtk_alignment_set (GtkAlignment *alignment,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_alignment_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkBin *bin;
|
||||
GtkAlignmentPrivate *priv;
|
||||
|
||||
bin = GTK_BIN (widget);
|
||||
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
|
||||
|
||||
requisition->width = GTK_CONTAINER (widget)->border_width * 2;
|
||||
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
|
||||
requisition->width += child_requisition.width;
|
||||
requisition->height += child_requisition.height;
|
||||
|
||||
/* Request extra space for the padding: */
|
||||
requisition->width += (priv->padding_left + priv->padding_right);
|
||||
requisition->height += (priv->padding_top + priv->padding_bottom);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
@@ -497,7 +477,6 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
GtkAlignment *alignment;
|
||||
GtkBin *bin;
|
||||
GtkAllocation child_allocation;
|
||||
GtkRequisition child_requisition;
|
||||
gint width, height;
|
||||
gint border_width;
|
||||
gint padding_horizontal, padding_vertical;
|
||||
@@ -512,7 +491,10 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
gtk_widget_get_child_requisition (bin->child, &child_requisition);
|
||||
GtkExtendedLayout *layout = GTK_EXTENDED_LAYOUT (bin->child);
|
||||
gint child_nat_width;
|
||||
gint child_nat_height;
|
||||
gint child_width, child_height;
|
||||
|
||||
border_width = GTK_CONTAINER (alignment)->border_width;
|
||||
|
||||
@@ -522,16 +504,37 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
|
||||
width = MAX (1, allocation->width - padding_horizontal - 2 * border_width);
|
||||
height = MAX (1, allocation->height - padding_vertical - 2 * border_width);
|
||||
|
||||
if (width > child_requisition.width)
|
||||
child_allocation.width = (child_requisition.width *
|
||||
|
||||
if (gtk_extended_layout_is_height_for_width (layout))
|
||||
{
|
||||
gtk_extended_layout_get_desired_width (layout, NULL, &child_nat_width);
|
||||
|
||||
child_width = MIN (width, child_nat_width);
|
||||
|
||||
gtk_extended_layout_get_height_for_width (layout, child_width, NULL, &child_nat_height);
|
||||
|
||||
child_height = MIN (height, child_nat_height);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_extended_layout_get_desired_height (layout, NULL, &child_nat_height);
|
||||
|
||||
child_height = MIN (height, child_nat_height);
|
||||
|
||||
gtk_extended_layout_get_width_for_height (layout, child_height, NULL, &child_nat_width);
|
||||
|
||||
child_width = MIN (width, child_nat_width);
|
||||
}
|
||||
|
||||
if (width > child_width)
|
||||
child_allocation.width = (child_width *
|
||||
(1.0 - alignment->xscale) +
|
||||
width * alignment->xscale);
|
||||
else
|
||||
child_allocation.width = width;
|
||||
|
||||
if (height > child_requisition.height)
|
||||
child_allocation.height = (child_requisition.height *
|
||||
|
||||
if (height > child_height)
|
||||
child_allocation.height = (child_height *
|
||||
(1.0 - alignment->yscale) +
|
||||
height * alignment->yscale);
|
||||
else
|
||||
@@ -548,6 +551,75 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_alignment_extended_layout_init (GtkExtendedLayoutIface *iface)
|
||||
{
|
||||
iface->get_desired_width = gtk_alignment_get_desired_width;
|
||||
iface->get_desired_height = gtk_alignment_get_desired_height;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_alignment_get_desired_size (GtkExtendedLayout *layout,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkWidget *child;
|
||||
GtkAlignmentPrivate *priv;
|
||||
gint minimum, natural;
|
||||
|
||||
priv = GTK_ALIGNMENT_GET_PRIVATE (layout);
|
||||
|
||||
natural = minimum = GTK_CONTAINER (layout)->border_width * 2;
|
||||
|
||||
if ((child = gtk_bin_get_child (GTK_BIN (layout))) && gtk_widget_get_visible (child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
|
||||
/* Request extra space for the padding: */
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
minimum += (priv->padding_left + priv->padding_right);
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child),
|
||||
&child_min, &child_nat);
|
||||
}
|
||||
else
|
||||
{
|
||||
minimum += (priv->padding_top + priv->padding_bottom);
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child),
|
||||
&child_min, &child_nat);
|
||||
}
|
||||
|
||||
natural = minimum;
|
||||
|
||||
minimum += child_min;
|
||||
natural += child_nat;
|
||||
}
|
||||
|
||||
if (minimum_size)
|
||||
*minimum_size = minimum;
|
||||
|
||||
if (natural_size)
|
||||
*natural_size = natural;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_alignment_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_alignment_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_alignment_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_alignment_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_alignment_set_padding:
|
||||
* @alignment: a #GtkAlignment
|
||||
|
||||
+10
-5
@@ -1167,13 +1167,14 @@ gtk_assistant_size_request (GtkWidget *widget,
|
||||
requisition->height = height;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_assistant_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkAssistant *assistant = GTK_ASSISTANT (widget);
|
||||
GtkAssistantPrivate *priv = assistant->priv;
|
||||
GtkRequisition header_requisition;
|
||||
GtkRequisition header_requisition, action_requisition, sidebar_requisition;
|
||||
GtkAllocation child_allocation, header_allocation;
|
||||
gint header_padding, content_padding;
|
||||
gboolean rtl;
|
||||
@@ -1200,24 +1201,28 @@ gtk_assistant_size_allocate (GtkWidget *widget,
|
||||
gtk_widget_size_allocate (priv->header_image, &header_allocation);
|
||||
|
||||
/* Action area */
|
||||
gtk_widget_get_child_requisition (priv->action_area, &action_requisition);
|
||||
|
||||
child_allocation.x = GTK_CONTAINER (widget)->border_width;
|
||||
child_allocation.y = allocation->height -
|
||||
GTK_CONTAINER (widget)->border_width - priv->action_area->requisition.height;
|
||||
GTK_CONTAINER (widget)->border_width - action_requisition.height;
|
||||
child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width;
|
||||
child_allocation.height = priv->action_area->requisition.height;
|
||||
child_allocation.height = action_requisition.height;
|
||||
|
||||
gtk_widget_size_allocate (priv->action_area, &child_allocation);
|
||||
|
||||
/* Sidebar */
|
||||
gtk_widget_get_child_requisition (priv->sidebar_image, &sidebar_requisition);
|
||||
|
||||
if (rtl)
|
||||
child_allocation.x = allocation->width -
|
||||
GTK_CONTAINER (widget)->border_width - priv->sidebar_image->requisition.width;
|
||||
GTK_CONTAINER (widget)->border_width - sidebar_requisition.width;
|
||||
else
|
||||
child_allocation.x = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
child_allocation.y = GTK_CONTAINER (widget)->border_width +
|
||||
priv->header_image->allocation.height + 2 * header_padding;
|
||||
child_allocation.width = priv->sidebar_image->requisition.width;
|
||||
child_allocation.width = sidebar_requisition.width;
|
||||
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
|
||||
priv->header_image->allocation.height - 2 * header_padding - priv->action_area->allocation.height;
|
||||
|
||||
|
||||
@@ -24,6 +24,34 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:gtkbbox
|
||||
* @Short_description: Base class for GtkHButtonBox and GtkVButtonBox
|
||||
* @Title: GtkButtonBox
|
||||
* @See_also: #GtkVButtonBox, #GtkHButtonBox
|
||||
*
|
||||
* The primary purpose of this class is to keep track of the various properties
|
||||
* of #GtkHButtonBox and #GtkVButtonBox widgets.
|
||||
*
|
||||
* gtk_button_box_get_child_size() retrieves the minimum width and height
|
||||
* for widgets in a given button box.
|
||||
*
|
||||
* The internal padding of buttons can be retrieved and changed per button box
|
||||
* using gtk_button_box_get_child_ipadding() and
|
||||
* gtk_button_box_set_child_ipadding() respectively.
|
||||
*
|
||||
* gtk_button_box_get_spacing() and gtk_button_box_set_spacing() retrieve and
|
||||
* change default number of pixels between buttons, respectively.
|
||||
*
|
||||
* gtk_button_box_get_layout() and gtk_button_box_set_layout() retrieve and
|
||||
* alter the method used to spread the buttons in a button box across the
|
||||
* container, respectively.
|
||||
*
|
||||
* The main purpose of GtkButtonBox is to make sure the children have all the
|
||||
* same size. Therefore it ignores the homogeneous property which it inherited
|
||||
* from GtkBox, and always behaves as if homogeneous was %TRUE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkbbox.h"
|
||||
#include "gtkhbbox.h"
|
||||
@@ -236,6 +264,21 @@ gtk_button_box_get_child_property (GtkContainer *container,
|
||||
|
||||
/* set per widget values for spacing, child size and child internal padding */
|
||||
|
||||
/**
|
||||
* gtk_button_box_set_child_size:
|
||||
* @widget: a #GtkButtonBox
|
||||
* @min_width: a default width for buttons in @widget
|
||||
* @min_height: a default height for buttons in @widget
|
||||
*
|
||||
* Sets a new default size for the children of a given button box.
|
||||
*
|
||||
* Deprecated: This is not supported anymore and can only be set through the
|
||||
* theme changing the style properties:
|
||||
* "<link linkend="GtkButtonBox--s-child-min-width">child-min-width</link>"
|
||||
* and
|
||||
* "<link linkend="GtkButtonBox--s-child-min-height">child-min-height</link>"
|
||||
* instead.
|
||||
*/
|
||||
void
|
||||
gtk_button_box_set_child_size (GtkButtonBox *widget,
|
||||
gint width, gint height)
|
||||
@@ -246,6 +289,18 @@ gtk_button_box_set_child_size (GtkButtonBox *widget,
|
||||
widget->child_min_height = height;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_button_box_set_child_ipadding:
|
||||
* @widget: a #GtkButtonBox
|
||||
* @ipad_x: the horizontal padding that should be used by each button in @widget
|
||||
* @ipad_y: the vertical padding that should be used by each button in @widget
|
||||
*
|
||||
* Changes the amount of internal padding used by all buttons in a given button
|
||||
* box.
|
||||
*
|
||||
* Deprecated: Use the style properties
|
||||
* <literal>"child-internal-pad-x/-y"</literal> instead.
|
||||
*/
|
||||
void
|
||||
gtk_button_box_set_child_ipadding (GtkButtonBox *widget,
|
||||
gint ipad_x, gint ipad_y)
|
||||
@@ -256,6 +311,13 @@ gtk_button_box_set_child_ipadding (GtkButtonBox *widget,
|
||||
widget->child_ipad_y = ipad_y;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_button_box_set_layout:
|
||||
* @widget: a #GtkButtonBox
|
||||
* @layout_style: the new layout style
|
||||
*
|
||||
* Changes the way buttons are arranged in their container.
|
||||
*/
|
||||
void
|
||||
gtk_button_box_set_layout (GtkButtonBox *widget,
|
||||
GtkButtonBoxStyle layout_style)
|
||||
@@ -275,6 +337,18 @@ gtk_button_box_set_layout (GtkButtonBox *widget,
|
||||
|
||||
/* get per widget values for spacing, child size and child internal padding */
|
||||
|
||||
/**
|
||||
* gtk_button_box_get_child_size:
|
||||
* @widget: a #GtkButtonBox
|
||||
* @min_width: the width of the buttons contained by @widget
|
||||
* @min_height: the height of the buttons contained by @widget
|
||||
*
|
||||
* Retrieves the current width and height of all child widgets in a button box.
|
||||
* @min_width and @min_height are filled with those values, respectively.
|
||||
*
|
||||
* Deprecated: Use the style properties
|
||||
* <literal>"child-min-width/-height"</literal> instead.
|
||||
*/
|
||||
void
|
||||
gtk_button_box_get_child_size (GtkButtonBox *widget,
|
||||
gint *width, gint *height)
|
||||
@@ -287,6 +361,20 @@ gtk_button_box_get_child_size (GtkButtonBox *widget,
|
||||
*height = widget->child_min_height;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_button_box_get_child_ipadding:
|
||||
* @widget: a #GtkButtonBox
|
||||
* @ipad_x: the horizontal padding used by buttons in @widget
|
||||
* @ipad_y: the vertical padding used by buttons in @widget
|
||||
*
|
||||
* Gets the default number of pixels that pad the buttons in a given button box.
|
||||
*
|
||||
* Deprecated: Use the style properties
|
||||
* "<link linkend="GtkButtonBox--s-child-internal-pad-x">child-internal-pad-x</link>"
|
||||
* and
|
||||
* "<link linkend="GtkButtonBox--s-child-internal-pad-y">child-internal-pad-y</link>"
|
||||
* instead.
|
||||
*/
|
||||
void
|
||||
gtk_button_box_get_child_ipadding (GtkButtonBox *widget,
|
||||
gint* ipad_x, gint *ipad_y)
|
||||
@@ -299,6 +387,14 @@ gtk_button_box_get_child_ipadding (GtkButtonBox *widget,
|
||||
*ipad_y = widget->child_ipad_y;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_button_box_get_layout:
|
||||
* @widget: a #GtkButtonBox
|
||||
*
|
||||
* Retrieves the method being used to arrange the buttons in a button box.
|
||||
*
|
||||
* Returns: the method used to layout buttons in @widget.
|
||||
*/
|
||||
GtkButtonBoxStyle
|
||||
gtk_button_box_get_layout (GtkButtonBox *widget)
|
||||
{
|
||||
|
||||
@@ -77,7 +77,26 @@ void gtk_button_box_set_child_secondary (GtkButtonBox *widget,
|
||||
gboolean is_secondary);
|
||||
|
||||
#ifndef GTK_DISABLE_DEPRECATED
|
||||
/**
|
||||
* gtk_button_box_set_spacing:
|
||||
* @b: a #GtkButtonBox
|
||||
* @s: the number of pixels of spacing
|
||||
*
|
||||
* Sets the amount of spacing between buttons in a given button box.
|
||||
*
|
||||
* Deprecated: Use gtk_box_set_spacing() instead.
|
||||
*/
|
||||
#define gtk_button_box_set_spacing(b,s) gtk_box_set_spacing (GTK_BOX (b), s)
|
||||
|
||||
/**
|
||||
* gtk_button_box_get_spacing:
|
||||
* @b: a #GtkButtonBox
|
||||
*
|
||||
* Retrieves how much space a button box is placing between each child button.
|
||||
*
|
||||
* Deprecated: Use gtk_box_get_spacing() instead.
|
||||
* Returns: the current spacing applied to the buttons in @widget
|
||||
*/
|
||||
#define gtk_button_box_get_spacing(b) gtk_box_get_spacing (GTK_BOX (b))
|
||||
|
||||
void gtk_button_box_set_child_size (GtkButtonBox *widget,
|
||||
|
||||
+120
-1
@@ -39,6 +39,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkbin.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
@@ -53,7 +54,22 @@ static void gtk_bin_forall (GtkContainer *container,
|
||||
static GType gtk_bin_child_type (GtkContainer *container);
|
||||
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER)
|
||||
static void gtk_bin_extended_layout_init (GtkExtendedLayoutIface *iface);
|
||||
static gboolean gtk_bin_is_height_for_width (GtkExtendedLayout *layout);
|
||||
static void gtk_bin_get_width_for_height (GtkExtendedLayout *layout,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
static void gtk_bin_get_height_for_width (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
|
||||
static GtkExtendedLayoutIface *parent_extended_layout_iface;
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
|
||||
gtk_bin_extended_layout_init))
|
||||
|
||||
static void
|
||||
gtk_bin_class_init (GtkBinClass *class)
|
||||
@@ -141,6 +157,109 @@ gtk_bin_forall (GtkContainer *container,
|
||||
(* callback) (bin->child, callback_data);
|
||||
}
|
||||
|
||||
|
||||
/* GtkBin widgets define the padding and borders independantly so
|
||||
* we cannot provide a generic get_desired_size() for the same reason
|
||||
* we never implemented size_request() here.
|
||||
*
|
||||
* But for cases where the GtkBin class's padding is constant and
|
||||
* does not vary based on allocation (most cases), we can at least
|
||||
* deduce a common code path for the get_width_for_height()/get_height_for_width()
|
||||
* cases by using the delta of the base size requsts.
|
||||
*/
|
||||
static void
|
||||
gtk_bin_extended_layout_init (GtkExtendedLayoutIface *iface)
|
||||
{
|
||||
parent_extended_layout_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
iface->is_height_for_width = gtk_bin_is_height_for_width;
|
||||
iface->get_width_for_height = gtk_bin_get_width_for_height;
|
||||
iface->get_height_for_width = gtk_bin_get_height_for_width;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_bin_is_height_for_width (GtkExtendedLayout *layout)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (layout);
|
||||
|
||||
if (bin->child)
|
||||
return gtk_extended_layout_is_height_for_width (GTK_EXTENDED_LAYOUT (bin->child));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
get_child_padding_delta (GtkBin *bin,
|
||||
gint *delta_h,
|
||||
gint *delta_v)
|
||||
{
|
||||
gint hmin, vmin, child_hmin, child_vmin;
|
||||
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin), &hmin, NULL);
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin), &vmin, NULL);
|
||||
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child), &child_hmin, NULL);
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child), &child_vmin, NULL);
|
||||
|
||||
*delta_h = hmin - child_hmin;
|
||||
*delta_v = vmin - child_vmin;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_bin_get_width_for_height (GtkExtendedLayout *layout,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (layout);
|
||||
gint hdelta, vdelta, child_min, child_nat;
|
||||
|
||||
if (bin->child)
|
||||
{
|
||||
get_child_padding_delta (bin, &hdelta, &vdelta);
|
||||
|
||||
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (bin->child),
|
||||
height - vdelta,
|
||||
&child_min, &child_nat);
|
||||
|
||||
if (minimum_width)
|
||||
*minimum_width = child_min + hdelta;
|
||||
|
||||
if (natural_width)
|
||||
*natural_width = child_nat + hdelta;
|
||||
}
|
||||
else
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_bin_get_height_for_width (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (layout);
|
||||
gint hdelta, vdelta, child_min, child_nat;
|
||||
|
||||
if (bin->child)
|
||||
{
|
||||
get_child_padding_delta (bin, &hdelta, &vdelta);
|
||||
|
||||
gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child),
|
||||
width - hdelta,
|
||||
&child_min, &child_nat);
|
||||
|
||||
if (minimum_height)
|
||||
*minimum_height = child_min + vdelta;
|
||||
|
||||
if (natural_height)
|
||||
*natural_height = child_nat + vdelta;
|
||||
}
|
||||
else
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_bin_get_child:
|
||||
* @bin: a #GtkBin
|
||||
|
||||
+773
-293
File diff suppressed because it is too large
Load Diff
@@ -65,6 +65,28 @@ struct _GtkBoxClass
|
||||
GtkContainerClass parent_class;
|
||||
};
|
||||
|
||||
/**
|
||||
* GtkBoxChild:
|
||||
* @widget: the child widget, packed into the GtkBox.
|
||||
* @padding: the number of extra pixels to put between this child and its
|
||||
* neighbors, set when packed, zero by default.
|
||||
* @expand: flag indicates whether extra space should be given to this child.
|
||||
* Any extra space given to the parent GtkBox is divided up among all children
|
||||
* with this attribute set to %TRUE; set when packed, %TRUE by default.
|
||||
* @fill: flag indicates whether any extra space given to this child due to its
|
||||
* @expand attribute being set is actually allocated to the child, rather than
|
||||
* being used as padding around the widget; set when packed, %TRUE by default.
|
||||
* @pack: one of #GtkPackType indicating whether the child is packed with
|
||||
* reference to the start (top/left) or end (bottom/right) of the GtkBox.
|
||||
* @is_secondary: %TRUE if the child is secondary
|
||||
*
|
||||
* The #GtkBoxChild holds a child widget of #GtkBox and describes how the child
|
||||
* is to be packed into the #GtkBox. All fields of this #GtkBoxChild should be
|
||||
* considered read-only and they should never be set directly by an application.
|
||||
* Use gtk_box_query_child_packing() and gtk_box_set_child_packing() to query
|
||||
* and set the #GtkBoxChild.padding, #GtkBoxChild.expand, #GtkBoxChild.fill and
|
||||
* #GtkBoxChild.pack fields.
|
||||
*/
|
||||
struct _GtkBoxChild
|
||||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
@@ -20,6 +20,224 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:gtkbuilder
|
||||
* @Short_description: Build an interface from an XML UI definition
|
||||
* @Title: GtkBuilder
|
||||
*
|
||||
* A GtkBuilder is an auxiliary object that reads textual descriptions
|
||||
* of a user interface and instantiates the described objects. To pass a
|
||||
* description to a GtkBuilder, call gtk_builder_add_from_file() or
|
||||
* gtk_builder_add_from_string(). These functions can be called multiple
|
||||
* times; the builder merges the content of all descriptions.
|
||||
*
|
||||
* A GtkBuilder holds a reference to all objects that it has constructed
|
||||
* and drops these references when it is finalized. This finalization can
|
||||
* cause the destruction of non-widget objects or widgets which are not
|
||||
* contained in a toplevel window. For toplevel windows constructed by a
|
||||
* builder, it is the responsibility of the user to call gtk_widget_destroy()
|
||||
* to get rid of them and all the widgets they contain.
|
||||
*
|
||||
* The functions gtk_builder_get_object() and gtk_builder_get_objects()
|
||||
* can be used to access the widgets in the interface by the names assigned
|
||||
* to them inside the UI description. Toplevel windows returned by these
|
||||
* functions will stay around until the user explicitly destroys them
|
||||
* with gtk_widget_destroy(). Other widgets will either be part of a
|
||||
* larger hierarchy constructed by the builder (in which case you should
|
||||
* not have to worry about their lifecycle), or without a parent, in which
|
||||
* case they have to be added to some container to make use of them.
|
||||
* Non-widget objects need to be reffed with g_object_ref() to keep them
|
||||
* beyond the lifespan of the builder.
|
||||
*
|
||||
* The function gtk_builder_connect_signals() and variants thereof can be
|
||||
* used to connect handlers to the named signals in the description.
|
||||
*
|
||||
* <refsect2 id="BUILDER-UI">
|
||||
* <title>GtkBuilder UI Definitions</title>
|
||||
* <para>
|
||||
* GtkBuilder parses textual descriptions of user interfaces which are specified
|
||||
* in an XML format which can be roughly described by the DTD below. We refer to
|
||||
* these descriptions as <firstterm>GtkBuilder UI definitions</firstterm> or
|
||||
* just <firstterm>UI definitions</firstterm> if the context is clear. Do not
|
||||
* confuse GtkBuilder UI Definitions with
|
||||
* <link linkend="XML-UI">GtkUIManager UI Definitions</link>, which are more
|
||||
* limited in scope.
|
||||
* </para>
|
||||
* <programlisting><![CDATA[
|
||||
* <!ELEMENT interface (requires|object)* >
|
||||
* <!ELEMENT object (property|signal|child|ANY)* >
|
||||
* <!ELEMENT property PCDATA >
|
||||
* <!ELEMENT signal EMPTY >
|
||||
* <!ELEMENT requires EMPTY >
|
||||
* <!ELEMENT child (object|ANY*) >
|
||||
*
|
||||
* <!ATTLIST interface domain #IMPLIED >
|
||||
* <!ATTLIST object id #REQUIRED
|
||||
* class #REQUIRED
|
||||
* type-func #IMPLIED
|
||||
* constructor #IMPLIED >
|
||||
* <!ATTLIST requires lib #REQUIRED
|
||||
* version #REQUIRED >
|
||||
* <!ATTLIST property name #REQUIRED
|
||||
* translatable #IMPLIED
|
||||
* comments #IMPLIED
|
||||
* context #IMPLIED >
|
||||
* <!ATTLIST signal name #REQUIRED
|
||||
* handler #REQUIRED
|
||||
* after #IMPLIED
|
||||
* swapped #IMPLIED
|
||||
* object #IMPLIED
|
||||
* last_modification_time #IMPLIED >
|
||||
* <!ATTLIST child type #IMPLIED
|
||||
* internal-child #IMPLIED >
|
||||
* ]]></programlisting>
|
||||
* <para>
|
||||
* The toplevel element is <interface>. It optionally takes a "domain"
|
||||
* attribute, which will make the builder look for translated strings using
|
||||
* dgettext() in the domain specified. This can also be done by calling
|
||||
* gtk_builder_set_translation_domain() on the builder. Objects are described by
|
||||
* <object> elements, which can contain <property> elements to set
|
||||
* properties, <signal> elements which connect signals to handlers, and
|
||||
* <child> elements, which describe child objects (most often widgets
|
||||
* inside a container, but also e.g. actions in an action group, or columns in a
|
||||
* tree model). A <child> element contains an <object> element which
|
||||
* describes the child object. The target toolkit version(s) are described by
|
||||
* <requires> elements, the "lib" attribute specifies the widget library
|
||||
* in question (currently the only supported value is "gtk+") and the "version"
|
||||
* attribute specifies the target version in the form
|
||||
* "<major>.<minor>". The builder will error out if the version
|
||||
* requirements are not met.
|
||||
*
|
||||
* Typically, the specific kind of object represented by an <object>
|
||||
* element is specified by the "class" attribute. If the type has not been
|
||||
* loaded yet, GTK+ tries to find the <function>_get_type()</function> from the
|
||||
* class name by applying heuristics. This works in most cases, but if
|
||||
* necessary, it is possible to specify the name of the
|
||||
* <function>_get_type()</function> explictly with the "type-func" attribute.
|
||||
* As a special case, GtkBuilder allows to use an object that has been
|
||||
* constructed by a #GtkUIManager in another part of the UI definition by
|
||||
* specifying the id of the #GtkUIManager in the "constructor" attribute and the
|
||||
* name of the object in the "id" attribute.
|
||||
*
|
||||
* Objects must be given a name with the "id" attribute, which allows the
|
||||
* application to retrieve them from the builder with gtk_builder_get_object().
|
||||
* An id is also necessary to use the object as property value in other parts of
|
||||
* the UI definition.
|
||||
* </para>
|
||||
* <note><para>
|
||||
* Prior to 2.20, GtkBuilder was setting the "name" property of constructed widgets to the
|
||||
* "id" attribute. In GTK+ 2.20 or newer, you have to use gtk_buildable_get_name() instead
|
||||
* of gtk_widget_get_name() to obtain the "id", or set the "name" property in your UI
|
||||
* definition.
|
||||
* </para></note>
|
||||
* <para>
|
||||
* Setting properties of objects is pretty straightforward with the
|
||||
* <property> element: the "name" attribute specifies the name of the
|
||||
* property, and the content of the element specifies the value. If the
|
||||
* "translatable" attribute is set to a true value, GTK+ uses gettext() (or
|
||||
* dgettext() if the builder has a translation domain set) to find a translation
|
||||
* for the value. This happens before the value is parsed, so it can be used for
|
||||
* properties of any type, but it is probably most useful for string properties.
|
||||
* It is also possible to specify a context to disambiguate short strings, and
|
||||
* comments which may help the translators.
|
||||
*
|
||||
* GtkBuilder can parse textual representations for the most common property
|
||||
* types: characters, strings, integers, floating-point numbers, booleans
|
||||
* (strings like "TRUE", "t", "yes", "y", "1" are interpreted as %TRUE, strings
|
||||
* like "FALSE, "f", "no", "n", "0" are interpreted as %FALSE), enumerations
|
||||
* (can be specified by their name, nick or integer value), flags (can be
|
||||
* specified by their name, nick, integer value, optionally combined with "|",
|
||||
* e.g. "GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by
|
||||
* gdk_color_parse()). Objects can be referred to by their name. Pixbufs can be
|
||||
* specified as a filename of an image file to load. In general, GtkBuilder
|
||||
* allows forward references to objects — an object doesn't have to be
|
||||
* constructed before it can be referred to. The exception to this rule is that
|
||||
* an object has to be constructed before it can be used as the value of a
|
||||
* construct-only property.
|
||||
*
|
||||
* Signal handlers are set up with the <signal> element. The "name"
|
||||
* attribute specifies the name of the signal, and the "handler" attribute
|
||||
* specifies the function to connect to the signal. By default, GTK+ tries to
|
||||
* find the handler using g_module_symbol(), but this can be changed by passing
|
||||
* a custom #GtkBuilderConnectFunc to gtk_builder_connect_signals_full(). The
|
||||
* remaining attributes, "after", "swapped" and "object", have the same meaning
|
||||
* as the corresponding parameters of the g_signal_connect_object() or
|
||||
* g_signal_connect_data() functions. A "last_modification_time" attribute
|
||||
* is also allowed, but it does not have a meaning to the builder.
|
||||
*
|
||||
* Sometimes it is necessary to refer to widgets which have implicitly been
|
||||
* constructed by GTK+ as part of a composite widget, to set properties on them
|
||||
* or to add further children (e.g. the @vbox of a #GtkDialog). This can be
|
||||
* achieved by setting the "internal-child" propery of the <child> element
|
||||
* to a true value. Note that GtkBuilder still requires an <object>
|
||||
* element for the internal child, even if it has already been constructed.
|
||||
*
|
||||
* A number of widgets have different places where a child can be added (e.g.
|
||||
* tabs vs. page content in notebooks). This can be reflected in a UI definition
|
||||
* by specifying the "type" attribute on a <child>. The possible values
|
||||
* for the "type" attribute are described in the sections describing the
|
||||
* widget-specific portions of UI definitions.
|
||||
* </para>
|
||||
* <example>
|
||||
* <title>A GtkBuilder UI Definition</title>
|
||||
* <programlisting><![CDATA[
|
||||
* <interface>
|
||||
* <object class="GtkDialog" id="dialog1">
|
||||
* <child internal-child="vbox">
|
||||
* <object class="GtkVBox" id="vbox1">
|
||||
* <property name="border-width">10</property>
|
||||
* <child internal-child="action_area">
|
||||
* <object class="GtkHButtonBox" id="hbuttonbox1">
|
||||
* <property name="border-width">20</property>
|
||||
* <child>
|
||||
* <object class="GtkButton" id="ok_button">
|
||||
* <property name="label">gtk-ok</property>
|
||||
* <property name="use-stock">TRUE</property>
|
||||
* <signal name="clicked" handler="ok_button_clicked"/>
|
||||
* </object>
|
||||
* </child>
|
||||
* </object>
|
||||
* </child>
|
||||
* </object>
|
||||
* </child>
|
||||
* </object>
|
||||
* </interface>
|
||||
* ]]></programlisting>
|
||||
* </example>
|
||||
* <para>
|
||||
* Beyond this general structure, several object classes define their own XML
|
||||
* DTD fragments for filling in the ANY placeholders in the DTD above. Note that
|
||||
* a custom element in a <child> element gets parsed by the custom tag
|
||||
* handler of the parent object, while a custom element in an <object>
|
||||
* element gets parsed by the custom tag handler of the object.
|
||||
*
|
||||
* These XML fragments are explained in the documentation of the respective
|
||||
* objects, see
|
||||
* <link linkend="GtkWidget-BUILDER-UI">GtkWidget</link>,
|
||||
* <link linkend="GtkLabel-BUILDER-UI">GtkLabel</link>,
|
||||
* <link linkend="GtkWindow-BUILDER-UI">GtkWindow</link>,
|
||||
* <link linkend="GtkContainer-BUILDER-UI">GtkContainer</link>,
|
||||
* <link linkend="GtkDialog-BUILDER-UI">GtkDialog</link>,
|
||||
* <link linkend="GtkCellLayout-BUILDER-UI">GtkCellLayout</link>,
|
||||
* <link linkend="GtkColorSelectionDialog-BUILDER-UI">GtkColorSelectionDialog</link>,
|
||||
* <link linkend="GtkFontSelectionDialog-BUILDER-UI">GtkFontSelectionDialog</link>,
|
||||
* <link linkend="GtkComboBoxEntry-BUILDER-UI">GtkComboBoxEntry</link>,
|
||||
* <link linkend="GtkExpander-BUILDER-UI">GtkExpander</link>,
|
||||
* <link linkend="GtkFrame-BUILDER-UI">GtkFrame</link>,
|
||||
* <link linkend="GtkListStore-BUILDER-UI">GtkListStore</link>,
|
||||
* <link linkend="GtkTreeStore-BUILDER-UI">GtkTreeStore</link>,
|
||||
* <link linkend="GtkNotebook-BUILDER-UI">GtkNotebook</link>,
|
||||
* <link linkend="GtkSizeGroup-BUILDER-UI">GtkSizeGroup</link>,
|
||||
* <link linkend="GtkTreeView-BUILDER-UI">GtkTreeView</link>,
|
||||
* <link linkend="GtkUIManager-BUILDER-UI">GtkUIManager</link>,
|
||||
* <link linkend="GtkActionGroup-BUILDER-UI">GtkActionGroup</link>.
|
||||
* <link linkend="GtkMenuItem-BUILDER-UI">GtkMenuItem</link>,
|
||||
* <link linkend="GtkAssistant-BUILDER-UI">GtkAssistant</link>,
|
||||
* <link linkend="GtkScale-BUILDER-UI">GtkScale</link>.
|
||||
* </para>
|
||||
* </refsect2>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <errno.h> /* errno */
|
||||
#include <stdlib.h> /* strtol, strtoul */
|
||||
|
||||
@@ -43,6 +43,29 @@ typedef struct _GtkBuilder GtkBuilder;
|
||||
typedef struct _GtkBuilderClass GtkBuilderClass;
|
||||
typedef struct _GtkBuilderPrivate GtkBuilderPrivate;
|
||||
|
||||
/**
|
||||
* GtkBuilderError:
|
||||
* @GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: A type-func attribute didn't name
|
||||
* a function that returns a #GType.
|
||||
* @GTK_BUILDER_ERROR_UNHANDLED_TAG: The input contained a tag that #GtkBuilder
|
||||
* can't handle.
|
||||
* @GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: An attribute that is required by
|
||||
* #GtkBuilder was missing.
|
||||
* @GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: #GtkBuilder found an attribute that
|
||||
* it doesn't understand.
|
||||
* @GTK_BUILDER_ERROR_INVALID_TAG: #GtkBuilder found a tag that
|
||||
* it doesn't understand.
|
||||
* @GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: A required property value was
|
||||
* missing.
|
||||
* @GTK_BUILDER_ERROR_INVALID_VALUE: #GtkBuilder couldn't parse
|
||||
* some attribute value.
|
||||
* @GTK_BUILDER_ERROR_VERSION_MISMATCH: The input file requires a newer version
|
||||
* of GTK+.
|
||||
* @GTK_BUILDER_ERROR_DUPLICATE_ID: An object id occurred twice.
|
||||
*
|
||||
* Error codes that identify various errors that can occur while using
|
||||
* #GtkBuilder.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
|
||||
@@ -135,6 +158,14 @@ gboolean gtk_builder_value_from_string_type (GtkBuilder *builder,
|
||||
GValue *value,
|
||||
GError **error);
|
||||
|
||||
/**
|
||||
* GTK_BUILDER_WARN_INVALID_CHILD_TYPE:
|
||||
* @object: the #GtkBuildable on which the warning ocurred
|
||||
* @type: the unexpected type value
|
||||
*
|
||||
* This macro should be used to emit a warning about and unexpected @type value
|
||||
* in a #GtkBuildable add_child implementation.
|
||||
*/
|
||||
#define GTK_BUILDER_WARN_INVALID_CHILD_TYPE(object, type) \
|
||||
g_warning ("'%s' is not a valid child type of '%s'", type, g_type_name (G_OBJECT_TYPE (object)))
|
||||
|
||||
|
||||
+102
-48
@@ -37,6 +37,7 @@
|
||||
#include "gtkstock.h"
|
||||
#include "gtkiconfactory.h"
|
||||
#include "gtkactivatable.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkalias.h"
|
||||
@@ -111,8 +112,6 @@ static void gtk_button_unrealize (GtkWidget * widget);
|
||||
static void gtk_button_map (GtkWidget * widget);
|
||||
static void gtk_button_unmap (GtkWidget * widget);
|
||||
static void gtk_button_style_set (GtkWidget * widget, GtkStyle * prev_style);
|
||||
static void gtk_button_size_request (GtkWidget * widget,
|
||||
GtkRequisition * requisition);
|
||||
static void gtk_button_size_allocate (GtkWidget * widget,
|
||||
GtkAllocation * allocation);
|
||||
static gint gtk_button_expose (GtkWidget * widget, GdkEventExpose * event);
|
||||
@@ -148,7 +147,7 @@ static void gtk_button_grab_notify (GtkWidget *widget,
|
||||
gboolean was_grabbed);
|
||||
|
||||
|
||||
static void gtk_button_activatable_interface_init (GtkActivatableIface *iface);
|
||||
static void gtk_button_activatable_interface_init(GtkActivatableIface *iface);
|
||||
static void gtk_button_update (GtkActivatable *activatable,
|
||||
GtkAction *action,
|
||||
const gchar *property_name);
|
||||
@@ -159,11 +158,21 @@ static void gtk_button_set_related_action (GtkButton *button,
|
||||
static void gtk_button_set_use_action_appearance (GtkButton *button,
|
||||
gboolean use_appearance);
|
||||
|
||||
static void gtk_button_extended_layout_init (GtkExtendedLayoutIface *iface);
|
||||
static void gtk_button_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_button_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
|
||||
static guint button_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkButton, gtk_button, GTK_TYPE_BIN,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
|
||||
gtk_button_activatable_interface_init))
|
||||
gtk_button_activatable_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
|
||||
gtk_button_extended_layout_init))
|
||||
|
||||
static void
|
||||
gtk_button_class_init (GtkButtonClass *klass)
|
||||
@@ -191,7 +200,6 @@ gtk_button_class_init (GtkButtonClass *klass)
|
||||
widget_class->map = gtk_button_map;
|
||||
widget_class->unmap = gtk_button_unmap;
|
||||
widget_class->style_set = gtk_button_style_set;
|
||||
widget_class->size_request = gtk_button_size_request;
|
||||
widget_class->size_allocate = gtk_button_size_allocate;
|
||||
widget_class->expose_event = gtk_button_expose;
|
||||
widget_class->button_press_event = gtk_button_button_press;
|
||||
@@ -1331,49 +1339,6 @@ gtk_button_get_props (GtkButton *button,
|
||||
if (interior_focus)
|
||||
gtk_widget_style_get (widget, "interior-focus", interior_focus, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON (widget);
|
||||
GtkBorder default_border;
|
||||
GtkBorder inner_border;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
|
||||
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
|
||||
gtk_widget_style_get (GTK_WIDGET (widget),
|
||||
"focus-line-width", &focus_width,
|
||||
"focus-padding", &focus_pad,
|
||||
NULL);
|
||||
|
||||
requisition->width = ((GTK_CONTAINER (widget)->border_width +
|
||||
GTK_WIDGET (widget)->style->xthickness) * 2 +
|
||||
inner_border.left + inner_border.right);
|
||||
requisition->height = ((GTK_CONTAINER (widget)->border_width +
|
||||
GTK_WIDGET (widget)->style->ythickness) * 2 +
|
||||
inner_border.top + inner_border.bottom);
|
||||
|
||||
if (gtk_widget_get_can_default (widget))
|
||||
{
|
||||
requisition->width += default_border.left + default_border.right;
|
||||
requisition->height += default_border.top + default_border.bottom;
|
||||
}
|
||||
|
||||
if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
|
||||
{
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
gtk_widget_size_request (GTK_BIN (button)->child, &child_requisition);
|
||||
|
||||
requisition->width += child_requisition.width;
|
||||
requisition->height += child_requisition.height;
|
||||
}
|
||||
|
||||
requisition->width += 2 * (focus_width + focus_pad);
|
||||
requisition->height += 2 * (focus_width + focus_pad);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_size_allocate (GtkWidget *widget,
|
||||
@@ -1803,6 +1768,95 @@ gtk_button_finish_activate (GtkButton *button,
|
||||
gtk_button_clicked (button);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_button_extended_layout_init (GtkExtendedLayoutIface *iface)
|
||||
{
|
||||
iface->get_desired_width = gtk_button_get_desired_width;
|
||||
iface->get_desired_height = gtk_button_get_desired_height;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_get_desired_size (GtkExtendedLayout *layout,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON (layout);
|
||||
GtkWidget *child;
|
||||
GtkBorder default_border;
|
||||
GtkBorder inner_border;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
gint minimum, natural;
|
||||
|
||||
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
|
||||
gtk_widget_style_get (GTK_WIDGET (layout),
|
||||
"focus-line-width", &focus_width,
|
||||
"focus-padding", &focus_pad,
|
||||
NULL);
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
minimum = ((GTK_CONTAINER (layout)->border_width +
|
||||
GTK_WIDGET (layout)->style->xthickness) * 2 +
|
||||
inner_border.left + inner_border.right);
|
||||
|
||||
if (gtk_widget_get_can_default (GTK_WIDGET (layout)))
|
||||
minimum += default_border.left + default_border.right;
|
||||
}
|
||||
else
|
||||
{
|
||||
minimum = ((GTK_CONTAINER (layout)->border_width +
|
||||
GTK_WIDGET (layout)->style->ythickness) * 2 +
|
||||
inner_border.top + inner_border.bottom);
|
||||
|
||||
if (gtk_widget_get_can_default (GTK_WIDGET (layout)))
|
||||
minimum += default_border.top + default_border.bottom;
|
||||
}
|
||||
|
||||
minimum += 2 * (focus_width + focus_pad);
|
||||
natural = minimum;
|
||||
|
||||
if ((child = gtk_bin_get_child (GTK_BIN (button))) &&
|
||||
gtk_widget_get_visible (child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child),
|
||||
&child_min, &child_nat);
|
||||
else
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child),
|
||||
&child_min, &child_nat);
|
||||
|
||||
minimum += child_min;
|
||||
natural += child_nat;
|
||||
}
|
||||
|
||||
if (minimum_size)
|
||||
*minimum_size = minimum;
|
||||
|
||||
if (natural_size)
|
||||
*natural_size = natural;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_button_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_button_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_button_set_label:
|
||||
* @button: a #GtkButton
|
||||
|
||||
+140
-19
@@ -497,6 +497,7 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkSettings *settings;
|
||||
gint width, height;
|
||||
GtkIconInfo *info;
|
||||
|
||||
priv = GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE (cellpixbuf);
|
||||
|
||||
@@ -519,29 +520,140 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf
|
||||
}
|
||||
|
||||
if (priv->icon_name)
|
||||
cellpixbuf->pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
||||
priv->icon_name,
|
||||
MIN (width, height),
|
||||
GTK_ICON_LOOKUP_USE_BUILTIN,
|
||||
NULL);
|
||||
info = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
priv->icon_name,
|
||||
MIN (width, height),
|
||||
GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
else if (priv->gicon)
|
||||
{
|
||||
GtkIconInfo *info;
|
||||
info = gtk_icon_theme_lookup_by_gicon (icon_theme,
|
||||
priv->gicon,
|
||||
MIN (width, height),
|
||||
GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
else
|
||||
info = NULL;
|
||||
|
||||
info = gtk_icon_theme_lookup_by_gicon (icon_theme,
|
||||
priv->gicon,
|
||||
MIN (width, height),
|
||||
GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
if (info)
|
||||
{
|
||||
cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, NULL);
|
||||
gtk_icon_info_free (info);
|
||||
}
|
||||
if (info)
|
||||
{
|
||||
GdkColor error_color, warning_color, success_color;
|
||||
GdkColor *error_ptr, *warning_ptr, *success_ptr;
|
||||
GtkStyle *style;
|
||||
|
||||
style = gtk_widget_get_style (GTK_WIDGET (widget));
|
||||
if (!gtk_style_lookup_color (style, "error_color", &error_color))
|
||||
error_ptr = NULL;
|
||||
else
|
||||
error_ptr = &error_color;
|
||||
if (!gtk_style_lookup_color (style, "warning_color", &warning_color))
|
||||
warning_ptr = NULL;
|
||||
else
|
||||
warning_ptr = &warning_color;
|
||||
if (!gtk_style_lookup_color (style, "success_color", &success_color))
|
||||
success_ptr = NULL;
|
||||
else
|
||||
success_ptr = &success_color;
|
||||
|
||||
cellpixbuf->pixbuf = gtk_icon_info_load_symbolic (info,
|
||||
&style->fg[GTK_STATE_NORMAL],
|
||||
success_ptr,
|
||||
warning_ptr,
|
||||
error_ptr,
|
||||
NULL,
|
||||
NULL);
|
||||
gtk_icon_info_free (info);
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (cellpixbuf), "pixbuf");
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
create_symbolic_pixbuf (GtkCellRendererPixbuf *cellpixbuf,
|
||||
GtkWidget *widget,
|
||||
GdkColor *fg)
|
||||
{
|
||||
GtkCellRendererPixbufPrivate *priv;
|
||||
GdkScreen *screen;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkSettings *settings;
|
||||
gint width, height;
|
||||
GtkIconInfo *info;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
priv = GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE (cellpixbuf);
|
||||
|
||||
/* Not a named symbolic icon? */
|
||||
if (priv->icon_name) {
|
||||
if (!g_str_has_suffix (priv->icon_name, "-symbolic"))
|
||||
return NULL;
|
||||
} else if (priv->gicon) {
|
||||
const gchar * const *names;
|
||||
if (!G_IS_THEMED_ICON (priv->gicon))
|
||||
return NULL;
|
||||
names = g_themed_icon_get_names (G_THEMED_ICON (priv->gicon));
|
||||
if (names == NULL || !g_str_has_suffix (names[0], "-symbolic"))
|
||||
return NULL;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (widget));
|
||||
icon_theme = gtk_icon_theme_get_for_screen (screen);
|
||||
settings = gtk_settings_get_for_screen (screen);
|
||||
|
||||
if (!gtk_icon_size_lookup_for_settings (settings,
|
||||
priv->stock_size,
|
||||
&width, &height))
|
||||
{
|
||||
g_warning ("Invalid icon size %u\n", priv->stock_size);
|
||||
width = height = 24;
|
||||
}
|
||||
|
||||
|
||||
if (priv->icon_name)
|
||||
info = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
priv->icon_name,
|
||||
MIN (width, height),
|
||||
GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
else if (priv->gicon)
|
||||
info = gtk_icon_theme_lookup_by_gicon (icon_theme,
|
||||
priv->gicon,
|
||||
MIN (width, height),
|
||||
GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
else
|
||||
return NULL;
|
||||
|
||||
if (info)
|
||||
{
|
||||
GdkColor error_color, warning_color, success_color;
|
||||
GdkColor *error_ptr, *warning_ptr, *success_ptr;
|
||||
GtkStyle *style;
|
||||
|
||||
style = gtk_widget_get_style (GTK_WIDGET (widget));
|
||||
if (!gtk_style_lookup_color (style, "error_color", &error_color))
|
||||
error_ptr = NULL;
|
||||
else
|
||||
error_ptr = &error_color;
|
||||
if (!gtk_style_lookup_color (style, "warning_color", &warning_color))
|
||||
warning_ptr = NULL;
|
||||
else
|
||||
warning_ptr = &warning_color;
|
||||
if (!gtk_style_lookup_color (style, "success_color", &success_color))
|
||||
success_ptr = NULL;
|
||||
else
|
||||
success_ptr = &success_color;
|
||||
|
||||
pixbuf = gtk_icon_info_load_symbolic (info,
|
||||
fg,
|
||||
success_ptr,
|
||||
warning_ptr,
|
||||
error_ptr,
|
||||
NULL,
|
||||
NULL);
|
||||
gtk_icon_info_free (info);
|
||||
return pixbuf;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
create_colorized_pixbuf (GdkPixbuf *src,
|
||||
GdkColor *new_color)
|
||||
@@ -678,6 +790,7 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
|
||||
GdkPixbuf *pixbuf;
|
||||
GdkPixbuf *invisible = NULL;
|
||||
GdkPixbuf *colorized = NULL;
|
||||
GdkPixbuf *symbolic = NULL;
|
||||
GdkRectangle pix_rect;
|
||||
GdkRectangle draw_rect;
|
||||
cairo_t *cr;
|
||||
@@ -755,10 +868,15 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
|
||||
else
|
||||
state = GTK_STATE_PRELIGHT;
|
||||
|
||||
colorized = create_colorized_pixbuf (pixbuf,
|
||||
&widget->style->base[state]);
|
||||
symbolic = create_symbolic_pixbuf (cellpixbuf, widget, &widget->style->fg[state]);
|
||||
if (!symbolic) {
|
||||
colorized = create_colorized_pixbuf (pixbuf,
|
||||
&widget->style->base[state]);
|
||||
|
||||
pixbuf = colorized;
|
||||
pixbuf = colorized;
|
||||
} else {
|
||||
pixbuf = symbolic;
|
||||
}
|
||||
}
|
||||
|
||||
cr = gdk_cairo_create (window);
|
||||
@@ -774,6 +892,9 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
|
||||
|
||||
if (colorized)
|
||||
g_object_unref (colorized);
|
||||
|
||||
if (symbolic)
|
||||
g_object_unref (symbolic);
|
||||
}
|
||||
|
||||
#define __GTK_CELL_RENDERER_PIXBUF_C__
|
||||
|
||||
@@ -1370,6 +1370,9 @@ _gtk_container_queue_resize (GtkContainer *container)
|
||||
{
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED);
|
||||
|
||||
if ((resize_container && widget == GTK_WIDGET (resize_container)) ||
|
||||
!widget->parent)
|
||||
break;
|
||||
|
||||
+13
-12
@@ -36,18 +36,19 @@
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef enum {
|
||||
GTK_DEBUG_MISC = 1 << 0,
|
||||
GTK_DEBUG_PLUGSOCKET = 1 << 1,
|
||||
GTK_DEBUG_TEXT = 1 << 2,
|
||||
GTK_DEBUG_TREE = 1 << 3,
|
||||
GTK_DEBUG_UPDATES = 1 << 4,
|
||||
GTK_DEBUG_KEYBINDINGS = 1 << 5,
|
||||
GTK_DEBUG_MULTIHEAD = 1 << 6,
|
||||
GTK_DEBUG_MODULES = 1 << 7,
|
||||
GTK_DEBUG_GEOMETRY = 1 << 8,
|
||||
GTK_DEBUG_ICONTHEME = 1 << 9,
|
||||
GTK_DEBUG_PRINTING = 1 << 10,
|
||||
GTK_DEBUG_BUILDER = 1 << 11
|
||||
GTK_DEBUG_MISC = 1 << 0,
|
||||
GTK_DEBUG_PLUGSOCKET = 1 << 1,
|
||||
GTK_DEBUG_TEXT = 1 << 2,
|
||||
GTK_DEBUG_TREE = 1 << 3,
|
||||
GTK_DEBUG_UPDATES = 1 << 4,
|
||||
GTK_DEBUG_KEYBINDINGS = 1 << 5,
|
||||
GTK_DEBUG_MULTIHEAD = 1 << 6,
|
||||
GTK_DEBUG_MODULES = 1 << 7,
|
||||
GTK_DEBUG_GEOMETRY = 1 << 8,
|
||||
GTK_DEBUG_ICONTHEME = 1 << 9,
|
||||
GTK_DEBUG_PRINTING = 1 << 10,
|
||||
GTK_DEBUG_BUILDER = 1 << 11,
|
||||
GTK_DEBUG_EXTENDED_LAYOUT = 1 << 12,
|
||||
} GtkDebugFlag;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
@@ -0,0 +1,535 @@
|
||||
/* gtkextendedlayout.c
|
||||
* Copyright (C) 2007-2010 Openismus GmbH
|
||||
*
|
||||
* Authors:
|
||||
* Mathias Hasselmann <mathias@openismus.com>
|
||||
* Tristan Van Berkom <tristan.van.berkom@gmail.com>
|
||||
*
|
||||
* 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, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* SECTION:gtkextendedlayout
|
||||
* @Short_Description: Height-for-width geometry management
|
||||
* @Title: GtkExtendedLayout
|
||||
*
|
||||
* The extended layout is GTK+'s height-for-width (and width-for-height)
|
||||
* geometry management system. Height-for-width means that a widget can
|
||||
* change how much vertical space it needs, depending on the amount
|
||||
* of horizontal space that it is given (and similar for width-for-height).
|
||||
* The most common example is a label that reflows to fill up the available
|
||||
* width, wraps to fewer lines, and therefore needs less height.
|
||||
*
|
||||
* GTK+'s traditional two-pass <link linkend="size-allocation">size-allocation</link>
|
||||
* algorithm does not allow this flexibility. #GtkWidget provides a default
|
||||
* implementation of the #GtkExtendedLayout interface for existing widgets,
|
||||
* which always requests the same height, regardless of the available width.
|
||||
*
|
||||
* <refsect2>
|
||||
* <title>Implementing GtkExtendedLayout</title>
|
||||
* <para>
|
||||
* Some important things to keep in mind when implementing
|
||||
* or using the extended layout.
|
||||
*
|
||||
* The Extended Layout system will query a logical hierarchy in
|
||||
* only one orientation at a time. When widgets are initially queried
|
||||
* for their minimum sizes it is generally done in a dual pass
|
||||
* in the direction chosen by the toplevel.
|
||||
*
|
||||
* For instance when queried in the normal height-for-width mode:
|
||||
* First the default minimum and natural width for each widget
|
||||
* in the interface will computed and collectively returned to
|
||||
* the toplevel by way of gtk_extended_layout_get_desired_width().
|
||||
* Next, the toplevel will use the minimum width to query for the
|
||||
* minimum height contextual to that width using
|
||||
* gtk_extended_layout_get_height_for_width(), which will also be a
|
||||
* highly recursive operation. This minimum-for-minimum size can be
|
||||
* used to set the minimum size constraint on the toplevel.
|
||||
*
|
||||
* When allocating, each container can use the minimum and natural
|
||||
* sizes reported by their children to allocate natural sizes and
|
||||
* expose as much content as possible with the given allocation.
|
||||
*
|
||||
* That means that the request operation at allocation time will
|
||||
* usually fire again in contexts of different allocated sizes than
|
||||
* the ones originally queried for. #GtkExtendedLayout caches a
|
||||
* small number of results to avoid re-querying for the same
|
||||
* allocated size in one allocation cycle.
|
||||
*
|
||||
* A widget that does not actually do height-for-width
|
||||
* or width-for-height size negotiations only has to implement
|
||||
* get_desired_width() and get_desired_height().
|
||||
*
|
||||
* If a widget does move content around to smartly use up the
|
||||
* allocated size, then it must support the request properly in
|
||||
* both orientations; even if the request only makes sense in
|
||||
* one orientation.
|
||||
*
|
||||
* For instance, a GtkLabel that does height-for-width word wrapping
|
||||
* will not expect to have get_desired_height() called because that
|
||||
* call is specific to a width-for-height request, in this case the
|
||||
* label must return the heights contextual to its minimum possible
|
||||
* width. By following this rule any widget that handles height-for-width
|
||||
* or width-for-height requests will always be allocated at least
|
||||
* enough space to fit its own content.
|
||||
* </para>
|
||||
* </refsect2>
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtksizegroup.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
/* With extended layout, a widget may be requested
|
||||
* its width for 2 or maximum 3 heights in one resize
|
||||
*/
|
||||
#define N_CACHED_SIZES 3
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guint age;
|
||||
gint for_size;
|
||||
gint minimum_size;
|
||||
gint natural_size;
|
||||
} DesiredSize;
|
||||
|
||||
typedef struct {
|
||||
DesiredSize desired_widths[N_CACHED_SIZES];
|
||||
DesiredSize desired_heights[N_CACHED_SIZES];
|
||||
guint8 cached_width_age;
|
||||
guint8 cached_height_age;
|
||||
} ExtendedLayoutCache;
|
||||
|
||||
static GQuark quark_cache = 0;
|
||||
|
||||
|
||||
GType
|
||||
gtk_extended_layout_get_type (void)
|
||||
{
|
||||
static GType extended_layout_type = 0;
|
||||
|
||||
if (G_UNLIKELY(!extended_layout_type))
|
||||
{
|
||||
extended_layout_type =
|
||||
g_type_register_static_simple (G_TYPE_INTERFACE, I_("GtkExtendedLayout"),
|
||||
sizeof (GtkExtendedLayoutIface),
|
||||
NULL, 0, NULL, 0);
|
||||
|
||||
g_type_interface_add_prerequisite (extended_layout_type, GTK_TYPE_WIDGET);
|
||||
|
||||
quark_cache = g_quark_from_static_string ("gtk-extended-layout-cache");
|
||||
}
|
||||
|
||||
return extended_layout_type;
|
||||
}
|
||||
|
||||
/* looks for a cached size request for this for_size. If not
|
||||
* found, returns the oldest entry so it can be overwritten
|
||||
*
|
||||
* Note that this caching code was directly derived from
|
||||
* the Clutter toolkit.
|
||||
*/
|
||||
static gboolean
|
||||
get_cached_desired_size (gint for_size,
|
||||
DesiredSize *cached_sizes,
|
||||
DesiredSize **result)
|
||||
{
|
||||
guint i;
|
||||
|
||||
*result = &cached_sizes[0];
|
||||
|
||||
for (i = 0; i < N_CACHED_SIZES; i++)
|
||||
{
|
||||
DesiredSize *cs;
|
||||
|
||||
cs = &cached_sizes[i];
|
||||
|
||||
if (cs->age > 0 && cs->for_size == for_size)
|
||||
{
|
||||
*result = cs;
|
||||
return TRUE;
|
||||
}
|
||||
else if (cs->age < (*result)->age)
|
||||
{
|
||||
*result = cs;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_cache (ExtendedLayoutCache *cache)
|
||||
{
|
||||
g_slice_free (ExtendedLayoutCache, cache);
|
||||
}
|
||||
|
||||
static ExtendedLayoutCache *
|
||||
get_cache (GtkExtendedLayout *layout,
|
||||
gboolean create)
|
||||
{
|
||||
ExtendedLayoutCache *cache;
|
||||
|
||||
cache = g_object_get_qdata (G_OBJECT (layout), quark_cache);
|
||||
if (!cache && create)
|
||||
{
|
||||
cache = g_slice_new0 (ExtendedLayoutCache);
|
||||
|
||||
cache->cached_width_age = 1;
|
||||
cache->cached_height_age = 1;
|
||||
|
||||
g_object_set_qdata_full (G_OBJECT (layout), quark_cache, cache,
|
||||
(GDestroyNotify)destroy_cache);
|
||||
}
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
do_size_request (GtkWidget *widget)
|
||||
{
|
||||
if (GTK_WIDGET_REQUEST_NEEDED (widget))
|
||||
{
|
||||
gtk_widget_ensure_style (widget);
|
||||
GTK_PRIVATE_UNSET_FLAG (widget, GTK_REQUEST_NEEDED);
|
||||
g_signal_emit_by_name (widget,
|
||||
"size-request",
|
||||
&widget->requisition);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
compute_size_for_orientation (GtkExtendedLayout *layout,
|
||||
GtkSizeGroupMode orientation,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
ExtendedLayoutCache *cache;
|
||||
DesiredSize *cached_size;
|
||||
GtkWidget *widget;
|
||||
gboolean found_in_cache = FALSE;
|
||||
|
||||
g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (layout));
|
||||
g_return_if_fail (minimum_size != NULL || natural_size != NULL);
|
||||
|
||||
widget = GTK_WIDGET (layout);
|
||||
cache = get_cache (layout, TRUE);
|
||||
|
||||
if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
|
||||
{
|
||||
cached_size = &cache->desired_widths[0];
|
||||
|
||||
if (!GTK_WIDGET_WIDTH_REQUEST_NEEDED (layout))
|
||||
found_in_cache = get_cached_desired_size (for_size, cache->desired_widths, &cached_size);
|
||||
else
|
||||
{
|
||||
memset (cache->desired_widths, 0, N_CACHED_SIZES * sizeof (DesiredSize));
|
||||
cache->cached_width_age = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cached_size = &cache->desired_heights[0];
|
||||
|
||||
if (!GTK_WIDGET_HEIGHT_REQUEST_NEEDED (layout))
|
||||
found_in_cache = get_cached_desired_size (for_size, cache->desired_heights, &cached_size);
|
||||
else
|
||||
{
|
||||
memset (cache->desired_heights, 0, N_CACHED_SIZES * sizeof (DesiredSize));
|
||||
cache->cached_height_age = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found_in_cache)
|
||||
{
|
||||
gint min_size = 0, nat_size = 0;
|
||||
gint group_size, requisition_size;
|
||||
|
||||
/* Unconditional size request runs but is often unhandled. */
|
||||
do_size_request (widget);
|
||||
|
||||
if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
|
||||
{
|
||||
requisition_size = widget->requisition.width;
|
||||
|
||||
if (for_size < 0)
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, &min_size, &nat_size);
|
||||
else
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_width_for_height (layout, for_size, &min_size, &nat_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
requisition_size = widget->requisition.height;
|
||||
|
||||
if (for_size < 0)
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, &min_size, &nat_size);
|
||||
else
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_height_for_width (layout, for_size, &min_size, &nat_size);
|
||||
}
|
||||
|
||||
/* Support for dangling "size-request" signals and forward derived
|
||||
* classes that will not default to a ->get_desired_width() that
|
||||
* returns the values in the ->requisition cache.
|
||||
*/
|
||||
min_size = MAX (min_size, requisition_size);
|
||||
nat_size = MAX (nat_size, requisition_size);
|
||||
|
||||
cached_size->minimum_size = min_size;
|
||||
cached_size->natural_size = nat_size;
|
||||
cached_size->for_size = for_size;
|
||||
|
||||
if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
|
||||
{
|
||||
cached_size->age = cache->cached_width_age;
|
||||
cache->cached_width_age++;
|
||||
|
||||
GTK_PRIVATE_UNSET_FLAG (layout, GTK_WIDTH_REQUEST_NEEDED);
|
||||
}
|
||||
else
|
||||
{
|
||||
cached_size->age = cache->cached_height_age;
|
||||
cache->cached_height_age++;
|
||||
|
||||
GTK_PRIVATE_UNSET_FLAG (layout, GTK_HEIGHT_REQUEST_NEEDED);
|
||||
}
|
||||
|
||||
/* Get size groups to compute the base requisition once one
|
||||
* of the values have been cached, then go ahead and update
|
||||
* the cache with the sizegroup computed value.
|
||||
*
|
||||
* Note this is also where values from gtk_widget_set_size_request()
|
||||
* are considered.
|
||||
*/
|
||||
group_size =
|
||||
_gtk_size_group_bump_requisition (GTK_WIDGET (layout),
|
||||
orientation, cached_size->minimum_size);
|
||||
|
||||
cached_size->minimum_size = MAX (cached_size->minimum_size, group_size);
|
||||
cached_size->natural_size = MAX (cached_size->natural_size, group_size);
|
||||
}
|
||||
|
||||
if (minimum_size)
|
||||
*minimum_size = cached_size->minimum_size;
|
||||
|
||||
if (natural_size)
|
||||
*natural_size = cached_size->natural_size;
|
||||
|
||||
g_assert (cached_size->minimum_size <= cached_size->natural_size);
|
||||
|
||||
GTK_NOTE (EXTENDED_LAYOUT,
|
||||
g_print ("[%p] %s\t%s: %d is minimum %d and natural: %d (hit cache: %s)\n",
|
||||
layout, G_OBJECT_TYPE_NAME (layout),
|
||||
orientation == GTK_SIZE_GROUP_HORIZONTAL ?
|
||||
"width for height" : "height for width" ,
|
||||
for_size,
|
||||
cached_size->minimum_size,
|
||||
cached_size->natural_size,
|
||||
found_in_cache ? "yes" : "no"));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_extended_layout_is_height_for_width:
|
||||
* @layout: a #GtkExtendedLayout instance
|
||||
*
|
||||
* Gets whether the widget prefers a height-for-width layout
|
||||
* or a width-for-height layout.
|
||||
*
|
||||
* <note><para>#GtkBin widgets generally propagate the preference of
|
||||
* their child, container widgets need to request something either in
|
||||
* context of their children or in context of their allocation
|
||||
* capabilities.</para></note>
|
||||
*
|
||||
* Returns: %TRUE if the widget prefers height-for-width, %FALSE if
|
||||
* the widget should be treated with a width-for-height preference.
|
||||
*
|
||||
* Since: 3.0
|
||||
*/
|
||||
gboolean
|
||||
gtk_extended_layout_is_height_for_width (GtkExtendedLayout *layout)
|
||||
{
|
||||
GtkExtendedLayoutIface *iface;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_EXTENDED_LAYOUT (layout), FALSE);
|
||||
|
||||
iface = GTK_EXTENDED_LAYOUT_GET_IFACE (layout);
|
||||
if (iface->is_height_for_width)
|
||||
return iface->is_height_for_width (layout);
|
||||
|
||||
/* By default widgets are height-for-width. */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_extended_layout_get_desired_width:
|
||||
* @layout: a #GtkExtendedLayout instance
|
||||
* @minimum_width: (allow-none): location to store the minimum width, or %NULL
|
||||
* @natural_width: (allow-none): location to store the natural width, or %NULL
|
||||
*
|
||||
* Retrieves a widget's initial minimum and natural width.
|
||||
*
|
||||
* <note><para>This call is specific to height-for-width
|
||||
* requests.</para></note>
|
||||
*
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_extended_layout_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL,
|
||||
-1, minimum_width, natural_width);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_extended_layout_get_desired_height:
|
||||
* @layout: a #GtkExtendedLayout instance
|
||||
* @minimum_height: (allow-none): location to store the minimum height, or %NULL
|
||||
* @natural_height: (allow-none): location to store the natural height, or %NULL
|
||||
*
|
||||
* Retrieves a widget's initial minimum and natural height.
|
||||
*
|
||||
* <note><para>This call is specific to width-for-height requests.</para></note>
|
||||
*
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_extended_layout_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL,
|
||||
-1, minimum_height, natural_height);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* gtk_extended_layout_get_width_for_height:
|
||||
* @layout: a #GtkExtendedLayout instance
|
||||
* @height: the height which is available for allocation
|
||||
* @minimum_width: (allow-none): location for storing the minimum width, or %NULL
|
||||
* @natural_width: (allow-none): location for storing the natural width, or %NULL
|
||||
*
|
||||
* Retrieves a widget's desired width if it would be given
|
||||
* the specified @height.
|
||||
*
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_extended_layout_get_width_for_height (GtkExtendedLayout *layout,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL,
|
||||
height, minimum_width, natural_width);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_extended_layout_get_height_for_width:
|
||||
* @layout: a #GtkExtendedLayout instance
|
||||
* @width: the width which is available for allocation
|
||||
* @minimum_height: (allow-none): location for storing the minimum height, or %NULL
|
||||
* @natural_height: (allow-none): location for storing the natural height, or %NULL
|
||||
*
|
||||
* Retrieves a widget's desired height if it would be given
|
||||
* the specified @width.
|
||||
*
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_extended_layout_get_height_for_width (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL,
|
||||
width, minimum_height, natural_height);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_extended_layout_get_desired_size:
|
||||
* @layout: a #GtkExtendedLayout instance
|
||||
* @width: the size which is available for allocation
|
||||
* @request_natural: Whether to base the contextual request off of the
|
||||
* base natural or the base minimum
|
||||
* @minimum_size: (allow-none): location for storing the minimum size, or %NULL
|
||||
* @natural_size: (allow-none): location for storing the natural size, or %NULL
|
||||
*
|
||||
* Retrieves the minimum and natural size of a widget taking
|
||||
* into account the widget's preference for height-for-width management.
|
||||
*
|
||||
* If request_natural is specified, the non-contextual natural value will
|
||||
* be used to make the contextual request; otherwise the minimum will be used.
|
||||
*
|
||||
* This is used to retrieve a suitable size by container widgets which do
|
||||
* not impose any restrictions on the child placement.
|
||||
*
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_extended_layout_get_desired_size (GtkExtendedLayout *layout,
|
||||
gboolean request_natural,
|
||||
GtkRequisition *minimum_size,
|
||||
GtkRequisition *natural_size)
|
||||
{
|
||||
gint min_width, nat_width;
|
||||
gint min_height, nat_height;
|
||||
|
||||
g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (layout));
|
||||
|
||||
if (gtk_extended_layout_is_height_for_width (layout))
|
||||
{
|
||||
gtk_extended_layout_get_desired_width (layout, &min_width, &nat_width);
|
||||
gtk_extended_layout_get_height_for_width (layout,
|
||||
request_natural ? nat_width : min_width,
|
||||
&min_height, &nat_height);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_extended_layout_get_desired_height (layout, &min_height, &nat_height);
|
||||
gtk_extended_layout_get_width_for_height (layout,
|
||||
request_natural ? nat_height : min_height,
|
||||
&min_width, &nat_width);
|
||||
}
|
||||
|
||||
if (minimum_size)
|
||||
{
|
||||
minimum_size->width = min_width;
|
||||
minimum_size->height = min_height;
|
||||
}
|
||||
|
||||
if (natural_size)
|
||||
{
|
||||
natural_size->width = nat_width;
|
||||
natural_size->height = nat_height;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define __GTK_EXTENDED_LAYOUT_C__
|
||||
#include "gtkaliasdef.c"
|
||||
@@ -0,0 +1,89 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2007-2010 Openismus GmbH
|
||||
*
|
||||
* Authors:
|
||||
* Mathias Hasselmann <mathias@openismus.com>
|
||||
* Tristan Van Berkom <tristan.van.berkom@gmail.com>
|
||||
*
|
||||
* 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, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_EXTENDED_LAYOUT_H__
|
||||
#define __GTK_EXTENDED_LAYOUT_H__
|
||||
|
||||
#include <gtk/gtkwidget.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_EXTENDED_LAYOUT (gtk_extended_layout_get_type ())
|
||||
#define GTK_EXTENDED_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_EXTENDED_LAYOUT, GtkExtendedLayout))
|
||||
#define GTK_EXTENDED_LAYOUT_CLASS(klass) ((GtkExtendedLayoutIface*)g_type_interface_peek ((klass), GTK_TYPE_EXTENDED_LAYOUT))
|
||||
#define GTK_IS_EXTENDED_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_EXTENDED_LAYOUT))
|
||||
#define GTK_EXTENDED_LAYOUT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_EXTENDED_LAYOUT, GtkExtendedLayoutIface))
|
||||
|
||||
typedef struct _GtkExtendedLayout GtkExtendedLayout;
|
||||
typedef struct _GtkExtendedLayoutIface GtkExtendedLayoutIface;
|
||||
|
||||
struct _GtkExtendedLayoutIface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
/* virtual table */
|
||||
gboolean (* is_height_for_width) (GtkExtendedLayout *layout);
|
||||
|
||||
void (* get_desired_width) (GtkExtendedLayout *layout,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
void (* get_desired_height) (GtkExtendedLayout *layout,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void (* get_width_for_height) (GtkExtendedLayout *layout,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
void (* get_height_for_width) (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
};
|
||||
|
||||
GType gtk_extended_layout_get_type (void) G_GNUC_CONST;
|
||||
|
||||
gboolean gtk_extended_layout_is_height_for_width (GtkExtendedLayout *layout);
|
||||
void gtk_extended_layout_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
void gtk_extended_layout_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void gtk_extended_layout_get_width_for_height (GtkExtendedLayout *layout,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
void gtk_extended_layout_get_height_for_width (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
|
||||
void gtk_extended_layout_get_desired_size (GtkExtendedLayout *layout,
|
||||
gboolean request_natural,
|
||||
GtkRequisition *minimum_size,
|
||||
GtkRequisition *natural_size);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_EXTENDED_LAYOUT_H__ */
|
||||
@@ -323,7 +323,7 @@
|
||||
* </variablelist>
|
||||
* <note>
|
||||
* You can create your own bindings for the
|
||||
* GtkFileChooserDefault::location-popup signal with custom
|
||||
* #GtkFileChooserDefault::location-popup signal with custom
|
||||
* <parameter>path</parameter> strings, and have a crude form
|
||||
* of easily-to-type bookmarks. For example, say you access
|
||||
* the path <filename>/home/username/misc</filename> very
|
||||
@@ -504,7 +504,11 @@
|
||||
* </listitem>
|
||||
* </varlistentry>
|
||||
* <varlistentry>
|
||||
<<<<<<< HEAD
|
||||
* <term><parameter>bookmark_indes</parameter> :</term>
|
||||
=======
|
||||
* <term><parameter>bookmark_index</parameter> :</term>
|
||||
>>>>>>> native-layout-incubator
|
||||
* <listitem>
|
||||
* <simpara>
|
||||
* index of the bookmark to switch to; the indices start at 0.
|
||||
|
||||
@@ -1747,6 +1747,7 @@ remove_file (GtkFileSystemModel *model,
|
||||
g_object_unref (node->info);
|
||||
|
||||
g_array_remove_index (model->files, id);
|
||||
g_hash_table_remove_all (model->file_lookup);
|
||||
/* We don't need to resort, as removing a row doesn't change the sorting order */
|
||||
}
|
||||
|
||||
|
||||
+116
-42
@@ -31,6 +31,7 @@
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
#define LABEL_PAD 1
|
||||
@@ -58,8 +59,6 @@ static void gtk_frame_paint (GtkWidget *widget,
|
||||
GdkRectangle *area);
|
||||
static gint gtk_frame_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
static void gtk_frame_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_frame_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static void gtk_frame_remove (GtkContainer *container,
|
||||
@@ -81,9 +80,19 @@ static void gtk_frame_buildable_add_child (GtkBuildable *buildable,
|
||||
GObject *child,
|
||||
const gchar *type);
|
||||
|
||||
static void gtk_frame_extended_layout_init (GtkExtendedLayoutIface *iface);
|
||||
static void gtk_frame_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_frame_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkFrame, gtk_frame, GTK_TYPE_BIN,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||
gtk_frame_buildable_init))
|
||||
gtk_frame_buildable_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
|
||||
gtk_frame_extended_layout_init))
|
||||
|
||||
static void
|
||||
gtk_frame_class_init (GtkFrameClass *class)
|
||||
@@ -150,7 +159,6 @@ gtk_frame_class_init (GtkFrameClass *class)
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
widget_class->expose_event = gtk_frame_expose;
|
||||
widget_class->size_request = gtk_frame_size_request;
|
||||
widget_class->size_allocate = gtk_frame_size_allocate;
|
||||
|
||||
container_class->remove = gtk_frame_remove;
|
||||
@@ -601,42 +609,6 @@ gtk_frame_expose (GtkWidget *widget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_frame_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkFrame *frame = GTK_FRAME (widget);
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
if (frame->label_widget && gtk_widget_get_visible (frame->label_widget))
|
||||
{
|
||||
gtk_widget_size_request (frame->label_widget, &child_requisition);
|
||||
|
||||
requisition->width = child_requisition.width + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
|
||||
requisition->height =
|
||||
MAX (0, child_requisition.height - widget->style->ythickness);
|
||||
}
|
||||
else
|
||||
{
|
||||
requisition->width = 0;
|
||||
requisition->height = 0;
|
||||
}
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
|
||||
requisition->width = MAX (requisition->width, child_requisition.width);
|
||||
requisition->height += child_requisition.height;
|
||||
}
|
||||
|
||||
requisition->width += (GTK_CONTAINER (widget)->border_width +
|
||||
GTK_WIDGET (widget)->style->xthickness) * 2;
|
||||
requisition->height += (GTK_CONTAINER (widget)->border_width +
|
||||
GTK_WIDGET (widget)->style->ythickness) * 2;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_frame_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
@@ -652,11 +624,15 @@ gtk_frame_size_allocate (GtkWidget *widget,
|
||||
/* If the child allocation changed, that means that the frame is drawn
|
||||
* in a new place, so we must redraw the entire widget.
|
||||
*/
|
||||
if (gtk_widget_get_mapped (widget) &&
|
||||
if (gtk_widget_get_mapped (widget)
|
||||
#if 0
|
||||
&&
|
||||
(new_allocation.x != frame->child_allocation.x ||
|
||||
new_allocation.y != frame->child_allocation.y ||
|
||||
new_allocation.width != frame->child_allocation.width ||
|
||||
new_allocation.height != frame->child_allocation.height))
|
||||
new_allocation.height != frame->child_allocation.height)
|
||||
#endif
|
||||
)
|
||||
gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
@@ -728,5 +704,103 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame,
|
||||
child_allocation->y += allocation->y;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_frame_get_desired_size (GtkExtendedLayout *layout,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (layout);
|
||||
GtkFrame *frame = GTK_FRAME (widget);
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
gint child_min, child_nat;
|
||||
gint minimum, natural;
|
||||
|
||||
if (frame->label_widget && gtk_widget_get_visible (frame->label_widget))
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (frame->label_widget),
|
||||
&child_min, &child_nat);
|
||||
minimum = child_min + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
|
||||
natural = child_nat + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (frame->label_widget),
|
||||
&child_min, &child_nat);
|
||||
minimum = MAX (0, child_min - widget->style->ythickness);
|
||||
natural = MAX (0, child_nat - widget->style->ythickness);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
minimum = 0;
|
||||
natural = 0;
|
||||
}
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child),
|
||||
&child_min, &child_nat);
|
||||
minimum = MAX (minimum, child_min);
|
||||
natural = MAX (natural, child_nat);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child),
|
||||
&child_min, &child_nat);
|
||||
minimum += child_min;
|
||||
natural += child_nat;
|
||||
}
|
||||
}
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
minimum += (GTK_CONTAINER (widget)->border_width +
|
||||
GTK_WIDGET (widget)->style->xthickness) * 2;
|
||||
natural += (GTK_CONTAINER (widget)->border_width +
|
||||
GTK_WIDGET (widget)->style->xthickness) * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
minimum += (GTK_CONTAINER (widget)->border_width +
|
||||
GTK_WIDGET (widget)->style->ythickness) * 2;
|
||||
natural += (GTK_CONTAINER (widget)->border_width +
|
||||
GTK_WIDGET (widget)->style->ythickness) * 2;
|
||||
}
|
||||
|
||||
if (minimum_size)
|
||||
*minimum_size = minimum;
|
||||
|
||||
if (natural_size)
|
||||
*natural_size = natural;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_frame_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_frame_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_frame_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_frame_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_frame_extended_layout_init (GtkExtendedLayoutIface *iface)
|
||||
{
|
||||
iface->get_desired_width = gtk_frame_get_desired_width;
|
||||
iface->get_desired_height = gtk_frame_get_desired_height;
|
||||
}
|
||||
|
||||
#define __GTK_FRAME_C__
|
||||
#include "gtkaliasdef.c"
|
||||
|
||||
@@ -3079,6 +3079,145 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info,
|
||||
return g_object_ref (icon_info->pixbuf);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
gdk_color_to_css (GdkColor *color)
|
||||
{
|
||||
return g_strdup_printf ("rgb(%d,%d,%d)",
|
||||
color->red >> 8,
|
||||
color->green >> 8,
|
||||
color->blue >> 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_info_load_symbolic:
|
||||
* @info: a #GtkIconInfo
|
||||
* @fg: a #GdkColor representing the foreground color of the icon
|
||||
* @success_color: (allow-none): a #GdkColor representing the warning color
|
||||
* of the icon or %NULL to use the default color
|
||||
* @warning_color: (allow-none): a #GdkColor representing the warning color
|
||||
* of the icon or %NULL to use the default color
|
||||
* @error_color: (allow-none): a #GdkColor representing the error color
|
||||
* of the icon or %NULL to use the default color (allow-none)
|
||||
* @was_symbolic: (allow-none): a #gboolean, returns whether the loaded icon
|
||||
* was a symbolic one and whether the @fg color was applied to it.
|
||||
* @error: (allow-none): location to store error information on failure,
|
||||
* or %NULL.
|
||||
*
|
||||
* Loads an icon, modifying it to match the system colours for the foreground,
|
||||
* success, warning and error colors provided. If the icon is not a symbolic
|
||||
* one, the function will return the result from gtk_icon_info_load_icon().
|
||||
*
|
||||
* This allows loading symbolic icons that will match the system theme.
|
||||
*
|
||||
* Unless you are implementing a widget, you will want to use
|
||||
* g_themed_icon_new_with_default_fallbacks() to load the icon.
|
||||
*
|
||||
* As implementation details, the icon loaded needs to be of SVG type,
|
||||
* contain the "symbolic" term as the last component of the icon name,
|
||||
* and use the 'fg', 'success', 'warning' and 'error' CSS styles in the
|
||||
* SVG file itself.
|
||||
*
|
||||
* See the <ulink url="http://www.freedesktop.org/wiki/SymbolicIcons">Symbolic Icons spec</ulink>
|
||||
* for more information about symbolic icons.
|
||||
*
|
||||
* Return value: a #GdkPixbuf representing the loaded icon
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
GdkPixbuf *
|
||||
gtk_icon_info_load_symbolic (GtkIconInfo *info,
|
||||
GdkColor *fg,
|
||||
GdkColor *success_color,
|
||||
GdkColor *warning_color,
|
||||
GdkColor *error_color,
|
||||
gboolean *was_symbolic,
|
||||
GError **error)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
GInputStream *stream;
|
||||
gchar *data;
|
||||
gchar *css_fg;
|
||||
gchar *css_success;
|
||||
gchar *css_warning;
|
||||
gchar *css_error;
|
||||
|
||||
g_return_val_if_fail (fg != NULL, NULL);
|
||||
|
||||
if (!info->filename || !g_str_has_suffix (info->filename, "-symbolic.svg"))
|
||||
{
|
||||
if (was_symbolic)
|
||||
*was_symbolic = FALSE;
|
||||
return gtk_icon_info_load_icon (info, error);
|
||||
}
|
||||
|
||||
if (was_symbolic)
|
||||
*was_symbolic = TRUE;
|
||||
|
||||
css_fg = gdk_color_to_css (fg);
|
||||
if (!warning_color)
|
||||
{
|
||||
GdkColor warning_default_color = { 0, 0xf500, 0x7900, 0x3e00 };
|
||||
css_warning = gdk_color_to_css (&warning_default_color);
|
||||
}
|
||||
else
|
||||
css_warning = gdk_color_to_css (warning_color);
|
||||
if (!error_color)
|
||||
{
|
||||
GdkColor error_default_color = { 0, 0xcc00, 0x0000, 0x0000 };
|
||||
css_error = gdk_color_to_css (&error_default_color);
|
||||
}
|
||||
else
|
||||
css_error = gdk_color_to_css (error_color);
|
||||
if (!success_color)
|
||||
{
|
||||
GdkColor success_default_color = { 0, 0x4e00, 0x9a00, 0x0600 };
|
||||
css_success = gdk_color_to_css (&success_default_color);
|
||||
}
|
||||
else
|
||||
css_success = gdk_color_to_css (success_color);
|
||||
|
||||
data = g_strconcat (
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
|
||||
"<svg version=\"1.1\"\n"
|
||||
" xmlns=\"http://www.w3.org/2000/svg\"\n"
|
||||
" xmlns:xi=\"http://www.w3.org/2001/XInclude\"\n"
|
||||
" width=\"16\"\n"
|
||||
" height=\"16\">\n"
|
||||
" <style type=\"text/css\">\n"
|
||||
" rect,path {\n"
|
||||
" fill: ", css_fg," !important;\n"
|
||||
" }\n"
|
||||
" .warning {\n"
|
||||
" fill: ", css_warning," !important;\n"
|
||||
" }\n"
|
||||
" .error {\n"
|
||||
" fill: ", css_error," !important;\n"
|
||||
" }\n"
|
||||
" .success {\n"
|
||||
" fill: ", css_success," !important;\n"
|
||||
" }\n"
|
||||
" </style>\n"
|
||||
" <xi:include href=\"", info->filename, "\"/>\n"
|
||||
"</svg>",
|
||||
NULL);
|
||||
g_free (css_fg);
|
||||
g_free (css_warning);
|
||||
g_free (css_success);
|
||||
g_free (css_error);
|
||||
|
||||
stream = g_memory_input_stream_new_from_data (data, -1, g_free);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream,
|
||||
info->desired_size,
|
||||
info->desired_size,
|
||||
TRUE,
|
||||
NULL,
|
||||
error);
|
||||
g_object_unref (stream);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_info_set_raw_coordinates:
|
||||
* @icon_info: a #GtkIconInfo
|
||||
|
||||
@@ -179,6 +179,13 @@ G_CONST_RETURN gchar *gtk_icon_info_get_filename (GtkIconInfo *icon_info
|
||||
GdkPixbuf * gtk_icon_info_get_builtin_pixbuf (GtkIconInfo *icon_info);
|
||||
GdkPixbuf * gtk_icon_info_load_icon (GtkIconInfo *icon_info,
|
||||
GError **error);
|
||||
GdkPixbuf * gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
|
||||
GdkColor *fg,
|
||||
GdkColor *success_color,
|
||||
GdkColor *warning_color,
|
||||
GdkColor *error_color,
|
||||
gboolean *was_symbolic,
|
||||
GError **error);
|
||||
void gtk_icon_info_set_raw_coordinates (GtkIconInfo *icon_info,
|
||||
gboolean raw_coordinates);
|
||||
|
||||
|
||||
+122
-15
@@ -134,6 +134,11 @@ struct _GtkImagePrivate
|
||||
/* Only used with GTK_IMAGE_ANIMATION, GTK_IMAGE_PIXBUF */
|
||||
gchar *filename;
|
||||
|
||||
/* a GtkStateType, with -1 meaning an invalid state,
|
||||
* only used with GTK_IMAGE_GICON, GTK_IMAGE_ICON_NAME */
|
||||
gint last_rendered_state;
|
||||
gboolean was_symbolic;
|
||||
|
||||
gint pixel_size;
|
||||
guint need_calc_size : 1;
|
||||
};
|
||||
@@ -1628,6 +1633,10 @@ animation_timeout (gpointer data)
|
||||
static void
|
||||
icon_theme_changed (GtkImage *image)
|
||||
{
|
||||
GtkImagePrivate *priv;
|
||||
|
||||
priv = GTK_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
if (image->storage_type == GTK_IMAGE_ICON_NAME)
|
||||
{
|
||||
if (image->data.name.pixbuf)
|
||||
@@ -1647,7 +1656,8 @@ icon_theme_changed (GtkImage *image)
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_pixbuf_for_icon_name (GtkImage *image)
|
||||
ensure_pixbuf_for_icon_name (GtkImage *image,
|
||||
GtkStateType state)
|
||||
{
|
||||
GtkImagePrivate *priv;
|
||||
GdkScreen *screen;
|
||||
@@ -1655,8 +1665,8 @@ ensure_pixbuf_for_icon_name (GtkImage *image)
|
||||
GtkSettings *settings;
|
||||
gint width, height;
|
||||
gint *sizes, *s, dist;
|
||||
GtkIconInfo *info;
|
||||
GtkIconLookupFlags flags;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_if_fail (image->storage_type == GTK_IMAGE_ICON_NAME);
|
||||
|
||||
@@ -1665,8 +1675,15 @@ ensure_pixbuf_for_icon_name (GtkImage *image)
|
||||
icon_theme = gtk_icon_theme_get_for_screen (screen);
|
||||
settings = gtk_settings_get_for_screen (screen);
|
||||
flags = GTK_ICON_LOOKUP_USE_BUILTIN;
|
||||
if (image->data.name.pixbuf == NULL)
|
||||
if (image->data.name.pixbuf == NULL ||
|
||||
(priv->was_symbolic && priv->last_rendered_state != state))
|
||||
{
|
||||
priv->last_rendered_state = state;
|
||||
if (image->data.name.pixbuf)
|
||||
{
|
||||
g_object_unref (image->data.name.pixbuf);
|
||||
image->data.name.pixbuf = NULL;
|
||||
}
|
||||
if (priv->pixel_size != -1)
|
||||
{
|
||||
width = height = priv->pixel_size;
|
||||
@@ -1714,24 +1731,57 @@ ensure_pixbuf_for_icon_name (GtkImage *image)
|
||||
width = height = 24;
|
||||
}
|
||||
}
|
||||
image->data.name.pixbuf =
|
||||
gtk_icon_theme_load_icon (icon_theme,
|
||||
image->data.name.icon_name,
|
||||
MIN (width, height), flags, &error);
|
||||
|
||||
info = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
image->data.name.icon_name,
|
||||
MIN (width, height), flags);
|
||||
if (info)
|
||||
{
|
||||
GdkColor error_color, warning_color, success_color;
|
||||
GdkColor *error_ptr, *warning_ptr, *success_ptr;
|
||||
GtkStyle *style;
|
||||
gboolean was_symbolic;
|
||||
|
||||
style = gtk_widget_get_style (GTK_WIDGET (image));
|
||||
if (!gtk_style_lookup_color (style, "error_color", &error_color))
|
||||
error_ptr = NULL;
|
||||
else
|
||||
error_ptr = &error_color;
|
||||
if (!gtk_style_lookup_color (style, "warning_color", &warning_color))
|
||||
warning_ptr = NULL;
|
||||
else
|
||||
warning_ptr = &warning_color;
|
||||
if (!gtk_style_lookup_color (style, "success_color", &success_color))
|
||||
success_ptr = NULL;
|
||||
else
|
||||
success_ptr = &success_color;
|
||||
|
||||
image->data.name.pixbuf = gtk_icon_info_load_symbolic (info,
|
||||
&style->fg[state],
|
||||
success_ptr,
|
||||
warning_ptr,
|
||||
error_ptr,
|
||||
&was_symbolic,
|
||||
NULL);
|
||||
priv->was_symbolic = was_symbolic;
|
||||
gtk_icon_info_free (info);
|
||||
}
|
||||
|
||||
if (image->data.name.pixbuf == NULL)
|
||||
{
|
||||
g_error_free (error);
|
||||
image->data.name.pixbuf =
|
||||
gtk_widget_render_icon (GTK_WIDGET (image),
|
||||
GTK_STOCK_MISSING_IMAGE,
|
||||
image->icon_size,
|
||||
NULL);
|
||||
priv->was_symbolic = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_pixbuf_for_gicon (GtkImage *image)
|
||||
ensure_pixbuf_for_gicon (GtkImage *image,
|
||||
GtkStateType state)
|
||||
{
|
||||
GtkImagePrivate *priv;
|
||||
GdkScreen *screen;
|
||||
@@ -1748,8 +1798,15 @@ ensure_pixbuf_for_gicon (GtkImage *image)
|
||||
icon_theme = gtk_icon_theme_get_for_screen (screen);
|
||||
settings = gtk_settings_get_for_screen (screen);
|
||||
flags = GTK_ICON_LOOKUP_USE_BUILTIN;
|
||||
if (image->data.gicon.pixbuf == NULL)
|
||||
if (image->data.gicon.pixbuf == NULL ||
|
||||
(priv->was_symbolic && priv->last_rendered_state != state))
|
||||
{
|
||||
priv->last_rendered_state = state;
|
||||
if (image->data.gicon.pixbuf)
|
||||
{
|
||||
g_object_unref (image->data.gicon.pixbuf);
|
||||
image->data.gicon.pixbuf = NULL;
|
||||
}
|
||||
if (priv->pixel_size != -1)
|
||||
{
|
||||
width = height = priv->pixel_size;
|
||||
@@ -1773,7 +1830,33 @@ ensure_pixbuf_for_gicon (GtkImage *image)
|
||||
MIN (width, height), flags);
|
||||
if (info)
|
||||
{
|
||||
image->data.gicon.pixbuf = gtk_icon_info_load_icon (info, NULL);
|
||||
GdkColor error_color, warning_color, success_color;
|
||||
GdkColor *error_ptr, *warning_ptr, *success_ptr;
|
||||
GtkStyle *style;
|
||||
gboolean was_symbolic;
|
||||
|
||||
style = gtk_widget_get_style (GTK_WIDGET (image));
|
||||
if (!gtk_style_lookup_color (style, "error_color", &error_color))
|
||||
error_ptr = NULL;
|
||||
else
|
||||
error_ptr = &error_color;
|
||||
if (!gtk_style_lookup_color (style, "warning_color", &warning_color))
|
||||
warning_ptr = NULL;
|
||||
else
|
||||
warning_ptr = &warning_color;
|
||||
if (!gtk_style_lookup_color (style, "success_color", &success_color))
|
||||
success_ptr = NULL;
|
||||
else
|
||||
success_ptr = &success_color;
|
||||
|
||||
image->data.gicon.pixbuf = gtk_icon_info_load_symbolic (info,
|
||||
&style->fg[state],
|
||||
success_ptr,
|
||||
warning_ptr,
|
||||
error_ptr,
|
||||
&was_symbolic,
|
||||
NULL);
|
||||
priv->was_symbolic = was_symbolic;
|
||||
gtk_icon_info_free (info);
|
||||
}
|
||||
|
||||
@@ -1784,6 +1867,7 @@ ensure_pixbuf_for_gicon (GtkImage *image)
|
||||
GTK_STOCK_MISSING_IMAGE,
|
||||
image->icon_size,
|
||||
NULL);
|
||||
priv->was_symbolic = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1845,6 +1929,7 @@ gtk_image_expose (GtkWidget *widget,
|
||||
gint x, y, mask_x, mask_y;
|
||||
GdkBitmap *mask;
|
||||
GdkPixbuf *pixbuf;
|
||||
GtkStateType state;
|
||||
gboolean needs_state_transform;
|
||||
|
||||
image = GTK_IMAGE (widget);
|
||||
@@ -2012,7 +2097,18 @@ gtk_image_expose (GtkWidget *widget,
|
||||
break;
|
||||
|
||||
case GTK_IMAGE_ICON_NAME:
|
||||
ensure_pixbuf_for_icon_name (image);
|
||||
state = gtk_widget_get_state (widget);
|
||||
if (state == GTK_STATE_INSENSITIVE)
|
||||
{
|
||||
ensure_pixbuf_for_icon_name (image, GTK_STATE_NORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ensure_pixbuf_for_icon_name (image, state);
|
||||
/* Already done by the loading function? */
|
||||
if (priv->was_symbolic)
|
||||
needs_state_transform = FALSE;
|
||||
}
|
||||
pixbuf = image->data.name.pixbuf;
|
||||
if (pixbuf)
|
||||
{
|
||||
@@ -2023,7 +2119,18 @@ gtk_image_expose (GtkWidget *widget,
|
||||
break;
|
||||
|
||||
case GTK_IMAGE_GICON:
|
||||
ensure_pixbuf_for_gicon (image);
|
||||
state = gtk_widget_get_state (widget);
|
||||
if (state == GTK_STATE_INSENSITIVE)
|
||||
{
|
||||
ensure_pixbuf_for_gicon (image, GTK_STATE_NORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ensure_pixbuf_for_gicon (image, state);
|
||||
/* Already done by the loading function? */
|
||||
if (priv->was_symbolic)
|
||||
needs_state_transform = FALSE;
|
||||
}
|
||||
pixbuf = image->data.gicon.pixbuf;
|
||||
if (pixbuf)
|
||||
{
|
||||
@@ -2325,12 +2432,12 @@ gtk_image_calc_size (GtkImage *image)
|
||||
NULL);
|
||||
break;
|
||||
case GTK_IMAGE_ICON_NAME:
|
||||
ensure_pixbuf_for_icon_name (image);
|
||||
ensure_pixbuf_for_icon_name (image, GTK_STATE_NORMAL);
|
||||
pixbuf = image->data.name.pixbuf;
|
||||
if (pixbuf) g_object_ref (pixbuf);
|
||||
break;
|
||||
case GTK_IMAGE_GICON:
|
||||
ensure_pixbuf_for_gicon (image);
|
||||
ensure_pixbuf_for_gicon (image, GTK_STATE_NORMAL);
|
||||
pixbuf = image->data.gicon.pixbuf;
|
||||
if (pixbuf)
|
||||
g_object_ref (pixbuf);
|
||||
|
||||
+581
-148
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -235,7 +235,8 @@ static const GDebugKey gtk_debug_keys[] = {
|
||||
{"geometry", GTK_DEBUG_GEOMETRY},
|
||||
{"icontheme", GTK_DEBUG_ICONTHEME},
|
||||
{"printing", GTK_DEBUG_PRINTING},
|
||||
{"builder", GTK_DEBUG_BUILDER}
|
||||
{"builder", GTK_DEBUG_BUILDER},
|
||||
{"extended-layout", GTK_DEBUG_EXTENDED_LAYOUT},
|
||||
};
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright (C) 2010 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, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Cody Russell <bratsche@gnome.org>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkmenuproxy.h"
|
||||
#include "gtkmenuproxymodule.h"
|
||||
#include "gtkmodules.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
enum {
|
||||
INSERTED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint menu_proxy_signals[LAST_SIGNAL] = { 0 };
|
||||
static GObjectClass *parent_class = NULL;
|
||||
static GtkMenuProxy *proxy_singleton = NULL;
|
||||
|
||||
static void gtk_menu_proxy_real_insert (GtkMenuProxy *proxy,
|
||||
GtkWidget *child,
|
||||
guint position);
|
||||
|
||||
|
||||
|
||||
/* --------------------------------------------------------- */
|
||||
|
||||
G_DEFINE_TYPE (GtkMenuProxy, gtk_menu_proxy, G_TYPE_OBJECT)
|
||||
|
||||
static GObject *
|
||||
gtk_menu_proxy_constructor (GType type,
|
||||
guint n_params,
|
||||
GObjectConstructParam *params)
|
||||
{
|
||||
GObject *object;
|
||||
|
||||
if (proxy_singleton != NULL)
|
||||
{
|
||||
object = g_object_ref (proxy_singleton);
|
||||
}
|
||||
else
|
||||
{
|
||||
object = G_OBJECT_CLASS (gtk_menu_proxy_parent_class)->constructor (type,
|
||||
n_params,
|
||||
params);
|
||||
|
||||
proxy_singleton = GTK_MENU_PROXY (object);
|
||||
g_object_add_weak_pointer (object, (gpointer) &proxy_singleton);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_proxy_init (GtkMenuProxy *proxy)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_proxy_class_init (GtkMenuProxyClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
menu_proxy_signals[INSERTED] =
|
||||
g_signal_new (I_("inserted"),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GtkMenuProxyClass, inserted),
|
||||
NULL, NULL,
|
||||
_gtk_marshal_VOID__OBJECT_UINT,
|
||||
G_TYPE_NONE, 2,
|
||||
GTK_TYPE_WIDGET, G_TYPE_UINT);
|
||||
|
||||
class->insert = gtk_menu_proxy_real_insert;
|
||||
|
||||
object_class->constructor = gtk_menu_proxy_constructor;
|
||||
}
|
||||
|
||||
GtkMenuProxy *
|
||||
gtk_menu_proxy_get (void)
|
||||
{
|
||||
if (!proxy_singleton)
|
||||
{
|
||||
gtk_menu_proxy_module_get ();
|
||||
}
|
||||
|
||||
return proxy_singleton;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_proxy_real_insert (GtkMenuProxy *proxy,
|
||||
GtkWidget *child,
|
||||
guint position)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gtk_menu_proxy_insert (GtkMenuProxy *proxy,
|
||||
GtkWidget *child,
|
||||
guint position)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_MENU_PROXY (proxy));
|
||||
|
||||
GTK_MENU_PROXY_GET_CLASS (proxy)->insert (proxy,
|
||||
child,
|
||||
position);
|
||||
|
||||
//g_signal_emit_by_name (proxy, "inserted", child, position);
|
||||
}
|
||||
|
||||
#define __GTK_MENU_PROXY_C__
|
||||
#include "gtkaliasdef.c"
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2010 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, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Cody Russell <bratsche@gnome.org>
|
||||
*/
|
||||
|
||||
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GTK_MENU_PROXY_H__
|
||||
#define __GTK_MENU_PROXY_H__
|
||||
|
||||
#include <gtk/gtkwidget.h>
|
||||
#include <gtk/gtktypeutils.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_MENU_PROXY (gtk_menu_proxy_get_type ())
|
||||
#define GTK_MENU_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_MENU_PROXY, GtkMenuProxy))
|
||||
#define GTK_MENU_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_MENU_PROXY, GtkMenuProxyClass))
|
||||
#define GTK_IS_MENU_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_MENU_PROXY))
|
||||
#define GTK_IS_MENU_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_MENU_PROXY))
|
||||
#define GTK_MENU_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_MENU_PROXY, GtkMenuProxyClass))
|
||||
|
||||
|
||||
typedef struct _GtkMenuProxy GtkMenuProxy;
|
||||
typedef struct _GtkMenuProxyClass GtkMenuProxyClass;
|
||||
|
||||
struct _GtkMenuProxy
|
||||
{
|
||||
GObject parent_object;
|
||||
};
|
||||
|
||||
struct _GtkMenuProxyClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
/* vtable */
|
||||
void (* insert) (GtkMenuProxy *proxy, GtkWidget *child, guint position);
|
||||
|
||||
/* signals */
|
||||
void (* inserted) (GtkMenuProxy *proxy, GtkWidget *child);
|
||||
};
|
||||
|
||||
GType gtk_menu_proxy_get_type (void) G_GNUC_CONST;
|
||||
GtkMenuProxy* gtk_menu_proxy_get (void);
|
||||
void gtk_menu_proxy_insert (GtkMenuProxy *proxy,
|
||||
GtkWidget *child,
|
||||
guint position);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_MENU_PROXY_H__ */
|
||||
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* Copyright (C) 2010 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, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Cody Russell <bratsche@gnome.org>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmenuproxy.h"
|
||||
#include "gtkmenuproxymodule.h"
|
||||
#include "gtkmodules.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_MODULENAME
|
||||
};
|
||||
|
||||
static GObject *gtk_menu_proxy_module_constructor (GType type,
|
||||
guint n_params,
|
||||
GObjectConstructParam *params);
|
||||
static void gtk_menu_proxy_module_finalize (GObject *object);
|
||||
static gboolean gtk_menu_proxy_module_real_load (GTypeModule *gmodule);
|
||||
static void gtk_menu_proxy_module_real_unload (GTypeModule *gmodule);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GtkMenuProxyModule, gtk_menu_proxy_module, G_TYPE_TYPE_MODULE);
|
||||
|
||||
static GtkMenuProxyModule *proxy_module_singleton = NULL;
|
||||
|
||||
static void
|
||||
gtk_menu_proxy_module_class_init (GtkMenuProxyModuleClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
|
||||
|
||||
//object_class->constructor = gtk_menu_proxy_module_constructor;
|
||||
object_class->finalize = gtk_menu_proxy_module_finalize;
|
||||
|
||||
type_module_class->load = gtk_menu_proxy_module_real_load;
|
||||
type_module_class->unload = gtk_menu_proxy_module_real_unload;
|
||||
}
|
||||
|
||||
/*
|
||||
static GObject *
|
||||
gtk_menu_proxy_module_constructor (GType type,
|
||||
guint n_params,
|
||||
GObjectConstructParam *params)
|
||||
{
|
||||
GObject *object;
|
||||
|
||||
if (proxy_module_singleton != NULL)
|
||||
{
|
||||
object = g_object_ref (proxy_module_singleton);
|
||||
}
|
||||
else
|
||||
{
|
||||
object = G_OBJECT_CLASS (gtk_menu_proxy_module_parent_class)->constructor (type,
|
||||
n_params,
|
||||
params);
|
||||
|
||||
proxy_module_singleton = GTK_MENU_PROXY_MODULE (object);
|
||||
g_object_add_weak_pointer (object, (gpointer) &proxy_module_singleton);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
*/
|
||||
|
||||
static void
|
||||
gtk_menu_proxy_module_init (GtkMenuProxyModule *module)
|
||||
{
|
||||
module->name = g_strdup (g_getenv ("GTK_MENUPROXY"));
|
||||
module->library = NULL;
|
||||
module->load = NULL;
|
||||
module->unload = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_proxy_module_finalize (GObject *object)
|
||||
{
|
||||
GtkMenuProxyModule *module = GTK_MENU_PROXY_MODULE (object);
|
||||
|
||||
if (module->name != NULL)
|
||||
{
|
||||
g_free (module->name);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gtk_menu_proxy_module_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_menu_proxy_module_real_load (GTypeModule *gmodule)
|
||||
{
|
||||
GtkMenuProxyModule *module = GTK_MENU_PROXY_MODULE (gmodule);
|
||||
gchar *path;
|
||||
|
||||
if (proxy_module_singleton != NULL)
|
||||
return TRUE;
|
||||
|
||||
if (!module->name)
|
||||
{
|
||||
g_warning ("Module path not set");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
path = _gtk_find_module (module->name, "menuproxies");
|
||||
|
||||
module->library = g_module_open (path, 0);
|
||||
|
||||
if (!module->library)
|
||||
{
|
||||
g_printerr ("%s\n", g_module_error ());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Make sure that the loaded library contains the required methods */
|
||||
if (!g_module_symbol (module->library,
|
||||
"menu_proxy_module_load",
|
||||
(gpointer *) &module->load) ||
|
||||
!g_module_symbol (module->library,
|
||||
"menu_proxy_module_unload",
|
||||
(gpointer *) &module->unload))
|
||||
{
|
||||
g_printerr ("%s\n", g_module_error ());
|
||||
g_module_close (module->library);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Initialize the loaded module */
|
||||
module->load (module);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_proxy_module_real_unload (GTypeModule *gmodule)
|
||||
{
|
||||
GtkMenuProxyModule *module = GTK_MENU_PROXY_MODULE (gmodule);
|
||||
|
||||
module->unload (module);
|
||||
|
||||
g_module_close (module->library);
|
||||
module->library = NULL;
|
||||
|
||||
module->load = NULL;
|
||||
module->unload = NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_valid_module_name (const gchar *name)
|
||||
{
|
||||
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
|
||||
return g_str_has_prefix (name, "lib") && g_str_has_suffix (name, ".so");
|
||||
#else
|
||||
return g_str_has_suffix (name, ".dll");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
setup_instance (GtkMenuProxyModule *module)
|
||||
{
|
||||
GType *proxy_types;
|
||||
guint n_proxies;
|
||||
|
||||
proxy_types = g_type_children (GTK_TYPE_MENU_PROXY,
|
||||
&n_proxies);
|
||||
|
||||
if (n_proxies > 1)
|
||||
{
|
||||
g_warning ("There are %d child types of GtkMenuProxy, should be 0 or 1.\n",
|
||||
n_proxies);
|
||||
}
|
||||
else if (n_proxies == 1)
|
||||
{
|
||||
g_object_new (proxy_types[0], NULL);
|
||||
}
|
||||
}
|
||||
|
||||
GtkMenuProxyModule *
|
||||
gtk_menu_proxy_module_get (void)
|
||||
{
|
||||
if (!proxy_module_singleton)
|
||||
{
|
||||
GtkMenuProxyModule *module = NULL;
|
||||
const gchar *module_name;
|
||||
|
||||
module_name = g_getenv ("GTK_MENUPROXY");
|
||||
|
||||
if (module_name != NULL)
|
||||
{
|
||||
if (is_valid_module_name (module_name))
|
||||
{
|
||||
gchar *path = _gtk_find_module (module_name, "menuproxies");
|
||||
|
||||
module = g_object_new (GTK_TYPE_MENU_PROXY_MODULE,
|
||||
NULL);
|
||||
|
||||
if (!g_type_module_use (G_TYPE_MODULE (module)))
|
||||
{
|
||||
g_warning ("Failed to load type module: %s\n", path);
|
||||
|
||||
g_object_unref (module);
|
||||
g_free (path);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
setup_instance (module);
|
||||
|
||||
g_free (path);
|
||||
g_type_module_unuse (G_TYPE_MODULE (module));
|
||||
}
|
||||
|
||||
proxy_module_singleton = module;
|
||||
}
|
||||
}
|
||||
|
||||
return proxy_module_singleton;
|
||||
}
|
||||
|
||||
#define __GTK_MENU_PROXY_MODULE_C__
|
||||
#include "gtkaliasdef.c"
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2010 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, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Cody Russell <bratsche@gnome.org>
|
||||
*/
|
||||
|
||||
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GTK_MENU_PROXY_MODULE_H__
|
||||
#define __GTK_MENU_PROXY_MODULE_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_MENU_PROXY_MODULE (gtk_menu_proxy_module_get_type ())
|
||||
#define GTK_MENU_PROXY_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_MENU_PROXY_MODULE, GtkMenuProxyModule))
|
||||
#define GTK_MENU_PROXY_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_MENU_PROXY_MODULE, GtkMenuProxyModuleClass))
|
||||
#define GTK_IS_MENU_MODULE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_MENU_PROXY_MODULE))
|
||||
#define GTK_IS_MENU_PROXY_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_MENU_PROXY_MODULE))
|
||||
#define GTK_MENU_PROXY_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_MENU_PROXY_MODULE, GtkMenuProxyModuleClass))
|
||||
|
||||
typedef struct _GtkMenuProxyModule GtkMenuProxyModule;
|
||||
typedef struct _GtkMenuProxyModuleClass GtkMenuProxyModuleClass;
|
||||
typedef struct _GtkMenuProxyModulePrivate GtkMenuProxyModulePrivate;
|
||||
|
||||
struct _GtkMenuProxyModule
|
||||
{
|
||||
GTypeModule parent_instance;
|
||||
|
||||
GtkMenuProxyModulePrivate *priv;
|
||||
|
||||
GModule *library;
|
||||
gchar *name;
|
||||
|
||||
void (* load) (GtkMenuProxyModule *module);
|
||||
void (* unload) (GtkMenuProxyModule *module);
|
||||
};
|
||||
|
||||
struct _GtkMenuProxyModuleClass
|
||||
{
|
||||
GTypeModuleClass parent_class;
|
||||
};
|
||||
|
||||
GType gtk_menu_proxy_module_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkMenuProxyModule *gtk_menu_proxy_module_get (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_MENU_PROXY_MODULE_H__ */
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "gtkmenubar.h"
|
||||
#include "gtkmenuitem.h"
|
||||
#include "gtkmenushell.h"
|
||||
#include "gtkmenuproxy.h"
|
||||
#include "gtkmnemonichash.h"
|
||||
#include "gtktearoffmenuitem.h"
|
||||
#include "gtkwindow.h"
|
||||
@@ -135,6 +136,8 @@ struct _GtkMenuShellPrivate
|
||||
GtkMnemonicHash *mnemonic_hash;
|
||||
GtkKeyHash *key_hash;
|
||||
|
||||
GtkMenuProxy *proxy;
|
||||
|
||||
guint take_focus : 1;
|
||||
guint activated_submenu : 1;
|
||||
/* This flag is a crutch to keep mnemonics in the same menu
|
||||
@@ -408,6 +411,8 @@ gtk_menu_shell_init (GtkMenuShell *menu_shell)
|
||||
priv->key_hash = NULL;
|
||||
priv->take_focus = TRUE;
|
||||
priv->activated_submenu = FALSE;
|
||||
priv->proxy = gtk_menu_proxy_get ();
|
||||
//priv->proxy = gtk_menu_proxy_factory_get_proxy ();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -483,12 +488,22 @@ gtk_menu_shell_insert (GtkMenuShell *menu_shell,
|
||||
gint position)
|
||||
{
|
||||
GtkMenuShellClass *class;
|
||||
GtkMenuShellPrivate *priv;
|
||||
|
||||
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
||||
g_return_if_fail (GTK_IS_MENU_ITEM (child));
|
||||
|
||||
class = GTK_MENU_SHELL_GET_CLASS (menu_shell);
|
||||
|
||||
priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
|
||||
|
||||
// XXX
|
||||
// insert to proxy
|
||||
if (priv->proxy != NULL)
|
||||
gtk_menu_proxy_insert (priv->proxy,
|
||||
child,
|
||||
position);
|
||||
|
||||
if (class->insert)
|
||||
class->insert (menu_shell, child, position);
|
||||
}
|
||||
|
||||
+20
-9
@@ -461,6 +461,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
|
||||
gint border_width;
|
||||
gboolean need_sliders = FALSE;
|
||||
gint up_slider_offset = 0;
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
widget->allocation = *allocation;
|
||||
|
||||
@@ -481,13 +482,15 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
|
||||
if (path_bar->fake_root)
|
||||
width = path_bar->spacing + path_bar->slider_width;
|
||||
else
|
||||
width = 0;
|
||||
width = 0;
|
||||
|
||||
for (list = path_bar->button_list; list; list = list->next)
|
||||
{
|
||||
child = BUTTON_DATA (list->data)->button;
|
||||
|
||||
width += child->requisition.width + path_bar->spacing;
|
||||
gtk_widget_get_child_requisition (child, &child_requisition);
|
||||
|
||||
width += child_requisition.width + path_bar->spacing;
|
||||
if (list == path_bar->fake_root)
|
||||
break;
|
||||
}
|
||||
@@ -515,19 +518,23 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
|
||||
* button, then count backwards.
|
||||
*/
|
||||
/* Count down the path chain towards the end. */
|
||||
width = BUTTON_DATA (first_button->data)->button->requisition.width;
|
||||
gtk_widget_get_child_requisition (BUTTON_DATA (first_button->data)->button, &child_requisition);
|
||||
|
||||
width = child_requisition.width;
|
||||
list = first_button->prev;
|
||||
while (list && !reached_end)
|
||||
{
|
||||
child = BUTTON_DATA (list->data)->button;
|
||||
|
||||
if (width + child->requisition.width +
|
||||
gtk_widget_get_child_requisition (child, &child_requisition);
|
||||
|
||||
if (width + child_requisition.width +
|
||||
path_bar->spacing + slider_space > allocation_width)
|
||||
reached_end = TRUE;
|
||||
else if (list == path_bar->fake_root)
|
||||
break;
|
||||
else
|
||||
width += child->requisition.width + path_bar->spacing;
|
||||
width += child_requisition.width + path_bar->spacing;
|
||||
|
||||
list = list->prev;
|
||||
}
|
||||
@@ -538,13 +545,15 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
child = BUTTON_DATA (first_button->next->data)->button;
|
||||
|
||||
if (width + child->requisition.width + path_bar->spacing + slider_space > allocation_width)
|
||||
gtk_widget_get_child_requisition (child, &child_requisition);
|
||||
|
||||
if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width)
|
||||
{
|
||||
reached_end = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
width += child->requisition.width + path_bar->spacing;
|
||||
width += child_requisition.width + path_bar->spacing;
|
||||
if (first_button == path_bar->fake_root)
|
||||
break;
|
||||
first_button = first_button->next;
|
||||
@@ -582,7 +591,9 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
|
||||
button_data = BUTTON_DATA (list->data);
|
||||
child = button_data->button;
|
||||
|
||||
child_allocation.width = MIN (child->requisition.width,
|
||||
gtk_widget_get_child_requisition (child, &child_requisition);
|
||||
|
||||
child_allocation.width = MIN (child_requisition.width,
|
||||
allocation_width - (path_bar->spacing + path_bar->slider_width) * 2);
|
||||
|
||||
if (direction == GTK_TEXT_DIR_RTL)
|
||||
@@ -601,7 +612,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
|
||||
break;
|
||||
}
|
||||
|
||||
if (child_allocation.width < child->requisition.width)
|
||||
if (child_allocation.width < child_requisition.width)
|
||||
{
|
||||
if (!gtk_widget_get_has_tooltip (child))
|
||||
gtk_widget_set_tooltip_text (child, button_data->dir_name);
|
||||
|
||||
@@ -792,7 +792,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
|
||||
|
||||
/* TODO: make this a gtkfilechooserentry once we move to GTK */
|
||||
priv->entry = gtk_entry_new ();
|
||||
priv->combo = gtk_file_chooser_button_new (source->display_text,
|
||||
priv->combo = gtk_file_chooser_button_new (_("Select a folder"),
|
||||
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
|
||||
|
||||
g_object_set (priv->combo, "local-only", FALSE, NULL);
|
||||
|
||||
+32
-27
@@ -35,37 +35,42 @@ G_BEGIN_DECLS
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
PRIVATE_GTK_USER_STYLE = 1 << 0,
|
||||
PRIVATE_GTK_RESIZE_PENDING = 1 << 2,
|
||||
PRIVATE_GTK_HAS_POINTER = 1 << 3, /* If the pointer is above a window belonging to the widget */
|
||||
PRIVATE_GTK_SHADOWED = 1 << 4, /* If there is a grab in effect shadowing the widget */
|
||||
PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5,
|
||||
PRIVATE_GTK_IN_REPARENT = 1 << 6,
|
||||
PRIVATE_GTK_DIRECTION_SET = 1 << 7, /* If the reading direction is not DIR_NONE */
|
||||
PRIVATE_GTK_DIRECTION_LTR = 1 << 8, /* If the reading direction is DIR_LTR */
|
||||
PRIVATE_GTK_ANCHORED = 1 << 9, /* If widget has a GtkWindow ancestor */
|
||||
PRIVATE_GTK_CHILD_VISIBLE = 1 << 10, /* If widget should be mapped when parent is mapped */
|
||||
PRIVATE_GTK_REDRAW_ON_ALLOC = 1 << 11, /* If we should queue a draw on the entire widget when it is reallocated */
|
||||
PRIVATE_GTK_ALLOC_NEEDED = 1 << 12, /* If we we should allocate even if the allocation is the same */
|
||||
PRIVATE_GTK_REQUEST_NEEDED = 1 << 13 /* Whether we need to call gtk_widget_size_request */
|
||||
PRIVATE_GTK_USER_STYLE = 1 << 0,
|
||||
PRIVATE_GTK_RESIZE_PENDING = 1 << 2,
|
||||
PRIVATE_GTK_HAS_POINTER = 1 << 3, /* If the pointer is above a window belonging to the widget */
|
||||
PRIVATE_GTK_SHADOWED = 1 << 4, /* If there is a grab in effect shadowing the widget */
|
||||
PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5,
|
||||
PRIVATE_GTK_IN_REPARENT = 1 << 6,
|
||||
PRIVATE_GTK_DIRECTION_SET = 1 << 7, /* If the reading direction is not DIR_NONE */
|
||||
PRIVATE_GTK_DIRECTION_LTR = 1 << 8, /* If the reading direction is DIR_LTR */
|
||||
PRIVATE_GTK_ANCHORED = 1 << 9, /* If widget has a GtkWindow ancestor */
|
||||
PRIVATE_GTK_CHILD_VISIBLE = 1 << 10, /* If widget should be mapped when parent is mapped */
|
||||
PRIVATE_GTK_REDRAW_ON_ALLOC = 1 << 11, /* If we should queue a draw on the entire widget when it is reallocated */
|
||||
PRIVATE_GTK_ALLOC_NEEDED = 1 << 12, /* If we we should allocate even if the allocation is the same */
|
||||
PRIVATE_GTK_REQUEST_NEEDED = 1 << 13, /* Whether we need to call gtk_widget_size_request */
|
||||
PRIVATE_GTK_WIDTH_REQUEST_NEEDED = 1 << 14, /* Whether we need to call gtk_extended_layout_get_desired_width */
|
||||
PRIVATE_GTK_HEIGHT_REQUEST_NEEDED = 1 << 15 /* Whether we need to call gtk_extended_layout_get_desired_height */
|
||||
|
||||
} GtkPrivateFlags;
|
||||
|
||||
/* Macros for extracting a widgets private_flags from GtkWidget.
|
||||
*/
|
||||
#define GTK_PRIVATE_FLAGS(wid) (GTK_WIDGET (wid)->private_flags)
|
||||
#define GTK_WIDGET_USER_STYLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_USER_STYLE) != 0)
|
||||
#define GTK_CONTAINER_RESIZE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_PENDING) != 0)
|
||||
#define GTK_WIDGET_HAS_POINTER(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_POINTER) != 0)
|
||||
#define GTK_WIDGET_SHADOWED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_SHADOWED) != 0)
|
||||
#define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0)
|
||||
#define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0)
|
||||
#define GTK_WIDGET_DIRECTION_SET(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_SET) != 0)
|
||||
#define GTK_WIDGET_DIRECTION_LTR(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_LTR) != 0)
|
||||
#define GTK_WIDGET_ANCHORED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ANCHORED) != 0)
|
||||
#define GTK_WIDGET_CHILD_VISIBLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_CHILD_VISIBLE) != 0)
|
||||
#define GTK_WIDGET_REDRAW_ON_ALLOC(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REDRAW_ON_ALLOC) != 0)
|
||||
#define GTK_WIDGET_ALLOC_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ALLOC_NEEDED) != 0)
|
||||
#define GTK_WIDGET_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REQUEST_NEEDED) != 0)
|
||||
#define GTK_PRIVATE_FLAGS(wid) (GTK_WIDGET (wid)->private_flags)
|
||||
#define GTK_WIDGET_USER_STYLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_USER_STYLE) != 0)
|
||||
#define GTK_CONTAINER_RESIZE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_PENDING) != 0)
|
||||
#define GTK_WIDGET_HAS_POINTER(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_POINTER) != 0)
|
||||
#define GTK_WIDGET_SHADOWED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_SHADOWED) != 0)
|
||||
#define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0)
|
||||
#define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0)
|
||||
#define GTK_WIDGET_DIRECTION_SET(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_SET) != 0)
|
||||
#define GTK_WIDGET_DIRECTION_LTR(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_LTR) != 0)
|
||||
#define GTK_WIDGET_ANCHORED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ANCHORED) != 0)
|
||||
#define GTK_WIDGET_CHILD_VISIBLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_CHILD_VISIBLE) != 0)
|
||||
#define GTK_WIDGET_REDRAW_ON_ALLOC(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REDRAW_ON_ALLOC) != 0)
|
||||
#define GTK_WIDGET_ALLOC_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ALLOC_NEEDED) != 0)
|
||||
#define GTK_WIDGET_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REQUEST_NEEDED) != 0)
|
||||
#define GTK_WIDGET_WIDTH_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_WIDTH_REQUEST_NEEDED) != 0)
|
||||
#define GTK_WIDGET_HEIGHT_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HEIGHT_REQUEST_NEEDED) != 0)
|
||||
|
||||
/* Macros for setting and clearing private widget flags.
|
||||
* we use a preprocessor string concatenation here for a clear
|
||||
|
||||
+28
@@ -1334,6 +1334,34 @@ _gtk_rc_style_get_color_hashes (GtkRcStyle *rc_style)
|
||||
return priv->color_hashes;
|
||||
}
|
||||
|
||||
static void gtk_rc_style_prepend_empty_color_hash (GtkRcStyle *rc_style);
|
||||
|
||||
void
|
||||
_gtk_rc_style_set_symbolic_color (GtkRcStyle *rc_style,
|
||||
const gchar *name,
|
||||
const GdkColor *color)
|
||||
{
|
||||
GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (rc_style);
|
||||
GHashTable *our_hash = NULL;
|
||||
|
||||
if (priv->color_hashes)
|
||||
our_hash = priv->color_hashes->data;
|
||||
|
||||
if (our_hash == NULL)
|
||||
{
|
||||
if (color == NULL)
|
||||
return;
|
||||
|
||||
gtk_rc_style_prepend_empty_color_hash (rc_style);
|
||||
our_hash = priv->color_hashes->data;
|
||||
}
|
||||
|
||||
if (color)
|
||||
g_hash_table_insert (our_hash, g_strdup (name), gdk_color_copy (color));
|
||||
else
|
||||
g_hash_table_remove (our_hash, name);
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_rc_properties_cmp (gconstpointer bsearch_node1,
|
||||
gconstpointer bsearch_node2)
|
||||
|
||||
@@ -263,6 +263,10 @@ void _gtk_rc_style_unset_rc_property (GtkRcStyle *rc_style,
|
||||
|
||||
GSList * _gtk_rc_style_get_color_hashes (GtkRcStyle *rc_style);
|
||||
|
||||
void _gtk_rc_style_set_symbolic_color (GtkRcStyle *rc_style,
|
||||
const gchar *name,
|
||||
const GdkColor *color);
|
||||
|
||||
const gchar* _gtk_rc_context_get_default_font_name (GtkSettings *settings);
|
||||
void _gtk_rc_context_destroy (GtkSettings *settings);
|
||||
|
||||
|
||||
+215
-96
@@ -28,6 +28,7 @@
|
||||
#include <math.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include "gtkbindings.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkscrolledwindow.h"
|
||||
#include "gtkwindow.h"
|
||||
@@ -113,8 +114,6 @@ static void gtk_scrolled_window_screen_changed (GtkWidget *widge
|
||||
GdkScreen *previous_screen);
|
||||
static gboolean gtk_scrolled_window_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
static void gtk_scrolled_window_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_scrolled_window_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_scrolled_window_scroll_event (GtkWidget *widget,
|
||||
@@ -142,9 +141,28 @@ static void gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjus
|
||||
|
||||
static void gtk_scrolled_window_update_real_placement (GtkScrolledWindow *scrolled_window);
|
||||
|
||||
static void gtk_scrolled_window_extended_layout_init (GtkExtendedLayoutIface *iface);
|
||||
static void gtk_scrolled_window_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_scrolled_window_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_scrolled_window_get_height_for_width (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
static void gtk_scrolled_window_get_width_for_height (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
|
||||
static guint signals[LAST_SIGNAL] = {0};
|
||||
|
||||
G_DEFINE_TYPE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN)
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
|
||||
gtk_scrolled_window_extended_layout_init))
|
||||
|
||||
|
||||
static void
|
||||
add_scroll_binding (GtkBindingSet *binding_set,
|
||||
@@ -198,7 +216,6 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
|
||||
widget_class->screen_changed = gtk_scrolled_window_screen_changed;
|
||||
widget_class->expose_event = gtk_scrolled_window_expose;
|
||||
widget_class->size_request = gtk_scrolled_window_size_request;
|
||||
widget_class->size_allocate = gtk_scrolled_window_size_allocate;
|
||||
widget_class->scroll_event = gtk_scrolled_window_scroll_event;
|
||||
widget_class->focus = gtk_scrolled_window_focus;
|
||||
@@ -380,9 +397,15 @@ gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window)
|
||||
* gtk_scrolled_window_new:
|
||||
* @hadjustment: (allow-none): horizontal adjustment
|
||||
* @vadjustment: (allow-none): vertical adjustment
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
* Creates a new scrolled window.
|
||||
*
|
||||
=======
|
||||
*
|
||||
* Creates a new scrolled window.
|
||||
*
|
||||
>>>>>>> native-layout-incubator
|
||||
* The two arguments are the scrolled window's adjustments; these will be
|
||||
* shared with the scrollbars and the child widget to keep the bars in sync
|
||||
* with the child. Usually you want to pass %NULL for the adjustments, which
|
||||
@@ -1229,98 +1252,6 @@ gtk_scrolled_window_move_focus_out (GtkScrolledWindow *scrolled_window,
|
||||
g_object_unref (scrolled_window);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkScrolledWindow *scrolled_window;
|
||||
GtkBin *bin;
|
||||
gint extra_width;
|
||||
gint extra_height;
|
||||
gint scrollbar_spacing;
|
||||
GtkRequisition hscrollbar_requisition;
|
||||
GtkRequisition vscrollbar_requisition;
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (widget));
|
||||
g_return_if_fail (requisition != NULL);
|
||||
|
||||
scrolled_window = GTK_SCROLLED_WINDOW (widget);
|
||||
bin = GTK_BIN (scrolled_window);
|
||||
|
||||
scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window);
|
||||
|
||||
extra_width = 0;
|
||||
extra_height = 0;
|
||||
requisition->width = 0;
|
||||
requisition->height = 0;
|
||||
|
||||
gtk_widget_size_request (scrolled_window->hscrollbar,
|
||||
&hscrollbar_requisition);
|
||||
gtk_widget_size_request (scrolled_window->vscrollbar,
|
||||
&vscrollbar_requisition);
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
|
||||
if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
|
||||
requisition->width += child_requisition.width;
|
||||
else
|
||||
{
|
||||
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE);
|
||||
|
||||
if (aux_info && aux_info->width > 0)
|
||||
{
|
||||
requisition->width += aux_info->width;
|
||||
extra_width = -1;
|
||||
}
|
||||
else
|
||||
requisition->width += vscrollbar_requisition.width;
|
||||
}
|
||||
|
||||
if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
|
||||
requisition->height += child_requisition.height;
|
||||
else
|
||||
{
|
||||
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE);
|
||||
|
||||
if (aux_info && aux_info->height > 0)
|
||||
{
|
||||
requisition->height += aux_info->height;
|
||||
extra_height = -1;
|
||||
}
|
||||
else
|
||||
requisition->height += hscrollbar_requisition.height;
|
||||
}
|
||||
}
|
||||
|
||||
if (scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC ||
|
||||
scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
|
||||
{
|
||||
requisition->width = MAX (requisition->width, hscrollbar_requisition.width);
|
||||
if (!extra_height || scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
|
||||
extra_height = scrollbar_spacing + hscrollbar_requisition.height;
|
||||
}
|
||||
|
||||
if (scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC ||
|
||||
scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
|
||||
{
|
||||
requisition->height = MAX (requisition->height, vscrollbar_requisition.height);
|
||||
if (!extra_height || scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
|
||||
extra_width = scrollbar_spacing + vscrollbar_requisition.width;
|
||||
}
|
||||
|
||||
requisition->width += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_width);
|
||||
requisition->height += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_height);
|
||||
|
||||
if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
|
||||
{
|
||||
requisition->width += 2 * widget->style->xthickness;
|
||||
requisition->height += 2 * widget->style->ythickness;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_relative_allocation (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
@@ -1795,5 +1726,193 @@ _gtk_scrolled_window_get_scrollbar_spacing (GtkScrolledWindow *scrolled_window)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_extended_layout_init (GtkExtendedLayoutIface *iface)
|
||||
{
|
||||
iface->get_desired_width = gtk_scrolled_window_get_desired_width;
|
||||
iface->get_desired_height = gtk_scrolled_window_get_desired_height;
|
||||
iface->get_height_for_width = gtk_scrolled_window_get_height_for_width;
|
||||
iface->get_width_for_height = gtk_scrolled_window_get_width_for_height;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_get_desired_size (GtkExtendedLayout *layout,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkScrolledWindow *scrolled_window;
|
||||
GtkBin *bin;
|
||||
gint extra_width;
|
||||
gint extra_height;
|
||||
gint scrollbar_spacing;
|
||||
GtkRequisition hscrollbar_requisition;
|
||||
GtkRequisition vscrollbar_requisition;
|
||||
GtkRequisition minimum_req, natural_req;
|
||||
gint min_child_size, nat_child_size;
|
||||
|
||||
scrolled_window = GTK_SCROLLED_WINDOW (layout);
|
||||
bin = GTK_BIN (scrolled_window);
|
||||
|
||||
scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window);
|
||||
|
||||
extra_width = 0;
|
||||
extra_height = 0;
|
||||
minimum_req.width = 0;
|
||||
minimum_req.height = 0;
|
||||
natural_req.width = 0;
|
||||
natural_req.height = 0;
|
||||
|
||||
gtk_widget_size_request (scrolled_window->hscrollbar,
|
||||
&hscrollbar_requisition);
|
||||
gtk_widget_size_request (scrolled_window->vscrollbar,
|
||||
&vscrollbar_requisition);
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child),
|
||||
&min_child_size,
|
||||
&nat_child_size);
|
||||
|
||||
if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
|
||||
{
|
||||
minimum_req.width += min_child_size;
|
||||
natural_req.width += nat_child_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE);
|
||||
|
||||
if (aux_info && aux_info->width > 0)
|
||||
{
|
||||
minimum_req.width += aux_info->width;
|
||||
natural_req.width += aux_info->width;
|
||||
extra_width = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
minimum_req.width += vscrollbar_requisition.width;
|
||||
natural_req.width += vscrollbar_requisition.width;
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* GTK_ORIENTATION_VERTICAL */
|
||||
{
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child),
|
||||
&min_child_size,
|
||||
&nat_child_size);
|
||||
|
||||
if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
|
||||
{
|
||||
minimum_req.height += min_child_size;
|
||||
natural_req.height += nat_child_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE);
|
||||
|
||||
if (aux_info && aux_info->height > 0)
|
||||
{
|
||||
minimum_req.height += aux_info->height;
|
||||
natural_req.height += aux_info->height;
|
||||
extra_height = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
minimum_req.height += hscrollbar_requisition.height;
|
||||
natural_req.height += hscrollbar_requisition.height;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC ||
|
||||
scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
|
||||
{
|
||||
minimum_req.width = MAX (minimum_req.width, hscrollbar_requisition.width);
|
||||
natural_req.width = MAX (natural_req.width, hscrollbar_requisition.width);
|
||||
if (!extra_height || scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
|
||||
extra_height = scrollbar_spacing + hscrollbar_requisition.height;
|
||||
}
|
||||
|
||||
if (scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC ||
|
||||
scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
|
||||
{
|
||||
minimum_req.height = MAX (minimum_req.height, vscrollbar_requisition.height);
|
||||
natural_req.height = MAX (natural_req.height, vscrollbar_requisition.height);
|
||||
if (!extra_height || scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
|
||||
extra_width = scrollbar_spacing + vscrollbar_requisition.width;
|
||||
}
|
||||
|
||||
minimum_req.width += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_width);
|
||||
minimum_req.height += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_height);
|
||||
natural_req.width += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_width);
|
||||
natural_req.height += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_height);
|
||||
|
||||
if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
|
||||
{
|
||||
minimum_req.width += 2 * GTK_WIDGET (layout)->style->xthickness;
|
||||
minimum_req.height += 2 * GTK_WIDGET (layout)->style->ythickness;
|
||||
natural_req.width += 2 * GTK_WIDGET (layout)->style->xthickness;
|
||||
natural_req.height += 2 * GTK_WIDGET (layout)->style->ythickness;
|
||||
}
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
if (minimum_size)
|
||||
*minimum_size = minimum_req.width;
|
||||
if (natural_size)
|
||||
*natural_size = natural_req.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minimum_size)
|
||||
*minimum_size = minimum_req.height;
|
||||
if (natural_size)
|
||||
*natural_size = natural_req.height;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_scrolled_window_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_scrolled_window_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_get_height_for_width (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_WIDGET (layout));
|
||||
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_get_width_for_height (GtkExtendedLayout *layout,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_WIDGET (layout));
|
||||
|
||||
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width);
|
||||
}
|
||||
|
||||
#define __GTK_SCROLLED_WINDOW_C__
|
||||
#include "gtkaliasdef.c"
|
||||
|
||||
+89
-137
@@ -25,6 +25,7 @@
|
||||
#include "gtkprivate.h"
|
||||
#include "gtksizegroup.h"
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
enum {
|
||||
@@ -71,6 +72,9 @@ static const gchar size_groups_tag[] = "gtk-size-groups";
|
||||
static GQuark visited_quark;
|
||||
static const gchar visited_tag[] = "gtk-size-group-visited";
|
||||
|
||||
static GQuark bumping_quark;
|
||||
static const gchar bumping_tag[] = "gtk-size-group-bumping";
|
||||
|
||||
static GSList *
|
||||
get_size_groups (GtkWidget *widget)
|
||||
{
|
||||
@@ -102,6 +106,18 @@ is_visited (gpointer object)
|
||||
return g_object_get_qdata (object, visited_quark) != NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
mark_bumping (gpointer object, gboolean bumping)
|
||||
{
|
||||
g_object_set_qdata (object, bumping_quark, bumping ? "bumping" : NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_bumping (gpointer object)
|
||||
{
|
||||
return g_object_get_qdata (object, bumping_quark) != NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
add_group_to_closure (GtkSizeGroup *group,
|
||||
GtkSizeGroupMode mode,
|
||||
@@ -154,6 +170,8 @@ real_queue_resize (GtkWidget *widget)
|
||||
{
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED);
|
||||
|
||||
if (widget->parent)
|
||||
_gtk_container_queue_resize (GTK_CONTAINER (widget->parent));
|
||||
@@ -284,6 +302,7 @@ initialize_size_group_quarks (void)
|
||||
{
|
||||
size_groups_quark = g_quark_from_static_string (size_groups_tag);
|
||||
visited_quark = g_quark_from_static_string (visited_tag);
|
||||
bumping_quark = g_quark_from_static_string (bumping_tag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,7 +568,7 @@ gtk_size_group_add_widget (GtkSizeGroup *size_group,
|
||||
|
||||
/**
|
||||
* gtk_size_group_remove_widget:
|
||||
* @size_group: a #GtkSizeGrup
|
||||
* @size_group: a #GtkSizeGroup
|
||||
* @widget: the #GtkWidget to remove
|
||||
*
|
||||
* Removes a widget from a #GtkSizeGroup.
|
||||
@@ -581,7 +600,7 @@ gtk_size_group_remove_widget (GtkSizeGroup *size_group,
|
||||
|
||||
/**
|
||||
* gtk_size_group_get_widgets:
|
||||
* @size_group: a #GtkSizeGrup
|
||||
* @size_group: a #GtkSizeGroup
|
||||
*
|
||||
* Returns the list of widgets associated with @size_group.
|
||||
*
|
||||
@@ -607,42 +626,35 @@ get_base_dimension (GtkWidget *widget,
|
||||
if (aux_info && aux_info->width > 0)
|
||||
return aux_info->width;
|
||||
else
|
||||
return widget->requisition.width;
|
||||
{
|
||||
/* XXX Possibly we should be using natural values and not minimums here. */
|
||||
gint width;
|
||||
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (widget), &width, NULL);
|
||||
|
||||
return width;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aux_info && aux_info->height > 0)
|
||||
return aux_info->height;
|
||||
else
|
||||
return widget->requisition.height;
|
||||
{
|
||||
/* XXX Possibly we should be using natural values and not minimums here. */
|
||||
gint height;
|
||||
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (widget), &height, NULL);
|
||||
|
||||
return height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
do_size_request (GtkWidget *widget)
|
||||
{
|
||||
if (GTK_WIDGET_REQUEST_NEEDED (widget))
|
||||
{
|
||||
gtk_widget_ensure_style (widget);
|
||||
GTK_PRIVATE_UNSET_FLAG (widget, GTK_REQUEST_NEEDED);
|
||||
g_signal_emit_by_name (widget,
|
||||
"size-request",
|
||||
&widget->requisition);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
compute_base_dimension (GtkWidget *widget,
|
||||
GtkSizeGroupMode mode)
|
||||
{
|
||||
do_size_request (widget);
|
||||
|
||||
return get_base_dimension (widget, mode);
|
||||
}
|
||||
|
||||
static gint
|
||||
compute_dimension (GtkWidget *widget,
|
||||
GtkSizeGroupMode mode)
|
||||
GtkSizeGroupMode mode,
|
||||
gint widget_requisition)
|
||||
{
|
||||
GSList *widgets = NULL;
|
||||
GSList *groups = NULL;
|
||||
@@ -658,7 +670,7 @@ compute_dimension (GtkWidget *widget,
|
||||
|
||||
if (!groups)
|
||||
{
|
||||
result = compute_base_dimension (widget, mode);
|
||||
result = widget_requisition;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -674,8 +686,12 @@ compute_dimension (GtkWidget *widget,
|
||||
while (tmp_list)
|
||||
{
|
||||
GtkWidget *tmp_widget = tmp_list->data;
|
||||
gint dimension;
|
||||
|
||||
gint dimension = compute_base_dimension (tmp_widget, mode);
|
||||
if (tmp_widget == widget)
|
||||
dimension = widget_requisition;
|
||||
else
|
||||
dimension = get_base_dimension (tmp_widget, mode);
|
||||
|
||||
if (gtk_widget_get_mapped (tmp_widget) || !group->ignore_hidden)
|
||||
{
|
||||
@@ -715,122 +731,58 @@ compute_dimension (GtkWidget *widget,
|
||||
return result;
|
||||
}
|
||||
|
||||
static gint
|
||||
get_dimension (GtkWidget *widget,
|
||||
GtkSizeGroupMode mode)
|
||||
/**
|
||||
* _gtk_size_group_bump_requisition:
|
||||
* @widget: a #GtkWidget
|
||||
* @mode: either %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_VERTICAL, depending
|
||||
* on the dimension in which to bump the size.
|
||||
*
|
||||
* Refreshes the sizegroup while returning the groups requested
|
||||
* value in the dimension @mode.
|
||||
*
|
||||
* This function is used to update sizegroup minimum size information
|
||||
* in multiple passes from the new #GtkExtendedLayout manager.
|
||||
*/
|
||||
gint
|
||||
_gtk_size_group_bump_requisition (GtkWidget *widget,
|
||||
GtkSizeGroupMode mode,
|
||||
gint widget_requisition)
|
||||
{
|
||||
GSList *widgets = NULL;
|
||||
GSList *groups = NULL;
|
||||
gint result = 0;
|
||||
gint result = widget_requisition;
|
||||
|
||||
add_widget_to_closure (widget, mode, &groups, &widgets);
|
||||
|
||||
g_slist_foreach (widgets, (GFunc)mark_unvisited, NULL);
|
||||
g_slist_foreach (groups, (GFunc)mark_unvisited, NULL);
|
||||
|
||||
if (!groups)
|
||||
if (!is_bumping (widget))
|
||||
{
|
||||
result = get_base_dimension (widget, mode);
|
||||
GtkWidgetAuxInfo *aux_info =
|
||||
_gtk_widget_get_aux_info (widget, FALSE);
|
||||
|
||||
/* Avoid recursion here */
|
||||
mark_bumping (widget, TRUE);
|
||||
|
||||
if (get_size_groups (widget))
|
||||
{
|
||||
if (aux_info)
|
||||
{
|
||||
if (mode == GTK_SIZE_GROUP_HORIZONTAL)
|
||||
result = compute_dimension (widget, mode, MAX (aux_info->width, widget_requisition));
|
||||
else
|
||||
result = compute_dimension (widget, mode, MAX (aux_info->height, widget_requisition));
|
||||
}
|
||||
else
|
||||
result = compute_dimension (widget, mode, widget_requisition);
|
||||
}
|
||||
else if (aux_info)
|
||||
{
|
||||
if (mode == GTK_SIZE_GROUP_HORIZONTAL)
|
||||
result = MAX (aux_info->width, widget_requisition);
|
||||
else
|
||||
result = MAX (aux_info->height, widget_requisition);
|
||||
}
|
||||
mark_bumping (widget, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkSizeGroup *group = groups->data;
|
||||
|
||||
if (mode == GTK_SIZE_GROUP_HORIZONTAL && group->have_width)
|
||||
result = group->requisition.width;
|
||||
else if (mode == GTK_SIZE_GROUP_VERTICAL && group->have_height)
|
||||
result = group->requisition.height;
|
||||
}
|
||||
|
||||
g_slist_free (widgets);
|
||||
g_slist_free (groups);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
get_fast_child_requisition (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (widget, FALSE);
|
||||
|
||||
*requisition = widget->requisition;
|
||||
|
||||
if (aux_info)
|
||||
{
|
||||
if (aux_info->width > 0)
|
||||
requisition->width = aux_info->width;
|
||||
if (aux_info && aux_info->height > 0)
|
||||
requisition->height = aux_info->height;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_size_group_get_child_requisition:
|
||||
* @widget: a #GtkWidget
|
||||
* @requisition: location to store computed requisition.
|
||||
*
|
||||
* Retrieve the "child requisition" of the widget, taking account grouping
|
||||
* of the widget's requisition with other widgets.
|
||||
**/
|
||||
void
|
||||
_gtk_size_group_get_child_requisition (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
initialize_size_group_quarks ();
|
||||
|
||||
if (requisition)
|
||||
{
|
||||
if (get_size_groups (widget))
|
||||
{
|
||||
requisition->width = get_dimension (widget, GTK_SIZE_GROUP_HORIZONTAL);
|
||||
requisition->height = get_dimension (widget, GTK_SIZE_GROUP_VERTICAL);
|
||||
|
||||
/* Only do the full computation if we actually have size groups */
|
||||
}
|
||||
else
|
||||
get_fast_child_requisition (widget, requisition);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_size_group_compute_requisition:
|
||||
* @widget: a #GtkWidget
|
||||
* @requisition: location to store computed requisition.
|
||||
*
|
||||
* Compute the requisition of a widget taking into account grouping of
|
||||
* the widget's requisition with other widgets.
|
||||
**/
|
||||
void
|
||||
_gtk_size_group_compute_requisition (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
initialize_size_group_quarks ();
|
||||
|
||||
if (get_size_groups (widget))
|
||||
{
|
||||
/* Only do the full computation if we actually have size groups */
|
||||
|
||||
width = compute_dimension (widget, GTK_SIZE_GROUP_HORIZONTAL);
|
||||
height = compute_dimension (widget, GTK_SIZE_GROUP_VERTICAL);
|
||||
|
||||
if (requisition)
|
||||
{
|
||||
requisition->width = width;
|
||||
requisition->height = height;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
do_size_request (widget);
|
||||
|
||||
if (requisition)
|
||||
get_fast_child_requisition (widget, requisition);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_size_group_queue_resize:
|
||||
|
||||
+6
-5
@@ -100,11 +100,12 @@ void gtk_size_group_remove_widget (GtkSizeGroup *size_group,
|
||||
GSList * gtk_size_group_get_widgets (GtkSizeGroup *size_group);
|
||||
|
||||
|
||||
void _gtk_size_group_get_child_requisition (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
void _gtk_size_group_compute_requisition (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
void _gtk_size_group_queue_resize (GtkWidget *widget);
|
||||
|
||||
gint _gtk_size_group_bump_requisition (GtkWidget *widget,
|
||||
GtkSizeGroupMode mode,
|
||||
gint widget_requisition);
|
||||
void _gtk_size_group_queue_resize (GtkWidget *widget);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
+59
-1
@@ -170,6 +170,10 @@ static void gtk_status_icon_screen_changed (GtkStatusIcon *status_icon,
|
||||
GdkScreen *old_screen);
|
||||
static void gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon);
|
||||
static void gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon);
|
||||
static void gtk_status_icon_fg_changed (GtkStatusIcon *status_icon);
|
||||
static void gtk_status_icon_color_changed (GtkTrayIcon *tray,
|
||||
GParamSpec *pspec,
|
||||
GtkStatusIcon *status_icon);
|
||||
static gboolean gtk_status_icon_scroll (GtkStatusIcon *status_icon,
|
||||
GdkEventScroll *event);
|
||||
static gboolean gtk_status_icon_query_tooltip (GtkStatusIcon *status_icon,
|
||||
@@ -827,7 +831,7 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
|
||||
priv = G_TYPE_INSTANCE_GET_PRIVATE (status_icon, GTK_TYPE_STATUS_ICON,
|
||||
GtkStatusIconPrivate);
|
||||
status_icon->priv = priv;
|
||||
|
||||
|
||||
priv->storage_type = GTK_IMAGE_EMPTY;
|
||||
priv->visible = TRUE;
|
||||
|
||||
@@ -850,6 +854,14 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
|
||||
G_CALLBACK (gtk_status_icon_embedded_changed), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "notify::orientation",
|
||||
G_CALLBACK (gtk_status_icon_orientation_changed), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "notify::fg-color",
|
||||
G_CALLBACK (gtk_status_icon_fg_changed), status_icon);
|
||||
g_signal_connect (priv->tray_icon, "notify::error-color",
|
||||
G_CALLBACK (gtk_status_icon_color_changed), status_icon);
|
||||
g_signal_connect (priv->tray_icon, "notify::warning-color",
|
||||
G_CALLBACK (gtk_status_icon_color_changed), status_icon);
|
||||
g_signal_connect (priv->tray_icon, "notify::success-color",
|
||||
G_CALLBACK (gtk_status_icon_color_changed), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "button-press-event",
|
||||
G_CALLBACK (gtk_status_icon_button_press), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "button-release-event",
|
||||
@@ -974,6 +986,10 @@ gtk_status_icon_finalize (GObject *object)
|
||||
gtk_status_icon_embedded_changed, status_icon);
|
||||
g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
gtk_status_icon_orientation_changed, status_icon);
|
||||
g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
gtk_status_icon_fg_changed, status_icon);
|
||||
g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
gtk_status_icon_color_changed, status_icon);
|
||||
g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
gtk_status_icon_button_press, status_icon);
|
||||
g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
@@ -1690,6 +1706,48 @@ gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon)
|
||||
g_object_notify (G_OBJECT (status_icon), "orientation");
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_status_icon_fg_changed (GtkStatusIcon *status_icon)
|
||||
{
|
||||
GtkStatusIconPrivate *priv = status_icon->priv;
|
||||
GdkColor color;
|
||||
|
||||
g_object_get (priv->tray_icon, "fg-color", &color, NULL);
|
||||
gtk_widget_modify_fg (priv->image, GTK_STATE_NORMAL, &color);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_status_icon_color_changed (GtkTrayIcon *tray,
|
||||
GParamSpec *pspec,
|
||||
GtkStatusIcon *status_icon)
|
||||
{
|
||||
GtkStatusIconPrivate *priv = status_icon->priv;
|
||||
const gchar *name;
|
||||
GdkColor color;
|
||||
|
||||
switch (pspec->name[0])
|
||||
{
|
||||
case 'e':
|
||||
name = "error";
|
||||
break;
|
||||
case 'w':
|
||||
name = "warning";
|
||||
break;
|
||||
case 's':
|
||||
name = "success";
|
||||
break;
|
||||
default:
|
||||
name = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (name)
|
||||
{
|
||||
g_object_get (priv->tray_icon, pspec->name, &color, NULL);
|
||||
gtk_widget_modify_symbolic_color (priv->image, name, &color);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_status_icon_key_press (GtkStatusIcon *status_icon,
|
||||
GdkEventKey *event)
|
||||
|
||||
+2
-2
@@ -470,11 +470,11 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
|
||||
gtk_widget_show (icon);
|
||||
}
|
||||
|
||||
if (icon && text_orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
if (GTK_IS_MISC (icon) && text_orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_misc_set_alignment (GTK_MISC (icon),
|
||||
1.0 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
|
||||
0.5);
|
||||
else if (icon)
|
||||
else if (GTK_IS_MISC (icon))
|
||||
gtk_misc_set_alignment (GTK_MISC (icon),
|
||||
0.5,
|
||||
gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));
|
||||
|
||||
+177
-5
@@ -43,7 +43,11 @@
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_ORIENTATION
|
||||
PROP_ORIENTATION,
|
||||
PROP_FG_COLOR,
|
||||
PROP_ERROR_COLOR,
|
||||
PROP_WARNING_COLOR,
|
||||
PROP_SUCCESS_COLOR
|
||||
};
|
||||
|
||||
struct _GtkTrayIconPrivate
|
||||
@@ -55,11 +59,16 @@ struct _GtkTrayIconPrivate
|
||||
Atom system_tray_opcode_atom;
|
||||
Atom orientation_atom;
|
||||
Atom visual_atom;
|
||||
Atom colors_atom;
|
||||
Window manager_window;
|
||||
GdkVisual *manager_visual;
|
||||
gboolean manager_visual_rgba;
|
||||
|
||||
GtkOrientation orientation;
|
||||
GdkColor fg_color;
|
||||
GdkColor error_color;
|
||||
GdkColor warning_color;
|
||||
GdkColor success_color;
|
||||
};
|
||||
|
||||
static void gtk_tray_icon_constructed (GObject *object);
|
||||
@@ -75,7 +84,7 @@ static void gtk_tray_icon_style_set (GtkWidget *widget,
|
||||
GtkStyle *previous_style);
|
||||
static gboolean gtk_tray_icon_delete (GtkWidget *widget,
|
||||
GdkEventAny *event);
|
||||
static gboolean gtk_tray_icon_expose (GtkWidget *widget,
|
||||
static gboolean gtk_tray_icon_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
|
||||
static void gtk_tray_icon_clear_manager_window (GtkTrayIcon *icon);
|
||||
@@ -113,6 +122,38 @@ gtk_tray_icon_class_init (GtkTrayIconClass *class)
|
||||
GTK_ORIENTATION_HORIZONTAL,
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_FG_COLOR,
|
||||
g_param_spec_boxed ("fg-color",
|
||||
P_("Foreground color"),
|
||||
P_("Foreground color for symbolic icons"),
|
||||
GDK_TYPE_COLOR,
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_ERROR_COLOR,
|
||||
g_param_spec_boxed ("error-color",
|
||||
P_("Error color"),
|
||||
P_("Error color for symbolic icons"),
|
||||
GDK_TYPE_COLOR,
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_WARNING_COLOR,
|
||||
g_param_spec_boxed ("warning-color",
|
||||
P_("Warning color"),
|
||||
P_("Warning color for symbolic icons"),
|
||||
GDK_TYPE_COLOR,
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_SUCCESS_COLOR,
|
||||
g_param_spec_boxed ("success-color",
|
||||
P_("Success color"),
|
||||
P_("Success color for symbolic icons"),
|
||||
GDK_TYPE_COLOR,
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
g_type_class_add_private (class, sizeof (GtkTrayIconPrivate));
|
||||
}
|
||||
|
||||
@@ -121,9 +162,21 @@ gtk_tray_icon_init (GtkTrayIcon *icon)
|
||||
{
|
||||
icon->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, GTK_TYPE_TRAY_ICON,
|
||||
GtkTrayIconPrivate);
|
||||
|
||||
|
||||
icon->priv->stamp = 1;
|
||||
icon->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
|
||||
icon->priv->fg_color.red = 0x0000;
|
||||
icon->priv->fg_color.green = 0x0000;
|
||||
icon->priv->fg_color.blue = 0x0000;
|
||||
icon->priv->error_color.red = 0xcc00;
|
||||
icon->priv->error_color.green = 0x0000;
|
||||
icon->priv->error_color.blue = 0x0000;
|
||||
icon->priv->warning_color.red = 0xf500;
|
||||
icon->priv->warning_color.green = 0x7900;
|
||||
icon->priv->warning_color.blue = 0x3e00;
|
||||
icon->priv->success_color.red = 0x4e00;
|
||||
icon->priv->success_color.green = 0x9a00;
|
||||
icon->priv->success_color.blue = 0x0600;
|
||||
|
||||
gtk_widget_set_app_paintable (GTK_WIDGET (icon), TRUE);
|
||||
gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK);
|
||||
@@ -161,6 +214,10 @@ gtk_tray_icon_constructed (GObject *object)
|
||||
"_NET_SYSTEM_TRAY_VISUAL",
|
||||
False);
|
||||
|
||||
icon->priv->colors_atom = XInternAtom (xdisplay,
|
||||
"_NET_SYSTEM_TRAY_COLORS",
|
||||
False);
|
||||
|
||||
/* Add a root window filter so that we get changes on MANAGER */
|
||||
gdk_window_add_filter (root_window,
|
||||
gtk_tray_icon_manager_filter, icon);
|
||||
@@ -212,6 +269,18 @@ gtk_tray_icon_get_property (GObject *object,
|
||||
case PROP_ORIENTATION:
|
||||
g_value_set_enum (value, icon->priv->orientation);
|
||||
break;
|
||||
case PROP_FG_COLOR:
|
||||
g_value_set_boxed (value, &icon->priv->fg_color);
|
||||
break;
|
||||
case PROP_ERROR_COLOR:
|
||||
g_value_set_boxed (value, &icon->priv->error_color);
|
||||
break;
|
||||
case PROP_WARNING_COLOR:
|
||||
g_value_set_boxed (value, &icon->priv->warning_color);
|
||||
break;
|
||||
case PROP_SUCCESS_COLOR:
|
||||
g_value_set_boxed (value, &icon->priv->success_color);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -372,9 +441,103 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon)
|
||||
XFree (prop.prop);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tray_icon_get_colors_property (GtkTrayIcon *icon)
|
||||
{
|
||||
GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (icon));
|
||||
GdkDisplay *display = gdk_screen_get_display (screen);
|
||||
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
|
||||
Atom type;
|
||||
int format;
|
||||
union {
|
||||
gulong *prop;
|
||||
guchar *prop_ch;
|
||||
} prop = { NULL };
|
||||
gulong nitems;
|
||||
gulong bytes_after;
|
||||
int error, result;
|
||||
|
||||
g_assert (icon->priv->manager_window != None);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
type = None;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
icon->priv->manager_window,
|
||||
icon->priv->colors_atom,
|
||||
0, G_MAXLONG, FALSE,
|
||||
XA_CARDINAL,
|
||||
&type, &format, &nitems,
|
||||
&bytes_after, &(prop.prop_ch));
|
||||
error = gdk_error_trap_pop ();
|
||||
|
||||
if (error || result != Success)
|
||||
return;
|
||||
|
||||
if (type == XA_CARDINAL && nitems == 12 && format == 32)
|
||||
{
|
||||
GdkColor color;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (icon));
|
||||
|
||||
color.red = prop.prop[0];
|
||||
color.green = prop.prop[1];
|
||||
color.blue = prop.prop[2];
|
||||
|
||||
if (!gdk_color_equal (&icon->priv->fg_color, &color))
|
||||
{
|
||||
icon->priv->fg_color = color;
|
||||
|
||||
g_object_notify (G_OBJECT (icon), "fg-color");
|
||||
}
|
||||
|
||||
color.red = prop.prop[3];
|
||||
color.green = prop.prop[4];
|
||||
color.blue = prop.prop[5];
|
||||
|
||||
if (!gdk_color_equal (&icon->priv->error_color, &color))
|
||||
{
|
||||
icon->priv->error_color = color;
|
||||
|
||||
g_object_notify (G_OBJECT (icon), "error-color");
|
||||
}
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (icon));
|
||||
|
||||
color.red = prop.prop[6];
|
||||
color.green = prop.prop[7];
|
||||
color.blue = prop.prop[8];
|
||||
|
||||
if (!gdk_color_equal (&icon->priv->warning_color, &color))
|
||||
{
|
||||
icon->priv->warning_color = color;
|
||||
|
||||
g_object_notify (G_OBJECT (icon), "warning-color");
|
||||
}
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (icon));
|
||||
|
||||
color.red = prop.prop[9];
|
||||
color.green = prop.prop[10];
|
||||
color.blue = prop.prop[11];
|
||||
|
||||
if (!gdk_color_equal (&icon->priv->success_color, &color))
|
||||
{
|
||||
icon->priv->success_color = color;
|
||||
|
||||
g_object_notify (G_OBJECT (icon), "success-color");
|
||||
}
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (icon));
|
||||
}
|
||||
|
||||
if (type != None)
|
||||
XFree (prop.prop);
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
gtk_tray_icon_manager_filter (GdkXEvent *xevent,
|
||||
GdkEvent *event,
|
||||
gtk_tray_icon_manager_filter (GdkXEvent *xevent,
|
||||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkTrayIcon *icon = user_data;
|
||||
@@ -399,6 +562,14 @@ gtk_tray_icon_manager_filter (GdkXEvent *xevent,
|
||||
|
||||
gtk_tray_icon_get_orientation_property (icon);
|
||||
}
|
||||
else if (xev->xany.type == PropertyNotify &&
|
||||
xev->xproperty.atom == icon->priv->colors_atom)
|
||||
{
|
||||
GTK_NOTE (PLUGSOCKET,
|
||||
g_print ("GtkStatusIcon %p: got PropertyNotify on manager window for colors atom\n", icon));
|
||||
|
||||
gtk_tray_icon_get_colors_property (icon);
|
||||
}
|
||||
else if (xev->xany.type == DestroyNotify)
|
||||
{
|
||||
GTK_NOTE (PLUGSOCKET,
|
||||
@@ -504,6 +675,7 @@ gtk_tray_icon_update_manager_window (GtkTrayIcon *icon)
|
||||
|
||||
gtk_tray_icon_get_orientation_property (icon);
|
||||
gtk_tray_icon_get_visual_property (icon);
|
||||
gtk_tray_icon_get_colors_property (icon);
|
||||
|
||||
if (gtk_widget_get_realized (GTK_WIDGET (icon)))
|
||||
{
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ void _gtk_tray_icon_cancel_message (GtkTrayIcon *icon,
|
||||
guint id);
|
||||
|
||||
GtkOrientation _gtk_tray_icon_get_orientation (GtkTrayIcon *icon);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_TRAY_ICON_H__ */
|
||||
|
||||
@@ -622,6 +622,31 @@ gtk_tree_path_get_indices (GtkTreePath *path)
|
||||
return path->indices;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_tree_path_get_indices_with_depth:
|
||||
* @path: A #GtkTreePath.
|
||||
* @depth: Number of elements returned in the integer array
|
||||
*
|
||||
* Returns the current indices of @path.
|
||||
* This is an array of integers, each representing a node in a tree.
|
||||
* It also returns the number of elements in the array.
|
||||
* The array should not be freed.
|
||||
*
|
||||
* Return value: (array length=depth): The current indices, or %NULL.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
gint *
|
||||
gtk_tree_path_get_indices_with_depth (GtkTreePath *path, gint *depth)
|
||||
{
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
|
||||
if (depth)
|
||||
*depth = path->depth;
|
||||
|
||||
return path->indices;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_tree_path_free:
|
||||
* @path: A #GtkTreePath.
|
||||
|
||||
@@ -134,6 +134,10 @@ void gtk_tree_path_prepend_index (GtkTreePath *path,
|
||||
gint index_);
|
||||
gint gtk_tree_path_get_depth (GtkTreePath *path);
|
||||
gint *gtk_tree_path_get_indices (GtkTreePath *path);
|
||||
|
||||
gint *gtk_tree_path_get_indices_with_depth (GtkTreePath *path,
|
||||
gint *depth);
|
||||
|
||||
void gtk_tree_path_free (GtkTreePath *path);
|
||||
GtkTreePath *gtk_tree_path_copy (const GtkTreePath *path);
|
||||
GType gtk_tree_path_get_type (void) G_GNUC_CONST;
|
||||
|
||||
+55
-22
@@ -234,6 +234,14 @@ static GtkTreePath *gtk_tree_model_filter_remove_root (GtkTr
|
||||
|
||||
static void gtk_tree_model_filter_increment_stamp (GtkTreeModelFilter *filter);
|
||||
|
||||
static void gtk_tree_model_filter_real_modify (GtkTreeModelFilter *self,
|
||||
GtkTreeModel *child_model,
|
||||
GtkTreeIter *iter,
|
||||
GValue *value,
|
||||
gint column);
|
||||
static gboolean gtk_tree_model_filter_real_visible (GtkTreeModelFilter *filter,
|
||||
GtkTreeModel *child_model,
|
||||
GtkTreeIter *child_iter);
|
||||
static gboolean gtk_tree_model_filter_visible (GtkTreeModelFilter *filter,
|
||||
GtkTreeIter *child_iter);
|
||||
static void gtk_tree_model_filter_clear_cache_helper (GtkTreeModelFilter *filter,
|
||||
@@ -311,6 +319,9 @@ gtk_tree_model_filter_class_init (GtkTreeModelFilterClass *filter_class)
|
||||
|
||||
object_class->finalize = gtk_tree_model_filter_finalize;
|
||||
|
||||
filter_class->visible = gtk_tree_model_filter_real_visible;
|
||||
filter_class->modify = gtk_tree_model_filter_real_modify;
|
||||
|
||||
/* Properties -- FIXME: disabled translations for now, until I can come up with a
|
||||
* better description
|
||||
*/
|
||||
@@ -756,12 +767,13 @@ gtk_tree_model_filter_increment_stamp (GtkTreeModelFilter *filter)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_tree_model_filter_visible (GtkTreeModelFilter *filter,
|
||||
GtkTreeIter *child_iter)
|
||||
gtk_tree_model_filter_real_visible (GtkTreeModelFilter *filter,
|
||||
GtkTreeModel *child_model,
|
||||
GtkTreeIter *child_iter)
|
||||
{
|
||||
if (filter->priv->visible_func)
|
||||
{
|
||||
return filter->priv->visible_func (filter->priv->child_model,
|
||||
return filter->priv->visible_func (child_model,
|
||||
child_iter,
|
||||
filter->priv->visible_data)
|
||||
? TRUE : FALSE;
|
||||
@@ -770,7 +782,7 @@ gtk_tree_model_filter_visible (GtkTreeModelFilter *filter,
|
||||
{
|
||||
GValue val = {0, };
|
||||
|
||||
gtk_tree_model_get_value (filter->priv->child_model, child_iter,
|
||||
gtk_tree_model_get_value (child_model, child_iter,
|
||||
filter->priv->visible_column, &val);
|
||||
|
||||
if (g_value_get_boolean (&val))
|
||||
@@ -787,6 +799,14 @@ gtk_tree_model_filter_visible (GtkTreeModelFilter *filter,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_tree_model_filter_visible (GtkTreeModelFilter *self,
|
||||
GtkTreeIter *child_iter)
|
||||
{
|
||||
return GTK_TREE_MODEL_FILTER_GET_CLASS (self)->visible (self,
|
||||
self->priv->child_model, child_iter);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tree_model_filter_clear_cache_helper (GtkTreeModelFilter *filter,
|
||||
FilterLevel *level)
|
||||
@@ -2383,36 +2403,49 @@ gtk_tree_model_filter_get_path (GtkTreeModel *model,
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tree_model_filter_real_modify (GtkTreeModelFilter *self,
|
||||
GtkTreeModel *child_model,
|
||||
GtkTreeIter *iter,
|
||||
GValue *value,
|
||||
gint column)
|
||||
{
|
||||
if (self->priv->modify_func)
|
||||
{
|
||||
g_return_if_fail (column < self->priv->modify_n_columns);
|
||||
|
||||
g_value_init (value, self->priv->modify_types[column]);
|
||||
self->priv->modify_func (GTK_TREE_MODEL (self),
|
||||
iter,
|
||||
value,
|
||||
column,
|
||||
self->priv->modify_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkTreeIter child_iter;
|
||||
|
||||
gtk_tree_model_filter_convert_iter_to_child_iter (
|
||||
GTK_TREE_MODEL_FILTER (self), &child_iter, iter);
|
||||
gtk_tree_model_get_value (child_model,
|
||||
&child_iter, column, value);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tree_model_filter_get_value (GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
gint column,
|
||||
GValue *value)
|
||||
{
|
||||
GtkTreeIter child_iter;
|
||||
GtkTreeModelFilter *filter = GTK_TREE_MODEL_FILTER (model);
|
||||
|
||||
g_return_if_fail (GTK_IS_TREE_MODEL_FILTER (model));
|
||||
g_return_if_fail (GTK_TREE_MODEL_FILTER (model)->priv->child_model != NULL);
|
||||
g_return_if_fail (GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp);
|
||||
|
||||
if (filter->priv->modify_func)
|
||||
{
|
||||
g_return_if_fail (column < filter->priv->modify_n_columns);
|
||||
|
||||
g_value_init (value, filter->priv->modify_types[column]);
|
||||
filter->priv->modify_func (model,
|
||||
iter,
|
||||
value,
|
||||
column,
|
||||
filter->priv->modify_data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_iter, iter);
|
||||
gtk_tree_model_get_value (GTK_TREE_MODEL_FILTER (model)->priv->child_model,
|
||||
&child_iter, column, value);
|
||||
GTK_TREE_MODEL_FILTER_GET_CLASS (model)->modify (filter,
|
||||
filter->priv->child_model, iter, value, column);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -62,11 +62,18 @@ struct _GtkTreeModelFilterClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
gboolean (* visible) (GtkTreeModelFilter *self,
|
||||
GtkTreeModel *child_model,
|
||||
GtkTreeIter *iter);
|
||||
void (* modify) (GtkTreeModelFilter *self,
|
||||
GtkTreeModel *child_model,
|
||||
GtkTreeIter *iter,
|
||||
GValue *value,
|
||||
gint column);
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gtk_reserved0) (void);
|
||||
void (*_gtk_reserved1) (void);
|
||||
void (*_gtk_reserved2) (void);
|
||||
void (*_gtk_reserved3) (void);
|
||||
};
|
||||
|
||||
/* base */
|
||||
|
||||
+88
-32
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkviewport.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkprivate.h"
|
||||
@@ -79,8 +80,6 @@ static gint gtk_viewport_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
static void gtk_viewport_add (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_viewport_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_viewport_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static void gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
|
||||
@@ -88,7 +87,18 @@ static void gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
|
||||
static void gtk_viewport_style_set (GtkWidget *widget,
|
||||
GtkStyle *previous_style);
|
||||
|
||||
G_DEFINE_TYPE (GtkViewport, gtk_viewport, GTK_TYPE_BIN)
|
||||
static void gtk_viewport_extended_layout_init (GtkExtendedLayoutIface *iface);
|
||||
static void gtk_viewport_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_viewport_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkViewport, gtk_viewport, GTK_TYPE_BIN,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
|
||||
gtk_viewport_extended_layout_init))
|
||||
|
||||
static void
|
||||
gtk_viewport_class_init (GtkViewportClass *class)
|
||||
@@ -111,7 +121,6 @@ gtk_viewport_class_init (GtkViewportClass *class)
|
||||
widget_class->realize = gtk_viewport_realize;
|
||||
widget_class->unrealize = gtk_viewport_unrealize;
|
||||
widget_class->expose_event = gtk_viewport_expose;
|
||||
widget_class->size_request = gtk_viewport_size_request;
|
||||
widget_class->size_allocate = gtk_viewport_size_allocate;
|
||||
widget_class->style_set = gtk_viewport_style_set;
|
||||
|
||||
@@ -436,10 +445,13 @@ viewport_set_vadjustment_values (GtkViewport *viewport,
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
GtkRequisition child_requisition;
|
||||
gint natural_height;
|
||||
|
||||
gtk_widget_get_child_requisition (bin->child, &child_requisition);
|
||||
vadjustment->upper = MAX (child_requisition.height, view_allocation.height);
|
||||
gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child),
|
||||
view_allocation.width,
|
||||
NULL,
|
||||
&natural_height);
|
||||
vadjustment->upper = MAX (natural_height, view_allocation.height);
|
||||
}
|
||||
else
|
||||
vadjustment->upper = view_allocation.height;
|
||||
@@ -740,31 +752,6 @@ gtk_viewport_add (GtkContainer *container,
|
||||
GTK_CONTAINER_CLASS (gtk_viewport_parent_class)->add (container, child);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_viewport_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
requisition->width = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
requisition->height = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
if (GTK_VIEWPORT (widget)->shadow_type != GTK_SHADOW_NONE)
|
||||
{
|
||||
requisition->width += 2 * widget->style->xthickness;
|
||||
requisition->height += 2 * widget->style->ythickness;
|
||||
}
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
requisition->width += child_requisition.width;
|
||||
requisition->height += child_requisition.height;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_viewport_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
@@ -868,5 +855,74 @@ gtk_viewport_style_set (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_viewport_extended_layout_init (GtkExtendedLayoutIface *iface)
|
||||
{
|
||||
iface->get_desired_width = gtk_viewport_get_desired_width;
|
||||
iface->get_desired_height = gtk_viewport_get_desired_height;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_viewport_get_desired_size (GtkExtendedLayout *layout,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkWidget *child;
|
||||
gint child_min, child_nat;
|
||||
gint minimum, natural;
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (layout));
|
||||
|
||||
/* XXX This should probably be (border_width * 2); but GTK+ has
|
||||
* been doing this with a single border for a while now...
|
||||
*/
|
||||
minimum = GTK_CONTAINER (layout)->border_width;
|
||||
|
||||
if (GTK_VIEWPORT (layout)->shadow_type != GTK_SHADOW_NONE)
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
minimum += 2 * GTK_WIDGET (layout)->style->xthickness;
|
||||
else
|
||||
minimum += 2 * GTK_WIDGET (layout)->style->ythickness;
|
||||
}
|
||||
|
||||
natural = minimum;
|
||||
|
||||
if (child && gtk_widget_get_visible (child))
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat);
|
||||
else
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat);
|
||||
|
||||
minimum += child_min;
|
||||
natural += child_nat;
|
||||
}
|
||||
|
||||
if (minimum_size)
|
||||
*minimum_size = minimum;
|
||||
|
||||
if (natural_size)
|
||||
*natural_size = natural;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_viewport_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_viewport_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_viewport_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_viewport_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
|
||||
}
|
||||
|
||||
#define __GTK_VIEWPORT_C__
|
||||
#include "gtkaliasdef.c"
|
||||
|
||||
+124
-17
@@ -53,6 +53,7 @@
|
||||
#include "gtkinvisible.h"
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtkbuilderprivate.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
/**
|
||||
@@ -344,6 +345,14 @@ static void gtk_widget_buildable_custom_finished (GtkBuildable
|
||||
static void gtk_widget_buildable_parser_finished (GtkBuildable *buildable,
|
||||
GtkBuilder *builder);
|
||||
|
||||
static void gtk_widget_extended_layout_init (GtkExtendedLayoutIface *iface);
|
||||
static void gtk_widget_real_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_widget_real_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
|
||||
static void gtk_widget_queue_tooltip_query (GtkWidget *widget);
|
||||
|
||||
static void gtk_widget_set_usize_internal (GtkWidget *widget,
|
||||
@@ -419,6 +428,13 @@ gtk_widget_get_type (void)
|
||||
NULL /* interface data */
|
||||
};
|
||||
|
||||
const GInterfaceInfo layout_info =
|
||||
{
|
||||
(GInterfaceInitFunc) gtk_widget_extended_layout_init,
|
||||
(GInterfaceFinalizeFunc) NULL,
|
||||
NULL /* interface data */
|
||||
};
|
||||
|
||||
widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget",
|
||||
&widget_info, G_TYPE_FLAG_ABSTRACT);
|
||||
|
||||
@@ -426,7 +442,8 @@ gtk_widget_get_type (void)
|
||||
&accessibility_info) ;
|
||||
g_type_add_interface_static (widget_type, GTK_TYPE_BUILDABLE,
|
||||
&buildable_info) ;
|
||||
|
||||
g_type_add_interface_static (widget_type, GTK_TYPE_EXTENDED_LAYOUT,
|
||||
&layout_info) ;
|
||||
}
|
||||
|
||||
return widget_type;
|
||||
@@ -2836,6 +2853,8 @@ gtk_widget_init (GtkWidget *widget)
|
||||
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_REDRAW_ON_ALLOC);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED);
|
||||
|
||||
widget->style = gtk_widget_get_default_style ();
|
||||
@@ -3862,7 +3881,7 @@ gtk_widget_draw (GtkWidget *widget,
|
||||
* Also remember that the size request is not necessarily the size
|
||||
* a widget will actually be allocated.
|
||||
*
|
||||
* See also gtk_widget_get_child_requisition().
|
||||
* Deprecated: 3.0: Use gtk_extended_layout_get_desired_size() instead.
|
||||
**/
|
||||
void
|
||||
gtk_widget_size_request (GtkWidget *widget,
|
||||
@@ -3872,10 +3891,11 @@ gtk_widget_size_request (GtkWidget *widget,
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (requisition == &widget->requisition)
|
||||
g_warning ("gtk_widget_size_request() called on child widget with request equal\n to widget->requisition. gtk_widget_set_usize() may not work properly.");
|
||||
g_warning ("gtk_widget_size_request() called on child widget with request equal\n"
|
||||
"to widget->requisition. gtk_widget_set_usize() may not work properly.");
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
_gtk_size_group_compute_requisition (widget, requisition);
|
||||
gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (widget), FALSE, requisition, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3901,12 +3921,15 @@ gtk_widget_size_request (GtkWidget *widget,
|
||||
* since the last time a resize was queued. In general, only container
|
||||
* implementations have this information; applications should use
|
||||
* gtk_widget_size_request().
|
||||
*
|
||||
*
|
||||
* Deprecated: 3.0: Use gtk_extended_layout_get_desired_size() instead.
|
||||
**/
|
||||
void
|
||||
gtk_widget_get_child_requisition (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
_gtk_size_group_get_child_requisition (widget, requisition);
|
||||
gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (widget), FALSE, requisition, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -6683,6 +6706,32 @@ gtk_widget_modify_color_component (GtkWidget *widget,
|
||||
gtk_widget_modify_style (widget, rc_style);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_modify_symbolic_color:
|
||||
* @widget: a #GtkWidget
|
||||
* @name: the name of the symbolic color to modify
|
||||
* @color: (allow-none): the color to assign (does not need to be allocated),
|
||||
* or %NULL to undo the effect of previous calls to
|
||||
* of gtk_widget_modify_symbolic_color().
|
||||
*
|
||||
* Sets a symbolic color for a widget.
|
||||
* All other style values are left untouched. See also
|
||||
* gtk_widget_modify_style().
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
void
|
||||
gtk_widget_modify_symbolic_color (GtkWidget *widget,
|
||||
const gchar *name,
|
||||
const GdkColor *color)
|
||||
{
|
||||
GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget);
|
||||
|
||||
_gtk_rc_style_set_symbolic_color (rc_style, name, color);
|
||||
|
||||
gtk_widget_modify_style (widget, rc_style);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_modify_fg:
|
||||
* @widget: a #GtkWidget
|
||||
@@ -9296,20 +9345,18 @@ _gtk_widget_get_aux_info (GtkWidget *widget,
|
||||
aux_info = g_object_get_qdata (G_OBJECT (widget), quark_aux_info);
|
||||
if (!aux_info && create)
|
||||
{
|
||||
aux_info = g_slice_new (GtkWidgetAuxInfo);
|
||||
aux_info = g_slice_new0 (GtkWidgetAuxInfo);
|
||||
|
||||
aux_info->width = -1;
|
||||
aux_info->height = -1;
|
||||
aux_info->x = 0;
|
||||
aux_info->y = 0;
|
||||
aux_info->x_set = FALSE;
|
||||
aux_info->y_set = FALSE;
|
||||
|
||||
g_object_set_qdata (G_OBJECT (widget), quark_aux_info, aux_info);
|
||||
}
|
||||
|
||||
return aux_info;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************
|
||||
* gtk_widget_aux_info_destroy:
|
||||
*
|
||||
@@ -10155,13 +10202,13 @@ gtk_requisition_get_type (void)
|
||||
* @widget: a #GtkWidget
|
||||
*
|
||||
* Returns the accessible object that describes the widget to an
|
||||
* assistive technology.
|
||||
*
|
||||
* If no accessibility library is loaded (i.e. no ATK implementation library is
|
||||
* loaded via <envar>GTK_MODULES</envar> or via another application library,
|
||||
* such as libgnome), then this #AtkObject instance may be a no-op. Likewise,
|
||||
* if no class-specific #AtkObject implementation is available for the widget
|
||||
* instance in question, it will inherit an #AtkObject implementation from the
|
||||
* assistive technology.
|
||||
*
|
||||
* If no accessibility library is loaded (i.e. no ATK implementation library is
|
||||
* loaded via <envar>GTK_MODULES</envar> or via another application library,
|
||||
* such as libgnome), then this #AtkObject instance may be a no-op. Likewise,
|
||||
* if no class-specific #AtkObject implementation is available for the widget
|
||||
* instance in question, it will inherit an #AtkObject implementation from the
|
||||
* first ancestor class for which such an implementation is defined.
|
||||
*
|
||||
* The documentation of the <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
|
||||
@@ -10742,7 +10789,67 @@ gtk_widget_buildable_custom_finished (GtkBuildable *buildable,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* GtkExtendedLayout implementation
|
||||
*/
|
||||
static void
|
||||
gtk_widget_real_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
/* Set the initial values so that unimplemented classes will fall back
|
||||
* on the "size-request" collected values (see gtksizegroup.c:do_size_request()).
|
||||
*/
|
||||
if (minimum_size)
|
||||
*minimum_size = GTK_WIDGET (layout)->requisition.width;
|
||||
|
||||
if (natural_size)
|
||||
*natural_size = GTK_WIDGET (layout)->requisition.width;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_widget_real_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
/* Set the initial values so that unimplemented classes will fall back
|
||||
* on the "size-request" collected values (see gtksizegroup.c:do_size_request()).
|
||||
*/
|
||||
if (minimum_size)
|
||||
*minimum_size = GTK_WIDGET (layout)->requisition.height;
|
||||
|
||||
if (natural_size)
|
||||
*natural_size = GTK_WIDGET (layout)->requisition.height;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_widget_real_get_height_for_width (GtkExtendedLayout *layout,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
gtk_extended_layout_get_desired_height (layout, minimum_height, natural_height);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_widget_real_get_width_for_height (GtkExtendedLayout *layout,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
gtk_extended_layout_get_desired_width (layout, minimum_width, natural_width);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_widget_extended_layout_init (GtkExtendedLayoutIface *iface)
|
||||
{
|
||||
iface->get_desired_width = gtk_widget_real_get_desired_width;
|
||||
iface->get_desired_height = gtk_widget_real_get_desired_height;
|
||||
iface->get_width_for_height = gtk_widget_real_get_width_for_height;
|
||||
iface->get_height_for_width = gtk_widget_real_get_height_for_width;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_widget_get_clipboard:
|
||||
* @widget: a #GtkWidget
|
||||
|
||||
@@ -482,6 +482,7 @@ typedef struct _GtkClipboard GtkClipboard;
|
||||
typedef struct _GtkTooltip GtkTooltip;
|
||||
typedef struct _GtkWindow GtkWindow;
|
||||
|
||||
|
||||
/**
|
||||
* GtkAllocation:
|
||||
* @x: the X position of the widget's area relative to its parents allocation.
|
||||
@@ -817,6 +818,7 @@ struct _GtkWidgetAuxInfo
|
||||
gint y;
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
guint x_set : 1;
|
||||
guint y_set : 1;
|
||||
};
|
||||
@@ -1156,6 +1158,9 @@ void gtk_widget_modify_cursor (GtkWidget *widget,
|
||||
const GdkColor *secondary);
|
||||
void gtk_widget_modify_font (GtkWidget *widget,
|
||||
PangoFontDescription *font_desc);
|
||||
void gtk_widget_modify_symbolic_color (GtkWidget *widget,
|
||||
const gchar *name,
|
||||
const GdkColor *color);
|
||||
|
||||
#ifndef GTK_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
+72
-29
@@ -48,6 +48,7 @@
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkplug.h"
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtkextendedlayout.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
@@ -207,8 +208,6 @@ static void gtk_window_map (GtkWidget *widget);
|
||||
static void gtk_window_unmap (GtkWidget *widget);
|
||||
static void gtk_window_realize (GtkWidget *widget);
|
||||
static void gtk_window_unrealize (GtkWidget *widget);
|
||||
static void gtk_window_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_window_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gint gtk_window_event (GtkWidget *widget,
|
||||
@@ -350,9 +349,19 @@ static void gtk_window_buildable_custom_finished (GtkBuildable *buildable,
|
||||
gpointer user_data);
|
||||
|
||||
|
||||
static void gtk_window_extended_layout_init (GtkExtendedLayoutIface *iface);
|
||||
static void gtk_window_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_window_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||
gtk_window_buildable_interface_init))
|
||||
gtk_window_buildable_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
|
||||
gtk_window_extended_layout_init))
|
||||
|
||||
static void
|
||||
add_tab_bindings (GtkBindingSet *binding_set,
|
||||
@@ -451,7 +460,6 @@ gtk_window_class_init (GtkWindowClass *klass)
|
||||
widget_class->unmap = gtk_window_unmap;
|
||||
widget_class->realize = gtk_window_realize;
|
||||
widget_class->unrealize = gtk_window_unrealize;
|
||||
widget_class->size_request = gtk_window_size_request;
|
||||
widget_class->size_allocate = gtk_window_size_allocate;
|
||||
widget_class->configure_event = gtk_window_configure_event;
|
||||
widget_class->key_press_event = gtk_window_key_press_event;
|
||||
@@ -4933,30 +4941,6 @@ gtk_window_unrealize (GtkWidget *widget)
|
||||
GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_window_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkWindow *window;
|
||||
GtkBin *bin;
|
||||
|
||||
window = GTK_WINDOW (widget);
|
||||
bin = GTK_BIN (window);
|
||||
|
||||
requisition->width = GTK_CONTAINER (window)->border_width * 2;
|
||||
requisition->height = GTK_CONTAINER (window)->border_width * 2;
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
|
||||
requisition->width += child_requisition.width;
|
||||
requisition->height += child_requisition.height;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_window_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
@@ -5546,6 +5530,64 @@ gtk_window_real_set_focus (GtkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_window_extended_layout_init (GtkExtendedLayoutIface *iface)
|
||||
{
|
||||
iface->get_desired_width = gtk_window_get_desired_width;
|
||||
iface->get_desired_height = gtk_window_get_desired_height;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_window_get_desired_width (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkWindow *window;
|
||||
GtkWidget *child;
|
||||
|
||||
window = GTK_WINDOW (layout);
|
||||
child = gtk_bin_get_child (GTK_BIN (window));
|
||||
|
||||
*minimum_size = GTK_CONTAINER (window)->border_width * 2;
|
||||
*natural_size = GTK_CONTAINER (window)->border_width * 2;
|
||||
|
||||
if (child && gtk_widget_get_visible (child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat);
|
||||
|
||||
*minimum_size += child_min;
|
||||
*natural_size += child_nat;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_window_get_desired_height (GtkExtendedLayout *layout,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkWindow *window;
|
||||
GtkWidget *child;
|
||||
|
||||
window = GTK_WINDOW (layout);
|
||||
child = gtk_bin_get_child (GTK_BIN (window));
|
||||
|
||||
*minimum_size = GTK_CONTAINER (window)->border_width * 2;
|
||||
*natural_size = GTK_CONTAINER (window)->border_width * 2;
|
||||
|
||||
if (child && gtk_widget_get_visible (child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat);
|
||||
|
||||
*minimum_size += child_min;
|
||||
*natural_size += child_nat;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _gtk_window_unset_focus_and_default:
|
||||
* @window: a #GtkWindow
|
||||
@@ -8468,7 +8510,8 @@ gtk_window_get_window_type (GtkWindow *window)
|
||||
return window->type;
|
||||
}
|
||||
|
||||
/* gtk_window_get_mnemonics_visible:
|
||||
/**
|
||||
* gtk_window_get_mnemonics_visible:
|
||||
* @window: a #GtkWindow
|
||||
*
|
||||
* Gets the value of the #GtkWindow:mnemonics-visible property.
|
||||
|
||||
@@ -47,6 +47,10 @@ TEST_PROGS += recentmanager
|
||||
recentmanager_SOURCES = recentmanager.c
|
||||
recentmanager_LDADD = $(progs_ldadd)
|
||||
|
||||
TEST_PROGS += menuproxy
|
||||
menuproxy_SOURCES = menuproxy.c
|
||||
menuproxy_LDADD = $(progs_ldadd)
|
||||
|
||||
TEST_PROGS += floating
|
||||
floating_SOURCES = floating.c
|
||||
floating_LDADD = $(progs_ldadd)
|
||||
|
||||
@@ -0,0 +1,278 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Cody Russell <bratsche@gnome.org>
|
||||
*/
|
||||
|
||||
#undef GTK_DISABLE_DEPRECATED
|
||||
#include "../gtk/gtk.h"
|
||||
|
||||
typedef struct _TestProxy TestProxy;
|
||||
typedef struct _TestProxyClass TestProxyClass;
|
||||
|
||||
//static GType test_proxy_type_id = 0;
|
||||
//static TestProxyClass *test_proxy_parent_class = NULL;
|
||||
|
||||
#define TEST_TYPE_PROXY (test_proxy_type_id)
|
||||
#define TEST_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_PROXY, TestProxy))
|
||||
#define TEST_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_PROXY, TestProxyClass))
|
||||
#define TEST_IS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_PROXY))
|
||||
|
||||
struct _TestProxy
|
||||
{
|
||||
GtkMenuProxy parent_object;
|
||||
};
|
||||
|
||||
struct _TestProxyClass
|
||||
{
|
||||
GtkMenuProxyClass parent_class;
|
||||
};
|
||||
|
||||
static void test_proxy_insert (GtkMenuProxy *proxy,
|
||||
GtkWidget *child,
|
||||
guint position);
|
||||
|
||||
G_DEFINE_DYNAMIC_TYPE(TestProxy, test_proxy, GTK_TYPE_MENU_PROXY)
|
||||
|
||||
static void
|
||||
test_proxy_init (TestProxy *proxy)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
test_proxy_class_init (TestProxyClass *class)
|
||||
{
|
||||
GtkMenuProxyClass *proxy_class = GTK_MENU_PROXY_CLASS (class);
|
||||
|
||||
test_proxy_parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
proxy_class->insert = test_proxy_insert;
|
||||
}
|
||||
|
||||
static void
|
||||
test_proxy_class_finalize (TestProxyClass *class)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
test_proxy_insert (GtkMenuProxy *proxy,
|
||||
GtkWidget *child,
|
||||
guint position)
|
||||
{
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------- */
|
||||
|
||||
#define TEST_TYPE_MODULE (test_module_get_type ())
|
||||
#define TEST_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_MODULE, TestModule))
|
||||
#define TEST_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_MODULE, TestModuleClass))
|
||||
#define TEST_IS_MODULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_MODULE))
|
||||
#define TEST_IS_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TEST_TYPE_MODULE))
|
||||
#define TEST_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TEST_TYPE_MODULE, TestModuleClass))
|
||||
|
||||
|
||||
typedef struct _TestModule TestModule;
|
||||
typedef struct _TestModuleClass TestModuleClass;
|
||||
|
||||
struct _TestModule
|
||||
{
|
||||
GTypeModule parent_instance;
|
||||
};
|
||||
|
||||
struct _TestModuleClass
|
||||
{
|
||||
GTypeModuleClass parent_class;
|
||||
};
|
||||
|
||||
static gboolean
|
||||
test_module_load (GTypeModule *module)
|
||||
{
|
||||
g_print ("registering type...\n");
|
||||
g_print (" type_id = %d\n", test_proxy_type_id);
|
||||
|
||||
test_proxy_register_type (G_TYPE_MODULE (module));
|
||||
|
||||
//test_proxy_get_type (G_TYPE_MODULE (module));
|
||||
|
||||
g_print (" type_id = %d\n", test_proxy_type_id);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
test_module_unload (GTypeModule *module)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
test_module_class_init (TestModuleClass *class)
|
||||
{
|
||||
GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
|
||||
|
||||
type_module_class->load = test_module_load;
|
||||
type_module_class->unload = test_module_unload;
|
||||
}
|
||||
|
||||
static void
|
||||
test_module_init (TestModule *module)
|
||||
{
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE (TestModule, test_module, G_TYPE_TYPE_MODULE);
|
||||
|
||||
TestModule *
|
||||
test_module_new (void)
|
||||
{
|
||||
TestModule *module = g_object_new (TEST_TYPE_MODULE,
|
||||
NULL);
|
||||
|
||||
g_print ("test_module_new(): %p\n", module);
|
||||
|
||||
return module;
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------- */
|
||||
|
||||
static void
|
||||
non_null_proxy_test (void)
|
||||
{
|
||||
GtkMenuProxyModule *module;
|
||||
|
||||
/* prevent the module loader from finding a proxy module */
|
||||
g_unsetenv ("GTK_MENUPROXY");
|
||||
|
||||
module = gtk_menu_proxy_module_get ();
|
||||
test_proxy_register_type (G_TYPE_MODULE (module));
|
||||
//test_proxy_get_type (G_TYPE_MODULE (module));
|
||||
|
||||
GtkWidget *widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
|
||||
g_object_ref_sink (widget);
|
||||
|
||||
g_assert (GTK_IS_MENU_BAR (widget));
|
||||
//g_assert (GTK_MENU_SHELL (widget)->proxy != NULL);
|
||||
|
||||
g_object_unref (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
null_proxy_test (void)
|
||||
{
|
||||
GtkWidget *widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
|
||||
g_object_ref_sink (widget);
|
||||
|
||||
g_assert (GTK_IS_MENU_BAR (widget));
|
||||
|
||||
//g_assert (GTK_MENU_SHELL (widget)->proxy == NULL);
|
||||
|
||||
g_object_unref (widget);
|
||||
}
|
||||
|
||||
static gboolean inserted_called = FALSE;
|
||||
|
||||
static void
|
||||
inserted_cb (GtkMenuProxy *proxy,
|
||||
GtkWidget *child,
|
||||
guint position,
|
||||
gpointer data)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_MENU_PROXY (proxy));
|
||||
g_return_if_fail (GTK_IS_WIDGET (child));
|
||||
inserted_called = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
menubar_signals_proxy_test (void)
|
||||
{
|
||||
GtkWidget *widget = NULL;
|
||||
GtkWidget *menuitem = NULL;
|
||||
GtkMenuProxy *proxy;
|
||||
|
||||
//gtk_menu_proxy_register_type (test_proxy_get_type ());
|
||||
|
||||
widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
|
||||
g_object_ref_sink (widget);
|
||||
|
||||
g_assert (GTK_IS_MENU_BAR (widget));
|
||||
//g_assert (GTK_MENU_SHELL (widget)->proxy != NULL);
|
||||
|
||||
/*
|
||||
proxy = GTK_MENU_SHELL (widget)->proxy;
|
||||
|
||||
g_signal_connect (proxy,
|
||||
"inserted", G_CALLBACK (inserted_cb),
|
||||
NULL);
|
||||
*/
|
||||
|
||||
// insert menuitem
|
||||
menuitem = gtk_menu_item_new_with_label ("Test Item");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (widget),
|
||||
menuitem);
|
||||
|
||||
g_assert (inserted_called == TRUE);
|
||||
|
||||
g_object_unref (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
proxy_type_exists_test (void)
|
||||
{
|
||||
#if 0
|
||||
GtkMenuProxyModule *module;
|
||||
|
||||
g_unsetenv ("GTK_MENUPROXY");
|
||||
|
||||
module = gtk_menu_proxy_module_get ();
|
||||
test_proxy_get_type (G_TYPE_MODULE (module));
|
||||
#endif
|
||||
|
||||
g_assert (gtk_menu_proxy_get_type () != 0);
|
||||
}
|
||||
|
||||
static void
|
||||
can_instantiate_test (void)
|
||||
{
|
||||
TestModule *module = test_module_new ();
|
||||
|
||||
g_type_module_use (G_TYPE_MODULE (module));
|
||||
|
||||
GtkMenuProxy *proxy = gtk_menu_proxy_get ();
|
||||
|
||||
g_assert (proxy != NULL);
|
||||
|
||||
g_object_ref_sink (proxy);
|
||||
|
||||
g_assert (TEST_IS_PROXY (proxy));
|
||||
g_assert (GTK_IS_MENU_PROXY (proxy));
|
||||
|
||||
g_object_unref (proxy);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
gtk_test_init (&argc, &argv);
|
||||
|
||||
g_test_add_func ("/proxy/null-proxy", null_proxy_test);
|
||||
g_test_add_func ("/proxy/type-exists", proxy_type_exists_test);
|
||||
g_test_add_func ("/proxy/can-instantiate", can_instantiate_test);
|
||||
g_test_add_func ("/proxy/non-null-proxy", non_null_proxy_test);
|
||||
g_test_add_func ("/proxy/menubar-signals-proxy", menubar_signals_proxy_test);
|
||||
|
||||
return g_test_run();
|
||||
}
|
||||
+90
-138
@@ -1,15 +1,15 @@
|
||||
# Qırımtatarca translation of gtk+-properties
|
||||
# This file is distributed under the same license as the gtk+-properties package.
|
||||
#
|
||||
# Reşat SABIQ <tilde.birlik@gmail.com>, 2009.
|
||||
# Reşat SABIQ <tilde.birlik@gmail.com>, 2009, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk+-properties\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-03-22 23:35-0400\n"
|
||||
"PO-Revision-Date: 2009-04-09 04:32-0500\n"
|
||||
"PO-Revision-Date: 2010-05-02 13:42-0500\n"
|
||||
"Last-Translator: Reşat SABIQ <tilde.birlik@gmail.com>\n"
|
||||
"Language-Team: Qırımtatarca (Qırım Türkçesi) <tilde-birlik-tercime@lists."
|
||||
"Language-Team: QIRIMTATARCA (Qırım Türkçesi) <tilde-birlik-tercime@lists."
|
||||
"sourceforge.net>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -18,15 +18,14 @@ msgstr ""
|
||||
"X-Generator: KBabel 1.11.4\n"
|
||||
|
||||
#: gdk-pixbuf/gdk-pixbuf-simple-anim.c:165
|
||||
#, fuzzy
|
||||
msgid "Loop"
|
||||
msgstr "Logo"
|
||||
msgstr "İlik"
|
||||
|
||||
# gtk/gtkcolorsel.c:1669
|
||||
# tüklü
|
||||
#: gdk-pixbuf/gdk-pixbuf-simple-anim.c:166
|
||||
#, fuzzy
|
||||
msgid "Whether the animation should loop when it reaches the end"
|
||||
msgstr "Saylamnıñ noqtacını taqip etip etmeycegi"
|
||||
msgstr "Canlandırmanıñ soñuna irişken soñ ilik yapıp yapmaycağı"
|
||||
|
||||
#: gdk-pixbuf/gdk-pixbuf.c:89
|
||||
msgid "Number of Channels"
|
||||
@@ -147,9 +146,8 @@ msgstr "Ekran üzerindeki urufatlarnıñ çezinirligi"
|
||||
|
||||
# gtk/gtksettings.c:151
|
||||
#: gdk/gdkwindow.c:496 gdk/gdkwindow.c:497
|
||||
#, fuzzy
|
||||
msgid "Cursor"
|
||||
msgstr "İmleç Qıpması"
|
||||
msgstr "İmleç"
|
||||
|
||||
# gtk/gtktexttag.c:198
|
||||
#: gtk/gtkaboutdialog.c:298
|
||||
@@ -233,7 +231,7 @@ msgstr "Sanatkârlar"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:449
|
||||
msgid "List of people who have contributed artwork to the program"
|
||||
msgstr "Programğa sanat işlerinen issede bulunğanlarnıñ listesi"
|
||||
msgstr "Programğa sanat işlerinen isse qoşqanlarnıñ listesi"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:466
|
||||
msgid "Translator credits"
|
||||
@@ -370,14 +368,14 @@ msgstr "İşaretçik temasından işaretçikniñ ismi"
|
||||
|
||||
#: gtk/gtkaction.c:292 gtk/gtktoolitem.c:192
|
||||
msgid "Visible when horizontal"
|
||||
msgstr "Gorizontal olğanda körünir"
|
||||
msgstr "Ufqiy olğanda körünir"
|
||||
|
||||
#: gtk/gtkaction.c:293 gtk/gtktoolitem.c:193
|
||||
msgid ""
|
||||
"Whether the toolbar item is visible when the toolbar is in a horizontal "
|
||||
"orientation."
|
||||
msgstr ""
|
||||
"Alet çubuğı gorizontal yöneldirimde olğanda alet çubuğı unsurınıñ körünip "
|
||||
"Alet çubuğı ufqiy yöneldirimde olğanda alet çubuğı unsurınıñ körünip "
|
||||
"körünmeycegi."
|
||||
|
||||
#: gtk/gtkaction.c:308
|
||||
@@ -486,9 +484,8 @@ msgstr "Amel zümresiniñ körünir olıp olmağanı."
|
||||
|
||||
# gtk/gtkprogressbar.c:187
|
||||
#: gtk/gtkactivatable.c:308
|
||||
#, fuzzy
|
||||
msgid "Related Action"
|
||||
msgstr "Amel"
|
||||
msgstr "Munasebetli Amel"
|
||||
|
||||
#: gtk/gtkactivatable.c:309
|
||||
msgid "The action this activatable will activate and receive updates from"
|
||||
@@ -500,10 +497,8 @@ msgstr ""
|
||||
|
||||
# gtk/gtklabel.c:252
|
||||
#: gtk/gtkactivatable.c:332
|
||||
#, fuzzy
|
||||
msgid "Whether to use the related actions appearance properties"
|
||||
msgstr ""
|
||||
"Etiket metniniñ bir depo menü unsurınıñ icadı içün qullanılıp qullanılmaycağı"
|
||||
msgstr "Munasebetli amelniñ körüniş hasiyetleriniñ qullanılıp qullanılmaycağı"
|
||||
|
||||
# gtk/gtkspinbutton.c:264
|
||||
#: gtk/gtkadjustment.c:93 gtk/gtkcellrendererprogress.c:128
|
||||
@@ -567,7 +562,7 @@ msgstr "Tadilniñ saife ölçüsi"
|
||||
# gtk/gtkalignment.c:102
|
||||
#: gtk/gtkalignment.c:90
|
||||
msgid "Horizontal alignment"
|
||||
msgstr "Gorizontal hizalama"
|
||||
msgstr "Ufqiy hizalama"
|
||||
|
||||
# tüklü
|
||||
#: gtk/gtkalignment.c:91 gtk/gtkbutton.c:270
|
||||
@@ -575,8 +570,8 @@ msgid ""
|
||||
"Horizontal position of child in available space. 0.0 is left aligned, 1.0 is "
|
||||
"right aligned"
|
||||
msgstr ""
|
||||
"Faydalanılışlı fezada balanıñ gorizontal mevamı. 0.0 ise solğa, 1.0 ise "
|
||||
"sağğa hizalanır"
|
||||
"Faydalanışlı fezada balanıñ ufqiy mevamı. 0.0 ise solğa, 1.0 ise sağğa "
|
||||
"hizalanır"
|
||||
|
||||
# gtk/gtkalignment.c:112
|
||||
#: gtk/gtkalignment.c:100
|
||||
@@ -588,13 +583,13 @@ msgid ""
|
||||
"Vertical position of child in available space. 0.0 is top aligned, 1.0 is "
|
||||
"bottom aligned"
|
||||
msgstr ""
|
||||
"Faydalanılışlı fezada balanıñ vertikal mevamı. 0.0 ise üstke, 1.0 ise altqa "
|
||||
"Faydalanışlı fezada balanıñ vertikal mevamı. 0.0 ise üstke, 1.0 ise altqa "
|
||||
"hizalanır"
|
||||
|
||||
# gtk/gtkalignment.c:121
|
||||
#: gtk/gtkalignment.c:109
|
||||
msgid "Horizontal scale"
|
||||
msgstr "Gorizontal miqyas"
|
||||
msgstr "Ufqiy miqyas"
|
||||
|
||||
# tüklü
|
||||
#: gtk/gtkalignment.c:110
|
||||
@@ -602,8 +597,8 @@ msgid ""
|
||||
"If available horizontal space is bigger than needed for the child, how much "
|
||||
"of it to use for the child. 0.0 means none, 1.0 means all"
|
||||
msgstr ""
|
||||
"Faydalanılışlı gorizontal feza bala içün kerekkenden büyük ise, onıñ ne "
|
||||
"qadarınıñ bala içün qullanılacağı. 0.0 ise iç, 1.0 ise episi demektir"
|
||||
"Faydalanışlı ufqiy feza bala içün kerekkenden büyük ise, onıñ ne qadarınıñ "
|
||||
"bala içün qullanılacağı. 0.0 ise iç, 1.0 ise episi demektir"
|
||||
|
||||
# gtk/gtkalignment.c:130
|
||||
#: gtk/gtkalignment.c:118
|
||||
@@ -615,7 +610,7 @@ msgid ""
|
||||
"If available vertical space is bigger than needed for the child, how much of "
|
||||
"it to use for the child. 0.0 means none, 1.0 means all"
|
||||
msgstr ""
|
||||
"Faydalanılışlı vertikal feza bala içün kerekkenden büyük ise, onıñ ne "
|
||||
"Faydalanışlı vertikal feza bala içün kerekkenden büyük ise, onıñ ne "
|
||||
"qadarınıñ bala içün qullanılacağıdır. 0.0 ise iç, 1.0 ise episi demektir"
|
||||
|
||||
# tüklü
|
||||
@@ -685,7 +680,7 @@ msgstr "Oq tarafından qullanılacaq fezanıñ miqdarı"
|
||||
# gtk/gtkaspectframe.c:107
|
||||
#: gtk/gtkaspectframe.c:79
|
||||
msgid "Horizontal Alignment"
|
||||
msgstr "Gorizontal Hizalama"
|
||||
msgstr "Ufqiy Hizalama"
|
||||
|
||||
# gtk/gtkaspectframe.c:108
|
||||
#: gtk/gtkaspectframe.c:80
|
||||
@@ -1214,9 +1209,8 @@ msgstr "Eger DOĞRU ise, tafsilât kösterilir"
|
||||
|
||||
# gtk/gtktreeviewcolumn.c:179
|
||||
#: gtk/gtkcelleditable.c:76
|
||||
#, fuzzy
|
||||
msgid "Editing Canceled"
|
||||
msgstr "Tarir etüv"
|
||||
msgstr "Tarir Etüvden Vazgeçildi"
|
||||
|
||||
#: gtk/gtkcelleditable.c:77
|
||||
msgid "Indicates that editing has been canceled"
|
||||
@@ -1616,9 +1610,8 @@ msgid "Whether the spinner is active (ie. shown) in the cell"
|
||||
msgstr "Saylanğan urufat uslûbınıñ etikette kösterilip kösterilmeycegi"
|
||||
|
||||
#: gtk/gtkcellrendererspinner.c:145
|
||||
#, fuzzy
|
||||
msgid "Pulse of the spinner"
|
||||
msgstr "Bastırıcınıñ ismi"
|
||||
msgstr "Aylanıcınıñ nabzı"
|
||||
|
||||
# gtk/gtkwindow.c:333
|
||||
#: gtk/gtkcellrendererspinner.c:159
|
||||
@@ -1851,8 +1844,8 @@ msgid ""
|
||||
"The preferred place to ellipsize the string, if the cell renderer does not "
|
||||
"have enough room to display the entire string"
|
||||
msgstr ""
|
||||
"Eger hüceyre qılıcısı bütün tizgini köstermek içün yeterli alanğa saip degil "
|
||||
"ise, tizgini hazıflaştırmaq içün tercih etilgen yer"
|
||||
"Eger hüceyre qılıcısı bütün tizgini köstermek içün yeterli alanğa saip "
|
||||
"degil ise, tizgini hazıflaştırmaq içün tercih etilgen yer"
|
||||
|
||||
# gtk/gtkentry.c:435
|
||||
#: gtk/gtkcellrenderertext.c:431 gtk/gtkfilechooserbutton.c:421
|
||||
@@ -1874,8 +1867,8 @@ msgid ""
|
||||
"How to break the string into multiple lines, if the cell renderer does not "
|
||||
"have enough room to display the entire string"
|
||||
msgstr ""
|
||||
"Eger hüceyre qılıcısı bütün tizgini köstermek içün yeterli alanğa saip degil "
|
||||
"ise, tizginiñ birden fazla satırğa nasıl bölünecegi"
|
||||
"Eger hüceyre qılıcısı bütün tizgini köstermek içün yeterli alanğa saip "
|
||||
"degil ise, tizginiñ birden fazla satırğa nasıl bölünecegi"
|
||||
|
||||
# gtk/gtklayout.c:435 gtk/gtktreeviewcolumn.c:188 gtk/gtkwidget.c:424
|
||||
#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:685
|
||||
@@ -2586,9 +2579,8 @@ msgid "Width of border around the button area at the bottom of the dialog"
|
||||
msgstr "Dialog tübündeki dögme mesahasınıñ etrafındaki sıñırnıñ kenişligi"
|
||||
|
||||
#: gtk/gtkentry.c:634
|
||||
#, fuzzy
|
||||
msgid "Text Buffer"
|
||||
msgstr "Bufer"
|
||||
msgstr "Metin Buferi"
|
||||
|
||||
#: gtk/gtkentry.c:635
|
||||
msgid "Text buffer object which actually stores entry text"
|
||||
@@ -3021,14 +3013,12 @@ msgid "How long to show the last input character in hidden entries"
|
||||
msgstr "Gizli kirildilerde soñki remizniñ ne qadar müddet kösterilecegi"
|
||||
|
||||
#: gtk/gtkentrybuffer.c:354
|
||||
#, fuzzy
|
||||
msgid "The contents of the buffer"
|
||||
msgstr "Kirildiniñ mündericesi"
|
||||
msgstr "Buferniñ mündericesi"
|
||||
|
||||
#: gtk/gtkentrybuffer.c:369
|
||||
#, fuzzy
|
||||
msgid "Length of the text currently in the buffer"
|
||||
msgstr "Kirildideki ağımdaki metinniñ uzunlığı"
|
||||
msgstr "Buferdeki ağımdaki metinniñ uzunlığı"
|
||||
|
||||
#: gtk/gtkentrycompletion.c:279
|
||||
msgid "Completion Model"
|
||||
@@ -3280,7 +3270,7 @@ msgstr "Gizlilerni Köster"
|
||||
# gtk/gtkfilesel.c:510
|
||||
#: gtk/gtkfilechooser.c:815
|
||||
msgid "Whether the hidden files and folders should be displayed"
|
||||
msgstr "Gizli dosye ve fihristlerniñ kösterilip kösterilmeycegi"
|
||||
msgstr "Gizli dosye ve cilbentlerniñ kösterilip kösterilmeycegi"
|
||||
|
||||
#: gtk/gtkfilechooser.c:830
|
||||
msgid "Do overwrite confirmation"
|
||||
@@ -3296,9 +3286,8 @@ msgstr ""
|
||||
|
||||
# gtk/gtkfilesel.c:509
|
||||
#: gtk/gtkfilechooser.c:847
|
||||
#, fuzzy
|
||||
msgid "Allow folders creation"
|
||||
msgstr "Dosye işletimlerini köster"
|
||||
msgstr "Cilbentler icat etmege izin ber"
|
||||
|
||||
#: gtk/gtkfilechooser.c:848
|
||||
#, fuzzy
|
||||
@@ -3471,7 +3460,7 @@ msgstr "Etiketniñ vertikal hizalaması"
|
||||
|
||||
#: gtk/gtkframe.c:131 gtk/gtkhandlebox.c:167
|
||||
msgid "Deprecated property, use shadow_type instead"
|
||||
msgstr "Takbih etilgen hasiyet, yerine shadow_type qullanıñız"
|
||||
msgstr "Taqbih etilgen hasiyet, yerine shadow_type qullanıñız"
|
||||
|
||||
# gtk/gtkframe.c:152
|
||||
#: gtk/gtkframe.c:138
|
||||
@@ -3657,9 +3646,8 @@ msgstr ""
|
||||
"Unsurlar içün alet-qaranesi metinlerini ihtiva etken model içindeki sutun"
|
||||
|
||||
#: gtk/gtkiconview.c:772
|
||||
#, fuzzy
|
||||
msgid "Item Padding"
|
||||
msgstr "Tüp Şilteleme"
|
||||
msgstr "Unsur Şilteleme"
|
||||
|
||||
#: gtk/gtkiconview.c:773
|
||||
msgid "Padding around icon view items"
|
||||
@@ -3818,21 +3806,18 @@ msgstr "Mesajnıñ türü"
|
||||
|
||||
# gtk/gtkdialog.c:150
|
||||
#: gtk/gtkinfobar.c:440
|
||||
#, fuzzy
|
||||
msgid "Width of border around the content area"
|
||||
msgstr "Ana dialog mesahasınıñ etrafındaki sıñırnıñ kenişligi"
|
||||
msgstr "Muhteva mesahasınıñ etrafındaki sıñırnıñ kenişligi"
|
||||
|
||||
# gtk/gtkscale.c:184
|
||||
#: gtk/gtkinfobar.c:457
|
||||
#, fuzzy
|
||||
msgid "Spacing between elements of the area"
|
||||
msgstr "Ana dialog mesahasınıñ unsurları arasındaki boşluqlama"
|
||||
msgstr "Mesahanıñ unsurları arasındaki boşluqlama"
|
||||
|
||||
# gtk/gtkdialog.c:150
|
||||
#: gtk/gtkinfobar.c:489
|
||||
#, fuzzy
|
||||
msgid "Width of border around the action area"
|
||||
msgstr "Ana dialog mesahasınıñ etrafındaki sıñırnıñ kenişligi"
|
||||
msgstr "Amel mesahasınıñ etrafındaki sıñırnıñ kenişligi"
|
||||
|
||||
#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:627
|
||||
msgid "The screen where this window will be displayed"
|
||||
@@ -3965,15 +3950,13 @@ msgstr "Etiketniñ istengen azamiy kenişligi, remiz cınsından"
|
||||
|
||||
# gtk/gtkwindow.c:333
|
||||
#: gtk/gtklabel.c:737
|
||||
#, fuzzy
|
||||
msgid "Track visited links"
|
||||
msgstr "Ziyaret etilgen ilişimlerniñ tüsü"
|
||||
msgstr "Ziyaret etilgen ilişimlerni taqip et"
|
||||
|
||||
# gtk/gtkfilesel.c:510
|
||||
#: gtk/gtklabel.c:738
|
||||
#, fuzzy
|
||||
msgid "Whether visited links should be tracked"
|
||||
msgstr "Hususiy unsurlarnıñ kösterilip kösterilmeycegi"
|
||||
msgstr "Ziyaret etilgen ilişimlerniñ taqip etilip etilmeycegi"
|
||||
|
||||
# gtk/gtkentry.c:397
|
||||
#: gtk/gtklabel.c:859
|
||||
@@ -4153,7 +4136,7 @@ msgstr "Çifte Oq"
|
||||
|
||||
#: gtk/gtkmenu.c:651
|
||||
msgid "When scrolling, always show both arrows."
|
||||
msgstr "Taydırğanda, er zaman oqlarnıñ ekisi de köster."
|
||||
msgstr "Taydırğanda, er zaman oqlarnıñ ekisini de köster."
|
||||
|
||||
#: gtk/gtkmenu.c:664
|
||||
msgid "Arrow Placement"
|
||||
@@ -4213,7 +4196,7 @@ msgstr ""
|
||||
|
||||
#: gtk/gtkmenu.c:805
|
||||
msgid "Delay before submenus appear"
|
||||
msgstr "Alt-menüler belirmeden evelki keçikme"
|
||||
msgstr "Alt-menüler belirmezden evelki keçikme"
|
||||
|
||||
#: gtk/gtkmenu.c:806
|
||||
msgid ""
|
||||
@@ -4224,15 +4207,14 @@ msgstr ""
|
||||
|
||||
#: gtk/gtkmenu.c:813
|
||||
msgid "Delay before hiding a submenu"
|
||||
msgstr "Bir alt-menüni gizlemeden evelki keçikme"
|
||||
msgstr "Bir alt-menüni gizlemezden evelki keçikme"
|
||||
|
||||
#: gtk/gtkmenu.c:814
|
||||
msgid ""
|
||||
"The time before hiding a submenu when the pointer is moving towards the "
|
||||
"submenu"
|
||||
msgstr ""
|
||||
"Noqtacı bir alt-menüge doğru areket etkende alt-menüni gizlemeden evelki "
|
||||
"vaqıt"
|
||||
"İbre bir alt-menüge doğru areket etkende alt-menüni gizlemezden evelki vaqıt"
|
||||
|
||||
# gtk/gtktexttag.c:267
|
||||
#: gtk/gtkmenubar.c:168
|
||||
@@ -4271,11 +4253,11 @@ msgstr ""
|
||||
|
||||
#: gtk/gtkmenubar.c:210
|
||||
msgid "Delay before drop down menus appear"
|
||||
msgstr "Aşağı tüşken menüler belirmeden evelki keçikme"
|
||||
msgstr "Aşağı tüşken menüler belirmezden evelki keçikme"
|
||||
|
||||
#: gtk/gtkmenubar.c:211
|
||||
msgid "Delay before the submenus of a menu bar appear"
|
||||
msgstr "Menü cubuğınıñ alt-menüleri belirmeden evelki keçikme"
|
||||
msgstr "Menü cubuğınıñ alt-menüleri belirmezden evelki keçikme"
|
||||
|
||||
#: gtk/gtkmenuitem.c:257
|
||||
msgid "Right Justified"
|
||||
@@ -5091,9 +5073,8 @@ msgid "Label for the tab containing custom widgets."
|
||||
msgstr "Şahsiyleştirilgen pencereçiklerni ihtiva etken ilmek içün etiket."
|
||||
|
||||
#: gtk/gtkprintoperation.c:1279 gtk/gtkprintunixdialog.c:345
|
||||
#, fuzzy
|
||||
msgid "Support Selection"
|
||||
msgstr "Tüs Saylamı"
|
||||
msgstr "Saylamnı Destekle"
|
||||
|
||||
#: gtk/gtkprintoperation.c:1280
|
||||
msgid "TRUE if the print operation will support print of selection."
|
||||
@@ -5101,9 +5082,8 @@ msgstr ""
|
||||
|
||||
# gtk/gtkfilesel.c:503
|
||||
#: gtk/gtkprintoperation.c:1296 gtk/gtkprintunixdialog.c:353
|
||||
#, fuzzy
|
||||
msgid "Has Selection"
|
||||
msgstr "Saylamı bar"
|
||||
msgstr "Saylamı Bar"
|
||||
|
||||
#: gtk/gtkprintoperation.c:1297
|
||||
msgid "TRUE if a selecion exists."
|
||||
@@ -5111,24 +5091,21 @@ msgstr ""
|
||||
|
||||
# gtk/gtkruler.c:148
|
||||
#: gtk/gtkprintoperation.c:1312 gtk/gtkprintunixdialog.c:361
|
||||
#, fuzzy
|
||||
msgid "Embed Page Setup"
|
||||
msgstr "Saife Tesbiti"
|
||||
msgstr "Saife Tesbitini İçeri Yatqız"
|
||||
|
||||
#: gtk/gtkprintoperation.c:1313
|
||||
msgid "TRUE if page setup combos are embedded in GtkPrintDialog"
|
||||
msgstr ""
|
||||
|
||||
#: gtk/gtkprintoperation.c:1334
|
||||
#, fuzzy
|
||||
msgid "Number of Pages To Print"
|
||||
msgstr "Saife Sayısı"
|
||||
msgstr "Bastırılacaq Saifelerniñ Sayısı"
|
||||
|
||||
# gtk/gtktable.c:157
|
||||
#: gtk/gtkprintoperation.c:1335
|
||||
#, fuzzy
|
||||
msgid "The number of pages that will be printed."
|
||||
msgstr "Belgedeki saife sayısı."
|
||||
msgstr "Bastırılacaq olğan saifelerniñ sayısı."
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:303
|
||||
msgid "The GtkPageSetup to use"
|
||||
@@ -5154,15 +5131,13 @@ msgstr ""
|
||||
|
||||
# gtk/gtklabel.c:252
|
||||
#: gtk/gtkprintunixdialog.c:346
|
||||
#, fuzzy
|
||||
msgid "Whether the dialog supports selection"
|
||||
msgstr "Etiketniñ saylanğan urufat ile sızılıp sızılmaycağı"
|
||||
msgstr "Dialognıñ saylamnı desteklep desteklemegeni"
|
||||
|
||||
# gtk/gtkwidget.c:443
|
||||
#: gtk/gtkprintunixdialog.c:354
|
||||
#, fuzzy
|
||||
msgid "Whether the application has a selection"
|
||||
msgstr "Amelniñ qabilleştirilgen olıp olmağanı."
|
||||
msgstr "Uyğulamanıñ bir saylamı olıp olmağanı"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:362
|
||||
msgid "TRUE if page setup combos are embedded in GtkPrintUnixDialog"
|
||||
@@ -5198,7 +5173,7 @@ msgstr "Teraqqiyatnıñ metin olaraq kösterilip kösterilmeycegi."
|
||||
# gtk/gtkprogressbar.c:132
|
||||
#: gtk/gtkprogressbar.c:119
|
||||
msgid "The GtkAdjustment connected to the progress bar (Deprecated)"
|
||||
msgstr "Teraqqiyat çubuğına bağlanğan GtkAdjustment (Takbih etilgen)"
|
||||
msgstr "Teraqqiyat çubuğına bağlanğan GtkAdjustment (Taqbih etilgen)"
|
||||
|
||||
# gtk/gtkprogressbar.c:148
|
||||
#: gtk/gtkprogressbar.c:135
|
||||
@@ -5209,7 +5184,7 @@ msgstr "Çubuq uslûbı"
|
||||
# gtk/gtkprogressbar.c:149
|
||||
#: gtk/gtkprogressbar.c:136
|
||||
msgid "Specifies the visual style of the bar in percentage mode (Deprecated)"
|
||||
msgstr "Faiz tarzında çubuqnıñ körsel uslûbını belirtir (Takbih etilgen)"
|
||||
msgstr "Faiz tarzında çubuqnıñ körsel uslûbını belirtir (Taqbih etilgen)"
|
||||
|
||||
# gtk/gtkprogressbar.c:157
|
||||
#: gtk/gtkprogressbar.c:144
|
||||
@@ -5220,7 +5195,7 @@ msgstr "Faaliyet Adımı"
|
||||
# gtk/gtkprogressbar.c:158
|
||||
#: gtk/gtkprogressbar.c:145
|
||||
msgid "The increment used for each iteration in activity mode (Deprecated)"
|
||||
msgstr "Faaliyet tarzında er keneleme içün qullanılğan artım (Takbih etilgen)"
|
||||
msgstr "Faaliyet tarzında er keneleme içün qullanılğan artım (Taqbih etilgen)"
|
||||
|
||||
# gtk/gtkprogressbar.c:167
|
||||
#: gtk/gtkprogressbar.c:152
|
||||
@@ -5234,7 +5209,7 @@ msgid ""
|
||||
"(Deprecated)"
|
||||
msgstr ""
|
||||
"Faaliyet tarzında teraqqiyat çubuğı mesahasına sığa bilecek blok sayısı "
|
||||
"(Takbih etilgen)"
|
||||
"(Taqbih etilgen)"
|
||||
|
||||
# tüklü
|
||||
# gtk/gtkprogressbar.c:177
|
||||
@@ -5967,8 +5942,8 @@ msgid ""
|
||||
"Maximum distance allowed between two clicks for them to be considered a "
|
||||
"double click (in pixels)"
|
||||
msgstr ""
|
||||
"Çifte çertme olaraq mulâaza etilüvi içün eki çertme arasındaki azamiy mesafe "
|
||||
"(piksel cınsından)"
|
||||
"Çifte çertme olaraq mulâaza etilüvi içün eki çertme arasındaki azamiy "
|
||||
"mesafe (piksel cınsından)"
|
||||
|
||||
# gtk/gtksettings.c:151
|
||||
#: gtk/gtksettings.c:249
|
||||
@@ -6012,7 +5987,7 @@ msgid ""
|
||||
"Whether two cursors should be displayed for mixed left-to-right and right-to-"
|
||||
"left text"
|
||||
msgstr ""
|
||||
"Qarışıq soldan-sağğa hem de sağdan-solğa metin içün eki imleçniñ kösterilip "
|
||||
"Qarışıq soldan-sağğa em de sağdan-solğa metin içün eki imleçniñ kösterilip "
|
||||
"kösterilmeycegi"
|
||||
|
||||
# gtk/gtksettings.c:175
|
||||
@@ -6070,7 +6045,7 @@ msgstr "Süyrekleme bosağası"
|
||||
|
||||
#: gtk/gtksettings.c:339
|
||||
msgid "Number of pixels the cursor can move before dragging"
|
||||
msgstr "Süyreklemeden evel imleçniñ areket ete bilecegi piksel sayısı"
|
||||
msgstr "Süyreklemezden evel imleçniñ areket ete bilecegi piksel sayısı"
|
||||
|
||||
# gtk/gtkfontsel.c:185
|
||||
#: gtk/gtksettings.c:347
|
||||
@@ -6279,7 +6254,7 @@ msgstr "Alet-qaranesi zaman aşımı"
|
||||
|
||||
#: gtk/gtksettings.c:608
|
||||
msgid "Timeout before tooltip is shown"
|
||||
msgstr "Alet-qaranesi kösterilmeden evel keçikme"
|
||||
msgstr "Alet-qaranesi kösterilmezden evel keçikme"
|
||||
|
||||
#: gtk/gtksettings.c:633
|
||||
msgid "Tooltip browse timeout"
|
||||
@@ -6288,7 +6263,7 @@ msgstr "Alet-qaranesi kezinme zaman aşımı"
|
||||
#: gtk/gtksettings.c:634
|
||||
msgid "Timeout before tooltip is shown when browse mode is enabled"
|
||||
msgstr ""
|
||||
"Kezinme tarzı qabilleştirilgen olğanda, alet-qaranesi kösterilmeden evelki "
|
||||
"Kezinme tarzı qabilleştirilgen olğanda, alet-qaranesi kösterilmezden evelki "
|
||||
"keçikme"
|
||||
|
||||
#: gtk/gtksettings.c:655
|
||||
@@ -6297,7 +6272,7 @@ msgstr "Alet-qaranesi kezinme tarzı zaman aşımı"
|
||||
|
||||
#: gtk/gtksettings.c:656
|
||||
msgid "Timeout after which browse mode is disabled"
|
||||
msgstr "Kezinme tarzı ğayrı qabilleştirilmeden evelki keçikme"
|
||||
msgstr "Kezinme tarzı ğayrı qabilleştirilmezden evelki keçikme"
|
||||
|
||||
# tüklü
|
||||
#: gtk/gtksettings.c:675
|
||||
@@ -6309,7 +6284,7 @@ msgstr "Ancaq Tuş Yürsetme İmleçi"
|
||||
msgid "When TRUE, there are only cursor keys available to navigate widgets"
|
||||
msgstr ""
|
||||
"DOĞRU olğanda, pencereçikler içerisinde yürsetmek içün sadece imleç tuşları "
|
||||
"faydalanılışlı olur"
|
||||
"faydalanışlı olur"
|
||||
|
||||
# tüklü
|
||||
#: gtk/gtksettings.c:693
|
||||
@@ -6475,21 +6450,18 @@ msgstr ""
|
||||
|
||||
# gtk/gtktoolbar.c:290
|
||||
#: gtk/gtksettings.c:996
|
||||
#, fuzzy
|
||||
msgid "Toolbar Icon Size"
|
||||
msgstr "Alet çubuğı işaretçik ölçüsi"
|
||||
msgstr "Alet Çubuğı İşaretçik Ölçüsi"
|
||||
|
||||
# gtk/gtktoolbar.c:291
|
||||
#: gtk/gtksettings.c:997
|
||||
#, fuzzy
|
||||
msgid "The size of icons in default toolbars."
|
||||
msgstr "Ög-belgilengen alet çubuqlarındaki işaretçiklerniñ ölçüsi"
|
||||
msgstr "Ög-belgilengen alet çubuqlarındaki işaretçiklerniñ ölçüsi."
|
||||
|
||||
# gtk/gtkstock.c:267
|
||||
#: gtk/gtksettings.c:1014
|
||||
#, fuzzy
|
||||
msgid "Auto Mnemonics"
|
||||
msgstr "Hatırlatıcılarnı Qabilleştir"
|
||||
msgstr "Avto Hatırlatıcılar"
|
||||
|
||||
#: gtk/gtksettings.c:1015
|
||||
msgid ""
|
||||
@@ -6592,14 +6564,12 @@ msgstr "Aylanma dögmesiniñ etrafındaki şev uslûbı"
|
||||
|
||||
# gtk/gtkwidget.c:443
|
||||
#: gtk/gtkspinner.c:129
|
||||
#, fuzzy
|
||||
msgid "Whether the spinner is active"
|
||||
msgstr "Birlemci işaretçikniñ faalleştirile bilip bilmegeni"
|
||||
msgstr "Aylanıcınıñ faal olıp olmağanı"
|
||||
|
||||
#: gtk/gtkspinner.c:143
|
||||
#, fuzzy
|
||||
msgid "Number of steps"
|
||||
msgstr "Saife Sayısı"
|
||||
msgstr "Adım sayısı"
|
||||
|
||||
#: gtk/gtkspinner.c:144
|
||||
msgid ""
|
||||
@@ -6610,9 +6580,8 @@ msgstr ""
|
||||
|
||||
# gtk/gtkstock.c:267
|
||||
#: gtk/gtkspinner.c:159
|
||||
#, fuzzy
|
||||
msgid "Animation duration"
|
||||
msgstr "Canlandırma"
|
||||
msgstr "Canlandırma süresi"
|
||||
|
||||
#: gtk/gtkspinner.c:160
|
||||
msgid ""
|
||||
@@ -6695,9 +6664,8 @@ msgstr "Bu sini işaretçigi içün alet-qaranesi mündericesi"
|
||||
|
||||
# gtk/gtkwindow.c:333
|
||||
#: gtk/gtkstatusicon.c:425
|
||||
#, fuzzy
|
||||
msgid "The title of this tray icon"
|
||||
msgstr "İşaretçikniñ ölçüsi"
|
||||
msgstr "Bu sini işaretçiginiñ ölçüsi"
|
||||
|
||||
# gtk/gtktable.c:156
|
||||
#: gtk/gtktable.c:129
|
||||
@@ -7572,15 +7540,13 @@ msgstr ""
|
||||
"çubuğı dögmeleri metinni GTK_TOOLBAR_BOTH_HORIZ tarzında kösterir"
|
||||
|
||||
#: gtk/gtktoolitemgroup.c:1536
|
||||
#, fuzzy
|
||||
msgid "The human-readable title of this item group"
|
||||
msgstr "Durumnıñ insanca oqula bilgen tasviri"
|
||||
msgstr "Bu unsur zümresiniñ insanca oqulabilgen serlevası"
|
||||
|
||||
# gtk/gtkframe.c:162
|
||||
#: gtk/gtktoolitemgroup.c:1543
|
||||
#, fuzzy
|
||||
msgid "A widget to display in place of the usual label"
|
||||
msgstr "Adetiy çerçive etiketiniñ yerinde kösterilecek bir pencereçik"
|
||||
msgstr "Adetiy etiketniñ yerinde kösterilecek bir pencereçik"
|
||||
|
||||
#: gtk/gtktoolitemgroup.c:1549
|
||||
msgid "Collapsed"
|
||||
@@ -7594,9 +7560,8 @@ msgstr ""
|
||||
"Bala pencereçigini ortağa çıqarmaq içün kenişleticiniñ açılğan olıp olmağanı"
|
||||
|
||||
#: gtk/gtktoolitemgroup.c:1556
|
||||
#, fuzzy
|
||||
msgid "ellipsize"
|
||||
msgstr "Hazıflaştır"
|
||||
msgstr "hazıflaştır"
|
||||
|
||||
#: gtk/gtktoolitemgroup.c:1557
|
||||
msgid "Ellipsize for item group headers"
|
||||
@@ -7604,9 +7569,8 @@ msgstr ""
|
||||
|
||||
# gtk/gtktreeview.c:489
|
||||
#: gtk/gtktoolitemgroup.c:1563
|
||||
#, fuzzy
|
||||
msgid "Header Relief"
|
||||
msgstr "Başlıq sureti"
|
||||
msgstr "Başlıq Relyefi"
|
||||
|
||||
# gtk/gtktreeview.c:482
|
||||
#: gtk/gtktoolitemgroup.c:1564
|
||||
@@ -7615,27 +7579,24 @@ msgid "Relief of the group header button"
|
||||
msgstr "Sutun başlığı dögmelerini köster"
|
||||
|
||||
#: gtk/gtktoolitemgroup.c:1579
|
||||
#, fuzzy
|
||||
msgid "Header Spacing"
|
||||
msgstr "Başlıq Şilteleme"
|
||||
msgstr "Başlıq Boşluqlaması"
|
||||
|
||||
# gtk/gtkoptionmenu.c:164
|
||||
# tüklü
|
||||
#: gtk/gtktoolitemgroup.c:1580
|
||||
#, fuzzy
|
||||
msgid "Spacing between expander arrow and caption"
|
||||
msgstr "Kenişletici oqunıñ etrafındaki boşluq"
|
||||
msgstr "Kenişletici oqu ve serlevası arasındaki boşluqlama"
|
||||
|
||||
# gtk/gtkbox.c:137
|
||||
#: gtk/gtktoolitemgroup.c:1596
|
||||
#, fuzzy
|
||||
msgid "Whether the item should receive extra space when the group grows"
|
||||
msgstr "Alet çubuğı büyügeni zaman unsurnıñ ziyade feza alıp almaycağı"
|
||||
msgstr "Zümre büyügeni zaman unsurnıñ ziyade feza alıp almaycağı"
|
||||
|
||||
# gtk/gtkbox.c:137
|
||||
#: gtk/gtktoolitemgroup.c:1603
|
||||
#, fuzzy
|
||||
msgid "Whether the item should fill the available space"
|
||||
msgstr "Balalarnıñ episiniñ aynı ölçüde olıp olmaycağı"
|
||||
msgstr "Unsurnıñ faydalanışlı fezanı toldurıp toldurmaycağı"
|
||||
|
||||
#: gtk/gtktoolitemgroup.c:1609
|
||||
msgid "New Row"
|
||||
@@ -7643,27 +7604,23 @@ msgstr ""
|
||||
|
||||
# gtk/gtkcheckmenuitem.c:115
|
||||
#: gtk/gtktoolitemgroup.c:1610
|
||||
#, fuzzy
|
||||
msgid "Whether the item should start a new row"
|
||||
msgstr "Unsurlarnıñ bir numara ile beraber kösterilip kösterilmeycegi"
|
||||
msgstr "Unsurnıñ yañı bir saf başlatıp başlatmaycağı"
|
||||
|
||||
# gtk/gtkruler.c:139
|
||||
#: gtk/gtktoolitemgroup.c:1617
|
||||
#, fuzzy
|
||||
msgid "Position of the item within this group"
|
||||
msgstr "Cedvel üzerindeki tamğanıñ mevamı"
|
||||
msgstr "Unsurnıñ zümre içerisindeki mevamı"
|
||||
|
||||
# gtk/gtktoolbar.c:291
|
||||
#: gtk/gtktoolpalette.c:991
|
||||
#, fuzzy
|
||||
msgid "Size of icons in this tool palette"
|
||||
msgstr "Bu alet çubuğındaki işaretçiklerniñ ölçüsi"
|
||||
msgstr "Bu alet paletindeki işaretçiklerniñ ölçüsi"
|
||||
|
||||
# gtk/gtktoolbar.c:277
|
||||
#: gtk/gtktoolpalette.c:1021
|
||||
#, fuzzy
|
||||
msgid "Style of items in the tool palette"
|
||||
msgstr "Alet çubuğınıñ etrafındaki şevniñ uslûbı"
|
||||
msgstr "Alet paletindeki unsurlarnıñ uslûbı"
|
||||
|
||||
#: gtk/gtktoolpalette.c:1037
|
||||
msgid "Exclusive"
|
||||
@@ -8075,9 +8032,8 @@ msgid "Sort direction the sort indicator should indicate"
|
||||
msgstr "Sıra köstergiçiniñ kösterecegi sıra yönelişi"
|
||||
|
||||
#: gtk/gtktreeviewcolumn.c:341
|
||||
#, fuzzy
|
||||
msgid "Sort column ID"
|
||||
msgstr "Metin sutunı"
|
||||
msgstr "Sıralama sutunı kimligi"
|
||||
|
||||
#: gtk/gtktreeviewcolumn.c:342
|
||||
msgid "Logical sort column ID this column sorts on when selected for sorting"
|
||||
@@ -8313,15 +8269,13 @@ msgid "The widget's window if it is realized"
|
||||
msgstr "Pencereçikniñ penceresi, eger cisimleştirilgen ise"
|
||||
|
||||
#: gtk/gtkwidget.c:774
|
||||
#, fuzzy
|
||||
msgid "Double Buffered"
|
||||
msgstr "Bufer"
|
||||
msgstr "Çifte Buferli"
|
||||
|
||||
# gtk/gtkwidget.c:443
|
||||
#: gtk/gtkwidget.c:775
|
||||
#, fuzzy
|
||||
msgid "Whether or not the widget is double buffered"
|
||||
msgstr "Tıqaçnıñ içeri yatqızılğan olıp olmağanı"
|
||||
msgstr "Pencereçikniñ çifte buferli olıp olmağanı"
|
||||
|
||||
# gtk/gtkwidget.c:1068
|
||||
#: gtk/gtkwidget.c:2403
|
||||
@@ -8381,7 +8335,7 @@ msgid ""
|
||||
"Color with which to draw the secondary insertion cursor when editing mixed "
|
||||
"right-to-left and left-to-right text"
|
||||
msgstr ""
|
||||
"Qarışıq soldan-sağğa hem de sağdan-solğa metinni tarir etkende ekilemci "
|
||||
"Qarışıq soldan-sağğa em de sağdan-solğa metinni tarir etkende ekilemci "
|
||||
"qıstırma imleçiniñ sızılacağı tüs"
|
||||
|
||||
#: gtk/gtkwidget.c:2441
|
||||
@@ -8605,15 +8559,13 @@ msgstr "Bu pencere içün işaretçik"
|
||||
|
||||
# gtk/gtklabel.c:258
|
||||
#: gtk/gtkwindow.c:602
|
||||
#, fuzzy
|
||||
msgid "Mnemonics Visible"
|
||||
msgstr "Hatırlatıcı tuş"
|
||||
msgstr "Hatırlatıcılar Körüne"
|
||||
|
||||
# gtk/gtkwidget.c:485
|
||||
#: gtk/gtkwindow.c:603
|
||||
#, fuzzy
|
||||
msgid "Whether mnemonics are currently visible in this window"
|
||||
msgstr "Üst seviyeniñ al-azırda faal pencere olıp olmağanı"
|
||||
msgstr "Hatırlatıcılarnıñ al-azırda bu pencerede körünip körünmegeni"
|
||||
|
||||
#: gtk/gtkwindow.c:619
|
||||
msgid "Name of the themed icon for this window"
|
||||
|
||||
+1827
-1765
File diff suppressed because it is too large
Load Diff
+1824
-1768
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,15 @@
|
||||
# Translation of gtk+ to Qırımtatarca.
|
||||
# This file is distributed under the same license as the gtk+ package.
|
||||
#
|
||||
# Reşat SABIQ <tilde.birlik@gmail.com>, 2009.
|
||||
# Reşat SABIQ <tilde.birlik@gmail.com>, 2009, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk+ TRUNK\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-03-22 23:34-0400\n"
|
||||
"PO-Revision-Date: 2009-04-09 03:07-0500\n"
|
||||
"PO-Revision-Date: 2010-05-02 14:03-0500\n"
|
||||
"Last-Translator: Reşat SABIQ <tilde.birlik@gmail.com>\n"
|
||||
"Language-Team: Qırımtatarca (Qırım Türkçesi) <tilde-birlik-tercime@lists."
|
||||
"Language-Team: QIRIMTATARCA (Qırım Türkçesi) <tilde-birlik-tercime@lists."
|
||||
"sourceforge.net>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -992,9 +992,8 @@ msgstr ""
|
||||
# tüklü
|
||||
# gdk-pixbuf/io-tiff.c:264
|
||||
#: gdk-pixbuf/io-qtif.c:143
|
||||
#, fuzzy
|
||||
msgid "Failed to read QTIF header"
|
||||
msgstr "Başlıq yazılamadı\n"
|
||||
msgstr "QTIF başlığı oqulamadı"
|
||||
|
||||
#: gdk-pixbuf/io-qtif.c:152 gdk-pixbuf/io-qtif.c:182 gdk-pixbuf/io-qtif.c:446
|
||||
#, c-format
|
||||
@@ -1003,9 +1002,9 @@ msgstr ""
|
||||
|
||||
# gdk-pixbuf/gdk-pixdata.c:378
|
||||
#: gdk-pixbuf/io-qtif.c:172
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "Failed to allocate %d bytes for file read buffer"
|
||||
msgstr "%u baytlıq suret buferi tahsis etilamadı"
|
||||
msgstr "%d baytlıq suret oquv buferi tahsis etilamadı"
|
||||
|
||||
# gdk-pixbuf/io-gif.c:218
|
||||
#: gdk-pixbuf/io-qtif.c:196
|
||||
@@ -1026,9 +1025,8 @@ msgstr "TGA kontekst yapısı içün hafiza tahsis etilamay"
|
||||
|
||||
# gdk-pixbuf/io-xbm.c:429
|
||||
#: gdk-pixbuf/io-qtif.c:317
|
||||
#, fuzzy
|
||||
msgid "Failed to create GdkPixbufLoader object."
|
||||
msgstr "Fihrist indeksi yazılamadı\n"
|
||||
msgstr "GdkPixbufLoader nesnesi icat etilamadı."
|
||||
|
||||
# gdk-pixbuf/io-tiff.c:264
|
||||
#: gdk-pixbuf/io-qtif.c:421
|
||||
@@ -1037,9 +1035,8 @@ msgid "Failed to find an image data atom."
|
||||
msgstr "TIFF sureti açılamadı"
|
||||
|
||||
#: gdk-pixbuf/io-qtif.c:602
|
||||
#, fuzzy
|
||||
msgid "The QTIF image format"
|
||||
msgstr "TIFF suret formatı"
|
||||
msgstr "QTIF suret formatı"
|
||||
|
||||
# gdk-pixbuf/io-bmp.c:278 gdk-pixbuf/io-bmp.c:300
|
||||
#: gdk-pixbuf/io-ras.c:126
|
||||
@@ -1397,9 +1394,8 @@ msgid_plural "Opening %d Items"
|
||||
msgstr[0] "%d Unsur Açıla"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:242
|
||||
#, fuzzy
|
||||
msgid "Could not show link"
|
||||
msgstr "Liste temizlenamadı"
|
||||
msgstr "İlişim kösterilamadı"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:365 gtk/gtkaboutdialog.c:2263
|
||||
msgid "License"
|
||||
@@ -1520,9 +1516,9 @@ msgstr "Keri-egik-sızıq"
|
||||
|
||||
# gdk-pixbuf/io-xbm.c:284
|
||||
#: gtk/gtkbuilderparser.c:343
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "Invalid type function on line %d: '%s'"
|
||||
msgstr "Keçersiz türden funktsiya: `%s'"
|
||||
msgstr "%d satrında keçersiz türden funktsiya: `%s'"
|
||||
|
||||
#: gtk/gtkbuilderparser.c:407
|
||||
#, c-format
|
||||
@@ -1635,10 +1631,9 @@ msgstr "Ğayrı qabilleştirilgen"
|
||||
#. * to gtk_accelerator_valid().
|
||||
#.
|
||||
#: gtk/gtkcellrendereraccel.c:254
|
||||
#, fuzzy
|
||||
msgctxt "Accelerator"
|
||||
msgid "Invalid"
|
||||
msgstr "Keçersiz URI"
|
||||
msgstr "Keçersiz"
|
||||
|
||||
#. This label is displayed in a treeview cell displaying
|
||||
#. * an accelerator when the cell is clicked to change the
|
||||
@@ -1677,8 +1672,8 @@ msgid ""
|
||||
"Click the eyedropper, then click a color anywhere on your screen to select "
|
||||
"that color."
|
||||
msgstr ""
|
||||
"Köz-tamçılığına çertken soñ ekranıñızda olğan er angi tüske çerterek o tüsni "
|
||||
"saylay bilirsiñiz."
|
||||
"Köz-tamçılığına çertken soñ ekranıñızda olğan er angi tüske çerterek o "
|
||||
"tüsni saylay bilirsiñiz."
|
||||
|
||||
# tüklü
|
||||
# gtk/gtkcolorsel.c:1796
|
||||
@@ -1927,7 +1922,7 @@ msgstr "Diger..."
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:148
|
||||
msgid "Type name of new folder"
|
||||
msgstr "Yañı fihristniñ adını kirsetiñiz"
|
||||
msgstr "Yañı cilbentniñ adını kirsetiñiz"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:974
|
||||
msgid "Could not retrieve information about the file"
|
||||
@@ -1943,14 +1938,14 @@ msgstr "Saife-imi silinamadı"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:1007
|
||||
msgid "The folder could not be created"
|
||||
msgstr "Fihrist icat etilamadı"
|
||||
msgstr "Cilbent icat etilamadı"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:1020
|
||||
msgid ""
|
||||
"The folder could not be created, as a file with the same name already "
|
||||
"exists. Try using a different name for the folder, or rename the file first."
|
||||
msgstr ""
|
||||
"Aynı isimde bir dosye mevcut olğanı içün fihrist icat etilamadı. Fihrist "
|
||||
"Aynı isimde bir dosye mevcut olğanı içün cilbent icat etilamadı. Cilbent "
|
||||
"içün farqlı bir isim qullanuvnı deñeñiz ya da evelâ dosyeniñ adını "
|
||||
"deñiştiriñiz."
|
||||
|
||||
@@ -1961,7 +1956,7 @@ msgstr "Keçersiz dosye adı"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:1041
|
||||
msgid "The folder contents could not be displayed"
|
||||
msgstr "Fihrist mündericesi kösterilamadı"
|
||||
msgstr "Cilbent mündericesi kösterilamadı"
|
||||
|
||||
#. Translators: the first string is a path and the second string
|
||||
#. * is a hostname. Nautilus and the panel contain the same string
|
||||
@@ -1987,17 +1982,17 @@ msgstr "Angi türdeki dosyelerniñ kösterilecegini saylañız"
|
||||
#: gtk/gtkfilechooserdefault.c:2793
|
||||
#, c-format
|
||||
msgid "Add the folder '%s' to the bookmarks"
|
||||
msgstr "'%s' fihristini saife-imlerine ekle"
|
||||
msgstr "'%s' cilbentini saife-imlerine ekle"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:2837
|
||||
#, c-format
|
||||
msgid "Add the current folder to the bookmarks"
|
||||
msgstr "Ağımdaki fihristni saife-imlerine ekle"
|
||||
msgstr "Ağımdaki cilbentni saife-imlerine ekle"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:2839
|
||||
#, c-format
|
||||
msgid "Add the selected folders to the bookmarks"
|
||||
msgstr "Saylanğan fihristlerni saife-imlerine ekle"
|
||||
msgstr "Saylanğan cilbentlerni saife-imlerine ekle"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:2877
|
||||
#, c-format
|
||||
@@ -2040,7 +2035,7 @@ msgstr "_Ekle"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:3898
|
||||
msgid "Add the selected folder to the Bookmarks"
|
||||
msgstr "Saylanğan fihristni Saife-imlerine ekle"
|
||||
msgstr "Saylanğan cilbentni Saife-imlerine ekle"
|
||||
|
||||
# gtk/gtkstock.c:303
|
||||
#: gtk/gtkfilechooserdefault.c:3903
|
||||
@@ -2091,7 +2086,7 @@ msgstr "_İsim:"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:4839
|
||||
msgid "_Browse for other folders"
|
||||
msgstr "Diger fihristler içün _kezin"
|
||||
msgstr "Diger cilbentler içün _kezin"
|
||||
|
||||
# gdk-pixbuf/io-xbm.c:284
|
||||
#: gtk/gtkfilechooserdefault.c:5111
|
||||
@@ -2101,7 +2096,7 @@ msgstr "Bir dosye adını kirsetiñiz"
|
||||
#. Create Folder
|
||||
#: gtk/gtkfilechooserdefault.c:5152
|
||||
msgid "Create Fo_lder"
|
||||
msgstr "_Fihrist İcat Et"
|
||||
msgstr "_Cilbent İcat Et"
|
||||
|
||||
# tüklü
|
||||
# gtk/gtkfilesel.c:1795
|
||||
@@ -2111,22 +2106,21 @@ msgstr "_Qonum:"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:5366
|
||||
msgid "Save in _folder:"
|
||||
msgstr "_Fihristte saqla:"
|
||||
msgstr "_Cilbentte saqla:"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:5368
|
||||
msgid "Create in _folder:"
|
||||
msgstr "_Fihristte icat et:"
|
||||
msgstr "_Cilbentte icat et:"
|
||||
|
||||
# gtk/gtkfilesel.c:1011
|
||||
#: gtk/gtkfilechooserdefault.c:6435
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "Could not read the contents of %s"
|
||||
msgstr "Aqım icat etilamadı: %s"
|
||||
msgstr "%s muhtevası oqulamadı"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:6439
|
||||
#, fuzzy
|
||||
msgid "Could not read the contents of the folder"
|
||||
msgstr "Tamır fihristni elde etamadım"
|
||||
msgstr "Cilbentniñ muhtevası oqulamadı"
|
||||
|
||||
# gtk/gtkinputdialog.c:577
|
||||
#: gtk/gtkfilechooserdefault.c:6532 gtk/gtkfilechooserdefault.c:6600
|
||||
@@ -2144,7 +2138,7 @@ msgstr "Tünevin: %H:%M"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:7215
|
||||
msgid "Cannot change to folder because it is not local"
|
||||
msgstr "Fihrist yerli olmağanı içün oña deñiştirilamay"
|
||||
msgstr "Cilbent yerli olmağanı içün oña deñiştirilamay"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:7812 gtk/gtkfilechooserdefault.c:7833
|
||||
#, c-format
|
||||
@@ -2194,9 +2188,8 @@ msgid "Could not send the search request"
|
||||
msgstr "Qıdırma istemi yiberilamadı"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:9034
|
||||
#, fuzzy
|
||||
msgid "Search:"
|
||||
msgstr "Qıdıruv"
|
||||
msgstr "Qıdırma:"
|
||||
|
||||
#: gtk/gtkfilechooserdefault.c:9638
|
||||
#, c-format
|
||||
@@ -2267,17 +2260,17 @@ msgstr "Yolçıq mevcut degil"
|
||||
#: gtk/gtkfilesel.c:1360
|
||||
#, c-format
|
||||
msgid "Error creating folder '%s': %s"
|
||||
msgstr "'%s' fihristi icat etilgende hata: %s"
|
||||
msgstr "'%s' cilbenti icat etilgende hata: %s"
|
||||
|
||||
# gtk/gtkfilesel.c:651
|
||||
#: gtk/gtkfilesel.c:694
|
||||
msgid "Folders"
|
||||
msgstr "Fihristler"
|
||||
msgstr "Cilbentler"
|
||||
|
||||
# gtk/gtkfilesel.c:651
|
||||
#: gtk/gtkfilesel.c:698
|
||||
msgid "Fol_ders"
|
||||
msgstr "_Fihristler"
|
||||
msgstr "_Cilbentler"
|
||||
|
||||
# gtk/gtkfilesel.c:651
|
||||
#: gtk/gtkfilesel.c:734
|
||||
@@ -2288,7 +2281,7 @@ msgstr "_Dosyeler"
|
||||
#: gtk/gtkfilesel.c:821 gtk/gtkfilesel.c:2154
|
||||
#, c-format
|
||||
msgid "Folder unreadable: %s"
|
||||
msgstr "Fihrist oqulamaz: %s"
|
||||
msgstr "Cilbent oqulamaz: %s"
|
||||
|
||||
#: gtk/gtkfilesel.c:905
|
||||
#, c-format
|
||||
@@ -2303,7 +2296,7 @@ msgstr ""
|
||||
|
||||
#: gtk/gtkfilesel.c:1020
|
||||
msgid "_New Folder"
|
||||
msgstr "_Yañı Fihrist"
|
||||
msgstr "_Yañı Cilbent"
|
||||
|
||||
# gtk/gtkfilesel.c:762 gtk/gtkfilesel.c:1176
|
||||
#: gtk/gtkfilesel.c:1031
|
||||
@@ -2321,16 +2314,16 @@ msgstr "Dosyeni _Kene Adlandır"
|
||||
msgid ""
|
||||
"The folder name \"%s\" contains symbols that are not allowed in filenames"
|
||||
msgstr ""
|
||||
"\"%s\" fihrist adı, dosye isimlerinde caiz olmağan remizlerni ihtiva ete"
|
||||
"\"%s\" cilbent adı, dosye isimlerinde caiz olmağan remizlerni ihtiva ete"
|
||||
|
||||
#: gtk/gtkfilesel.c:1394
|
||||
msgid "New Folder"
|
||||
msgstr "Yañı Fihrist"
|
||||
msgstr "Yañı Cilbent"
|
||||
|
||||
# gtk/gtkfilesel.c:502
|
||||
#: gtk/gtkfilesel.c:1409
|
||||
msgid "_Folder name:"
|
||||
msgstr "_Fihrist ismi:"
|
||||
msgstr "_Cilbent ismi:"
|
||||
|
||||
# gtk/gtkfilesel.c:1073
|
||||
#: gtk/gtkfilesel.c:1433
|
||||
@@ -2536,7 +2529,6 @@ msgstr "Sistem"
|
||||
|
||||
# gtk/gtkinputdialog.c:514
|
||||
#: gtk/gtkimmulticontext.c:573
|
||||
#, fuzzy
|
||||
msgctxt "input method menu"
|
||||
msgid "None"
|
||||
msgstr "İç biri"
|
||||
@@ -2646,9 +2638,8 @@ msgstr "_Temizle"
|
||||
|
||||
#. Open Link
|
||||
#: gtk/gtklabel.c:5685
|
||||
#, fuzzy
|
||||
msgid "_Open Link"
|
||||
msgstr "_Aç"
|
||||
msgstr "İlişimni _Aç"
|
||||
|
||||
#. Copy Link Address
|
||||
#: gtk/gtklabel.c:5697
|
||||
@@ -2780,9 +2771,8 @@ msgid "Terminal Pager"
|
||||
msgstr ""
|
||||
|
||||
#: gtk/gtkmountoperation-x11.c:866
|
||||
#, fuzzy
|
||||
msgid "Top Command"
|
||||
msgstr "Emir Satırı "
|
||||
msgstr "Eñ Üst Buyruq"
|
||||
|
||||
#: gtk/gtkmountoperation-x11.c:867
|
||||
msgid "Bourne Again Shell"
|
||||
@@ -2813,16 +2803,12 @@ msgstr "Keçerli bir saife tesbiti dosyesi degil"
|
||||
|
||||
# gtk/gtkstock.c:299
|
||||
#: gtk/gtkpagesetupunixdialog.c:167
|
||||
#, fuzzy
|
||||
msgid "Any Printer"
|
||||
msgstr "Bastırıcı"
|
||||
msgstr "Er Angi Bastırıcı"
|
||||
|
||||
#: gtk/gtkpagesetupunixdialog.c:167
|
||||
#, fuzzy
|
||||
msgid "For portable documents"
|
||||
msgstr ""
|
||||
"<b>Er Angi Bastırıcı</b>\n"
|
||||
"Taşınabilir vesiqalar içün"
|
||||
msgstr "Taşınabilir vesiqalar içün"
|
||||
|
||||
#: gtk/gtkpagesetupunixdialog.c:797
|
||||
#, c-format
|
||||
@@ -2878,9 +2864,8 @@ msgstr "Dosye Sistemi Tamırı"
|
||||
|
||||
# gtk/gtkfilesel.c:1795
|
||||
#: gtk/gtkprintbackend.c:749
|
||||
#, fuzzy
|
||||
msgid "Authentication"
|
||||
msgstr "Uyğulama"
|
||||
msgstr "Sahihlenim"
|
||||
|
||||
#: gtk/gtkprinteroptionwidget.c:695
|
||||
msgid "Not available"
|
||||
@@ -2888,7 +2873,7 @@ msgstr "Namevcut"
|
||||
|
||||
#: gtk/gtkprinteroptionwidget.c:814
|
||||
msgid "_Save in folder:"
|
||||
msgstr "_Fihristte saqla:"
|
||||
msgstr "_Cilbentte saqla:"
|
||||
|
||||
# tüklü
|
||||
#. translators: this string is the default job title for print
|
||||
@@ -2908,7 +2893,7 @@ msgstr "Başlanğıç durum"
|
||||
#: gtk/gtkprintoperation.c:1688
|
||||
msgctxt "print operation status"
|
||||
msgid "Preparing to print"
|
||||
msgstr "Bastırılmağa hazırlana"
|
||||
msgstr "Bastırılmağa azırlana"
|
||||
|
||||
#: gtk/gtkprintoperation.c:1689
|
||||
msgctxt "print operation status"
|
||||
@@ -2949,7 +2934,7 @@ msgstr "Hatanen tamamlandı"
|
||||
#: gtk/gtkprintoperation.c:2254
|
||||
#, c-format
|
||||
msgid "Preparing %d"
|
||||
msgstr "%d hazırlana"
|
||||
msgstr "%d azırlana"
|
||||
|
||||
# gtk/gtkstock.c:268
|
||||
#: gtk/gtkprintoperation.c:2256 gtk/gtkprintoperation.c:2875
|
||||
@@ -3090,7 +3075,6 @@ msgstr "_Ağımdaki Saife"
|
||||
|
||||
# gtk/gtkfilesel.c:1795
|
||||
#: gtk/gtkprintunixdialog.c:2200
|
||||
#, fuzzy
|
||||
msgid "Se_lection"
|
||||
msgstr "_Saylam: "
|
||||
|
||||
@@ -3107,9 +3091,8 @@ msgstr ""
|
||||
" meselâ 1-3,7,11"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:2220
|
||||
#, fuzzy
|
||||
msgid "Pages"
|
||||
msgstr "_Saifeler:"
|
||||
msgstr "Saifeler"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:2233
|
||||
msgid "Copies"
|
||||
@@ -3199,14 +3182,12 @@ msgid "Right to left"
|
||||
msgstr "Sağdan solğa"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:3059
|
||||
#, fuzzy
|
||||
msgid "Top to bottom"
|
||||
msgstr "Yuqarıdan aşağığa, soldan sağğa"
|
||||
msgstr "Yuqarıdan aşağığa"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:3060
|
||||
#, fuzzy
|
||||
msgid "Bottom to top"
|
||||
msgstr "Aşağıdan yuqarığa, soldan sağğa"
|
||||
msgstr "Aşağıdan yuqarığa"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:3300
|
||||
msgid "Layout"
|
||||
@@ -3269,29 +3250,24 @@ msgstr "Çıqtı _sinisi:"
|
||||
# tüklü
|
||||
# gtk/gtkcolorsel.c:1798
|
||||
#: gtk/gtkprintunixdialog.c:3473
|
||||
#, fuzzy
|
||||
msgid "Or_ientation:"
|
||||
msgstr "_Yöneldirim:"
|
||||
|
||||
# gtk/gtkstock.c:299
|
||||
#. In enum order
|
||||
#: gtk/gtkprintunixdialog.c:3488
|
||||
#, fuzzy
|
||||
msgid "Portrait"
|
||||
msgstr "Portret"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:3489
|
||||
#, fuzzy
|
||||
msgid "Landscape"
|
||||
msgstr "Manzara"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:3490
|
||||
#, fuzzy
|
||||
msgid "Reverse portrait"
|
||||
msgstr "Ters portret"
|
||||
|
||||
#: gtk/gtkprintunixdialog.c:3491
|
||||
#, fuzzy
|
||||
msgid "Reverse landscape"
|
||||
msgstr "Ters manzara"
|
||||
|
||||
@@ -3472,12 +3448,12 @@ msgstr "_Hususiy Çoqraqlarnı Köster"
|
||||
#.
|
||||
#: gtk/gtkrecentchoosermenu.c:342
|
||||
msgid "No items found"
|
||||
msgstr "İç bir unsur tapılamadı"
|
||||
msgstr "İç bir unsur tapılmadı"
|
||||
|
||||
#: gtk/gtkrecentchoosermenu.c:508 gtk/gtkrecentchoosermenu.c:564
|
||||
#, c-format
|
||||
msgid "No recently used resource found with URI `%s'"
|
||||
msgstr "'%s' URI ile içün iç bir demi qullanılğan çoqraq tapılamadı"
|
||||
msgstr "'%s' URI ile iç bir demi qullanılğan çoqraq tapılmadı"
|
||||
|
||||
#: gtk/gtkrecentchoosermenu.c:775
|
||||
#, c-format
|
||||
@@ -3517,11 +3493,11 @@ msgstr "%d. %s"
|
||||
msgid "Unable to find an item with URI '%s'"
|
||||
msgstr "'%s' URI ile bir unsur tapılamadı"
|
||||
|
||||
# tüklü
|
||||
#: gtk/gtkspinner.c:458
|
||||
#, fuzzy
|
||||
msgctxt "throbbing progress animation widget"
|
||||
msgid "Spinner"
|
||||
msgstr "Super"
|
||||
msgstr "Aylanıcı"
|
||||
|
||||
#: gtk/gtkspinner.c:459
|
||||
msgid "Provides visual indication of progress"
|
||||
@@ -4093,7 +4069,7 @@ msgstr "%s formatı içün keri-silsileleştirme funktsiyası yoq"
|
||||
#: gtk/gtktextbufferserialize.c:796 gtk/gtktextbufferserialize.c:822
|
||||
#, c-format
|
||||
msgid "Both \"id\" and \"name\" were found on the <%s> element"
|
||||
msgstr "<%s> unsurında hem \"id\" hem \"name\" tapıldı"
|
||||
msgstr "<%s> unsurında em \"id\" em \"name\" tapıldı"
|
||||
|
||||
#: gtk/gtktextbufferserialize.c:806 gtk/gtktextbufferserialize.c:832
|
||||
#, c-format
|
||||
@@ -5126,10 +5102,9 @@ msgid "prc8 Envelope"
|
||||
msgstr "prc8 Zarfı"
|
||||
|
||||
#: gtk/paper_names_offsets.c:166
|
||||
#, fuzzy
|
||||
msgctxt "paper size"
|
||||
msgid "prc9 Envelope"
|
||||
msgstr "prc1 Zarfı"
|
||||
msgstr "prc9 Zarfı"
|
||||
|
||||
#: gtk/paper_names_offsets.c:167
|
||||
msgctxt "paper size"
|
||||
@@ -5167,7 +5142,7 @@ msgstr "Heş cedveli yazılamadı\n"
|
||||
#: gtk/updateiconcache.c:1386
|
||||
#, c-format
|
||||
msgid "Failed to write folder index\n"
|
||||
msgstr "Fihrist indeksi yazılamadı\n"
|
||||
msgstr "Cilbent indeksi yazılamadı\n"
|
||||
|
||||
# gdk-pixbuf/io-tiff.c:264
|
||||
#: gtk/updateiconcache.c:1394
|
||||
@@ -5250,9 +5225,9 @@ msgid "Not a valid icon cache: %s\n"
|
||||
msgstr "Keçerli bir işaretçik ög-hafizası degil: %s\n"
|
||||
|
||||
#: gtk/updateiconcache.c:1702
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "No theme index file.\n"
|
||||
msgstr "Tema indeks dosyesi yoq."
|
||||
msgstr "Tema indeks dosyesi yoq.\n"
|
||||
|
||||
#: gtk/updateiconcache.c:1706
|
||||
#, c-format
|
||||
@@ -5327,16 +5302,14 @@ msgstr "X Kirdi Usulı"
|
||||
# gtk/gtkfilesel.c:1351
|
||||
#: modules/printbackends/cups/gtkprintbackendcups.c:809
|
||||
#: modules/printbackends/cups/gtkprintbackendcups.c:1018
|
||||
#, fuzzy
|
||||
msgid "Username:"
|
||||
msgstr "_Qullanıcı adı:"
|
||||
msgstr "Qullanıcı adı:"
|
||||
|
||||
# gtk/gtkinputdialog.c:471
|
||||
#: modules/printbackends/cups/gtkprintbackendcups.c:810
|
||||
#: modules/printbackends/cups/gtkprintbackendcups.c:1027
|
||||
#, fuzzy
|
||||
msgid "Password:"
|
||||
msgstr "_Sır-söz:"
|
||||
msgstr "Sır-söz:"
|
||||
|
||||
#: modules/printbackends/cups/gtkprintbackendcups.c:848
|
||||
#, c-format
|
||||
@@ -5389,7 +5362,6 @@ msgstr ""
|
||||
|
||||
# gtk/gtkfilesel.c:1795
|
||||
#: modules/printbackends/cups/gtkprintbackendcups.c:1012
|
||||
#, fuzzy
|
||||
msgid "Domain:"
|
||||
msgstr "_Saa:"
|
||||
|
||||
@@ -5707,7 +5679,7 @@ msgstr "Postscript"
|
||||
|
||||
#: modules/printbackends/file/gtkprintbackendfile.c:570
|
||||
msgid "SVG"
|
||||
msgstr ""
|
||||
msgstr "SVG"
|
||||
|
||||
#: modules/printbackends/file/gtkprintbackendfile.c:582
|
||||
#: modules/printbackends/test/gtkprintbackendtest.c:503
|
||||
@@ -5738,15 +5710,13 @@ msgstr "Emir Satırı "
|
||||
# tüklü
|
||||
#. SUN_BRANDING
|
||||
#: modules/printbackends/papi/gtkprintbackendpapi.c:811
|
||||
#, fuzzy
|
||||
msgid "printer offline"
|
||||
msgstr "Bastırıcı devre-tışı"
|
||||
msgstr "bastırıcı devre-tışı"
|
||||
|
||||
#. SUN_BRANDING
|
||||
#: modules/printbackends/papi/gtkprintbackendpapi.c:829
|
||||
#, fuzzy
|
||||
msgid "ready to print"
|
||||
msgstr "Bastırılmağa hazırlana"
|
||||
msgstr "bastırmağa azır"
|
||||
|
||||
#. SUN_BRANDING
|
||||
#: modules/printbackends/papi/gtkprintbackendpapi.c:832
|
||||
@@ -5756,16 +5726,14 @@ msgstr ""
|
||||
# gtk/gtkstock.c:297
|
||||
#. SUN_BRANDING
|
||||
#: modules/printbackends/papi/gtkprintbackendpapi.c:836
|
||||
#, fuzzy
|
||||
msgid "paused"
|
||||
msgstr "Tınışlandı"
|
||||
msgstr "tınışlanğan"
|
||||
|
||||
# gtk/gtkinputdialog.c:577
|
||||
#. SUN_BRANDING
|
||||
#: modules/printbackends/papi/gtkprintbackendpapi.c:839
|
||||
#, fuzzy
|
||||
msgid "unknown"
|
||||
msgstr "(namalüm)"
|
||||
msgstr "namalüm"
|
||||
|
||||
#. default filename used for print-to-test
|
||||
#: modules/printbackends/test/gtkprintbackendtest.c:234
|
||||
|
||||
@@ -10,21 +10,21 @@
|
||||
# Ignacio Casal Quinteiro <nacho.resa@gmail.com>, 2005, 2006.
|
||||
# Ignacio Casal Quinteiro <icq@svn.gnome.org>, 2008.
|
||||
# Mancomún - Centro de Referencia e Servizos de Software Libre <g11n@mancomun.org>, 2009.
|
||||
# Fran Diéguez <fran.dieguez@mabishu.com>, 2009.
|
||||
# Antón Méixome <meixome@mancomun.org>, 2009.
|
||||
# Anton Meixome <certima@certima.net>, 2009.
|
||||
# Fran Dieguez <fran.dieguez@glug.es>, 2009.
|
||||
# Fran Diéguez <frandieguez@ubuntu.com>, 2010.
|
||||
# Antón Méixome <meixome@certima.net>, 2010.
|
||||
# Francisco Diéguez <frandieguez@ubuntu.com>, 2010.
|
||||
# Fran Diéguez <frandieguez@ubuntu.com>, 2009, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk+-master-po-gl-77922___.merged\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-04-05 20:57+0300\n"
|
||||
"PO-Revision-Date: 2010-04-05 15:17+0100\n"
|
||||
"Last-Translator: Antón Méixome <meixome@certima.net>\n"
|
||||
"Language-Team: Galician <proxecto@trasno.net>\n"
|
||||
"POT-Creation-Date: 2010-05-02 00:12+0200\n"
|
||||
"PO-Revision-Date: 2010-05-02 00:14+0200\n"
|
||||
"Last-Translator: Fran Diéguez <frandieguez@ubuntu.com>\n"
|
||||
"Language-Team: Galician <gnome@g11n.net>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -91,7 +91,7 @@ msgstr "Parámetros de depuración Gdk para activar"
|
||||
#. Placeholder in --gdk-no-debug=FLAGS in --help output
|
||||
#. Placeholder in --gtk-debug=FLAGS in --help output
|
||||
#. Placeholder in --gtk-no-debug=FLAGS in --help output
|
||||
#: ../gdk/gdk.c:165 ../gdk/gdk.c:168 ../gtk/gtkmain.c:459 ../gtk/gtkmain.c:462
|
||||
#: ../gdk/gdk.c:165 ../gdk/gdk.c:168 ../gtk/gtkmain.c:460 ../gtk/gtkmain.c:463
|
||||
msgid "FLAGS"
|
||||
msgstr "PARÁMETROS"
|
||||
|
||||
@@ -422,13 +422,11 @@ msgid "Image pixel data corrupt"
|
||||
msgstr "Os datos do píxel da imaxe están danados"
|
||||
|
||||
#: ../gdk-pixbuf/gdk-pixdata.c:432
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "failed to allocate image buffer of %u byte"
|
||||
msgid_plural "failed to allocate image buffer of %u bytes"
|
||||
msgstr[0] ""
|
||||
"Produciuse un fallo ao asignar %d bytes para o búfer de lectura do ficheiro"
|
||||
msgstr[1] ""
|
||||
"Produciuse un fallo ao asignar %d bytes para o búfer de lectura do ficheiro"
|
||||
msgstr[0] "Produciuse un fallo ao asignar o búfer de imaxe de %u bytes "
|
||||
msgstr[1] "Produciuse un fallo ao asignar o búfer de imaxe de %u bytes"
|
||||
|
||||
#: ../gdk-pixbuf/io-ani.c:244
|
||||
msgid "Unexpected icon chunk in animation"
|
||||
@@ -1261,11 +1259,11 @@ msgid "Opening %s"
|
||||
msgstr "Abrindo %s"
|
||||
|
||||
#: ../gdk/x11/gdkapplaunchcontext-x11.c:318
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "Opening %d Item"
|
||||
msgid_plural "Opening %d Items"
|
||||
msgstr[0] "Abrindo %s"
|
||||
msgstr[1] "Abrindo %s"
|
||||
msgstr[0] "Abrindo %d elemento"
|
||||
msgstr[1] "Abrindo %d elementos"
|
||||
|
||||
#: ../gtk/gtkaboutdialog.c:242
|
||||
msgid "Could not show link"
|
||||
@@ -1728,11 +1726,11 @@ msgstr "_Dereito:"
|
||||
msgid "Paper Margins"
|
||||
msgstr "Marxes do papel"
|
||||
|
||||
#: ../gtk/gtkentry.c:8698 ../gtk/gtktextview.c:7881
|
||||
#: ../gtk/gtkentry.c:8698 ../gtk/gtktextview.c:7917
|
||||
msgid "Input _Methods"
|
||||
msgstr "_Métodos de entrada"
|
||||
|
||||
#: ../gtk/gtkentry.c:8712 ../gtk/gtktextview.c:7895
|
||||
#: ../gtk/gtkentry.c:8712 ../gtk/gtktextview.c:7931
|
||||
msgid "_Insert Unicode Control Character"
|
||||
msgstr "_Inserir un carácter de control Unicode"
|
||||
|
||||
@@ -1744,7 +1742,7 @@ msgstr "Bloq Maiús está activado"
|
||||
msgid "Select A File"
|
||||
msgstr "Seleccionar un ficheiro"
|
||||
|
||||
#: ../gtk/gtkfilechooserbutton.c:65 ../gtk/gtkfilechooserdefault.c:1848
|
||||
#: ../gtk/gtkfilechooserbutton.c:65 ../gtk/gtkfilechooserdefault.c:1839
|
||||
msgid "Desktop"
|
||||
msgstr "Escritorio"
|
||||
|
||||
@@ -1760,23 +1758,23 @@ msgstr "Outro..."
|
||||
msgid "Type name of new folder"
|
||||
msgstr "Escriba o nome do cartafol novo"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:974
|
||||
#: ../gtk/gtkfilechooserdefault.c:965
|
||||
msgid "Could not retrieve information about the file"
|
||||
msgstr "Non foi posíbel recuperar a información sobre o ficheiro"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:985
|
||||
#: ../gtk/gtkfilechooserdefault.c:976
|
||||
msgid "Could not add a bookmark"
|
||||
msgstr "Non foi posíbel engadir un marcador"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:996
|
||||
#: ../gtk/gtkfilechooserdefault.c:987
|
||||
msgid "Could not remove bookmark"
|
||||
msgstr "Non foi posíbel eliminar o marcador"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:1007
|
||||
#: ../gtk/gtkfilechooserdefault.c:998
|
||||
msgid "The folder could not be created"
|
||||
msgstr "Non foi posíbel crear o cartafol"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:1020
|
||||
#: ../gtk/gtkfilechooserdefault.c:1011
|
||||
msgid ""
|
||||
"The folder could not be created, as a file with the same name already "
|
||||
"exists. Try using a different name for the folder, or rename the file first."
|
||||
@@ -1784,11 +1782,11 @@ msgstr ""
|
||||
"Non foi posíbel crear o cartafol: xa existe un ficheiro co mesmo nome. Tente "
|
||||
"usar un nome diferente para o cartafol ou renomee o ficheiro primeiro."
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:1031
|
||||
#: ../gtk/gtkfilechooserdefault.c:1022
|
||||
msgid "Invalid file name"
|
||||
msgstr "O nome do ficheiro é incorrecto"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:1041
|
||||
#: ../gtk/gtkfilechooserdefault.c:1032
|
||||
msgid "The folder contents could not be displayed"
|
||||
msgstr "Non foi posíbel mostrar o contido do cartafol"
|
||||
|
||||
@@ -1796,186 +1794,186 @@ msgstr "Non foi posíbel mostrar o contido do cartafol"
|
||||
#. * is a hostname. Nautilus and the panel contain the same string
|
||||
#. * to translate.
|
||||
#.
|
||||
#: ../gtk/gtkfilechooserdefault.c:1591
|
||||
#: ../gtk/gtkfilechooserdefault.c:1582
|
||||
#, c-format
|
||||
msgid "%1$s on %2$s"
|
||||
msgstr "%1$s en %2$s"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:1767
|
||||
#: ../gtk/gtkfilechooserdefault.c:1758
|
||||
msgid "Search"
|
||||
msgstr "Buscar"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:1791 ../gtk/gtkfilechooserdefault.c:9462
|
||||
#: ../gtk/gtkfilechooserdefault.c:1782 ../gtk/gtkfilechooserdefault.c:9458
|
||||
msgid "Recently Used"
|
||||
msgstr "Usado recentemente"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:2434
|
||||
#: ../gtk/gtkfilechooserdefault.c:2422
|
||||
msgid "Select which types of files are shown"
|
||||
msgstr "Seleccione que tipos de ficheiros se mostran"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:2793
|
||||
#: ../gtk/gtkfilechooserdefault.c:2781
|
||||
#, c-format
|
||||
msgid "Add the folder '%s' to the bookmarks"
|
||||
msgstr "Engadirlle o cartafol '%s' aos marcadores"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:2837
|
||||
#: ../gtk/gtkfilechooserdefault.c:2825
|
||||
#, c-format
|
||||
msgid "Add the current folder to the bookmarks"
|
||||
msgstr "Engadirlle o cartafol actual aos marcadores"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:2839
|
||||
#: ../gtk/gtkfilechooserdefault.c:2827
|
||||
#, c-format
|
||||
msgid "Add the selected folders to the bookmarks"
|
||||
msgstr "Engadirlle os cartafoles seleccionados aos marcadores"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:2877
|
||||
#: ../gtk/gtkfilechooserdefault.c:2865
|
||||
#, c-format
|
||||
msgid "Remove the bookmark '%s'"
|
||||
msgstr "Eliminar o marcador '%s'"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:2879
|
||||
#: ../gtk/gtkfilechooserdefault.c:2867
|
||||
#, c-format
|
||||
msgid "Bookmark '%s' cannot be removed"
|
||||
msgstr "O marcador '%s' non pode ser eliminado"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:2886 ../gtk/gtkfilechooserdefault.c:3910
|
||||
#: ../gtk/gtkfilechooserdefault.c:2874 ../gtk/gtkfilechooserdefault.c:3898
|
||||
msgid "Remove the selected bookmark"
|
||||
msgstr "Eliminar o marcador seleccionado"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:3606
|
||||
#: ../gtk/gtkfilechooserdefault.c:3594
|
||||
msgid "Remove"
|
||||
msgstr "Eliminar"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:3615
|
||||
#: ../gtk/gtkfilechooserdefault.c:3603
|
||||
msgid "Rename..."
|
||||
msgstr "Renomear..."
|
||||
|
||||
#. Accessible object name for the file chooser's shortcuts pane
|
||||
#: ../gtk/gtkfilechooserdefault.c:3778
|
||||
#: ../gtk/gtkfilechooserdefault.c:3766
|
||||
msgid "Places"
|
||||
msgstr "Lugares"
|
||||
|
||||
#. Column header for the file chooser's shortcuts pane
|
||||
#: ../gtk/gtkfilechooserdefault.c:3835
|
||||
#: ../gtk/gtkfilechooserdefault.c:3823
|
||||
msgid "_Places"
|
||||
msgstr "_Lugares"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:3891
|
||||
#: ../gtk/gtkfilechooserdefault.c:3879
|
||||
msgid "_Add"
|
||||
msgstr "_Engadir"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:3898
|
||||
#: ../gtk/gtkfilechooserdefault.c:3886
|
||||
msgid "Add the selected folder to the Bookmarks"
|
||||
msgstr "Engadir o cartafol seleccionado aos marcadores"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:3903
|
||||
#: ../gtk/gtkfilechooserdefault.c:3891
|
||||
msgid "_Remove"
|
||||
msgstr "_Eliminar"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4038
|
||||
#: ../gtk/gtkfilechooserdefault.c:4026
|
||||
msgid "Could not select file"
|
||||
msgstr "Non foi posíbel seleccionar o ficheiro"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4213
|
||||
#: ../gtk/gtkfilechooserdefault.c:4201
|
||||
msgid "_Add to Bookmarks"
|
||||
msgstr "_Engadir aos marcadores"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4226
|
||||
#: ../gtk/gtkfilechooserdefault.c:4214
|
||||
msgid "Show _Hidden Files"
|
||||
msgstr "Mostrar os ficheiros _ocultos"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4233
|
||||
#: ../gtk/gtkfilechooserdefault.c:4221
|
||||
msgid "Show _Size Column"
|
||||
msgstr "Mostrar a columna de _tamaño"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4453 ../gtk/gtkfilesel.c:730
|
||||
#: ../gtk/gtkfilechooserdefault.c:4441 ../gtk/gtkfilesel.c:730
|
||||
msgid "Files"
|
||||
msgstr "Ficheiros"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4504
|
||||
#: ../gtk/gtkfilechooserdefault.c:4492
|
||||
msgid "Name"
|
||||
msgstr "Nome"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4527
|
||||
#: ../gtk/gtkfilechooserdefault.c:4515
|
||||
msgid "Size"
|
||||
msgstr "Tamaño"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4541
|
||||
#: ../gtk/gtkfilechooserdefault.c:4529
|
||||
msgid "Modified"
|
||||
msgstr "Modificado"
|
||||
|
||||
#. Label
|
||||
#: ../gtk/gtkfilechooserdefault.c:4796 ../gtk/gtkprinteroptionwidget.c:802
|
||||
#: ../gtk/gtkfilechooserdefault.c:4784 ../gtk/gtkprinteroptionwidget.c:802
|
||||
msgid "_Name:"
|
||||
msgstr "_Nome:"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:4839
|
||||
#: ../gtk/gtkfilechooserdefault.c:4827
|
||||
msgid "_Browse for other folders"
|
||||
msgstr "_Buscar outros cartafoles"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:5111
|
||||
#: ../gtk/gtkfilechooserdefault.c:5099
|
||||
msgid "Type a file name"
|
||||
msgstr "Teclee un nome de ficheiro"
|
||||
|
||||
#. Create Folder
|
||||
#: ../gtk/gtkfilechooserdefault.c:5152
|
||||
#: ../gtk/gtkfilechooserdefault.c:5140
|
||||
msgid "Create Fo_lder"
|
||||
msgstr "Crear car_tafol"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:5162
|
||||
#: ../gtk/gtkfilechooserdefault.c:5150
|
||||
msgid "_Location:"
|
||||
msgstr "_Localización:"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:5366
|
||||
#: ../gtk/gtkfilechooserdefault.c:5354
|
||||
msgid "Save in _folder:"
|
||||
msgstr "Gardar no _cartafol:"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:5368
|
||||
#: ../gtk/gtkfilechooserdefault.c:5356
|
||||
msgid "Create in _folder:"
|
||||
msgstr "Crear no _cartafol:"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:6435
|
||||
#: ../gtk/gtkfilechooserdefault.c:6423
|
||||
#, c-format
|
||||
msgid "Could not read the contents of %s"
|
||||
msgstr "Non foi posíbel ler os contidos do %s"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:6439
|
||||
#: ../gtk/gtkfilechooserdefault.c:6427
|
||||
msgid "Could not read the contents of the folder"
|
||||
msgstr "Non foi posíbel ler os contidos do cartafol"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:6532 ../gtk/gtkfilechooserdefault.c:6600
|
||||
#: ../gtk/gtkfilechooserdefault.c:6745
|
||||
#: ../gtk/gtkfilechooserdefault.c:6520 ../gtk/gtkfilechooserdefault.c:6588
|
||||
#: ../gtk/gtkfilechooserdefault.c:6733
|
||||
msgid "Unknown"
|
||||
msgstr "Descoñecido"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:6547
|
||||
#: ../gtk/gtkfilechooserdefault.c:6535
|
||||
msgid "%H:%M"
|
||||
msgstr "%H:%M"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:6549
|
||||
#: ../gtk/gtkfilechooserdefault.c:6537
|
||||
msgid "Yesterday at %H:%M"
|
||||
msgstr "Onte ás %H:%M"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:7215
|
||||
#: ../gtk/gtkfilechooserdefault.c:7203
|
||||
msgid "Cannot change to folder because it is not local"
|
||||
msgstr "Non é posíbel cambiar ao cartafol porque non é local"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:7812 ../gtk/gtkfilechooserdefault.c:7833
|
||||
#: ../gtk/gtkfilechooserdefault.c:7800 ../gtk/gtkfilechooserdefault.c:7821
|
||||
#, c-format
|
||||
msgid "Shortcut %s already exists"
|
||||
msgstr "O atallo %s xa existe"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:7923
|
||||
#: ../gtk/gtkfilechooserdefault.c:7911
|
||||
#, c-format
|
||||
msgid "Shortcut %s does not exist"
|
||||
msgstr "O atallo %s non existe"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:8178 ../gtk/gtkprintunixdialog.c:480
|
||||
#: ../gtk/gtkfilechooserdefault.c:8166 ../gtk/gtkprintunixdialog.c:480
|
||||
#, c-format
|
||||
msgid "A file named \"%s\" already exists. Do you want to replace it?"
|
||||
msgstr "Xa existe un ficheiro con nome \"%s\". Quere substituílo?"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:8181 ../gtk/gtkprintunixdialog.c:484
|
||||
#: ../gtk/gtkfilechooserdefault.c:8169 ../gtk/gtkprintunixdialog.c:484
|
||||
#, c-format
|
||||
msgid ""
|
||||
"The file already exists in \"%s\". Replacing it will overwrite its contents."
|
||||
@@ -1983,15 +1981,15 @@ msgstr ""
|
||||
"O ficheiro xa existe en \"%s\". Se o substitúe sobrescribirá os seus "
|
||||
"contidos."
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:8186 ../gtk/gtkprintunixdialog.c:491
|
||||
#: ../gtk/gtkfilechooserdefault.c:8174 ../gtk/gtkprintunixdialog.c:491
|
||||
msgid "_Replace"
|
||||
msgstr "_Substituír"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:8830
|
||||
#: ../gtk/gtkfilechooserdefault.c:8826
|
||||
msgid "Could not start the search process"
|
||||
msgstr "Non foi posíbel iniciar o proceso de busca"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:8831
|
||||
#: ../gtk/gtkfilechooserdefault.c:8827
|
||||
msgid ""
|
||||
"The program was not able to create a connection to the indexer daemon. "
|
||||
"Please make sure it is running."
|
||||
@@ -1999,15 +1997,15 @@ msgstr ""
|
||||
"O programa non puido crear unha conexión co deamon indexador. Asegúrese de "
|
||||
"que está en execución."
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:8845
|
||||
#: ../gtk/gtkfilechooserdefault.c:8841
|
||||
msgid "Could not send the search request"
|
||||
msgstr "Non foi posíbel enviar a solicitude de busca"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:9034
|
||||
#: ../gtk/gtkfilechooserdefault.c:9030
|
||||
msgid "Search:"
|
||||
msgstr "Buscar:"
|
||||
|
||||
#: ../gtk/gtkfilechooserdefault.c:9638
|
||||
#: ../gtk/gtkfilechooserdefault.c:9634
|
||||
#, c-format
|
||||
msgid "Could not mount %s"
|
||||
msgstr "Non foi posíbel montar %s"
|
||||
@@ -2397,12 +2395,12 @@ msgid "Cl_ear"
|
||||
msgstr "Li_mpar"
|
||||
|
||||
#. Open Link
|
||||
#: ../gtk/gtklabel.c:5685
|
||||
#: ../gtk/gtklabel.c:6118
|
||||
msgid "_Open Link"
|
||||
msgstr "_Abrir a ligazón"
|
||||
|
||||
#. Copy Link Address
|
||||
#: ../gtk/gtklabel.c:5697
|
||||
#: ../gtk/gtklabel.c:6130
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "Copiar o enderezo da _ligazón"
|
||||
|
||||
@@ -2415,27 +2413,27 @@ msgid "Invalid URI"
|
||||
msgstr "URI incorrecto"
|
||||
|
||||
#. Description of --gtk-module=MODULES in --help output
|
||||
#: ../gtk/gtkmain.c:452
|
||||
#: ../gtk/gtkmain.c:453
|
||||
msgid "Load additional GTK+ modules"
|
||||
msgstr "Cargar os módulos adicionais GTK+"
|
||||
|
||||
#. Placeholder in --gtk-module=MODULES in --help output
|
||||
#: ../gtk/gtkmain.c:453
|
||||
#: ../gtk/gtkmain.c:454
|
||||
msgid "MODULES"
|
||||
msgstr "MÓDULOS"
|
||||
|
||||
#. Description of --g-fatal-warnings in --help output
|
||||
#: ../gtk/gtkmain.c:455
|
||||
#: ../gtk/gtkmain.c:456
|
||||
msgid "Make all warnings fatal"
|
||||
msgstr "Facer todos os avisos fatais"
|
||||
|
||||
#. Description of --gtk-debug=FLAGS in --help output
|
||||
#: ../gtk/gtkmain.c:458
|
||||
#: ../gtk/gtkmain.c:459
|
||||
msgid "GTK+ debugging flags to set"
|
||||
msgstr "Marcas de depuración GTK+ para activar"
|
||||
|
||||
#. Description of --gtk-no-debug=FLAGS in --help output
|
||||
#: ../gtk/gtkmain.c:461
|
||||
#: ../gtk/gtkmain.c:462
|
||||
msgid "GTK+ debugging flags to unset"
|
||||
msgstr "Marcas de depuración GTK+ para desconfigurar"
|
||||
|
||||
@@ -2444,20 +2442,20 @@ msgstr "Marcas de depuración GTK+ para desconfigurar"
|
||||
#. * Do *not* translate it to "predefinito:LTR", if it
|
||||
#. * it isn't default:LTR or default:RTL it will not work
|
||||
#.
|
||||
#: ../gtk/gtkmain.c:713
|
||||
#: ../gtk/gtkmain.c:714
|
||||
msgid "default:LTR"
|
||||
msgstr "default:LTR"
|
||||
|
||||
#: ../gtk/gtkmain.c:778
|
||||
#: ../gtk/gtkmain.c:779
|
||||
#, c-format
|
||||
msgid "Cannot open display: %s"
|
||||
msgstr "Non é posíbel abrir a pantalla: %s"
|
||||
|
||||
#: ../gtk/gtkmain.c:815
|
||||
#: ../gtk/gtkmain.c:816
|
||||
msgid "GTK+ Options"
|
||||
msgstr "Opcións GTK+"
|
||||
|
||||
#: ../gtk/gtkmain.c:815
|
||||
#: ../gtk/gtkmain.c:816
|
||||
msgid "Show GTK+ Options"
|
||||
msgstr "Mostrar opcións GTK+"
|
||||
|
||||
@@ -2603,7 +2601,7 @@ msgstr "Camiño superior"
|
||||
msgid "Down Path"
|
||||
msgstr "Camiño inferior"
|
||||
|
||||
#: ../gtk/gtkpathbar.c:1469
|
||||
#: ../gtk/gtkpathbar.c:1480
|
||||
msgid "File System Root"
|
||||
msgstr "Sistema de ficheiros raíz"
|
||||
|
||||
@@ -2615,6 +2613,10 @@ msgstr "Autenticación"
|
||||
msgid "Not available"
|
||||
msgstr "Non dispoñíbel"
|
||||
|
||||
#: ../gtk/gtkprinteroptionwidget.c:795
|
||||
msgid "Select a folder"
|
||||
msgstr "Seleccionar un cartafol"
|
||||
|
||||
#: ../gtk/gtkprinteroptionwidget.c:814
|
||||
msgid "_Save in folder:"
|
||||
msgstr "_Gardar no cartafol:"
|
||||
@@ -3086,12 +3088,12 @@ msgstr "Algunhas das configuracións do diálogo están en conflito"
|
||||
msgid "Print"
|
||||
msgstr "Imprimir"
|
||||
|
||||
#: ../gtk/gtkrc.c:2878
|
||||
#: ../gtk/gtkrc.c:2906
|
||||
#, c-format
|
||||
msgid "Unable to find include file: \"%s\""
|
||||
msgstr "Non é posíbel localizar o ficheiro 'include': \"%s\""
|
||||
|
||||
#: ../gtk/gtkrc.c:3508 ../gtk/gtkrc.c:3511
|
||||
#: ../gtk/gtkrc.c:3536 ../gtk/gtkrc.c:3539
|
||||
#, c-format
|
||||
msgid "Unable to locate image file in pixmap_path: \"%s\""
|
||||
msgstr "Non é posíbel localizar o ficheiro de imaxe no pixmap_path: \"%s\""
|
||||
@@ -3886,39 +3888,39 @@ msgstr "Datos de carácter inesperados na liña %d carácter %d"
|
||||
msgid "Empty"
|
||||
msgstr "Baleiro"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:73
|
||||
#: ../gtk/gtkvolumebutton.c:83
|
||||
msgid "Volume"
|
||||
msgstr "Volume"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:75
|
||||
#: ../gtk/gtkvolumebutton.c:85
|
||||
msgid "Turns volume down or up"
|
||||
msgstr "Sobe ou baixa o volume"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:78
|
||||
#: ../gtk/gtkvolumebutton.c:88
|
||||
msgid "Adjusts the volume"
|
||||
msgstr "Axusta o volume"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:81 ../gtk/gtkvolumebutton.c:84
|
||||
#: ../gtk/gtkvolumebutton.c:91 ../gtk/gtkvolumebutton.c:94
|
||||
msgid "Volume Down"
|
||||
msgstr "Baixar o volume"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:83
|
||||
#: ../gtk/gtkvolumebutton.c:93
|
||||
msgid "Decreases the volume"
|
||||
msgstr "Abaixa o volume"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:87 ../gtk/gtkvolumebutton.c:90
|
||||
#: ../gtk/gtkvolumebutton.c:97 ../gtk/gtkvolumebutton.c:100
|
||||
msgid "Volume Up"
|
||||
msgstr "Subir o volume"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:89
|
||||
#: ../gtk/gtkvolumebutton.c:99
|
||||
msgid "Increases the volume"
|
||||
msgstr "Sobe o volume"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:147
|
||||
#: ../gtk/gtkvolumebutton.c:157
|
||||
msgid "Muted"
|
||||
msgstr "Silenciado"
|
||||
|
||||
#: ../gtk/gtkvolumebutton.c:151
|
||||
#: ../gtk/gtkvolumebutton.c:161
|
||||
msgid "Full Volume"
|
||||
msgstr "Volume máximo"
|
||||
|
||||
@@ -3927,7 +3929,7 @@ msgstr "Volume máximo"
|
||||
#. * Translate the "%d" to "%Id" if you want to use localised digits,
|
||||
#. * or otherwise translate the "%d" to "%d".
|
||||
#.
|
||||
#: ../gtk/gtkvolumebutton.c:164
|
||||
#: ../gtk/gtkvolumebutton.c:174
|
||||
#, c-format
|
||||
msgctxt "volume percentage"
|
||||
msgid "%d %%"
|
||||
|
||||
@@ -29,6 +29,7 @@ noinst_PROGRAMS = $(TEST_PROGS) \
|
||||
simple \
|
||||
flicker \
|
||||
print-editor \
|
||||
extendedlayoutexample \
|
||||
testaccel \
|
||||
testassistant \
|
||||
testbbox \
|
||||
@@ -112,6 +113,7 @@ endif
|
||||
flicker_DEPENDENCIES = $(TEST_DEPS)
|
||||
simple_DEPENDENCIES = $(TEST_DEPS)
|
||||
print_editor_DEPENDENCIES = $(TEST_DEPS)
|
||||
extendedlayoutexample_DEPENDENCIES = $(TEST_DEPS)
|
||||
testicontheme_DEPENDENCIES = $(TEST_DEPS)
|
||||
testiconview_DEPENDENCIES = $(TEST_DEPS)
|
||||
testaccel_DEPENDENCIES = $(TEST_DEPS)
|
||||
@@ -176,6 +178,7 @@ testwindows_DEPENDENCIES = $(TEST_DEPS)
|
||||
flicker_LDADD = $(LDADDS)
|
||||
simple_LDADD = $(LDADDS)
|
||||
print_editor_LDADD = $(LDADDS)
|
||||
extendedlayoutexample_LDADD = $(LDADDS)
|
||||
testaccel_LDADD = $(LDADDS)
|
||||
testassistant_LDADD = $(LDADDS)
|
||||
testbbox_LDADD = $(LDADDS)
|
||||
|
||||
@@ -0,0 +1,620 @@
|
||||
/* extendedlayoutexample.c
|
||||
* Copyright (C) 2010 Openismus GmbH
|
||||
*
|
||||
* Author:
|
||||
* Tristan Van Berkom <tristan.van.berkom@gmail.com>
|
||||
*
|
||||
* 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, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
typedef struct {
|
||||
const gchar *name;
|
||||
const gchar *tooltip;
|
||||
const gchar *interface;
|
||||
GtkWidget *window;
|
||||
} TestInterface;
|
||||
|
||||
|
||||
/* These strings were generated with:
|
||||
*
|
||||
* IFS=""; while read line; do echo -n \"; echo -n $line | sed -e 's|\"|\\"|g'; echo \"; done < file.glade
|
||||
*/
|
||||
TestInterface interfaces[] = {
|
||||
{
|
||||
"Ellipsizing Labels",
|
||||
"Demonstrates how labels will request a natural size in a horizontal space",
|
||||
"<interface>"
|
||||
" <requires lib=\"gtk+\" version=\"2.20\"/>"
|
||||
" <!-- interface-naming-policy project-wide -->"
|
||||
" <object class=\"GtkWindow\" id=\"window\">"
|
||||
" <property name=\"default_width\">450</property>"
|
||||
" <property name=\"default_height\">50</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkHBox\" id=\"hbox5\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label9\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">Some labels do ellipsize</property>"
|
||||
" <property name=\"ellipsize\">end</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#09610feefe03\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">0</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label10\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">but some</property>"
|
||||
" <property name=\"ellipsize\">end</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#0000af6b0993\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">1</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label11\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">do not at all</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"style\" value=\"normal\"/>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">2</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
"</interface>",
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
"Wrapping Label",
|
||||
"Demonstrates how a wrapping label can require a height contextual to its allocated width",
|
||||
"<interface>"
|
||||
" <requires lib=\"gtk+\" version=\"2.18\"/>"
|
||||
" <!-- interface-naming-policy project-wide -->"
|
||||
" <object class=\"GtkWindow\" id=\"window\">"
|
||||
" <property name=\"border_width\">12</property>"
|
||||
" <property name=\"default_width\">300</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkHPaned\" id=\"hpaned1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"can_focus\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkVBox\" id=\"vbox2\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label3\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">A short static label.</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">0</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkFrame\" id=\"frame1\">"
|
||||
" <property name=\"label\">Long label</property>"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">This is a really long label for the purpose of testing line wrapping is working correctly in conjunction with height-for-width support in GTK+</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <property name=\"max_width_chars\">30</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"foreground\" value=\"#18c52119f796\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"expand\">False</property>"
|
||||
" <property name=\"position\">1</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkButton\" id=\"button2\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"can_focus\">True</property>"
|
||||
" <property name=\"receives_default\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label2\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">A really really long label inside a button to demonstrate height for width working inside buttons</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <property name=\"max_width_chars\">25</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"foreground\" value=\"#1e3687ab0a52\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"expand\">False</property>"
|
||||
" <property name=\"position\">2</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"resize\">False</property>"
|
||||
" <property name=\"shrink\">False</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label4\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">This static label\n"
|
||||
"can shrink.</property>"
|
||||
" <property name=\"justify\">center</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"style\" value=\"normal\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"resize\">True</property>"
|
||||
" <property name=\"shrink\">True</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
"</interface>",
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
"Horizontal Box",
|
||||
"Demonstrates how a horizontal box can calculate the collective height for an allocated width",
|
||||
"<interface>"
|
||||
" <requires lib=\"gtk+\" version=\"2.20\"/>"
|
||||
" <!-- interface-naming-policy project-wide -->"
|
||||
" <object class=\"GtkWindow\" id=\"window\">"
|
||||
" <property name=\"default_height\">200</property>"
|
||||
" <property name=\"default_width\">600</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkHPaned\" id=\"hpaned1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"can_focus\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkVBox\" id=\"vbox1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkHBox\" id=\"hbox1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkButton\" id=\"button1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"can_focus\">True</property>"
|
||||
" <property name=\"receives_default\">True</property>"
|
||||
" <property name=\"use_action_appearance\">False</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label2\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">A button that wraps.</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <property name=\"width_chars\">10</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"foreground\" value=\"#0000041dffff\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"expand\">False</property>"
|
||||
" <property name=\"position\">0</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">Lets try setting up some long text to wrap up in this hbox and see if the height-for-width is gonna work !</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <property name=\"width_chars\">30</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"foreground\" value=\"#07d0a9b20972\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">1</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"expand\">False</property>"
|
||||
" <property name=\"position\">0</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkButton\" id=\"button2\">"
|
||||
" <property name=\"label\" translatable=\"yes\">A button that expands in the vbox</property>"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"can_focus\">True</property>"
|
||||
" <property name=\"receives_default\">True</property>"
|
||||
" <property name=\"use_action_appearance\">False</property>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">1</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"resize\">False</property>"
|
||||
" <property name=\"shrink\">False</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label4\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">This label is\n"
|
||||
"set to shrink inside\n"
|
||||
"the paned window.</property>"
|
||||
" <property name=\"justify\">center</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"style\" value=\"normal\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"resize\">True</property>"
|
||||
" <property name=\"shrink\">True</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
"</interface>",
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
"Vertical Labels",
|
||||
"Demonstrates how a horizontal box will consider width-for-height when allocating children "
|
||||
"even if the toplevel window is requested as height-for-width.",
|
||||
"<interface>"
|
||||
" <requires lib=\"gtk+\" version=\"2.20\"/>"
|
||||
" <!-- interface-naming-policy project-wide -->"
|
||||
" <object class=\"GtkWindow\" id=\"window\">"
|
||||
" <property name=\"default_width\">400</property>"
|
||||
" <property name=\"default_height\">300</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkVPaned\" id=\"vpaned1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"can_focus\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkHBox\" id=\"hbox1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">Some long width-for-height text that wraps</property>"
|
||||
" <property name=\"justify\">center</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <property name=\"width_chars\">10</property>"
|
||||
" <property name=\"angle\">90</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#03e307ddfb5f\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"expand\">False</property>"
|
||||
" <property name=\"position\">0</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkFrame\" id=\"frame1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label_xalign\">0</property>"
|
||||
" <property name=\"shadow_type\">out</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label5\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">Neither of the panes are\n"
|
||||
"set to shrink.</property>"
|
||||
" <property name=\"justify\">center</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" <child type=\"label_item\">"
|
||||
" <placeholder/>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">1</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"resize\">False</property>"
|
||||
" <property name=\"shrink\">False</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkHBox\" id=\"hbox2\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkFrame\" id=\"frame2\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label_xalign\">0</property>"
|
||||
" <property name=\"shadow_type\">out</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label4\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">The interface is allocated as height\n"
|
||||
"for width, but the horizontal boxes\n"
|
||||
"allocate in width for height mode.</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"foreground\" value=\"#000097970808\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" <child type=\"label_item\">"
|
||||
" <placeholder/>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">0</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label3\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">Some long width-for-height text that wraps</property>"
|
||||
" <property name=\"justify\">center</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <property name=\"width_chars\">10</property>"
|
||||
" <property name=\"angle\">270</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#03e307ddfb5f\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"expand\">False</property>"
|
||||
" <property name=\"position\">1</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"resize\">False</property>"
|
||||
" <property name=\"shrink\">False</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
"</interface>",
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
"Label Parameters",
|
||||
"This test demonstrates how \"width-chars\" and \"max-width-chars\" can be used "
|
||||
"to effect minimum and natural widths in wrapping labels.",
|
||||
"<interface>"
|
||||
" <requires lib=\"gtk+\" version=\"2.20\"/>"
|
||||
" <!-- interface-naming-policy project-wide -->"
|
||||
" <object class=\"GtkWindow\" id=\"window\">"
|
||||
" <property name=\"default_width\">900</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkHPaned\" id=\"hpaned1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"can_focus\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkVBox\" id=\"vbox1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkHBox\" id=\"hbox1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"spacing\">6</property>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label1\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">The first 2 labels require 10 characters.</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <property name=\"width_chars\">10</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"expand\">False</property>"
|
||||
" <property name=\"fill\">False</property>"
|
||||
" <property name=\"position\">0</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label2\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">This label has a maximum natural width of 20 characters. The second two labels expand.</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <property name=\"width_chars\">10</property>"
|
||||
" <property name=\"max_width_chars\">20</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#05c2a161134b\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"expand\">True</property>"
|
||||
" <property name=\"fill\">True</property>"
|
||||
" <property name=\"position\">1</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label3\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">This label requires a default minimum size.</property>"
|
||||
" <property name=\"wrap\">True</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"weight\" value=\"bold\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#03e30758fb5f\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">2</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">0</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label4\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">This test demonstrates how the \"width-chars\" and \"max-width-chars\"\n"
|
||||
"properties can be used to specify the minimum requested wrap width\n"
|
||||
"and the maximum natural wrap width respectively.</property>"
|
||||
" <property name=\"ellipsize\">end</property>"
|
||||
" <property name=\"width_chars\">30</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"style\" value=\"normal\"/>"
|
||||
" <attribute name=\"foreground\" value=\"#05470000abaf\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"position\">1</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"resize\">False</property>"
|
||||
" <property name=\"shrink\">False</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" <child>"
|
||||
" <object class=\"GtkLabel\" id=\"label5\">"
|
||||
" <property name=\"visible\">True</property>"
|
||||
" <property name=\"label\" translatable=\"yes\">Some static\n"
|
||||
"text that shrinks.\n"
|
||||
"\n"
|
||||
"You will need to stretch\n"
|
||||
"this window quite wide\n"
|
||||
"to see the effects.</property>"
|
||||
" <property name=\"justify\">center</property>"
|
||||
" <attributes>"
|
||||
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
|
||||
" </attributes>"
|
||||
" </object>"
|
||||
" <packing>"
|
||||
" <property name=\"resize\">True</property>"
|
||||
" <property name=\"shrink\">True</property>"
|
||||
" </packing>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
" </child>"
|
||||
" </object>"
|
||||
"</interface>",
|
||||
NULL
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
test_clicked (GtkWidget *button,
|
||||
TestInterface *interface)
|
||||
{
|
||||
if (!interface->window)
|
||||
{
|
||||
GtkBuilder *builder = gtk_builder_new ();
|
||||
|
||||
gtk_builder_add_from_string (builder, interface->interface, -1, NULL);
|
||||
interface->window = (GtkWidget *)gtk_builder_get_object (builder, "window");
|
||||
|
||||
g_signal_connect (interface->window, "delete_event",
|
||||
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
|
||||
}
|
||||
|
||||
gtk_widget_show (interface->window);
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget *
|
||||
create_window (void)
|
||||
{
|
||||
GtkWidget *window, *vbox, *button;
|
||||
gint i;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
vbox = gtk_vbox_new (FALSE, 6);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
|
||||
gtk_widget_show (vbox);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (interfaces); i++)
|
||||
{
|
||||
button = gtk_button_new_with_label (interfaces[i].name);
|
||||
|
||||
gtk_widget_set_tooltip_text (button, interfaces[i].tooltip);
|
||||
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (test_clicked), &interfaces[i]);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = create_window ();
|
||||
|
||||
g_signal_connect (window, "delete-event",
|
||||
G_CALLBACK (gtk_main_quit), window);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
+113
-8
@@ -25,6 +25,21 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
redraw_event_box (GtkWidget *widget)
|
||||
{
|
||||
while (widget)
|
||||
{
|
||||
if (GTK_IS_EVENT_BOX (widget))
|
||||
{
|
||||
gtk_widget_queue_draw (widget);
|
||||
break;
|
||||
}
|
||||
|
||||
widget = gtk_widget_get_parent (widget);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
combo_changed_cb (GtkWidget *combo,
|
||||
gpointer data)
|
||||
@@ -33,33 +48,123 @@ combo_changed_cb (GtkWidget *combo,
|
||||
gint active;
|
||||
|
||||
active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo));
|
||||
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label), (PangoEllipsizeMode)active);
|
||||
redraw_event_box (label);
|
||||
}
|
||||
|
||||
static void
|
||||
scale_changed_cb (GtkRange *range,
|
||||
gpointer data)
|
||||
{
|
||||
double angle = gtk_range_get_value (range);
|
||||
GtkWidget *label = GTK_WIDGET (data);
|
||||
|
||||
gtk_label_set_angle (GTK_LABEL (label), angle);
|
||||
redraw_event_box (label);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ebox_expose_event_cb (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
PangoLayout *layout;
|
||||
const double dashes[] = { 6, 18 };
|
||||
GtkRequisition minimum_size, natural_size;
|
||||
GtkWidget *label = data;
|
||||
cairo_t *cr;
|
||||
gint x, y;
|
||||
|
||||
cr = gdk_cairo_create (widget->window);
|
||||
cairo_translate (cr, -0.5, -0.5);
|
||||
cairo_set_line_width (cr, 1);
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
cairo_rectangle (cr, 0, 0, widget->allocation.width, widget->allocation.height);
|
||||
cairo_fill (cr);
|
||||
|
||||
gtk_widget_translate_coordinates (label, widget, 0, 0, &x, &y);
|
||||
layout = gtk_widget_create_pango_layout (widget, "");
|
||||
|
||||
gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (label), FALSE,
|
||||
&minimum_size, &natural_size);
|
||||
|
||||
pango_layout_set_markup (layout,
|
||||
"<span color='#c33'>\342\227\217 requisition</span>\n"
|
||||
"<span color='#3c3'>\342\227\217 natural size</span>\n"
|
||||
"<span color='#33c'>\342\227\217 allocation</span>", -1);
|
||||
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
g_object_unref (layout);
|
||||
|
||||
cairo_rectangle (cr,
|
||||
x + 0.5 * (label->allocation.width - minimum_size.width),
|
||||
y + 0.5 * (label->allocation.height - minimum_size.height),
|
||||
minimum_size.width, minimum_size.height);
|
||||
cairo_set_source_rgb (cr, 0.8, 0.2, 0.2);
|
||||
cairo_set_dash (cr, NULL, 0, 0);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_rectangle (cr, x, y, label->allocation.width, label->allocation.height);
|
||||
cairo_set_source_rgb (cr, 0.2, 0.2, 0.8);
|
||||
cairo_set_dash (cr, dashes, 2, 0.5);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_rectangle (cr,
|
||||
x + 0.5 * (label->allocation.width - natural_size.width),
|
||||
y + 0.5 * (label->allocation.height - natural_size.height),
|
||||
natural_size.width, natural_size.height);
|
||||
cairo_set_source_rgb (cr, 0.2, 0.8, 0.2);
|
||||
cairo_set_dash (cr, dashes, 2, 12.5);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *window, *vbox, *hbox, *label, *combo;
|
||||
GtkWidget *window, *vbox, *label;
|
||||
GtkWidget *combo, *scale, *align, *ebox;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
vbox = gtk_vbox_new (0, FALSE);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 6);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
hbox = gtk_hbox_new (0, FALSE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
|
||||
label = gtk_label_new ("This label may be ellipsized\nto make it fit.");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
|
||||
combo = gtk_combo_box_new_text ();
|
||||
scale = gtk_hscale_new_with_range (0, 360, 1);
|
||||
label = gtk_label_new ("This label may be ellipsized\nto make it fit.");
|
||||
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "NONE");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "START");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "MIDDLE");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "END");
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
|
||||
|
||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||
gtk_container_add (GTK_CONTAINER (align), label);
|
||||
|
||||
ebox = gtk_event_box_new ();
|
||||
gtk_widget_set_app_paintable (ebox, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (ebox), align);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), combo, FALSE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), ebox, TRUE, TRUE, 0);
|
||||
|
||||
g_object_set_data (G_OBJECT (label), "combo", combo);
|
||||
|
||||
g_signal_connect (combo, "changed", G_CALLBACK (combo_changed_cb), label);
|
||||
g_signal_connect (scale, "value-changed", G_CALLBACK (scale_changed_cb), label);
|
||||
g_signal_connect (ebox, "expose-event", G_CALLBACK (ebox_expose_event_cb), label);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *
|
||||
create_menu (depth)
|
||||
create_menu (guint depth)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *menuitem;
|
||||
@@ -70,19 +70,19 @@ create_menubar (GtkPackDirection pack_dir,
|
||||
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_HOME, NULL);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
|
||||
menu = create_menu (2, TRUE);
|
||||
menu = create_menu (2);
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label ("foo");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
|
||||
menu = create_menu (2, TRUE);
|
||||
menu = create_menu (2);
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label ("bar");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
|
||||
menu = create_menu (2, TRUE);
|
||||
menu = create_menu (2);
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
|
||||
|
||||
return menubar;
|
||||
|
||||
Reference in New Issue
Block a user