Compare commits
515 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 182e87c45e | |||
| 49a4f1d1bc | |||
| 7446281390 | |||
| 71f6aaf758 | |||
| 9ab960fcaf | |||
| 9335fda656 | |||
| 0d9a3a61a9 | |||
| 527f0d661e | |||
| 1bb8460d44 | |||
| 2c53782a25 | |||
| e17dcbe842 | |||
| b441142d38 | |||
| 801cda22cf | |||
| 4c907db3f5 | |||
| 178b5b71bb | |||
| 7d41854e51 | |||
| c1f342e932 | |||
| b827e6ff7a | |||
| d8e0541662 | |||
| b8364aa766 | |||
| e9d1653539 | |||
| ed6d6654c4 | |||
| 7cff1a2465 | |||
| 0e43b2afcf | |||
| d33afa53b0 | |||
| 8f9cfa5412 | |||
| a8883174a7 | |||
| 107ff616dd | |||
| 47957c506c | |||
| ebb3e404c2 | |||
| b15a60430c | |||
| b6b069ded6 | |||
| 25fa4a2929 | |||
| f2d34da673 | |||
| e5984372f7 | |||
| b97d614a8f | |||
| e1a5b83bf7 | |||
| e954b6bff7 | |||
| 6c3b94d150 | |||
| 8e61946d8c | |||
| 6832e19ee8 | |||
| 1a7ead495f | |||
| 1b20880913 | |||
| 79d310eec2 | |||
| ab3fb67021 | |||
| 03d1832a0f | |||
| 65952109a8 | |||
| 55310be446 | |||
| 8238ec0e30 | |||
| eb0bce386d | |||
| 660d582303 | |||
| 31afa7cb21 | |||
| aec747b934 | |||
| 97ff1cad6c | |||
| c8ca3843e3 | |||
| d369dac004 | |||
| 227a426150 | |||
| c6e4f1f11b | |||
| f900bc16de | |||
| acff5f14f5 | |||
| c55b24017e | |||
| 7d1dfbbada | |||
| b075272224 | |||
| 7f442307ff | |||
| 683cf2a4ae | |||
| 8d2faa0925 | |||
| e26438dd48 | |||
| f48968233b | |||
| 6aa575925f | |||
| 460fa5b79a | |||
| 0b10588fe3 | |||
| 6ca81efdcc | |||
| 325a04fbcd | |||
| 52a6a1b0f8 | |||
| 7ccebc7269 | |||
| ca27dff39a | |||
| 9975feaf20 | |||
| 784e23d524 | |||
| a66f378d74 | |||
| ce7993a5a0 | |||
| 068d429d5b | |||
| eb8ae3642c | |||
| 46f404dd2d | |||
| f252b50818 | |||
| 31aaf53f17 | |||
| 895a93c9cd | |||
| 7b69898bd4 | |||
| 00fc8b0d54 | |||
| 7c01e990d0 | |||
| 8577819a60 | |||
| 22ff6e3f7b | |||
| f53c911a0d | |||
| caae5c8123 | |||
| 3fa55dca40 | |||
| 58a54401f7 | |||
| 718b7b0f48 | |||
| 14fa6c2604 | |||
| 24b8bee242 | |||
| 7142292fa2 | |||
| 7ff7a6c7c1 | |||
| 523c9393c9 | |||
| 9bd1e7d6dd | |||
| b915fe54f9 | |||
| 0aaac89cfd | |||
| 851a9de3f3 | |||
| 98769cab15 | |||
| e8665cab15 | |||
| 9073be9fc4 | |||
| a04fa6d9c6 | |||
| c7a75ce4fe | |||
| 0b17e54c95 | |||
| 745f5693f3 | |||
| 70b23a7b03 | |||
| 6c3a8d215d | |||
| 6b3f5d0d67 | |||
| 7745b5ff2e | |||
| fd83f1c36d | |||
| ea747c393d | |||
| 76c0da0d5d | |||
| 062d21fe58 | |||
| b1da918d3f | |||
| 5ba902e605 | |||
| 912095f4bf | |||
| 0216ec037d | |||
| 1800ebb2b9 | |||
| 35fe7f27f9 | |||
| 6f33202c91 | |||
| 7f0210fd09 | |||
| 434e95da34 | |||
| 17dcc1ac18 | |||
| ce0c3d5ca1 | |||
| 156b2d8d3b | |||
| 50c3a75f3c | |||
| b738ec5cd4 | |||
| b2484c8f95 | |||
| 17ebc8414b | |||
| 13eb6884c6 | |||
| 4468c47dce | |||
| 912e49b912 | |||
| a732d38919 | |||
| 285cb969b4 | |||
| afc7f42ac9 | |||
| 7b4169c13b | |||
| a621e55bb6 | |||
| c4d3f3eb91 | |||
| 7418f2c815 | |||
| 08014324db | |||
| 3a146d9a5e | |||
| 678614e37a | |||
| 7034622b6e | |||
| fdb93e840a | |||
| b532358bed | |||
| 2c343b9e1a | |||
| a02bdaa351 | |||
| fcc540cbdc | |||
| a039d716de | |||
| 1fb5246568 | |||
| f699e32ccf | |||
| 929764860e | |||
| b2882aad44 | |||
| 1c9d78fd2e | |||
| 1928afbfa7 | |||
| a97b49d1ba | |||
| 6d657772ef | |||
| 1c03759148 | |||
| ec01429338 | |||
| a033cc27e4 | |||
| 517f9e62db | |||
| 1fa984600f | |||
| baa44a15cf | |||
| 8bfbb78b47 | |||
| 4ee1f6f214 | |||
| 9a914f63c9 | |||
| eb44a56ef0 | |||
| 5b73035853 | |||
| 8e3e9b1fbe | |||
| c8c2a5c16e | |||
| 1108ffcb7f | |||
| d03aad17d6 | |||
| 5952378001 | |||
| 72f4711274 | |||
| 45016319d0 | |||
| 7778781f8a | |||
| b67781e243 | |||
| 989067eded | |||
| 1159220ac2 | |||
| f2ad93c496 | |||
| 692875a219 | |||
| 75f1b42db4 | |||
| 5204cb3007 | |||
| e77da6c140 | |||
| 6f2e3cc4ab | |||
| da2ab86879 | |||
| 8b7c288f92 | |||
| a0d84ec19a | |||
| 309bbf03c1 | |||
| e4d85fa378 | |||
| 9f055423b7 | |||
| 882144878c | |||
| ea8ea5d5cb | |||
| 4157993682 | |||
| 54b366f546 | |||
| 4e0ff51873 | |||
| ba08829366 | |||
| 85f59d66e1 | |||
| 2f06d8ad44 | |||
| 03b6cf491d | |||
| 9573059b2d | |||
| bf54ef87c6 | |||
| 64c73128d1 | |||
| e56818a84f | |||
| cd10630a0c | |||
| 6f75426b7d | |||
| 5d5a62f8ef | |||
| 93fed9bb4b | |||
| 32dba76d50 | |||
| f48958e8a8 | |||
| 7a18b8a1d8 | |||
| 5e1613d2be | |||
| cb004a2e5a | |||
| 65094784f2 | |||
| 63f5bcbb87 | |||
| 77090de17f | |||
| ed0f6a27e8 | |||
| e82cce5275 | |||
| 1df3a75ac4 | |||
| 08e9728fa0 | |||
| 965b411861 | |||
| 686f3dddad | |||
| b203410c34 | |||
| 262b27294b | |||
| cbf3179705 | |||
| 3401ff3f62 | |||
| fc27ee6273 | |||
| 718e8073b4 | |||
| 57c4eb6f8d | |||
| cf19843f22 | |||
| 0a7ad8d681 | |||
| 0b710f2617 | |||
| 2a8625f46e | |||
| 496fe33399 | |||
| b34bef2341 | |||
| c1b7eeefee | |||
| 4489472e1f | |||
| bd2f564550 | |||
| 879386022f | |||
| 3c084768ad | |||
| 1e47f687ad | |||
| 67d71439c5 | |||
| 25d90b843d | |||
| 25630a7b6c | |||
| 30e654e71b | |||
| 81df15dbd4 | |||
| f7c5f43a72 | |||
| 963ceb9356 | |||
| 61e13c4c77 | |||
| 82c31ad22b | |||
| f2a519b6b3 | |||
| f4adc0dba4 | |||
| 4dc5a17c15 | |||
| d00889a3ed | |||
| 025b50b977 | |||
| 2b41c5d460 | |||
| 665ecdb8ec | |||
| 02ec92b2ed | |||
| b439c49898 | |||
| f34d6dbbe9 | |||
| 2020453616 | |||
| aa5c0cb2d2 | |||
| 76900792f4 | |||
| 249b9c1218 | |||
| afef1cc9db | |||
| a114bc7096 | |||
| 8daf239a03 | |||
| 70076454c6 | |||
| 8996a22718 | |||
| eb924984dc | |||
| 21ce0b3f20 | |||
| 27129904a9 | |||
| f1fdab1574 | |||
| d0e1b8482b | |||
| f36342b52d | |||
| 79b790a09b | |||
| cffa661b92 | |||
| cdcbdeaf44 | |||
| cfeee35965 | |||
| 70e6af9504 | |||
| ed31e5a048 | |||
| 29e1292636 | |||
| 3a8845dafc | |||
| c7d2a3cfd3 | |||
| 7dc629c56d | |||
| a97f96b8d5 | |||
| 4190964158 | |||
| b4c44e4c42 | |||
| f911da5e90 | |||
| 3c1da10415 | |||
| 5233d0baf4 | |||
| bce254c912 | |||
| 09ab5502c2 | |||
| 361743d885 | |||
| 4585e13bb2 | |||
| 3e5714b31b | |||
| f560ca2abf | |||
| 2888c662b4 | |||
| a6148c464b | |||
| 10eb81cc03 | |||
| e8a9c6d40c | |||
| 0406f5c2f8 | |||
| deff88d90c | |||
| 02defda7a2 | |||
| 591368e293 | |||
| b201a24ed2 | |||
| 816acf018f | |||
| 41045df10d | |||
| 52897dca78 | |||
| 3787535900 | |||
| 617c2261ae | |||
| f05ed3f6da | |||
| 56f933309d | |||
| 4fe91ca0a9 | |||
| a796b1f9bc | |||
| 4d6333f0bf | |||
| 8900c03e11 | |||
| 2b18858303 | |||
| 6c2bc78064 | |||
| cd592c2645 | |||
| 6413017f03 | |||
| a44db0c5c4 | |||
| 7266f9a800 | |||
| c1f8ca5929 | |||
| 5446f039d2 | |||
| 2b2719befc | |||
| 6fb41ab84b | |||
| 06332e35e6 | |||
| a7343b31c3 | |||
| 4db49dde07 | |||
| ca55b116a8 | |||
| 9171e7438f | |||
| bdb5f882ab | |||
| 323dffbc3b | |||
| af554cb133 | |||
| 2e6649ba17 | |||
| 733d0c9154 | |||
| db9ce55567 | |||
| c214874a8c | |||
| 175146c46d | |||
| fd551b2522 | |||
| e2d90b91c1 | |||
| f979c5c56e | |||
| a7ce2ab638 | |||
| 49639a9cd1 | |||
| 6f1882c24c | |||
| 2a98a16650 | |||
| 6f3cb8b1e1 | |||
| fa57ef8aef | |||
| 4ec3a1d6bd | |||
| f23bda0aad | |||
| cb32f70d20 | |||
| 4e59943375 | |||
| aa36444d7b | |||
| 6c7d7624de | |||
| 8c204e5162 | |||
| cf41b53d71 | |||
| 7608f14b65 | |||
| 8291422086 | |||
| 4a34b201cb | |||
| 1c575522c7 | |||
| 4d67d33f02 | |||
| 7c02992921 | |||
| 50ff8e97f9 | |||
| 7cd37d663b | |||
| 06a15ebedb | |||
| 5bbe06755f | |||
| 154f5dad5b | |||
| d9a12031a2 | |||
| 304f9655f9 | |||
| e9786ce85d | |||
| 96ad6fc4bf | |||
| df8a418a8f | |||
| 7cf485c594 | |||
| 0b9bdc7987 | |||
| 781d7b3364 | |||
| 1a12599fdb | |||
| f1331d8410 | |||
| 529fb0f44f | |||
| ac680cad1e | |||
| 632ce3d3ae | |||
| cf098bba4b | |||
| b4fa63e261 | |||
| b5b88a69aa | |||
| 02f7f14cf2 | |||
| b741e5d3a4 | |||
| ad7adfb4e3 | |||
| e782c03412 | |||
| 0fe0cbaf0c | |||
| 8faf265c12 | |||
| faec05473d | |||
| e753dc2e5a | |||
| b85ef7f732 | |||
| ebe22cd6d3 | |||
| ef50ede3b6 | |||
| 292b331f5b | |||
| eb86193b07 | |||
| c518a56720 | |||
| 204d0e0003 | |||
| af19500ed3 | |||
| f408e1f17f | |||
| c3e91c2604 | |||
| bcd4a8cdb3 | |||
| a7df1508a6 | |||
| 8dbbf8321b | |||
| 3cc2f664cd | |||
| 4fb311b311 | |||
| 96425d2e3c | |||
| 34121a9108 | |||
| ce88affe29 | |||
| af65cdb24e | |||
| 5ca944a813 | |||
| 8f382907d7 | |||
| 4915dc0ef8 | |||
| 105deb1810 | |||
| 3a364cd602 | |||
| 0ed32754f4 | |||
| f740c34dcb | |||
| c8a682947a | |||
| d004f2901e | |||
| 569090f11e | |||
| 32eed3d40a | |||
| 37c0651b95 | |||
| bb6dd7da57 | |||
| 2fb484d7cc | |||
| d0c98af5f8 | |||
| bec6655a7c | |||
| d436ab3def | |||
| 6da13b2f0a | |||
| 35f8965bed | |||
| d516dac5b2 | |||
| b55a0e4921 | |||
| 71d1467304 | |||
| 41bf2931d2 | |||
| aad633f661 | |||
| d29d5fd365 | |||
| f3e0bab511 | |||
| 34b133c8b9 | |||
| 876528e16b | |||
| 5f1caa9779 | |||
| 9f18204cc5 | |||
| 798e56c1e9 | |||
| 0c18fe881b | |||
| ce4015d2ec | |||
| 3ac2421694 | |||
| 9846287396 | |||
| 5b9f86b96a | |||
| c1a4a4cd56 | |||
| 516d2b85e5 | |||
| 24739f4261 | |||
| f6e4a6ae2b | |||
| 3d7693a13c | |||
| 4f525073c6 | |||
| 9e4e9889da | |||
| fbbd38ddb1 | |||
| 6e92d31415 | |||
| a075ca97ed | |||
| af177c8c1c | |||
| e0e5f1fd52 | |||
| 1594006ba2 | |||
| 087ea955d9 | |||
| 41e1167283 | |||
| 0988088c47 | |||
| 47a464fcb6 | |||
| 78068978a0 | |||
| 7bdde1e104 | |||
| f951eff62e | |||
| 653190b0df | |||
| 6caac23b8e | |||
| 2c2fdce82f | |||
| 205be12b37 | |||
| 245e344eff | |||
| d9fb9d5963 | |||
| be8d1d14b7 | |||
| 1322998cd6 | |||
| 5d2c80e124 | |||
| 0e7ede9036 | |||
| cd396b22ae | |||
| a2e52bc8cc | |||
| fffd34a24d | |||
| 39043b9dcc | |||
| 5d21cd3b72 | |||
| fccbe77810 | |||
| 79648eb953 | |||
| 458d964173 | |||
| 1cf67fae1b | |||
| 4635094c2f | |||
| 809c1777a4 | |||
| 61fddfc0ef | |||
| d9808b04bb | |||
| 457e5acb0b | |||
| 37976d540d | |||
| 4b38323296 | |||
| 4c9adc8d19 | |||
| 3c032484c1 | |||
| 20016b1511 | |||
| b95a071007 | |||
| fa98ac6287 | |||
| e3f5861fa0 | |||
| c5f53b623c | |||
| e6fbe340fa | |||
| 0f205e9172 | |||
| f48cdf2100 | |||
| b834eee6c6 | |||
| 620c316530 | |||
| db0bc7fb3b | |||
| bcf28d3444 | |||
| e69970bd65 |
+2400
File diff suppressed because it is too large
Load Diff
+2400
File diff suppressed because it is too large
Load Diff
+2400
File diff suppressed because it is too large
Load Diff
@@ -18,8 +18,8 @@ GTK+ requires the following packages:
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-2.4.1.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.4.1 # change to the toplevel directory
|
||||
% gzip -cd gtk+-2.4.14.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.4.14 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
|
||||
@@ -1,3 +1,236 @@
|
||||
Overview of Changes from GTK+ 2.4.13 to GTK+ 2.4.14
|
||||
===================================================
|
||||
* GtkFileChooser
|
||||
- Improve keybindings [Federico Mena Quintero]
|
||||
- Speed up loading of large directories [Federico]
|
||||
- Move "Browse for other folders" expander up [Federico]
|
||||
- Support DND from the path bar [Federico]
|
||||
* GtkUIManager
|
||||
- Speed up [Dave Neary, Michael Natterer, Sven Neumann,
|
||||
Soeren Sandmann]
|
||||
* GtkTreeView
|
||||
- Fix resizing artifacts in empty, focused
|
||||
treeviews [Billy Biggs, Vincent Noel]
|
||||
* GtkSettings
|
||||
- Handle changes to gtk-menu-images and gtk-button-images
|
||||
much more efficiently [Matthias Clasen]
|
||||
* GDK
|
||||
- Allow to set wm hints on leader windows [Sebastien Bacher]
|
||||
* Win32
|
||||
- Implement resize grips [Robert Ögren]
|
||||
- Bug fixes [Robert, Tor Lillqvist]
|
||||
* Bug fixes [Morten Welinder, William Jon McCann,
|
||||
Anders Carlsson, Philip Langdale, Christian Persch,
|
||||
John Finlay, Carlos Garnacho Parro, Tim Janik, Gavin Romig-Koch,
|
||||
Jonathan Blandford, Billy Biggs, Federico, Christian Neumair,
|
||||
Kristian Høgsberg, Sven, Dennis Cranston]
|
||||
Updated translations (ca,id,nb,no,nso,pa,zh_CN)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.11 to GTK+ 2.4.13
|
||||
===================================================
|
||||
* Fix size allocation problems. [Crispin Flowerday, Tim Janik, Tommi Komulainen, Owen Taylor]
|
||||
* New and updated translations (fr,ta)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.10 to GTK+ 2.4.11
|
||||
===================================================
|
||||
* GtkFileChooser
|
||||
- Make path bar arrows larger [Matthias Clasen]
|
||||
- Make SELECT_FOLDER mode work [Matthias]
|
||||
- Speed up the completion popup [Matthias]
|
||||
- Update the preview when searching [Tommi Komulainen]
|
||||
- Pop up completions again when tab is pressed [Jon Bech Madsen]
|
||||
- Don't prepopulate the location entry [Matthias]
|
||||
* Win32 bug fixes [Robert Ögren]
|
||||
* Other bug fixes [Federico Mena Quintero, Joel Fredrikson, Matthias,
|
||||
Padraig O'Briain, Michèle Garoche. Frederic Crozat,
|
||||
Jonathan Blandford, John Cupitt, Morten Welinder, Christian Persch,
|
||||
Lorenzo Gil Sanchez, Federico]
|
||||
Martyn Russell]
|
||||
* Documentation improvements [John Finlay, Billy Biggs, Jonathan,
|
||||
Owen Taylor]
|
||||
* New and updated translations (az_IR,ang,en_CA,gl,hu,it,nl)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.9 to GTK+ 2.4.10
|
||||
==================================================
|
||||
* GtkFileChooser
|
||||
- Fix some memory leaks [Kjartan Maraas]
|
||||
- Make autocompletion less annoying in save mode [Owen Taylor]
|
||||
* Default theme
|
||||
- Improve drawing of expanders [Matthias Clasen]
|
||||
* GtkEntryCompletion
|
||||
- Improve positioning of popups [Matthias]
|
||||
* Make selection handling robust against invalid UTF-8 [Owen Taylor]
|
||||
* gdk-pixbuf
|
||||
- Fix saving of pixbufs with alpha-channel as jpeg [Emmanuel Pacaud]
|
||||
- Security fixes [Chris Evans]
|
||||
* Win32 bug fixes
|
||||
- Improve tablet handling [Robert Ögren]
|
||||
- Handle screen resolution changes [Arjohn Kampman, Tor Lillqvist]
|
||||
- Fix loading of input modules on Win32 [Kazuki IWAMOTO]
|
||||
* Other bug fixes [Tim Janik, Bill Haneman, Padraig O'Briain,
|
||||
Frederic Croszat, Matthias, Felipe Heidrich, Lorenzo Gil
|
||||
Sanchez, Olivier Andrieu, Jean Bréfort, Christian Persch,
|
||||
Edd Dumbhill, Marco Pesenti Gritti]
|
||||
* Updated translations (ang,bn,cs,cy,de,en_CA,hu,ne,nn,ro,tr,uk)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.7 to GTK+ 2.4.8
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Fix some memory leaks [Federico Mena Quintero]
|
||||
- Make save mode work with old versions of the
|
||||
gnome-vfs backend. [Zack Cerza]
|
||||
* GtkEntryCompletion
|
||||
- Warn if text column has wrong type [Fernando San Martin Woerner,
|
||||
Gustavo Carneiro]
|
||||
* GtkTreeView
|
||||
- Fix a redraw problem in fixed height mode [Pawel Salek]
|
||||
* GDK
|
||||
- Complete the _NEW_WM_USER_TIME implementation [Elijah Newren]
|
||||
- Update the _NET_ACTIVE_WINDOW implementation [Elijah]
|
||||
* gdk-pixbuf
|
||||
- Avoid infinite loops for bad BMPs [Chris Evans, Manish Singh]
|
||||
- Fix a problem with GDK_INTERP_NEAREST scaling which caused
|
||||
Nautilus thumbnails to be misdrawn [Christoph Fergeau]
|
||||
- Avoid segfaults in gdk-pixbuf-csource [Matthias Clasen]
|
||||
* Win32 bug fixes [Tim Evans, Tor Lillqvist]
|
||||
* Other bug fixes [Gustavo, Torsten Schoenfeld, Manish, Tomislav Jonjic,
|
||||
Soeren Sandmann, Tommi Komulainen, Philip Langdale, Jon-Kare Hellan]
|
||||
* Documentation improvements [Matthias]
|
||||
* Updated translations (bs,da,fi,sq)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.6 to GTK+ 2.4.7
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Fix for Open button not actually opening [Tommi Komulainen]
|
||||
- Fix crash when g_get_home_dir() returns NULL [Tor Lillqvist]
|
||||
|
||||
Overview of Changes from GTK+ 2.4.4 to GTK+ 2.4.6
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Set busy cursor while mounting [Federico Mena Quintero]
|
||||
- Set accessible name [Padraig O'Briain]
|
||||
- Improve activation on focus [Federico]
|
||||
- Accept paths in entry [Federico]
|
||||
* GtkTreeView
|
||||
- Draw focus indicator for empty tree views [Federico]
|
||||
- Make column dragging more robust [Matthias Clasen,
|
||||
Christian Biere]
|
||||
- Prevent DND on non-sources [Pawel Salek]
|
||||
* GtkUIManager
|
||||
- Accept paths with a leading / [David Malcolm]
|
||||
* Gdk
|
||||
- Fix handling of keep-above and keep-below
|
||||
state [Matthew Garret]
|
||||
- Add some missing error traps [Thomas Leonard]
|
||||
* gdk-pixbuf
|
||||
- Make incremental loading work for 8bit pcx
|
||||
files [Magnus Bergman]
|
||||
- Handle edge pixels consistently [Brian Cameron,
|
||||
Matthias]
|
||||
- Handle OS/2 BMPs [Jon-Kare Hellan]
|
||||
* Bug fixes for Copy-Paste behaviour in text widgets
|
||||
[Mikael Hallendal, Scott Bronson]
|
||||
* Memory leak fixes in multiple widgets [Kjartan Maraas,
|
||||
Tommi Komulainen, Crispin Flowerday, Matthias]
|
||||
* Win32 fixes [Robert Ögren, Tor Lillqvist, Hans Breuer
|
||||
* Other bug fixes [John Cupitt, Elke Meier, Matthias,
|
||||
Peter Zelezny, Guilherme Salgado, John Finlay, Tommi,
|
||||
Padaig, Olivier Sessink, Nicolas Deves, Lorenzo Gil
|
||||
Sanchez, Christian Persch, Morten Welinder, Markku Vire,
|
||||
Markus Lausser, Abel Daniel]
|
||||
* Documentation improvements [Owen Taylor, Matthias, Axel
|
||||
Simon, David, Federico, Mariano Suarez-Alvarez]
|
||||
* Updated translations (ang,az,bg,br,ca,cs,en_CA,es,fi,fr,hi,hu,
|
||||
it,ja,ko,mn,nb,nl,no,pl,pt,pt_BR,ru,sq,sr,sr@Latn,sr@ije,sv,uz,
|
||||
wa,zh_CN)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.3 to GTK+ 2.4.4
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Use Save button in save mode. [Federico Mena Quintero]
|
||||
- Check for errors when opening folders [Federico]
|
||||
- Fall back to stock icons if icon theme is not found [Federico]
|
||||
- Bug fixes [Federico, Alex Roitman, Owen Taylor]
|
||||
* GtkComboBox
|
||||
- Make it work without a model [Mariano Suarez-Alvarez, Christian Persch]
|
||||
- Improve placement of popup [David A. Knight]
|
||||
* GtkImage
|
||||
- Fix issues with partial redrawing [John Ehresman, Felipe Heidrich,
|
||||
Billy Biggs]
|
||||
* GtkEntry
|
||||
- Fix cursor movement with combining marks [Theppitak Karoonboonyanan]
|
||||
- Protect passwords better [Morten Welinder]
|
||||
* Win32 fixes
|
||||
- Fix build without wintab [J. Ali Harlow]
|
||||
- Improve Clipboard handling [Tor Lillqvist, John Ehresman]
|
||||
* Gdk
|
||||
- Make RGBA cursors work [Michael Natterer]
|
||||
- Work with odd XServers [Bastien Nocera]
|
||||
- Handle _NET_WM_STATE_ABOVE/_BELOW better [Billy Biggs]
|
||||
- Don't leak DND contexts [Alex Larsson]
|
||||
* gdk-pixbuf
|
||||
- Make tiff loader work with libtiff 3.6.1 [Marco Ghirlanda]
|
||||
- Fix math for GDK_INTERP_HYPER [Brian Cameron]
|
||||
- Fix Win32 exported symbols [Tor Lillqvist]
|
||||
* Documentation improvements [Billy Biggs, Matthias Clasen,
|
||||
Oliver Andrieu]
|
||||
* Other bug fixes [Federico, Michael, Matthias, Philip Kendall,
|
||||
Jean-François Wauthy, John Finlay, Jeff Franks, Tim Janik,
|
||||
Nickolay V. Shmyrev, Sampo Nurmentaus, William Jon McCann,
|
||||
Jan-Marek Glogowski, Yevgen Muntyan, Pawel Salek,
|
||||
Jonathan Blandford, Sunil, Dimitiry. M Shatrov]
|
||||
* Updated translations (bg,he,hu,ne,sq)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.2 to GTK+ 2.4.3
|
||||
=================================================
|
||||
* GtkButton
|
||||
- Give extra space to children of !CAN_FOCUS buttons [Matthias Clasen]
|
||||
* GtkFileChooser
|
||||
- Make DND work when the dialog is modal [Federico Mena Quintero]
|
||||
* GtkToolbar
|
||||
- Don't show empty overflow menu [Soeren Sandmann]
|
||||
- Don't show initial separator in overflow menu [Soeren]
|
||||
- Handle dynamic changes to overflow menu [Soeren]
|
||||
* Documentation improvements [Bastien Nocera, Matthias]
|
||||
* Other bug fixes [Matthias, Soeren, Sven Neumann]
|
||||
* Updated translations (hu,ne)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.1 to GTK+ 2.4.2
|
||||
=================================================
|
||||
* GtkUIManager
|
||||
- Install signals correctly [Michael Natterer]
|
||||
- Make the output of gtk_ui_manager_get_ui() parsable. [Michael]
|
||||
- Add a way to suppress stock accelerators. [David A Knight]
|
||||
* GtkClipboard
|
||||
- Fix INCRemental transfer of MULTIPLE targets [Matthias Clasen]
|
||||
- Increase the chunk size for INCRemental transfers [Matthias]
|
||||
* GtkFileChooser
|
||||
- Hide the combo box when appropriate [Christian Neumair]
|
||||
- bug fixes [Federico Mena Quintero]
|
||||
* GtkComboBox
|
||||
- add mouse/wheel bindings on the cellview [Matthias]
|
||||
- improve positioning of popup [Matthias]
|
||||
- make the selection follow the mouse [Matthias]
|
||||
* GtkEntryCompletion
|
||||
- make the selection follow the mouse [Matthias]
|
||||
- restrict popup size to monitor size [Matthias, DmD Ljungmark]
|
||||
- don't complete on paste [Anders Carlsson]
|
||||
* Win32
|
||||
- bug fixes [Benoît Carpentier, Hans Breuer, John Ehresman,
|
||||
Tor Lillqvist, Robert Ögren]
|
||||
* GtkButton/GtkArrow
|
||||
- Don't draw the focus over the button child [Matthias]
|
||||
- Increase default arrow size to compensate [Matthias]
|
||||
* Documentation improvements [Doug Quale, Matthias,
|
||||
Steffen Röcker, Steve Chaplin, Tommi Komulainen]
|
||||
* Other bug fixes [Billy Biggs, Crispin Flowerday,
|
||||
David Hawthorne, Federico, Havoc Pennington, John Finlay,
|
||||
Kouichirou Hiratsuka, Mark McLoughlin, Matthias, Michael,
|
||||
Michal Pasternak, Morten Welinder, Olivier Andrieu,
|
||||
Owen Taylor, Padraig O'Briain, Sam Stevenson, Scott Tsai,
|
||||
Soeren Sandmann, Sven Neumann]
|
||||
* Updated translations (bg,it,nl,tk,wa,zh_CN)
|
||||
|
||||
Overview of Changes from GTK+ 2.4.0 to GTK+ 2.4.1
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 2.4.1. GTK+ is a multi-platform toolkit for
|
||||
This is GTK+ version 2.4.14. GTK+ is a multi-platform toolkit for
|
||||
creating graphical user interfaces. Offering a complete set of widgets,
|
||||
GTK+ is suitable for projects ranging from small one-off projects to
|
||||
complete application suites.
|
||||
|
||||
+8
-5
@@ -12,10 +12,10 @@ AC_PREREQ(2.54)
|
||||
|
||||
m4_define([gtk_major_version], [2])
|
||||
m4_define([gtk_minor_version], [4])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_micro_version], [15])
|
||||
m4_define([gtk_version],
|
||||
[gtk_major_version.gtk_minor_version.gtk_micro_version])
|
||||
m4_define([gtk_interface_age], [1])
|
||||
m4_define([gtk_interface_age], [15])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
# This is the X.Y used in -lgtk-FOO-X.Y
|
||||
@@ -401,7 +401,7 @@ fi
|
||||
# sure that both po/ and po-properties/ have .po files that correspond
|
||||
# to your language. If you only add one to po/, the build will break
|
||||
# in po-properties/.
|
||||
ALL_LINGUAS="af am ar az be bg bn br ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu ia id is it ja ko li lt lv mi mk ml mn mr ms ne nl nn no pa pl pt pt_BR ro ru sk sl sq sr sr@ije sr@Latn sv ta th tr uk uz uz@Latn vi wa yi zh_CN zh_TW"
|
||||
ALL_LINGUAS="af am ang ar az az_IR be bg bn br bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu ia id is it ja ko li lt lv mi mk ml mn mr ms nb ne nl nn no nso pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sr@ije sv ta th tk tr uk uz uz@Latn vi wa yi zh_CN zh_TW"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
@@ -1099,12 +1099,15 @@ if test "x$gdktarget" = "xx11"; then
|
||||
# Check for solaris
|
||||
use_solaris_xinerama=yes
|
||||
AC_CHECK_LIB(Xext, XineramaGetInfo,
|
||||
use_solaris_xinerama=yes, use_solaris_xinerama=no)
|
||||
use_solaris_xinerama=yes,
|
||||
use_solaris_xinerama=no,
|
||||
, -lXext $x_libs_for_checks)
|
||||
if test "x$use_solaris_xinerama" = "xyes"; then
|
||||
AC_CHECK_HEADER(X11/extensions/xinerama.h,
|
||||
[GTK_ADD_LIB(x_extra_libs,Xext)
|
||||
AC_DEFINE(HAVE_SOLARIS_XINERAMA)
|
||||
AC_DEFINE(HAVE_XINERAMA)], use_solaris_xinerama=no, -lXext $x_libs_for_checks)
|
||||
AC_DEFINE(HAVE_XINERAMA)],
|
||||
use_solaris_xinerama=no,[#include <X11/Xlib.h>])
|
||||
fi
|
||||
AC_MSG_CHECKING(for Xinerama support on Solaris)
|
||||
AC_MSG_RESULT($use_solaris_xinerama);
|
||||
|
||||
@@ -1,3 +1,39 @@
|
||||
2004-12-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.14 ===
|
||||
|
||||
2004-10-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.13 ===
|
||||
|
||||
2004-10-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.12 ===
|
||||
|
||||
2004-10-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.11 ===
|
||||
|
||||
2004-09-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.10 ===
|
||||
|
||||
2004-08-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.9 ===
|
||||
|
||||
2004-08-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.8 ===
|
||||
|
||||
Sat Aug 14 19:15:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* === Released 2.4.7 ===
|
||||
|
||||
Tue Jul 20 23:27:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-xlibrgb.c: Include config.h first. (#148034)
|
||||
|
||||
Tue Mar 9 09:33:54 2004 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* === Released 2.3.6 ===
|
||||
|
||||
@@ -47,8 +47,6 @@
|
||||
* Shawn T. Amundson <amundson@gtk.org>
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
# if STDC_HEADERS
|
||||
@@ -61,6 +59,8 @@
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define ENABLE_GRAYSCALE
|
||||
|
||||
/* include this before so that we can get endian definitions if
|
||||
|
||||
@@ -132,7 +132,7 @@ static guint n_color_entries = G_N_ELEMENTS (color_entries);
|
||||
enum {
|
||||
SHAPE_SQUARE,
|
||||
SHAPE_RECTANGLE,
|
||||
SHAPE_OVAL,
|
||||
SHAPE_OVAL
|
||||
};
|
||||
|
||||
static GtkRadioActionEntry shape_entries[] = {
|
||||
|
||||
@@ -196,7 +196,7 @@ progressive_timeout (gpointer data)
|
||||
}
|
||||
else
|
||||
{
|
||||
image_stream = fopen (filename, "r");
|
||||
image_stream = fopen (filename, "rb");
|
||||
g_free (filename);
|
||||
|
||||
if (!image_stream)
|
||||
|
||||
@@ -265,6 +265,7 @@ do_pixbufs (GtkWidget *do_widget)
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
g_object_unref (frame);
|
||||
}
|
||||
|
||||
return window;
|
||||
|
||||
@@ -89,7 +89,7 @@ static guint n_color_entries = G_N_ELEMENTS (color_entries);
|
||||
enum {
|
||||
SHAPE_SQUARE,
|
||||
SHAPE_RECTANGLE,
|
||||
SHAPE_OVAL,
|
||||
SHAPE_OVAL
|
||||
};
|
||||
|
||||
static GtkRadioActionEntry shape_entries[] = {
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <demos.h>
|
||||
|
||||
static GtkTextBuffer *info_buffer;
|
||||
static GtkTextBuffer *source_buffer;
|
||||
|
||||
static gchar *current_file = NULL;
|
||||
|
||||
enum {
|
||||
TITLE_COLUMN,
|
||||
FILENAME_COLUMN,
|
||||
FUNC_COLUMN,
|
||||
ITALIC_COLUMN,
|
||||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
gboolean
|
||||
read_line (FILE *stream, GString *str)
|
||||
{
|
||||
int n_read = 0;
|
||||
|
||||
flockfile (stream);
|
||||
|
||||
g_string_truncate (str, 0);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int c;
|
||||
|
||||
c = getc_unlocked (stream);
|
||||
|
||||
if (c == EOF)
|
||||
goto done;
|
||||
else
|
||||
n_read++;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\r':
|
||||
case '\n':
|
||||
{
|
||||
int next_c = getc_unlocked (stream);
|
||||
|
||||
if (!(next_c == EOF ||
|
||||
(c == '\r' && next_c == '\n') ||
|
||||
(c == '\n' && next_c == '\r')))
|
||||
ungetc (next_c, stream);
|
||||
|
||||
goto done;
|
||||
}
|
||||
default:
|
||||
g_string_append_c (str, c);
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
funlockfile (stream);
|
||||
|
||||
return n_read > 0;
|
||||
}
|
||||
|
||||
void
|
||||
load_file (const gchar *filename)
|
||||
{
|
||||
FILE *file;
|
||||
GtkTextIter start, end;
|
||||
GString *buffer = g_string_new (NULL);
|
||||
int state = 0;
|
||||
gboolean in_para = 0;
|
||||
|
||||
if (current_file && !strcmp (current_file, filename))
|
||||
return;
|
||||
|
||||
g_free (current_file);
|
||||
current_file = g_strdup (filename);
|
||||
|
||||
gtk_text_buffer_get_bounds (info_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (info_buffer, &start, &end);
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (source_buffer, &start, &end);
|
||||
|
||||
file = fopen (filename, "r");
|
||||
if (!file)
|
||||
{
|
||||
g_warning ("Cannot open %s: %s\n", filename, g_strerror (errno));
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
|
||||
while (read_line (file, buffer))
|
||||
{
|
||||
gchar *p = buffer->str;
|
||||
gchar *q;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
/* Reading title */
|
||||
while (*p == '/' || *p == '*' || isspace (*p))
|
||||
p++;
|
||||
q = p + strlen (p);
|
||||
while (q > p && isspace (*(q - 1)))
|
||||
q--;
|
||||
|
||||
if (q > p)
|
||||
{
|
||||
int len_chars = g_utf8_pointer_to_offset (p, q);
|
||||
|
||||
end = start;
|
||||
|
||||
g_assert (strlen (p) >= q - p);
|
||||
gtk_text_buffer_insert (info_buffer, &end, p, q - p);
|
||||
start = end;
|
||||
|
||||
gtk_text_iter_backward_chars (&start, len_chars);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "title", &start, &end);
|
||||
|
||||
start = end;
|
||||
|
||||
state++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
/* Reading body of info section */
|
||||
while (isspace (*p))
|
||||
p++;
|
||||
if (*p == '*' && *(p + 1) == '/')
|
||||
{
|
||||
gtk_text_buffer_get_iter_at_offset (source_buffer, &start, 0);
|
||||
state++;
|
||||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
|
||||
while (*p == '*' || isspace (*p))
|
||||
p++;
|
||||
|
||||
len = strlen (p);
|
||||
while (isspace (*(p + len - 1)))
|
||||
len--;
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
if (in_para)
|
||||
gtk_text_buffer_insert (info_buffer, &start, " ", 1);
|
||||
|
||||
g_assert (strlen (p) >= len);
|
||||
gtk_text_buffer_insert (info_buffer, &start, p, len);
|
||||
in_para = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_text_buffer_insert (info_buffer, &start, "\n", 1);
|
||||
in_para = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
/* Skipping blank lines */
|
||||
while (isspace (*p))
|
||||
p++;
|
||||
if (*p)
|
||||
{
|
||||
p = buffer->str;
|
||||
state++;
|
||||
/* Fall through */
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* Reading program body */
|
||||
gtk_text_buffer_insert (source_buffer, &start, p, -1);
|
||||
gtk_text_buffer_insert (info_buffer, &start, "\n", 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "source", &start, &end);
|
||||
}
|
||||
|
||||
gboolean
|
||||
button_press_event_cb (GtkTreeView *tree_view,
|
||||
GdkEventButton *event,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
if (event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
GtkTreePath *path = NULL;
|
||||
|
||||
gtk_tree_view_get_path_at_pos (tree_view,
|
||||
event->window,
|
||||
event->x,
|
||||
event->y,
|
||||
&path,
|
||||
NULL);
|
||||
|
||||
if (path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean italic;
|
||||
GVoidFunc func;
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_tree_store_get (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
FUNC_COLUMN, &func,
|
||||
ITALIC_COLUMN, &italic,
|
||||
-1);
|
||||
(func) ();
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
ITALIC_COLUMN, !italic,
|
||||
-1);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
gtk_signal_emit_stop_by_name (GTK_OBJECT (tree_view),
|
||||
"button_press_event");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
selection_cb (GtkTreeSelection *selection,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GValue value = {0, };
|
||||
|
||||
if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
return;
|
||||
|
||||
gtk_tree_model_get_value (model, &iter,
|
||||
FILENAME_COLUMN,
|
||||
&value);
|
||||
load_file (g_value_get_string (&value));
|
||||
g_value_unset (&value);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_text (GtkTextBuffer **buffer,
|
||||
gboolean is_source)
|
||||
{
|
||||
GtkWidget *scrolled_window;
|
||||
GtkWidget *text_view;
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_SHADOW_IN);
|
||||
|
||||
text_view = gtk_text_view_new ();
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
||||
|
||||
*buffer = gtk_text_buffer_new (NULL);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), *buffer);
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
|
||||
if (is_source)
|
||||
{
|
||||
font_desc = pango_font_description_from_string ("Courier 10");
|
||||
gtk_widget_modify_font (text_view, font_desc);
|
||||
pango_font_description_free (font_desc);
|
||||
}
|
||||
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), !is_source);
|
||||
|
||||
return scrolled_window;
|
||||
}
|
||||
|
||||
/* Technically a list, but if we do go to 80 demos, we may want to move to a tree */
|
||||
static GtkWidget *
|
||||
create_tree (void)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
GtkCellRenderer *cell;
|
||||
GtkWidget *tree_view;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeStore *model;
|
||||
GtkTreeIter iter;
|
||||
gint i;
|
||||
|
||||
model = gtk_tree_store_new_with_types (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
|
||||
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
|
||||
|
||||
gtk_tree_selection_set_type (GTK_TREE_SELECTION (selection),
|
||||
GTK_TREE_SELECTION_SINGLE);
|
||||
gtk_widget_set_usize (tree_view, 200, -1);
|
||||
|
||||
for (i=0; i < G_N_ELEMENTS (testgtk_demos); i++)
|
||||
{
|
||||
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL);
|
||||
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
TITLE_COLUMN, testgtk_demos[i].title,
|
||||
FILENAME_COLUMN, testgtk_demos[i].filename,
|
||||
FUNC_COLUMN, testgtk_demos[i].func,
|
||||
ITALIC_COLUMN, FALSE,
|
||||
-1);
|
||||
}
|
||||
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("Widget",
|
||||
cell,
|
||||
"text", TITLE_COLUMN,
|
||||
"italic", ITALIC_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
|
||||
GTK_TREE_VIEW_COLUMN (column));
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (selection), "selection_changed", selection_cb, model);
|
||||
gtk_signal_connect (GTK_OBJECT (tree_view), "button_press_event", GTK_SIGNAL_FUNC (button_press_event_cb), model);
|
||||
|
||||
return tree_view;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *notebook;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *tree;
|
||||
GtkTextTag *tag;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), hbox);
|
||||
|
||||
tree = create_tree ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), tree, FALSE, FALSE, 0);
|
||||
|
||||
notebook = gtk_notebook_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), notebook, TRUE, TRUE, 0);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&info_buffer, FALSE),
|
||||
gtk_label_new ("Info"));
|
||||
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&source_buffer, TRUE),
|
||||
gtk_label_new ("Source"));
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "title");
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Sans 18",
|
||||
NULL);
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "source");
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Courier 10",
|
||||
"pixels_above_lines", 0,
|
||||
"pixels_below_lines", 0,
|
||||
NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
|
||||
load_file (testgtk_demos[0].filename);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
+4
-2
@@ -16,8 +16,9 @@ Without those packages make distcheck will *not* pass.
|
||||
0) Blow away your gtk+ directory, check a new version out
|
||||
1) autogen and build it, make sure to enable docs.
|
||||
2) Update NEWS based on the various ChangeLog files
|
||||
3) Update version in configure.in, increase micro and interface age by 1.
|
||||
(Note that this is critical, a slip-up here will cause the soname to change).
|
||||
3) Verify that the version in configure.in has been bumped after the last
|
||||
release. (Note that this is critical, a slip-up here will cause the soname
|
||||
to change).
|
||||
4) Add === Released 2.x.y === at the top of all ChangeLog files
|
||||
5) make distcheck
|
||||
6) Fix broken stuff found by 5) repeat
|
||||
@@ -34,3 +35,4 @@ create a new message in the same form, replacing version numbers, commentary
|
||||
at the top about "what this release is about" and the Summary of changes.
|
||||
12) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and
|
||||
gtk-devel-list. Set reply-to to gnome-hackers.
|
||||
13) Bump the version number in configure.in.
|
||||
|
||||
@@ -429,7 +429,7 @@ in which they need to be installed:</para>
|
||||
|
||||
<itemizedlist spacing=compact>
|
||||
<listitem><simpara> pkg-config
|
||||
(<ulink url="http://www.freedesktop.org/software/pkgconfig/">
|
||||
(<ulink url="http://www.freedesktop.org/software/pkgconfig">
|
||||
pkg-config Site</ulink>)</simpara>
|
||||
</listitem>
|
||||
|
||||
|
||||
@@ -1,3 +1,140 @@
|
||||
2004-12-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.14 ===
|
||||
|
||||
2004-10-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.13 ===
|
||||
|
||||
2004-10-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.12 ===
|
||||
|
||||
2004-10-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.11 ===
|
||||
|
||||
2004-10-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkenums.sgml: Document selection modes.
|
||||
(#154188, Jonathan Blandford, wording proposed by Owen Taylor)
|
||||
|
||||
2004-09-21 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/running.sgml: Refer to GTK2_RC_FILES, not to
|
||||
GTK_RC_FILES. (#153326, Billy Biggs)
|
||||
|
||||
2004-09-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.10 ===
|
||||
|
||||
2004-08-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.9 ===
|
||||
|
||||
2004-08-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.8 ===
|
||||
|
||||
2004-08-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf-csource.xml: Document bugs of
|
||||
the runlength encoder.
|
||||
|
||||
Sat Aug 14 19:15:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* === Released 2.4.7 ===
|
||||
|
||||
2004-08-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.6 ===
|
||||
|
||||
Thu Aug 12 00:06:20 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkuimanager.sgml: Add some information about
|
||||
allowed values for the name and action attributes.
|
||||
|
||||
2004-08-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkrc.sgml: Fix a typo. (#149470, Mariano
|
||||
Suarez-Alvarez)
|
||||
|
||||
2004-07-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtk-sections.txt: Add gtk_parse_args.
|
||||
|
||||
2004-07-12 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/glossary.xml: Start of the GTK+ glossary.
|
||||
|
||||
* gtk/Makefile.am (content_files): Added glossary.xml.
|
||||
|
||||
* gtk/gtk-docs.sgml: Likewise.
|
||||
|
||||
2004-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.4 ===
|
||||
|
||||
Sat Jul 3 23:44:45 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtksocket.sgml:
|
||||
* gtk/tmpl/gtkicontheme.sgml:
|
||||
* gtk/building.sgml:
|
||||
* gdk/tmpl/windows.sgml: Fix links to www.freedesktop.org.
|
||||
(#145210, Billy Biggs)
|
||||
|
||||
Tue Jun 22 21:54:24 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf/composite.dia:
|
||||
* gdk-pixbuf/composite.png: Flip the y axes in the diagrams.
|
||||
|
||||
Sun Jun 20 00:17:58 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf/composite.png: Add a figure which tries
|
||||
to expain pixbuf compositing.
|
||||
|
||||
* gdk-pixbuf/composite.dia:
|
||||
* gdk-pixbuf/apple-red-1a.png:
|
||||
* gdk-pixbuf/apple-red-2c.png:
|
||||
* gdk-pixbuf/gnome-gmush-1.png: Sources for composite.png.
|
||||
|
||||
* gdk-pixbuf/Makefile.am (HTML_IMAGES): Add composite.png.
|
||||
|
||||
Fri Jun 18 21:23:08 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtktreemodelfilter.sgml: Fix the docs for
|
||||
GtkTreeModelFilterVisibleFunc. (#144583, Olivier Andrieu)
|
||||
|
||||
2004-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.3 ===
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.2 ===
|
||||
|
||||
Mon May 31 00:18:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtktable.sgml: Document the default attach
|
||||
options for gtk_table_attach_defaults(). (#143391,
|
||||
Steve Chaplin)
|
||||
|
||||
Fri May 28 14:35:53 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkcontainer.sgml: Fix docs for
|
||||
gtk_container_border_width(). (#143309, Doug Quale)
|
||||
|
||||
Fri May 7 01:36:30 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf-csource.xml: Add an "Environment"
|
||||
section. (Jens Elkner)
|
||||
|
||||
Fri May 7 01:23:03 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkicontheme.sgml: Fix example. (Steffen Röcker)
|
||||
|
||||
2004-05-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkuimanager.sgml: Fixes to the DTD.
|
||||
|
||||
@@ -57,7 +57,7 @@ content_files = \
|
||||
gdk-pixbuf-query-loaders.xml
|
||||
|
||||
# Images to copy into HTML directory
|
||||
HTML_IMAGES =
|
||||
HTML_IMAGES = composite.png
|
||||
|
||||
# Extra options to supply to gtkdoc-fixref
|
||||
FIXXREF_OPTIONS=
|
||||
@@ -65,7 +65,12 @@ FIXXREF_OPTIONS=
|
||||
include $(top_srcdir)/gtk-doc.make
|
||||
|
||||
# Other files to distribute
|
||||
EXTRA_DIST += version.xml.in
|
||||
EXTRA_DIST += version.xml.in \
|
||||
composite.png \
|
||||
composite.dia \
|
||||
apple-red-1a.png \
|
||||
apple-red-2c.png \
|
||||
gnome-gmush-1.png
|
||||
|
||||
########################################################################
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
@@ -21,77 +21,81 @@
|
||||
.SH NAME
|
||||
gdk-pixbuf-csource \- C code generation utility for GdkPixbuf images
|
||||
.SH "SYNOPSIS"
|
||||
|
||||
.nf
|
||||
\fBgdk-pixbuf-csource\fR [options] [image]
|
||||
.fi
|
||||
|
||||
.nf
|
||||
\fBgdk-pixbuf-csource\fR [options] --build-list [[name] [image]...]
|
||||
.fi
|
||||
.ad l
|
||||
.hy 0
|
||||
.HP 19
|
||||
\fBgdk\-pixbuf\-csource\fR [options] [image]
|
||||
.ad
|
||||
.hy
|
||||
.ad l
|
||||
.hy 0
|
||||
.HP 19
|
||||
\fBgdk\-pixbuf\-csource\fR [options] \-\-build\-list [[name]\ [image]...]
|
||||
.ad
|
||||
.hy
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
|
||||
.PP
|
||||
\fBgdk-pixbuf-csource\fR is a small utility that generates C code containing images, useful for compiling images directly into programs\&.
|
||||
\fBgdk\-pixbuf\-csource\fR is a small utility that generates C code containing images, useful for compiling images directly into programs\&.
|
||||
|
||||
.SH "INVOCATION"
|
||||
|
||||
.PP
|
||||
\fBgdk-pixbuf-csource\fR either takes as input one image file name to generate code for, or, using the \fB--build-list\fR option, a list of (\fIname\fR, \fIimage\fR) pairs to generate code for a list of images into named variables\&.
|
||||
\fBgdk\-pixbuf\-csource\fR either takes as input one image file name to generate code for, or, using the \fB\-\-build\-list\fR option, a list of (\fIname\fR, \fIimage\fR) pairs to generate code for a list of images into named variables\&.
|
||||
|
||||
.SS "Options"
|
||||
|
||||
.TP
|
||||
\fB--stream\fR
|
||||
\fB\-\-stream\fR
|
||||
Generate pixbuf data stream (a single string containing a serialized GdkPixdata structure in network byte order)\&.
|
||||
|
||||
.TP
|
||||
\fB--struct\fR
|
||||
Generate GdkPixdata structure (needs the GdkPixdata structure definition from \fIgdk-pixdata\&.h\fR)\&.
|
||||
\fB\-\-struct\fR
|
||||
Generate GdkPixdata structure (needs the GdkPixdata structure definition from \fIgdk\-pixdata\&.h\fR)\&.
|
||||
|
||||
.TP
|
||||
\fB--macros\fR
|
||||
\fB\-\-macros\fR
|
||||
Generate *_ROWSTRIDE, *_WIDTH, *_HEIGHT, *_BYTES_PER_PIXEL and *_RLE_PIXEL_DATA or *_PIXEL_DATA macro definitions for the image\&.
|
||||
|
||||
.TP
|
||||
\fB--rle\fR
|
||||
Enables run-length encoding for the generated pixel data (default)\&.
|
||||
\fB\-\-rle\fR
|
||||
Enables run\-length encoding for the generated pixel data (default)\&.
|
||||
|
||||
.TP
|
||||
\fB--raw\fR
|
||||
Disables run-length encoding for the generated pixel data\&.
|
||||
\fB\-\-raw\fR
|
||||
Disables run\-length encoding for the generated pixel data\&.
|
||||
|
||||
.TP
|
||||
\fB--extern\fR
|
||||
\fB\-\-extern\fR
|
||||
Generate extern symbols\&.
|
||||
|
||||
.TP
|
||||
\fB--static\fR
|
||||
\fB\-\-static\fR
|
||||
Generate static symbols (default)\&.
|
||||
|
||||
.TP
|
||||
\fB--decoder\fR
|
||||
Provide a *_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp) macro definition to decode run-length encoded image data\&.
|
||||
\fB\-\-decoder\fR
|
||||
Provide a *_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp) macro definition to decode run\-length encoded image data\&.
|
||||
|
||||
.TP
|
||||
\fB--name=identifier\fR
|
||||
Specifies the identifier name (prefix) for the generated variables or macros (useful only if \fB--build-list\fR was not specified)\&.
|
||||
\fB\-\-name=identifier\fR
|
||||
Specifies the identifier name (prefix) for the generated variables or macros (useful only if \fB\-\-build\-list\fR was not specified)\&.
|
||||
|
||||
.TP
|
||||
\fB--build-list\fR
|
||||
\fB\-\-build\-list\fR
|
||||
Enables (\fIname\fR, \fIimage\fR) pair parsing mode\&.
|
||||
|
||||
.TP
|
||||
\fB-h\fR, \fB--help\fR
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
Print brief help and exit\&.
|
||||
|
||||
.TP
|
||||
\fB-v\fR, \fB--version\fR
|
||||
\fB\-v\fR, \fB\-\-version\fR
|
||||
Print version and exit\&.
|
||||
|
||||
.TP
|
||||
\fB--g-fatal-warnings\fR
|
||||
\fB\-\-g\-fatal\-warnings\fR
|
||||
Make warnings fatal (causes the program to abort)\&.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
@@ -102,12 +106,12 @@ The GdkPixbuf documentation, shipped with the Gtk+ distribution, available from
|
||||
.SH "BUGS"
|
||||
|
||||
.PP
|
||||
None known yet\&.
|
||||
The runlength encoder gets out of sync with the pixel boundaries, since it includes the rowstride padding in the encoded stream\&. Furthermore, it generates pixbufs with suboptimal rowstride in some cases\&.
|
||||
|
||||
.SH "AUTHOR"
|
||||
|
||||
.PP
|
||||
\fBgdk-pixbuf-csource\fR was written by Tim Janik <timj@gtk\&.org>\&.
|
||||
\fBgdk\-pixbuf\-csource\fR was written by Tim Janik <timj@gtk\&.org>\&.
|
||||
|
||||
.PP
|
||||
This manual page was provided by Tim Janik <timj@gtk\&.org>\&.
|
||||
|
||||
@@ -154,7 +154,9 @@ Gtk+ distribution, available from <ulink url="http://www.gtk.org">www.gtk.org</u
|
||||
|
||||
<refsect1><title>Bugs</title>
|
||||
<para>
|
||||
None known yet.
|
||||
The runlength encoder gets out of sync with the pixel boundaries, since
|
||||
it includes the rowstride padding in the encoded stream. Furthermore, it
|
||||
generates pixbufs with suboptimal rowstride in some cases.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -155,7 +155,7 @@ ratio.
|
||||
Defines the reference point of a window and the meaning of coordinates
|
||||
passed to gtk_window_move(). See gtk_window_move() and the "implementation
|
||||
notes" section of the
|
||||
<ulink url="http://www.freedesktop.org/standards/wm-spec.html">extended
|
||||
<ulink url="http://www.freedesktop.org/standards/wm-spec">extended
|
||||
window manager hints</ulink> specification for more details.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ content_files = \
|
||||
changes-2.0.sgml \
|
||||
compiling.sgml \
|
||||
framebuffer.sgml \
|
||||
glossary.xml \
|
||||
migrating-checklist.sgml \
|
||||
migrating-GtkAction.sgml \
|
||||
migrating-GtkComboBox.sgml \
|
||||
|
||||
@@ -134,7 +134,7 @@ How to compile GTK+ itself
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink
|
||||
url="http://www.freedesktop.org/software/pkgconfig/">pkg-config</ulink>
|
||||
url="http://www.freedesktop.org/software/pkgconfig">pkg-config</ulink>
|
||||
is a tool for tracking the compilation flags needed for
|
||||
libraries that are used by the GTK+ libraries. (For each
|
||||
library, a small <literal>.pc</literal> text file is installed in a standard
|
||||
|
||||
@@ -0,0 +1,307 @@
|
||||
<glossary id="glossary">
|
||||
<title>Glossary</title>
|
||||
|
||||
<glossentry id="allocation">
|
||||
<glossterm>allocation</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
The final size of a <glossterm
|
||||
linkend="widget">widget</glossterm> within its <glossterm
|
||||
linkend="parent">parent</glossterm>. For example, a widget
|
||||
may request a minimum size of 20×20 pixels, but its
|
||||
parent may decide to allocate 50×20 pixels for it
|
||||
instead.
|
||||
</para>
|
||||
<glossseealso>
|
||||
<glossterm linkend="requisition">requisition</glossterm>
|
||||
</glossseealso>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="bin">
|
||||
<glossterm>bin</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A <glossterm linkend="container">container</glossterm> that
|
||||
can hold at most one child widget. The base class for bins is
|
||||
<link linkend="GtkBin">GtkBin</link>.
|
||||
</para>
|
||||
<glossseealso>
|
||||
<glossterm linkend="container">container</glossterm>
|
||||
</glossseealso>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="child">
|
||||
<glossterm>child</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A <glossterm linkend="container">container's</glossterm> child
|
||||
is a <glossterm linkend="widget">widget</glossterm> contained
|
||||
inside it.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="column">
|
||||
<glossterm>column</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
FIXME
|
||||
</para>
|
||||
<glossseealso>model column</glossseealso>
|
||||
<glossseealso>view column</glossseealso>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="container">
|
||||
<glossterm>container</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A <glossterm linkend="widget">widget</glossterm> that contains
|
||||
other widgets; in that case, the container is the
|
||||
<emphasis>parent</emphasis> of the <emphasis>child</emphasis>
|
||||
widgets. Some containers don't draw anything on their own,
|
||||
but rather just organize their children's <glossterm
|
||||
linkend="geometry">geometry</glossterm>; for example, <link
|
||||
linkend="GtkVBox">GtkVBox</link> lays out its children
|
||||
vertically without painting anything on its own. Other
|
||||
containers include decorative elements; for example, <link
|
||||
linkend="GtkFrame">GtkFrame</link> contains the frame's child
|
||||
and a label in addition to the shaded frame it draws. The
|
||||
base class for containers is <link
|
||||
linkend="GtkContainer">GtkContainer</link>.
|
||||
</para>
|
||||
<glossseealso>
|
||||
<glossterm linkend="container">widget</glossterm>
|
||||
<glossterm linkend="container">geometry</glossterm>
|
||||
</glossseealso>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="display">
|
||||
<glossterm>display</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
FIXME
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="event">
|
||||
<glossterm>event</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
FIXME
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="geometry">
|
||||
<glossterm>geometry</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A <glossterm linkend="widget">widget's</glossterm> position
|
||||
and size. Within its parent, this is called the widget's
|
||||
<glossterm linkend="allocation">allocation</glossterm>.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="mapping">
|
||||
<glossterm>mapping</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
This is the step in a <glossterm
|
||||
linkend="widget">widget's</glossterm> life cycle where it
|
||||
actually shows the GdkWindows it created when it was
|
||||
<glossterm linkend="realization">realized</glossterm>. When a
|
||||
widget is mapped, it must turn on its
|
||||
<constant>GTK_MAPPED</constant> <link
|
||||
linkend="GtkWidgetFlags">flag</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Note that due to the asynchronous nature of the X window
|
||||
system, a widget's window may not appear on the screen
|
||||
immediatly after one calls <link
|
||||
linkend="gdk-window-show"><function>gdk_window_show()</function></link>:
|
||||
you must wait for the corresponding map <glossterm
|
||||
linkend="event">event</glossterm> to be received. You can do
|
||||
this with the <link
|
||||
linkend="GtkWidget-map-event"><methodname>GtkWidget::map-event</methodname>
|
||||
signal</link>.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="model-column">
|
||||
<glossterm>model column</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
FIXME
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="no-window">
|
||||
<glossterm>no-window widget</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A widget that does not have a GdkWindow of its own on which to
|
||||
draw its contents, but rather shares its <glossterm
|
||||
linkend="parent">parent's</glossterm>. Such a widget has the
|
||||
<constant>GTK_NO_WINDOW</constant> <link
|
||||
linkend="GtkWidgetFlags">flag</link> set, and can be tested
|
||||
with the <link
|
||||
linkend="gtk-widget-no-window-caps"><function>GTK_WIDGET_NO_WINDOW()</function></link>
|
||||
macro.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="parent">
|
||||
<glossterm>parent</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A <glossterm linkend="widget">widget's</glossterm> parent is
|
||||
the <glossterm linkend="container">container</glossterm>
|
||||
inside which it resides.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="realization">
|
||||
<glossterm>realization</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
This is the step in a <glossterm
|
||||
linkend="widget">widget's</glossterm> life cycle where it
|
||||
creates its own GdkWindow, or otherwise associates itself with
|
||||
its <glossterm linkend="parent">parent's</glossterm>
|
||||
GdkWindow. If the widget has its own window, then it must
|
||||
also attach a <glossterm linkend="style">style</glossterm> to
|
||||
it. A widget becomes unrealized by destroying its associated
|
||||
GdkWindow. When a widget is realized, it must turn on its
|
||||
<constant>GTK_REALIZED</constant> <link
|
||||
linkend="GtkWidgetFlags">flag</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Widgets that don't own the GdkWindow on which they draw are
|
||||
called <glossterm linkend="no-window">no-window
|
||||
widgets</glossterm>. This can be tested with the <link
|
||||
linkend="gtk-widget-no-window-caps"><function>GTK_WIDGET_NO_WINDOW()</function></link>
|
||||
macro. Normally, these widgets draw on their parent's
|
||||
GdkWindow.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Note that when a widget creates a window in its <link
|
||||
linkend="gtkwidget-realize"><methodname>::realize()</methodname></link>
|
||||
handler, it does not actually show the window. That is, the
|
||||
window's structure is just created in memory. The widget
|
||||
actually shows the window when it gets <glossterm
|
||||
linkend="mapping">mapped</glossterm>.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="requisition">
|
||||
<glossterm>requisition</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
The size requisition of a <glossterm
|
||||
linkend="widget">widget</glossterm> is the minimum amount of
|
||||
space it requests from its <glossterm
|
||||
linkend="parent">parent</glossterm>. Once the parent computes
|
||||
the widget's final size, it gives it its <glossterm
|
||||
linkend="allocation">size allocation</glossterm>.
|
||||
</para>
|
||||
<glossseealso>
|
||||
<glossterm linkend="allocation">allocation</glossterm>
|
||||
</glossseealso>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="screen">
|
||||
<glossterm>screen</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
FIXME
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="style">
|
||||
<glossterm>style</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
FIXME
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="toplevel">
|
||||
<glossterm>toplevel</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A <glossterm linkend="widget">widget</glossterm> that does not
|
||||
require a <glossterm linkend="parent">parent</glossterm>
|
||||
container. The only toplevel widget in GTK+ is <link
|
||||
linkend="GtkWindow">GtkWindow</link>.
|
||||
</para>
|
||||
<glossseealso>
|
||||
<glossterm linkend="container">container</glossterm>
|
||||
</glossseealso>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="unmap">
|
||||
<glossterm>unmap</glossterm>
|
||||
<glosssee><glossterm linkend="mapping">mapping</glossterm></glosssee>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="unrealize">
|
||||
<glossterm>unrealize</glossterm>
|
||||
<glosssee><glossterm linkend="realization">realization</glossterm></glosssee>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="view-column">
|
||||
<glossterm>view column</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
FIXME
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="widget">
|
||||
<glossterm>widget</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A control in a graphical user interface. Widgets can draw
|
||||
themselves and process events from the mouse and keyboard.
|
||||
Widget types include buttons, menus, text entry lines, and
|
||||
lists. Widgets can be arranged into <glossterm
|
||||
linkend="container">containers</glossterm>, and these take
|
||||
care of assigning the <glossterm
|
||||
linkend="geometry">geometry</glossterm> of the widgets: every
|
||||
widget thus has a parent except those widgets which are
|
||||
<glossterm linkend="toplevel">toplevels</glossterm>. The base
|
||||
class for widgets is <link
|
||||
linkend="GtkWidget">GtkWidget</link>.
|
||||
</para>
|
||||
<glossseealso>
|
||||
<glossterm linkend="container">container</glossterm>
|
||||
</glossseealso>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossary>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "glossary")
|
||||
End:
|
||||
-->
|
||||
@@ -185,6 +185,7 @@
|
||||
<!ENTITY gtk-migrating-GtkComboBox SYSTEM "migrating-GtkComboBox.sgml">
|
||||
<!ENTITY version SYSTEM "version.xml">
|
||||
<!ENTITY gtk-query-immodules SYSTEM "gtk-query-immodules-2.0.xml">
|
||||
<!ENTITY gtk-glossary SYSTEM "glossary.xml">
|
||||
]>
|
||||
<book id="index">
|
||||
<bookinfo>
|
||||
@@ -557,6 +558,8 @@ that is, GUI components such as <link linkend="GtkButton">GtkButton</link> or
|
||||
>k-query-immodules;
|
||||
</part>
|
||||
|
||||
>k-glossary;
|
||||
|
||||
<index/>
|
||||
|
||||
</book>
|
||||
|
||||
@@ -4496,6 +4496,7 @@ gtk_window_group_get_type
|
||||
gtk_set_locale
|
||||
gtk_disable_setlocale
|
||||
gtk_get_default_language
|
||||
gtk_parse_args
|
||||
gtk_init
|
||||
gtk_init_check
|
||||
gtk_exit
|
||||
|
||||
@@ -285,7 +285,7 @@ or <envar>DISPLAY</envar>; mostly to determine paths to look for certain files.
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GTK_RC_FILES</envar></title>
|
||||
<title><envar>GTK2_RC_FILES</envar></title>
|
||||
|
||||
<para>
|
||||
Specifies a list of RC files to parse instead of the default ones;
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
<!-- ##### SECTION ./tmpl/gtkaboutdialog.sgml:Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkAboutDialog offers a simple way to display information about
|
||||
a program like its logo, name, copyright, website and license. It is
|
||||
also possible to give credits to the authors, documenters, translators
|
||||
and artists who have worked on the program. An about dialog is typically
|
||||
opened when the user selects the <literal>About</literal> option from
|
||||
the <literal>Help</literal> menu. All parts of the dialog are optional.
|
||||
</para>
|
||||
<para>
|
||||
About dialog often contain links and email addresses. #GtkAboutDialog
|
||||
supports this by offering global hooks, which are called when the user
|
||||
clicks on a link or email address, see gtk_about_dialog_set_email_hook()
|
||||
and gtk_about_dialog_set_url_hook().
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkaboutdialog.sgml:See_Also ##### -->
|
||||
<para>
|
||||
#GTK_STOCK_ABOUT
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkaboutdialog.sgml:Short_Description ##### -->
|
||||
a widget displaying information about a program
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkaboutdialog.sgml:Title ##### -->
|
||||
GtkAboutDialog
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkarg.sgml:Long_Description ##### -->
|
||||
<para>
|
||||
All the functions in here are marked a Non-public.
|
||||
@@ -101,6 +132,26 @@ Debugging
|
||||
gtkenums.sgml
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkfilechooserbutton.sgml:Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkfilechooserbutton.sgml:See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkfilechooserbutton.sgml:Short_Description ##### -->
|
||||
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkfilechooserbutton.sgml:Title ##### -->
|
||||
GtkFileChooserButton
|
||||
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gtkmarshal.sgml:Long_Description ##### -->
|
||||
<refsect2>
|
||||
<title>What are Signal Marshallers?</title>
|
||||
@@ -513,6 +564,24 @@ Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_FOREIGN
|
||||
@b:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### STRUCT GtkAboutDialog ##### -->
|
||||
<para>
|
||||
The <structname>GtkAboutDialog</structname> struct contains
|
||||
only private fields and should not be directly accessed.
|
||||
</para>
|
||||
|
||||
@parent_instance:
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkAboutDialogActivateLinkFunc ##### -->
|
||||
<para>
|
||||
The type of a function which is called when a URL or email
|
||||
link is activated.
|
||||
</para>
|
||||
|
||||
@about: the #GtkAboutDialog in which the link was activated
|
||||
@link: the URL or email address to whiche the activated link points
|
||||
@data:
|
||||
|
||||
<!-- ##### STRUCT GtkAccelEntry ##### -->
|
||||
<para>
|
||||
This is a private struct used by GTK+ internally, don't worry about it.
|
||||
@@ -845,6 +914,12 @@ You may not attach these to signals created with the
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkFileChooserButton ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkFontFilterType ##### -->
|
||||
<para>
|
||||
A set of bit flags used to specify the filter being set
|
||||
@@ -1460,6 +1535,225 @@ If the window shrinks automatically when widgets within it shrink.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_artists ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_authors ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_comments ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_copyright ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_documenters ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_license ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_logo ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_translator_credits ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_version ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_website ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_get_website_label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_artists ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@artists:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_authors ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@authors:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_comments ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@comments:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_copyright ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@copyright:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_documenters ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@documenters:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_email_hook ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@func:
|
||||
@data:
|
||||
@destroy:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_license ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@license:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_logo ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@logo:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@name:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_translator_credits ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@translator_credits:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_url_hook ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@func:
|
||||
@data:
|
||||
@destroy:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_version ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@version:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_website ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@website:
|
||||
|
||||
<!-- ##### FUNCTION gtk_about_dialog_set_website_label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@about:
|
||||
@website_label:
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_group_add ##### -->
|
||||
<para>
|
||||
|
||||
@@ -2100,6 +2394,63 @@ Claim or disclaim ownership of the PRIMARY X selection.
|
||||
@claim: if %TRUE, claim the selection, otherwise, disclaim it.
|
||||
@time: the timestamp for claiming the selection.
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_chooser_button_get_active ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@button:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_chooser_button_get_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@button:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_chooser_button_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@title:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_chooser_button_new_with_backend ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@title:
|
||||
@backend:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_chooser_button_new_with_dialog ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_chooser_button_set_active ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@button:
|
||||
@is_active:
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_chooser_button_set_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@button:
|
||||
@title:
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_chooser_get_folder_mode ##### -->
|
||||
<para>
|
||||
|
||||
@@ -2761,6 +3112,15 @@ Internal function.
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gtk_show_about_dialog ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@parent:
|
||||
@first_property_name:
|
||||
@Varargs:
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_add_emission_hook ##### -->
|
||||
<para>
|
||||
Add an emission hook for a type of signal, for any object.
|
||||
|
||||
@@ -118,6 +118,8 @@ a widget used to choose from a list of items.
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@index_:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
|
||||
@@ -168,10 +168,10 @@ changes, use gtk_widget_child_notify().
|
||||
|
||||
<!-- ##### MACRO gtk_container_border_width ##### -->
|
||||
<para>
|
||||
Does the same as gtk_container_get_border_width().
|
||||
Does the same as gtk_container_set_border_width().
|
||||
</para>
|
||||
|
||||
@Deprecated: Use gtk_container_get_border_width() instead.
|
||||
@Deprecated: Use gtk_container_set_border_width() instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_container_add ##### -->
|
||||
|
||||
@@ -170,8 +170,10 @@ A function which decides whether the row indicated by @iter matches a given
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index:
|
||||
@index_:
|
||||
@text:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_insert_action_markup ##### -->
|
||||
@@ -180,8 +182,10 @@ A function which decides whether the row indicated by @iter matches a given
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index:
|
||||
@index_:
|
||||
@markup:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_delete_action ##### -->
|
||||
@@ -190,6 +194,8 @@ A function which decides whether the row indicated by @iter matches a given
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index_:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
|
||||
@@ -332,14 +332,22 @@ Indicated the relief to be drawn around a #GtkButton.
|
||||
|
||||
<!-- ##### ENUM GtkSelectionMode ##### -->
|
||||
<para>
|
||||
|
||||
Used to control what selections users are allowed to make.
|
||||
</para>
|
||||
|
||||
@GTK_SELECTION_NONE:
|
||||
@GTK_SELECTION_SINGLE:
|
||||
@GTK_SELECTION_BROWSE:
|
||||
@GTK_SELECTION_MULTIPLE:
|
||||
@GTK_SELECTION_EXTENDED:
|
||||
@GTK_SELECTION_NONE: No selection is possible.
|
||||
@GTK_SELECTION_SINGLE: Zero or one element may be selected.
|
||||
@GTK_SELECTION_BROWSE: Exactly one element is selected. In some circumstances,
|
||||
such as initially or during a search operation, it's possible for no element
|
||||
to be selected with %GTK_SELECTION_BROWSE. What is really enforced is that
|
||||
the user can't deselect a currently selected element except by selecting
|
||||
another element.
|
||||
@GTK_SELECTION_MULTIPLE: Any number of elements may be selected.
|
||||
Clicks toggle the state of an item. Any number of elements may be selected.
|
||||
Click-drag selects a range of elements; the Ctrl key may be used to enlarge
|
||||
the selection, and Shift key to select between the focus and the child
|
||||
pointed to.
|
||||
@GTK_SELECTION_EXTENDED: Deprecated, behaves identical to %GTK_SELECTION_MULTIPLE.
|
||||
|
||||
<!-- ##### ENUM GtkShadowType ##### -->
|
||||
<para>
|
||||
|
||||
@@ -12,7 +12,7 @@ providing a filename is to allow different icons to be used
|
||||
depending on what <firstterm>icon theme</firstterm> is selecetd
|
||||
by the user. The operation of icon themes on Linux and Unix
|
||||
follows the <ulink
|
||||
url="http://www.freedesktop.org/standards/icon-theme-spec.html">Icon
|
||||
url="http://www.freedesktop.org/standards/icon-theme-spec">Icon
|
||||
Theme Specification</ulink>. There is a default icon theme,
|
||||
named <literal>hicolor</literal> where applications should install
|
||||
their icons, but more additional application themes can be
|
||||
@@ -80,7 +80,8 @@ icon_theme = gtk_icon_theme_get_default ();
|
||||
pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
||||
"my-icon-name", /* icon name */
|
||||
48, /* size */
|
||||
0, /* flags */);
|
||||
0, /* flags */
|
||||
&error);
|
||||
if (!pixbuf)
|
||||
{
|
||||
g_warning ("Couldn't load icon: %s", error->message);
|
||||
|
||||
@@ -104,6 +104,16 @@ functions such as g_signal_connect().
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_parse_args ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@argc:
|
||||
@argv:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_init ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@@ -73,7 +73,7 @@ outermost to innermost. The difference is that in
|
||||
the widget path, the name assigned by
|
||||
gtk_widget_set_name() is used
|
||||
if present, otherwise the class name of the widget, while
|
||||
for the widget path, the class name is always used.
|
||||
for the class path, the class name is always used.
|
||||
</para>
|
||||
<para>
|
||||
So, if you have a #GtkEntry named
|
||||
|
||||
@@ -64,7 +64,7 @@ is running.
|
||||
|
||||
<para>
|
||||
The communication between a #GtkSocket and a #GtkPlug follows the
|
||||
<ulink url="http://www.freedesktop.org/standards/xembed.html">XEmbed</ulink>
|
||||
<ulink url="http://www.freedesktop.org/standards/xembed-spec">XEmbed</ulink>
|
||||
protocol. This protocol has also been implemented in other toolkits, e.g.
|
||||
<application>Qt</application>, allowing the same level of integration
|
||||
when embedding a <application>Qt</application> widget in GTK or vice versa.</para>
|
||||
@@ -85,7 +85,7 @@ as between a #GtkPlug and a #GtkSocket.</para>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><ulink url="http://www.freedesktop.org/standards/xembed.html">XEmbed</ulink></term>
|
||||
<term><ulink url="http://www.freedesktop.org/standards/xembed-spec">XEmbed</ulink></term>
|
||||
<listitem><para>the XEmbed Protocol Specification.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ and row numbers of the table. (Columns and rows are indexed from zero).
|
||||
|
||||
<!-- ##### FUNCTION gtk_table_attach_defaults ##### -->
|
||||
<para>
|
||||
As there are many options associated with gtk_table_attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options.
|
||||
As there are many options associated with gtk_table_attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options. The values used for the #GtkAttachOptions are <literal>GTK_EXPAND | GTK_FILL</literal>, and the padding is set to 0.
|
||||
</para>
|
||||
|
||||
@table: The table to add a new child widget to.
|
||||
|
||||
@@ -244,6 +244,8 @@ to a #GtkToolbar.
|
||||
|
||||
@toolbar:
|
||||
@tool_item:
|
||||
@index_:
|
||||
<!-- # Unused Parameters # -->
|
||||
@index:
|
||||
|
||||
|
||||
|
||||
@@ -55,8 +55,9 @@ The GtkTreeModelFilter struct contains only private fields.
|
||||
A function which decides whether the row indicated by @iter is visible.
|
||||
</para>
|
||||
|
||||
@model: the #GtkTreeModelFilter
|
||||
@iter: a #GtkTreeIter pointing to the row whose visibility is determined
|
||||
@model: the child model of the #GtkTreeModelFilter
|
||||
@iter: a #GtkTreeIter pointing to the row in @model whose visibility
|
||||
is determined
|
||||
@data: user data given to gtk_tree_model_filter_set_visible_func()
|
||||
@Returns: Whether the row indicated by @iter is visible.
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
|
||||
GtkUIManager
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
@@ -51,9 +52,15 @@ There are some additional restrictions beyond those specified in the
|
||||
DTD, e.g. every toolitem must have a toolbar in its anchestry and
|
||||
every menuitem must have a menubar or popup in its anchestry. Since
|
||||
a #GMarkup parser is used to parse the UI description, it must not only
|
||||
be valid XML, but valid #GMarkup. If a name is not specified, it defaults
|
||||
to the action. If an action is not specified either, the element name is
|
||||
used.
|
||||
be valid XML, but valid #GMarkup.
|
||||
</para>
|
||||
<para>
|
||||
If a name is not specified, it defaults to the action. If an action is
|
||||
not specified either, the element name is used. The name and action
|
||||
attributes must not contain '/' characters after parsing (since that
|
||||
would mess up path lookup) and must be usable as XML attributes when
|
||||
enclosed in doublequotes, thus they must not '"' characters or references
|
||||
to the &quot; entity.
|
||||
</para>
|
||||
<example>
|
||||
<title>A UI definition</title>
|
||||
|
||||
@@ -271,6 +271,11 @@ GtkButton
|
||||
|
||||
=====================
|
||||
|
||||
NOTE: Due to a bug that is basically unfixable in a sufficiently compatible
|
||||
NOTE: way, the button gives the space requested for focus_width and
|
||||
NOTE: focus_padding to the child (in addition to the space requested by
|
||||
NOTE: the child), if the button is !CAN_FOCUS.
|
||||
|
||||
Style properties
|
||||
|
||||
GtkWidget::interior_focus = TRUE
|
||||
|
||||
@@ -1,3 +1,160 @@
|
||||
2004-12-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.14 ===
|
||||
|
||||
2004-10-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.13 ===
|
||||
|
||||
2004-10-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.12 ===
|
||||
|
||||
2004-10-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.11 ===
|
||||
|
||||
2004-09-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.10 ===
|
||||
|
||||
Thu Sep 16 23:24:36 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-xpm.c (pixbuf_create_from_xpm): Reuse existing message
|
||||
to avoid unnecessary string freeze break. Noticed by Danilo
|
||||
Segan.
|
||||
|
||||
2004-09-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-ico.c:
|
||||
* io-xpm.c: Fix some security issues discovered by Chris Evans.
|
||||
|
||||
Mon Sep 13 19:31:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-jpeg.c (real_save_jpeg): Drop the alpha channel
|
||||
when saving 4-channel pixbufs. (#152450, Emmanuel Pacaud)
|
||||
|
||||
2004-08-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.9 ===
|
||||
|
||||
2004-08-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.8 ===
|
||||
|
||||
2004-08-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_mime_type): Use
|
||||
the correct index, and compare correctly, reported by Tommi Komulainen.
|
||||
|
||||
* gdk-pixdata.c (gdk_pixdata_from_pixbuf): Work around bugs in
|
||||
the runlength encoder by forcing rowstride * height to be
|
||||
divisible by bpp. (#150882)
|
||||
|
||||
Mon Aug 23 00:51:20 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* pixops/pixops.c (pixops_scale_nearest): Make it
|
||||
compile. (#150761, Jon-Kare Hellan)
|
||||
|
||||
Sun Aug 22 03:24:38 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* pixops/pixops.c (pixops_scale_nearest): Fix a mixup in
|
||||
the handling of dest_channels. (#111922, Christophe Fergeau)
|
||||
|
||||
Fri Aug 20 11:59:10 2004 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* io-bmp.c: Fix infinite loop that can occur for bad
|
||||
image data (#150601, Chris Evans, Manish Singh)
|
||||
|
||||
Sat Aug 14 19:15:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* === Released 2.4.7 ===
|
||||
|
||||
2004-08-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.6 ===
|
||||
|
||||
Thu Aug 12 22:19:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-bmp.c (DecodeHeader): Properly determine the number of
|
||||
colors in an OS/2 BMP file. (#150003, Jon-Kare Hellan)
|
||||
|
||||
2004-08-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* pixops/pixops.c: Remove C99-isms. (#149967, Vincent Noel)
|
||||
|
||||
2004-08-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* pixops/pixops.c: Make scaling and compositing functions handle
|
||||
edge pixels consistently. (#111922, Brian Cameron)
|
||||
|
||||
Sun Aug 1 23:57:06 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-pcx.c (pcx_increment_load_data_1): Fix progressive
|
||||
loading of 8bit pcx files. (#148518, Magnus Bergman)
|
||||
|
||||
Tue Jul 20 22:23:26 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-io.h: Remove trailing commas from
|
||||
enumerations. (#148035)
|
||||
|
||||
2004-07-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.4 ===
|
||||
|
||||
2004-07-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-features.h.in: Fix the build.
|
||||
|
||||
2004-07-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk-pixbuf-features.h.in
|
||||
* gdk-pixbuf.c: Mark the version variables for proper import and
|
||||
export from Windows DLLs. Thanks to Laurent Sansonetti for
|
||||
reporting the problem.
|
||||
|
||||
Sat Jul 3 00:41:44 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* pixops/pixops.c (bilinear_box_make_weights): Correct the
|
||||
math to calculate bilinear weights. (#112412, Brian Cameron)
|
||||
|
||||
Sun Jun 20 00:16:00 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-scale.c (gdk_pixbuf_composite): Add a figure which
|
||||
explains pixbuf compositing.
|
||||
|
||||
2004-06-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-tiff.c: Make the tiff loader work with both
|
||||
libtiff 3.5.7 and libtiff 3.6.1. (#135541, Marco Ghirlanda)
|
||||
|
||||
2004-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.3 ===
|
||||
|
||||
Sat Jun 5 00:59:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-animation.c:
|
||||
* gdk-pixbuf-io.c: Convert filenames to UTF-8 when embedding
|
||||
them in error messages. (#143654, Sven Neumann)
|
||||
|
||||
2004-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.2 ===
|
||||
|
||||
Sun May 16 22:55:49 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-pnm.c (pnm_read_next_value): Don't read integers
|
||||
partially. (#142584, Kouichirou Hiratsuka)
|
||||
|
||||
2004-05-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* pixops/timescale.c:
|
||||
* pixops/pixops.c:
|
||||
* pixops/pixops.h:
|
||||
* gdk-pixbuf-scale.c: _-prefix the nonstatic pixops_...
|
||||
functions. (#142233, Morten Welinder)
|
||||
|
||||
2004-04-30 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.4.1 ===
|
||||
|
||||
@@ -135,28 +135,36 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
|
||||
FILE *f;
|
||||
guchar buffer [128];
|
||||
GdkPixbufModule *image_module;
|
||||
gchar *utf8_filename;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (!f) {
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to open file '%s': %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size = fread (&buffer, 1, sizeof (buffer), f);
|
||||
|
||||
if (size == 0) {
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("Image file '%s' contains no data"),
|
||||
filename);
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
|
||||
fclose (f);
|
||||
return NULL;
|
||||
@@ -192,11 +200,14 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
|
||||
|
||||
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.",
|
||||
image_module->module_name);
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load image '%s': reason not known, probably a corrupt image file"),
|
||||
filename);
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
}
|
||||
|
||||
if (pixbuf == NULL)
|
||||
@@ -220,11 +231,14 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
|
||||
|
||||
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.",
|
||||
image_module->module_name);
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load animation '%s': reason not known, probably a corrupt animation file"),
|
||||
filename);
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
}
|
||||
|
||||
fclose (f);
|
||||
|
||||
@@ -6,7 +6,34 @@
|
||||
#define GDK_PIXBUF_MICRO (@GDK_PIXBUF_MICRO@)
|
||||
#define GDK_PIXBUF_VERSION "@GDK_PIXBUF_VERSION@"
|
||||
|
||||
extern const guint gdk_pixbuf_major_version, gdk_pixbuf_minor_version, gdk_pixbuf_micro_version;
|
||||
extern const char *gdk_pixbuf_version;
|
||||
/* We prefix variable declarations so they can
|
||||
* properly get exported/imported from Windows DLLs.
|
||||
*/
|
||||
#ifndef GDK_PIXBUF_VAR
|
||||
# ifdef G_PLATFORM_WIN32
|
||||
# ifdef GDK_PIXBUF_STATIC_COMPILATION
|
||||
# define GDK_PIXBUF_VAR extern
|
||||
# else /* !GDK_PIXBUF_STATIC_COMPILATION */
|
||||
# ifdef GDK_PIXBUF_COMPILATION
|
||||
# ifdef DLL_EXPORT
|
||||
# define GDK_PIXBUF_VAR __declspec(dllexport)
|
||||
# else /* !DLL_EXPORT */
|
||||
# define GDK_PIXBUF_VAR extern
|
||||
# endif /* !DLL_EXPORT */
|
||||
# else /* !GDK_PIXBUF_COMPILATION */
|
||||
# define GDK_PIXBUF_VAR extern __declspec(dllimport)
|
||||
# endif /* !GDK_PIXBUF_COMPILATION */
|
||||
# endif /* !GDK_PIXBUF_STATIC_COMPILATION */
|
||||
# else /* !G_PLATFORM_WIN32 */
|
||||
# ifndef GDK_PIXBUF_COMPILATION
|
||||
# define GDK_PIXBUF_VAR extern
|
||||
# else
|
||||
# define GDK_PIXBUF_VAR
|
||||
# endif /* !GDK_PIXBUF_COMPILATION */
|
||||
# endif /* !G_PLATFORM_WIN32 */
|
||||
#endif /* GDK_PIXBUF_VAR */
|
||||
|
||||
GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version, gdk_pixbuf_minor_version, gdk_pixbuf_micro_version;
|
||||
GDK_PIXBUF_VAR const char *gdk_pixbuf_version;
|
||||
|
||||
#endif
|
||||
|
||||
+62
-23
@@ -637,6 +637,8 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size,
|
||||
|
||||
gint score, best = 0;
|
||||
GdkPixbufModule *selected = NULL;
|
||||
gchar *utf8_filename = NULL;
|
||||
|
||||
for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) {
|
||||
GdkPixbufModule *module = (GdkPixbufModule *)modules->data;
|
||||
score = format_check (module, buffer, size);
|
||||
@@ -651,18 +653,24 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size,
|
||||
return selected;
|
||||
|
||||
if (filename)
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Couldn't recognize the image file format for file '%s'"),
|
||||
filename);
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if (utf8_filename) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Couldn't recognize the image file format for file '%s'"),
|
||||
utf8_filename);
|
||||
g_free (utf8_filename);
|
||||
}
|
||||
else
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Unrecognized image file format"));
|
||||
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -763,22 +771,28 @@ gdk_pixbuf_new_from_file (const char *filename,
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (!f) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to open file '%s': %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size = fread (&buffer, 1, sizeof (buffer), f);
|
||||
if (size == 0) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("Image file '%s' contains no data"),
|
||||
filename);
|
||||
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
@@ -800,33 +814,41 @@ gdk_pixbuf_new_from_file (const char *filename,
|
||||
fclose (f);
|
||||
|
||||
if (pixbuf == NULL && error != NULL && *error == NULL) {
|
||||
|
||||
/* I don't trust these crufty longjmp()'ing image libs
|
||||
* to maintain proper error invariants, and I don't
|
||||
* want user code to segfault as a result. We need to maintain
|
||||
* the invariastable/gdk-pixbuf/nt that error gets set if NULL is returned.
|
||||
* the invariant that error gets set if NULL is returned.
|
||||
*/
|
||||
|
||||
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.", image_module->module_name);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load image '%s': reason not known, probably a corrupt image file"),
|
||||
filename);
|
||||
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
} else if (error != NULL && *error != NULL) {
|
||||
|
||||
/* Add the filename to the error message */
|
||||
GError *e = *error;
|
||||
gchar *old;
|
||||
|
||||
gchar *old;
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
old = e->message;
|
||||
|
||||
e->message = g_strdup_printf (_("Failed to load image '%s': %s"),
|
||||
filename, old);
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
old);
|
||||
|
||||
g_free (utf8_filename);
|
||||
g_free (old);
|
||||
}
|
||||
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
@@ -896,11 +918,15 @@ gdk_pixbuf_new_from_file_at_size (const char *filename,
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (!f) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to open file '%s': %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -908,7 +934,7 @@ gdk_pixbuf_new_from_file_at_size (const char *filename,
|
||||
|
||||
info.width = width;
|
||||
info.height = height;
|
||||
|
||||
|
||||
g_signal_connect (loader, "size-prepared", G_CALLBACK (size_prepared_cb), &info);
|
||||
|
||||
while (!feof (f) && !ferror (f)) {
|
||||
@@ -932,12 +958,17 @@ gdk_pixbuf_new_from_file_at_size (const char *filename,
|
||||
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
|
||||
|
||||
if (!pixbuf) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (loader);
|
||||
g_set_error (error,
|
||||
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load image '%s': reason not known, probably a corrupt image file"),
|
||||
filename);
|
||||
utf8_filename ? utf8_filename : "???");
|
||||
g_free (utf8_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1405,11 +1436,15 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf,
|
||||
f = fopen (filename, "wb");
|
||||
|
||||
if (f == NULL) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to open '%s' for writing: %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1426,11 +1461,15 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf,
|
||||
}
|
||||
|
||||
if (fclose (f) < 0) {
|
||||
gchar *utf8_filename = g_filename_to_utf8 (filename, -1,
|
||||
NULL, NULL, NULL);
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
_("Failed to close '%s' while writing image, all data may not have been saved: %s"),
|
||||
filename, g_strerror (errno));
|
||||
utf8_filename ? utf8_filename : "???",
|
||||
g_strerror (errno));
|
||||
g_free (utf8_filename);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf,
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0,
|
||||
GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0
|
||||
} GdkPixbufFormatFlags;
|
||||
|
||||
struct _GdkPixbufFormat {
|
||||
|
||||
@@ -599,11 +599,11 @@ gdk_pixbuf_loader_new_with_mime_type (const char *mime_type,
|
||||
mimes = info->mime_types;
|
||||
|
||||
for (j = 0; mimes[j] != NULL; j++)
|
||||
if (g_ascii_strcasecmp (mimes[i], mime_type)) {
|
||||
if (g_ascii_strcasecmp (mimes[j], mime_type) == 0) {
|
||||
image_type = info->name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_slist_free (formats);
|
||||
|
||||
|
||||
@@ -72,13 +72,13 @@ gdk_pixbuf_scale (const GdkPixbuf *src,
|
||||
offset_x = floor (offset_x + 0.5);
|
||||
offset_y = floor (offset_y + 0.5);
|
||||
|
||||
pixops_scale (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type);
|
||||
_pixops_scale (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,9 +97,20 @@ gdk_pixbuf_scale (const GdkPixbuf *src,
|
||||
* @overall_alpha: overall alpha for source image (0..255)
|
||||
*
|
||||
* Creates a transformation of the source image @src by scaling by
|
||||
* @scale_x and @scale_y then translating by @offset_x and @offset_y,
|
||||
* then composites the rectangle (@dest_x, @dest_y, @dest_width,
|
||||
* @dest_height) of the resulting image onto the destination image.
|
||||
* @scale_x and @scale_y then translating by @offset_x and @offset_y.
|
||||
* This gives an image in the coordinates of the destination pixbuf.
|
||||
* The rectangle (@dest_x, @dest_y, @dest_width, @dest_height)
|
||||
* is then composited onto the corresponding rectangle of the
|
||||
* original destination image.
|
||||
*
|
||||
* When the destination rectangle contains parts not in the source
|
||||
* image, the data at the edges of the source image is replicated
|
||||
* to infinity.
|
||||
*
|
||||
* <figure id="pixbuf-composite-diagram">
|
||||
* <title>Compositing of pixbufs</title>
|
||||
* <graphic fileref="composite.png" format="PNG"/>
|
||||
* </figure>
|
||||
**/
|
||||
void
|
||||
gdk_pixbuf_composite (const GdkPixbuf *src,
|
||||
@@ -123,13 +134,13 @@ gdk_pixbuf_composite (const GdkPixbuf *src,
|
||||
|
||||
offset_x = floor (offset_x + 0.5);
|
||||
offset_y = floor (offset_y + 0.5);
|
||||
pixops_composite (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha);
|
||||
_pixops_composite (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,14 +202,14 @@ gdk_pixbuf_composite_color (const GdkPixbuf *src,
|
||||
offset_x = floor (offset_x + 0.5);
|
||||
offset_y = floor (offset_y + 0.5);
|
||||
|
||||
pixops_composite_color (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha, check_x, check_y,
|
||||
check_size, color1, color2);
|
||||
_pixops_composite_color (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||
dest_x - offset_x, dest_y - offset_y,
|
||||
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||
src->pixels, src->width, src->height,
|
||||
src->rowstride, src->n_channels, src->has_alpha,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha, check_x, check_y,
|
||||
check_size, color1, color2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define GDK_PIXBUF_COMPILATION
|
||||
#include "gdk-pixbuf.h"
|
||||
#include "gdk-pixbuf-private.h"
|
||||
|
||||
@@ -518,11 +519,11 @@ gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf)
|
||||
|
||||
|
||||
/* General initialization hooks */
|
||||
const guint gdk_pixbuf_major_version = GDK_PIXBUF_MAJOR;
|
||||
const guint gdk_pixbuf_minor_version = GDK_PIXBUF_MINOR;
|
||||
const guint gdk_pixbuf_micro_version = GDK_PIXBUF_MICRO;
|
||||
GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version = GDK_PIXBUF_MAJOR;
|
||||
GDK_PIXBUF_VAR const guint gdk_pixbuf_minor_version = GDK_PIXBUF_MINOR;
|
||||
GDK_PIXBUF_VAR const guint gdk_pixbuf_micro_version = GDK_PIXBUF_MICRO;
|
||||
|
||||
const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
|
||||
GDK_PIXBUF_VAR const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
|
||||
|
||||
/* Error quark */
|
||||
GQuark
|
||||
|
||||
@@ -289,6 +289,13 @@ rl_encode_rgbx (guint8 *bp, /* dest buffer */
|
||||
return bp;
|
||||
}
|
||||
|
||||
/* Used as the destroy notification function for gdk_pixbuf_new() */
|
||||
static void
|
||||
free_buffer (guchar *pixels, gpointer data)
|
||||
{
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_pixdata_from_pixbuf:
|
||||
* @pixdata: a #GdkPixdata to fill.
|
||||
@@ -327,16 +334,36 @@ gdk_pixdata_from_pixbuf (GdkPixdata *pixdata,
|
||||
{
|
||||
guint pad, n_bytes = rowstride * height;
|
||||
guint8 *img_buffer_end, *data;
|
||||
GdkPixbuf *buf = NULL;
|
||||
|
||||
if (n_bytes % bpp != 0)
|
||||
{
|
||||
rowstride = pixbuf->width * bpp;
|
||||
n_bytes = rowstride * height;
|
||||
data = g_malloc (n_bytes);
|
||||
buf = gdk_pixbuf_new_from_data (data,
|
||||
GDK_COLORSPACE_RGB,
|
||||
pixbuf->has_alpha, 8,
|
||||
pixbuf->width,
|
||||
pixbuf->height,
|
||||
rowstride,
|
||||
free_buffer, NULL);
|
||||
gdk_pixbuf_copy_area (pixbuf, 0, 0, pixbuf->width, pixbuf->height,
|
||||
buf, 0, 0);
|
||||
}
|
||||
else
|
||||
buf = (GdkPixbuf *)pixbuf;
|
||||
pad = rowstride;
|
||||
pad = MAX (pad, 130 + n_bytes / 127);
|
||||
data = g_new (guint8, pad + n_bytes);
|
||||
free_me = data;
|
||||
img_buffer = data;
|
||||
img_buffer_end = rl_encode_rgbx (img_buffer,
|
||||
pixbuf->pixels, pixbuf->pixels + n_bytes,
|
||||
buf->pixels, buf->pixels + n_bytes,
|
||||
bpp);
|
||||
length = img_buffer_end - img_buffer;
|
||||
if (buf != pixbuf)
|
||||
g_object_unref (buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+16
-2
@@ -269,7 +269,11 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
clrUsed = (int) (BIH[35] << 24) + (BIH[34] << 16) + (BIH[33] << 8) + (BIH[32]);
|
||||
if (State->Header.size == 12)
|
||||
clrUsed = 1 << State->Header.depth;
|
||||
else
|
||||
clrUsed = (int) (BIH[35] << 24) + (BIH[34] << 16) + (BIH[33] << 8) + (BIH[32]);
|
||||
|
||||
if (clrUsed != 0)
|
||||
State->Header.n_colors = clrUsed;
|
||||
else
|
||||
@@ -872,8 +876,18 @@ DoCompressed(struct bmp_progressive_state *context, GError **error)
|
||||
guchar c;
|
||||
gint idx;
|
||||
|
||||
if (context->compr.y >= context->Header.height)
|
||||
/* context->compr.y might be past the last line because we are
|
||||
* on padding past the end of a valid data, or we might have hit
|
||||
* out-of-bounds data. Either way we just eat-and-ignore the
|
||||
* rest of the file. Doing the check only here and not when
|
||||
* we change y below is fine since BufferSize is always 2 here
|
||||
* and the BMP file format always starts new data on 16-bit
|
||||
* boundaries.
|
||||
*/
|
||||
if (context->compr.y >= context->Header.height) {
|
||||
context->BufferDone = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
y = context->compr.y;
|
||||
|
||||
|
||||
@@ -323,6 +323,14 @@ static void DecodeHeader(guchar *Data, gint Bytes,
|
||||
|
||||
State->HeaderSize+=I;
|
||||
|
||||
if (State->HeaderSize < 0) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("Invalid header in icon"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (State->HeaderSize>State->BytesInHeaderBuf) {
|
||||
guchar *tmp=g_try_realloc(State->HeaderBuf,State->HeaderSize);
|
||||
if (!tmp) {
|
||||
|
||||
@@ -872,6 +872,7 @@ real_save_jpeg (GdkPixbuf *pixbuf,
|
||||
int i, j;
|
||||
int w, h = 0;
|
||||
int rowstride = 0;
|
||||
int n_channels;
|
||||
struct error_handler_data jerr;
|
||||
ToFunctionDestinationManager to_callback_destmgr;
|
||||
|
||||
@@ -922,6 +923,7 @@ real_save_jpeg (GdkPixbuf *pixbuf,
|
||||
}
|
||||
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
n_channels = gdk_pixbuf_get_n_channels (pixbuf);
|
||||
|
||||
w = gdk_pixbuf_get_width (pixbuf);
|
||||
h = gdk_pixbuf_get_height (pixbuf);
|
||||
@@ -994,7 +996,7 @@ real_save_jpeg (GdkPixbuf *pixbuf,
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
/* convert scanline from ARGB to RGB packed */
|
||||
for (j = 0; j < w; j++)
|
||||
memcpy (&(buf[j*3]), &(ptr[i*rowstride + j*3]), 3);
|
||||
memcpy (&(buf[j*3]), &(ptr[i*rowstride + j*n_channels]), 3);
|
||||
|
||||
/* write scanline */
|
||||
jbuf = (JSAMPROW *)(&buf);
|
||||
|
||||
+1
-1
@@ -353,7 +353,7 @@ pcx_increment_load_data_1(struct pcx_context *context)
|
||||
}
|
||||
|
||||
if(context->updated_func)
|
||||
context->updated_func(context->pixbuf, 0, context->current_line, context->width, 1, context->user_data);
|
||||
context->updated_func(context->pixbuf, 0, 0, context->width, context->height, context->user_data);
|
||||
|
||||
context->current_line++;
|
||||
|
||||
|
||||
+1
-1
@@ -237,7 +237,7 @@ pnm_read_next_value (PnmIOBuffer *inbuf, guint *value, GError **error)
|
||||
*word = '\0';
|
||||
|
||||
/* hmmm, there must be more data to this 'word' */
|
||||
if (!g_ascii_isspace (*p) && (*p != '#') && (p - inptr < 128))
|
||||
if (p == inend || (!g_ascii_isspace (*p) && (*p != '#') && (p - inptr < 128)))
|
||||
return PNM_SUSPEND;
|
||||
|
||||
/* get the value */
|
||||
|
||||
+88
-67
@@ -145,34 +145,14 @@ static void free_buffer (guchar *pixels, gpointer data)
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
static tileContigRoutine tiff_put_contig;
|
||||
static tileSeparateRoutine tiff_put_separate;
|
||||
|
||||
/* We're lucky that TIFFRGBAImage uses the same RGBA packing
|
||||
as gdk-pixbuf, thus we can simple reuse the default libtiff
|
||||
put routines, only adjusting the coordinate system.
|
||||
*/
|
||||
static void
|
||||
put_contig (TIFFRGBAImage *img, uint32 *raster,
|
||||
uint32 x, uint32 y, uint32 w, uint32 h,
|
||||
int32 fromskew, int32 toskew, unsigned char *cp)
|
||||
static gboolean tifflibversion (int *major, int *minor, int *revision)
|
||||
{
|
||||
uint32 *data = raster - y * img->width - x;
|
||||
if (sscanf (TIFFGetVersion(),
|
||||
"LIBTIFF, Version %d.%d.%d",
|
||||
major, minor, revision) < 3)
|
||||
return FALSE;
|
||||
|
||||
tiff_put_contig (img, data + img->width * (img->height - 1 - y) + x,
|
||||
x, y, w, h, fromskew, -toskew - 2*(int32)w, cp);
|
||||
}
|
||||
|
||||
static void
|
||||
put_separate (TIFFRGBAImage *img, uint32 *raster,
|
||||
uint32 x, uint32 y, uint32 w, uint32 h,
|
||||
int32 fromskew, int32 toskew,
|
||||
unsigned char* r, unsigned char* g, unsigned char* b, unsigned char* a)
|
||||
{
|
||||
uint32 *data = raster - y * img->width - x;
|
||||
|
||||
tiff_put_separate (img, data + img->width * (img->height - 1 - y) + x,
|
||||
x, y, w, h, fromskew, -toskew - 2*w, r, g, b, a);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
@@ -181,8 +161,9 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
||||
guchar *pixels = NULL;
|
||||
gint width, height, rowstride, bytes;
|
||||
GdkPixbuf *pixbuf;
|
||||
TIFFRGBAImage img;
|
||||
gchar emsg[1024];
|
||||
#if TIFFLIB_VERSION >= 20031226
|
||||
gint major, minor, revision;
|
||||
#endif
|
||||
|
||||
/* We're called with the lock held. */
|
||||
|
||||
@@ -263,49 +244,89 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
||||
if (context)
|
||||
(* context->prepare_func) (pixbuf, NULL, context->user_data);
|
||||
G_LOCK (tiff_loader);
|
||||
|
||||
if (!TIFFRGBAImageBegin (&img, tiff, 1, emsg) || global_error) {
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load RGB data from TIFF file"));
|
||||
g_object_unref (pixbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (img.put.any == NULL) {
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Unsupported TIFF variant"));
|
||||
g_object_unref (pixbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (img.isContig) {
|
||||
tiff_put_contig = img.put.contig;
|
||||
img.put.contig = put_contig;
|
||||
}
|
||||
else {
|
||||
tiff_put_separate = img.put.separate;
|
||||
img.put.separate = put_separate;
|
||||
}
|
||||
|
||||
TIFFRGBAImageGet (&img, (uint32 *)pixels, width, height);
|
||||
TIFFRGBAImageEnd (&img);
|
||||
#if TIFFLIB_VERSION >= 20031226
|
||||
if (tifflibversion(&major, &minor, &revision) && major == 3 &&
|
||||
(minor > 6 || (minor == 6 && revision > 0))) {
|
||||
if (!TIFFReadRGBAImageOriented (tiff, width, height, (uint32 *)pixels, ORIENTATION_TOPLEFT, 1) || global_error)
|
||||
{
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load RGB data from TIFF file"));
|
||||
g_object_unref (pixbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
/* Turns out that the packing used by TIFFRGBAImage depends on the host byte order... */
|
||||
while (pixels < pixbuf->pixels + bytes) {
|
||||
uint32 pixel = *(uint32 *)pixels;
|
||||
int r = TIFFGetR(pixel);
|
||||
int g = TIFFGetG(pixel);
|
||||
int b = TIFFGetB(pixel);
|
||||
int a = TIFFGetA(pixel);
|
||||
*pixels++ = r;
|
||||
*pixels++ = g;
|
||||
*pixels++ = b;
|
||||
*pixels++ = a;
|
||||
}
|
||||
/* Turns out that the packing used by TIFFRGBAImage depends on
|
||||
* the host byte order...
|
||||
*/
|
||||
while (pixels < pixbuf->pixels + bytes) {
|
||||
uint32 pixel = *(uint32 *)pixels;
|
||||
int r = TIFFGetR(pixel);
|
||||
int g = TIFFGetG(pixel);
|
||||
int b = TIFFGetB(pixel);
|
||||
int a = TIFFGetA(pixel);
|
||||
*pixels++ = r;
|
||||
*pixels++ = g;
|
||||
*pixels++ = b;
|
||||
*pixels++ = a;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
uint32 *rast, *tmp_rast;
|
||||
gint x, y;
|
||||
guchar *tmppix;
|
||||
|
||||
/* Yes, it needs to be _TIFFMalloc... */
|
||||
rast = (uint32 *) _TIFFmalloc (width * height * sizeof (uint32));
|
||||
if (!rast) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
||||
_("Insufficient memory to open TIFF file"));
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
if (!TIFFReadRGBAImage (tiff, width, height, rast, 1) || global_error) {
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load RGB data from TIFF file"));
|
||||
g_object_unref (pixbuf);
|
||||
_TIFFfree (rast);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
|
||||
g_assert (pixels);
|
||||
|
||||
tmppix = pixels;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
/* Unexplainable...are tiffs backwards? */
|
||||
/* Also looking at the GIMP plugin, this
|
||||
* whole reading thing can be a bit more
|
||||
* robust.
|
||||
*/
|
||||
tmp_rast = rast + ((height - y - 1) * width);
|
||||
for (x = 0; x < width; x++) {
|
||||
tmppix[0] = TIFFGetR (*tmp_rast);
|
||||
tmppix[1] = TIFFGetG (*tmp_rast);
|
||||
tmppix[2] = TIFFGetB (*tmp_rast);
|
||||
tmppix[3] = TIFFGetA (*tmp_rast);
|
||||
tmp_rast++;
|
||||
tmppix += 4;
|
||||
}
|
||||
}
|
||||
|
||||
_TIFFfree (rast);
|
||||
}
|
||||
|
||||
G_UNLOCK (tiff_loader);
|
||||
if (context)
|
||||
|
||||
+29
-13
@@ -1079,7 +1079,7 @@ xpm_extract_color (const gchar *buffer)
|
||||
gint key = 0;
|
||||
gint current_key = 1;
|
||||
gint space = 128;
|
||||
gchar word[128], color[128], current_color[128];
|
||||
gchar word[129], color[129], current_color[129];
|
||||
gchar *r;
|
||||
|
||||
word[0] = '\0';
|
||||
@@ -1121,8 +1121,8 @@ xpm_extract_color (const gchar *buffer)
|
||||
return NULL;
|
||||
/* accumulate color name */
|
||||
if (color[0] != '\0') {
|
||||
strcat (color, " ");
|
||||
space--;
|
||||
strncat (color, " ", space);
|
||||
space -= MIN (space, 1);
|
||||
}
|
||||
strncat (color, word, space);
|
||||
space -= MIN (space, strlen (word));
|
||||
@@ -1245,14 +1245,6 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
|
||||
_("XPM file has image height <= 0"));
|
||||
return NULL;
|
||||
|
||||
}
|
||||
if (n_col <= 0) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("XPM file has invalid number of colors"));
|
||||
return NULL;
|
||||
|
||||
}
|
||||
if (cpp <= 0 || cpp >= 32) {
|
||||
g_set_error (error,
|
||||
@@ -1261,12 +1253,36 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
|
||||
_("XPM has invalid number of chars per pixel"));
|
||||
return NULL;
|
||||
}
|
||||
if (n_col <= 0 || n_col >= G_MAXINT / (cpp + 1)) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("XPM file has invalid number of colors"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* The hash is used for fast lookups of color from chars */
|
||||
color_hash = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
name_buf = g_new (gchar, n_col * (cpp + 1));
|
||||
colors = g_new (XPMColor, n_col);
|
||||
name_buf = g_try_malloc (n_col * (cpp + 1));
|
||||
if (!name_buf) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
||||
_("Can't allocate memory for loading XPM image"));
|
||||
g_hash_table_destroy (color_hash);
|
||||
return NULL;
|
||||
}
|
||||
colors = (XPMColor *) g_try_malloc (sizeof (XPMColor) * n_col);
|
||||
if (!colors) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
||||
_("Can't allocate memory for loading XPM image"));
|
||||
g_hash_table_destroy (color_hash);
|
||||
g_free (name_buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (cnt = 0; cnt < n_col; cnt++) {
|
||||
gchar *color_name;
|
||||
|
||||
+142
-129
@@ -71,36 +71,49 @@ pixops_scale_nearest (guchar *dest_buf,
|
||||
double scale_x,
|
||||
double scale_y)
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
int x;
|
||||
int x_step = (1 << SCALE_SHIFT) / scale_x;
|
||||
int y_step = (1 << SCALE_SHIFT) / scale_y;
|
||||
int xmax, xstart, xstop, x_pos, y_pos;
|
||||
const guchar *p;
|
||||
|
||||
#define INNER_LOOP(SRC_CHANNELS,DEST_CHANNELS) \
|
||||
for (j=0; j < (render_x1 - render_x0); j++) \
|
||||
{ \
|
||||
const guchar *p = src + (x >> SCALE_SHIFT) * SRC_CHANNELS; \
|
||||
\
|
||||
dest[0] = p[0]; \
|
||||
dest[1] = p[1]; \
|
||||
dest[2] = p[2]; \
|
||||
\
|
||||
if (DEST_CHANNELS == 4) \
|
||||
{ \
|
||||
if (SRC_CHANNELS == 4) \
|
||||
dest[3] = p[3]; \
|
||||
else \
|
||||
dest[3] = 0xff; \
|
||||
} \
|
||||
\
|
||||
dest += DEST_CHANNELS; \
|
||||
x += x_step; \
|
||||
}
|
||||
#define INNER_LOOP(SRC_CHANNELS,DEST_CHANNELS,ASSIGN_PIXEL) \
|
||||
xmax = x + (render_x1 - render_x0) * x_step; \
|
||||
xstart = MIN (0, xmax); \
|
||||
xstop = MIN (src_width << SCALE_SHIFT, xmax); \
|
||||
p = src + (CLAMP (x, xstart, xstop) >> SCALE_SHIFT) * SRC_CHANNELS; \
|
||||
while (x < xstart) \
|
||||
{ \
|
||||
ASSIGN_PIXEL; \
|
||||
dest += DEST_CHANNELS; \
|
||||
x += x_step; \
|
||||
} \
|
||||
while (x < xstop) \
|
||||
{ \
|
||||
p = src + (x >> SCALE_SHIFT) * SRC_CHANNELS; \
|
||||
ASSIGN_PIXEL; \
|
||||
dest += DEST_CHANNELS; \
|
||||
x += x_step; \
|
||||
} \
|
||||
x_pos = x >> SCALE_SHIFT; \
|
||||
p = src + CLAMP (x_pos, 0, src_width - 1) * SRC_CHANNELS; \
|
||||
while (x < xmax) \
|
||||
{ \
|
||||
ASSIGN_PIXEL; \
|
||||
dest += DEST_CHANNELS; \
|
||||
x += x_step; \
|
||||
}
|
||||
|
||||
for (i = 0; i < (render_y1 - render_y0); i++)
|
||||
{
|
||||
const guchar *src = src_buf + (((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
|
||||
guchar *dest = dest_buf + i * dest_rowstride;
|
||||
const guchar *src;
|
||||
guchar *dest;
|
||||
|
||||
y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
|
||||
y_pos = CLAMP (y_pos, 0, src_height - 1);
|
||||
src = src_buf + y_pos * src_rowstride;
|
||||
dest = dest_buf + i * dest_rowstride;
|
||||
|
||||
x = render_x0 * x_step + x_step / 2;
|
||||
|
||||
@@ -108,36 +121,26 @@ pixops_scale_nearest (guchar *dest_buf,
|
||||
{
|
||||
if (dest_channels == 3)
|
||||
{
|
||||
INNER_LOOP (3, 3);
|
||||
INNER_LOOP (3, 3, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
INNER_LOOP (3, 4);
|
||||
INNER_LOOP (3, 4, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2];dest[3]=0xff);
|
||||
}
|
||||
}
|
||||
else if (src_channels == 4)
|
||||
{
|
||||
if (dest_channels == 3)
|
||||
{
|
||||
INNER_LOOP (4, 3);
|
||||
INNER_LOOP (4, 3, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (j=0; j < (render_x1 - render_x0); j++)
|
||||
{
|
||||
const guchar *p = src + (x >> SCALE_SHIFT) * 4;
|
||||
guint32 *p32;
|
||||
|
||||
p32 = (guint32 *) dest;
|
||||
*p32 = *((guint32 *) p);
|
||||
|
||||
dest += 4;
|
||||
x += x_step;
|
||||
}
|
||||
guint32 *p32;
|
||||
INNER_LOOP(4, 4, p32=(guint32*)dest;*p32=*((guint32*)p));
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef INNER_LOOP
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -159,23 +162,27 @@ pixops_composite_nearest (guchar *dest_buf,
|
||||
double scale_y,
|
||||
int overall_alpha)
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
int x;
|
||||
int x_step = (1 << SCALE_SHIFT) / scale_x;
|
||||
int y_step = (1 << SCALE_SHIFT) / scale_y;
|
||||
int xmax, xstart, xstop, x_pos, y_pos;
|
||||
const guchar *p;
|
||||
unsigned int a0;
|
||||
|
||||
for (i = 0; i < (render_y1 - render_y0); i++)
|
||||
{
|
||||
const guchar *src = src_buf + (((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
|
||||
guchar *dest = dest_buf + i * dest_rowstride;
|
||||
const guchar *src;
|
||||
guchar *dest;
|
||||
|
||||
y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
|
||||
y_pos = CLAMP (y_pos, 0, src_height - 1);
|
||||
src = src_buf + y_pos * src_rowstride;
|
||||
dest = dest_buf + i * dest_rowstride;
|
||||
|
||||
x = render_x0 * x_step + x_step / 2;
|
||||
|
||||
for (j=0; j < (render_x1 - render_x0); j++)
|
||||
{
|
||||
const guchar *p = src + (x >> SCALE_SHIFT) * src_channels;
|
||||
unsigned int a0;
|
||||
|
||||
INNER_LOOP(src_channels, dest_channels,
|
||||
if (src_has_alpha)
|
||||
a0 = (p[3] * overall_alpha) / 0xff;
|
||||
else
|
||||
@@ -218,9 +225,7 @@ pixops_composite_nearest (guchar *dest_buf,
|
||||
}
|
||||
break;
|
||||
}
|
||||
dest += dest_channels;
|
||||
x += x_step;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,14 +259,23 @@ pixops_composite_color_nearest (guchar *dest_buf,
|
||||
int y_step = (1 << SCALE_SHIFT) / scale_y;
|
||||
int r1, g1, b1, r2, g2, b2;
|
||||
int check_shift = get_check_shift (check_size);
|
||||
int xmax, xstart, xstop, x_pos, y_pos;
|
||||
const guchar *p;
|
||||
unsigned int a0;
|
||||
|
||||
for (i = 0; i < (render_y1 - render_y0); i++)
|
||||
{
|
||||
const guchar *src = src_buf + (((i + render_y0) * y_step + y_step/2) >> SCALE_SHIFT) * src_rowstride;
|
||||
guchar *dest = dest_buf + i * dest_rowstride;
|
||||
const guchar *src;
|
||||
guchar *dest;
|
||||
|
||||
y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
|
||||
y_pos = CLAMP (y_pos, 0, src_height - 1);
|
||||
src = src_buf + y_pos * src_rowstride;
|
||||
dest = dest_buf + i * dest_rowstride;
|
||||
|
||||
x = render_x0 * x_step + x_step / 2;
|
||||
|
||||
|
||||
if (((i + check_y) >> check_shift) & 1)
|
||||
{
|
||||
r1 = (color2 & 0xff0000) >> 16;
|
||||
@@ -283,12 +297,8 @@ pixops_composite_color_nearest (guchar *dest_buf,
|
||||
b2 = color2 & 0xff;
|
||||
}
|
||||
|
||||
for (j=0 ; j < (render_x1 - render_x0); j++)
|
||||
{
|
||||
const guchar *p = src + (x >> SCALE_SHIFT) * src_channels;
|
||||
int a0;
|
||||
int tmp;
|
||||
|
||||
j = 0;
|
||||
INNER_LOOP(src_channels, dest_channels,
|
||||
if (src_has_alpha)
|
||||
a0 = (p[3] * overall_alpha + 0xff) >> 8;
|
||||
else
|
||||
@@ -316,6 +326,8 @@ pixops_composite_color_nearest (guchar *dest_buf,
|
||||
dest[2] = p[2];
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unsigned int tmp;
|
||||
if (((j + check_x) >> check_shift) & 1)
|
||||
{
|
||||
tmp = ((int) p[0] - r2) * a0;
|
||||
@@ -334,17 +346,18 @@ pixops_composite_color_nearest (guchar *dest_buf,
|
||||
tmp = ((int) p[2] - b1) * a0;
|
||||
dest[2] = b1 + ((tmp + (tmp >> 8) + 0x80) >> 8);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (dest_channels == 4)
|
||||
dest[3] = 0xff;
|
||||
|
||||
dest += dest_channels;
|
||||
x += x_step;
|
||||
}
|
||||
j++;
|
||||
);
|
||||
}
|
||||
}
|
||||
#undef INNER_LOOP
|
||||
|
||||
static void
|
||||
composite_pixel (guchar *dest, int dest_x, int dest_channels, int dest_has_alpha,
|
||||
@@ -1312,7 +1325,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim,
|
||||
dim->n = n;
|
||||
dim->weights = pixel_weights;
|
||||
|
||||
for (offset =0 ; offset < SUBSAMPLE; offset++)
|
||||
for (offset = 0; offset < SUBSAMPLE; offset++)
|
||||
{
|
||||
double x = (double)offset / SUBSAMPLE;
|
||||
double a = x + 1 / scale;
|
||||
@@ -1320,7 +1333,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim,
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
w = linear_box_half (0.5 + i - a, 0.5 + i - x);
|
||||
w += linear_box_half (1.5 + x - i, 1.5 + a - i);
|
||||
w += linear_box_half (0.5 + x - i, 0.5 + a - i);
|
||||
|
||||
*(pixel_weights++) = w * scale;
|
||||
}
|
||||
@@ -1357,29 +1370,29 @@ make_weights (PixopsFilter *filter,
|
||||
}
|
||||
|
||||
void
|
||||
pixops_composite_color (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha,
|
||||
int check_x,
|
||||
int check_y,
|
||||
int check_size,
|
||||
guint32 color1,
|
||||
guint32 color2)
|
||||
_pixops_composite_color (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha,
|
||||
int check_x,
|
||||
int check_y,
|
||||
int check_size,
|
||||
guint32 color1,
|
||||
guint32 color2)
|
||||
{
|
||||
PixopsFilter filter;
|
||||
PixopsLineFunc line_func;
|
||||
@@ -1396,10 +1409,10 @@ pixops_composite_color (guchar *dest_buf,
|
||||
|
||||
if (!src_has_alpha && overall_alpha == 255)
|
||||
{
|
||||
pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
|
||||
dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels,
|
||||
src_has_alpha, scale_x, scale_y, interp_type);
|
||||
_pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
|
||||
dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels,
|
||||
src_has_alpha, scale_x, scale_y, interp_type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1435,7 +1448,7 @@ pixops_composite_color (guchar *dest_buf,
|
||||
}
|
||||
|
||||
/**
|
||||
* pixops_composite:
|
||||
* _pixops_composite:
|
||||
* @dest_buf: pointer to location to store result
|
||||
* @render_x0: x0 of region of scaled source to store into @dest_buf
|
||||
* @render_y0: y0 of region of scaled source to store into @dest_buf
|
||||
@@ -1459,24 +1472,24 @@ pixops_composite_color (guchar *dest_buf,
|
||||
* of the result into the destination buffer.
|
||||
**/
|
||||
void
|
||||
pixops_composite (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha)
|
||||
_pixops_composite (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha)
|
||||
{
|
||||
PixopsFilter filter;
|
||||
PixopsLineFunc line_func;
|
||||
@@ -1493,10 +1506,10 @@ pixops_composite (guchar *dest_buf,
|
||||
|
||||
if (!src_has_alpha && overall_alpha == 255)
|
||||
{
|
||||
pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
|
||||
dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels,
|
||||
src_has_alpha, scale_x, scale_y, interp_type);
|
||||
_pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
|
||||
dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels,
|
||||
src_has_alpha, scale_x, scale_y, interp_type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1536,23 +1549,23 @@ pixops_composite (guchar *dest_buf,
|
||||
}
|
||||
|
||||
void
|
||||
pixops_scale (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type)
|
||||
_pixops_scale (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
gboolean dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
gboolean src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type)
|
||||
{
|
||||
PixopsFilter filter;
|
||||
PixopsLineFunc line_func;
|
||||
|
||||
+42
-42
@@ -18,24 +18,24 @@ typedef enum {
|
||||
* render_x, render_y, render_width, render_height in the new
|
||||
* coordinate system into dest_buf starting at 0, 0
|
||||
*/
|
||||
void pixops_composite (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
int src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha);
|
||||
void _pixops_composite (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
int src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha);
|
||||
|
||||
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
|
||||
* and composite the portion corresponding to
|
||||
@@ -43,36 +43,36 @@ void pixops_composite (guchar *dest_buf,
|
||||
* coordinate system against a checkboard with checks of size check_size
|
||||
* of the colors color1 and color2 into dest_buf starting at 0, 0
|
||||
*/
|
||||
void pixops_composite_color (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
int src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha,
|
||||
int check_x,
|
||||
int check_y,
|
||||
int check_size,
|
||||
guint32 color1,
|
||||
guint32 color2);
|
||||
void _pixops_composite_color (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
int render_y1,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
const guchar *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
int src_channels,
|
||||
int src_has_alpha,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
PixopsInterpType interp_type,
|
||||
int overall_alpha,
|
||||
int check_x,
|
||||
int check_y,
|
||||
int check_size,
|
||||
guint32 color1,
|
||||
guint32 color2);
|
||||
|
||||
/* Scale src_buf from src_width / src_height by factors scale_x, scale_y
|
||||
* and composite the portion corresponding to
|
||||
* render_x, render_y, render_width, render_height in the new
|
||||
* coordinate system into dest_buf starting at 0, 0
|
||||
*/
|
||||
void pixops_scale (guchar *dest_buf,
|
||||
void _pixops_scale (guchar *dest_buf,
|
||||
int render_x0,
|
||||
int render_y0,
|
||||
int render_x1,
|
||||
|
||||
@@ -182,10 +182,10 @@ int main (int argc, char **argv)
|
||||
start_timing ();
|
||||
for (i = 0; i < ITERS; i++)
|
||||
{
|
||||
pixops_scale (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level);
|
||||
_pixops_scale (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level);
|
||||
}
|
||||
scale_times[src_index][dest_index][filter_level] =
|
||||
stop_timing (" scale\t\t", ITERS, dest_height * dest_width);
|
||||
@@ -194,10 +194,10 @@ int main (int argc, char **argv)
|
||||
start_timing ();
|
||||
for (i = 0; i < ITERS; i++)
|
||||
{
|
||||
pixops_composite (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level, 255);
|
||||
_pixops_composite (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level, 255);
|
||||
}
|
||||
composite_times[src_index][dest_index][filter_level] =
|
||||
stop_timing (" composite\t\t", ITERS, dest_height * dest_width);
|
||||
@@ -205,10 +205,10 @@ int main (int argc, char **argv)
|
||||
start_timing ();
|
||||
for (i = 0; i < ITERS; i++)
|
||||
{
|
||||
pixops_composite_color (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level, 255, 0, 0, 16, 0xaaaaaa, 0x555555);
|
||||
_pixops_composite_color (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
|
||||
src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
|
||||
(double)dest_width / src_width, (double)dest_height / src_height,
|
||||
filter_level, 255, 0, 0, 16, 0xaaaaaa, 0x555555);
|
||||
}
|
||||
composite_color_times[src_index][dest_index][filter_level] =
|
||||
stop_timing (" composite color\t", ITERS, dest_height * dest_width);
|
||||
|
||||
+21
-21
@@ -40,27 +40,27 @@ static void gdk_display_dispose (GObject *object);
|
||||
static void gdk_display_finalize (GObject *object);
|
||||
|
||||
|
||||
void singlehead_get_pointer (GdkDisplay *display,
|
||||
static void singlehead_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* singlehead_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* singlehead_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
static GdkWindow* singlehead_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
static GdkWindow* singlehead_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
|
||||
GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
static GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
@@ -558,7 +558,7 @@ gdk_display_set_pointer_hooks (GdkDisplay *display,
|
||||
return (GdkDisplayPointerHooks *)result;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
singlehead_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
@@ -573,7 +573,7 @@ singlehead_get_pointer (GdkDisplay *display,
|
||||
singlehead_current_pointer_hooks->get_pointer (root_window, x, y, mask);
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
static GdkWindow*
|
||||
singlehead_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
@@ -583,7 +583,7 @@ singlehead_window_get_pointer (GdkDisplay *display,
|
||||
return singlehead_current_pointer_hooks->get_pointer (window, x, y, mask);
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
static GdkWindow*
|
||||
singlehead_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
@@ -594,7 +594,7 @@ singlehead_window_at_pointer (GdkDisplay *display,
|
||||
win_x, win_y);
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
static GdkWindow*
|
||||
singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
@@ -604,7 +604,7 @@ singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
window, x, y, mask);
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
static GdkWindow*
|
||||
singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ allocate_scratch_images (GdkScratchImageInfo *info,
|
||||
gint j;
|
||||
|
||||
for (j = 0; j < i; j++)
|
||||
g_object_unref (info->static_image[i]);
|
||||
g_object_unref (info->static_image[j]);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+3
-1
@@ -130,7 +130,9 @@ typedef enum
|
||||
GDK_BUTTON3_MASK = 1 << 10,
|
||||
GDK_BUTTON4_MASK = 1 << 11,
|
||||
GDK_BUTTON5_MASK = 1 << 12,
|
||||
/* The next few modifiers are used by XKB, so we skip to the end
|
||||
/* The next few modifiers are used by XKB, so we skip to the end.
|
||||
* Bits 16 - 28 are currently unused, but will eventually
|
||||
* be used for "virtual modifiers". Bit 29 is used internally.
|
||||
*/
|
||||
GDK_RELEASE_MASK = 1 << 30,
|
||||
GDK_MODIFIER_MASK = GDK_RELEASE_MASK | 0x1fff
|
||||
|
||||
+1
-1
@@ -826,7 +826,7 @@ gdk_window_is_viewable (GdkWindow *window)
|
||||
(private != (GdkWindowObject *)root_window) &&
|
||||
(GDK_WINDOW_TYPE (private) != GDK_WINDOW_FOREIGN))
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window) || !GDK_WINDOW_IS_MAPPED (window))
|
||||
if (GDK_WINDOW_DESTROYED (private) || !GDK_WINDOW_IS_MAPPED (private))
|
||||
return FALSE;
|
||||
|
||||
private = (GdkWindowObject *)private->parent;
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
#include "gdkregion-generic.h"
|
||||
#include <linux/fb.h>
|
||||
#include <stdio.h>
|
||||
#include <freetype/freetype.h>
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#define GDK_TYPE_DRAWABLE_IMPL_FBDATA (gdk_drawable_impl_fb_get_type ())
|
||||
#define GDK_DRAWABLE_IMPL_FBDATA(win) ((GdkDrawableFBData *)((GdkWindowObject *)(win))->impl)
|
||||
|
||||
@@ -1440,8 +1440,8 @@ gdk_window_set_transient_for (GdkWindow *window,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_set_background (const GdkWindow *window,
|
||||
const GdkColor *color)
|
||||
gdk_window_set_background (GdkWindow *window,
|
||||
const GdkColor *color)
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
|
||||
|
||||
@@ -80,33 +80,20 @@ enum_monitor (HMONITOR hmonitor,
|
||||
#define MONITORINFOF_PRIMARY 1
|
||||
#endif
|
||||
|
||||
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY)
|
||||
monitor->x = monitor_info.rcMonitor.left;
|
||||
monitor->y = monitor_info.rcMonitor.top;
|
||||
monitor->width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left;
|
||||
monitor->height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top;
|
||||
|
||||
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY &&
|
||||
*index != 0)
|
||||
{
|
||||
/* For the primary monitor, use SPI_GETWORKAREA */
|
||||
RECT rect;
|
||||
|
||||
SystemParametersInfo (SPI_GETWORKAREA, 0, &rect, 0);
|
||||
monitor->x = rect.left;
|
||||
monitor->y = rect.top;
|
||||
monitor->width = rect.right - rect.left;
|
||||
monitor->height = rect.bottom - rect.top;
|
||||
|
||||
/* Put primary monitor at index 0, just in case somebody needs
|
||||
* to know which one is the primary.
|
||||
*/
|
||||
if (*index != 0)
|
||||
{
|
||||
GdkRectangle temp = *monitor;
|
||||
*monitor = _gdk_monitors[0];
|
||||
_gdk_monitors[0] = temp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
monitor->x = monitor_info.rcMonitor.left;
|
||||
monitor->y = monitor_info.rcMonitor.top;
|
||||
monitor->width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left;
|
||||
monitor->height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top;
|
||||
GdkRectangle temp = *monitor;
|
||||
*monitor = _gdk_monitors[0];
|
||||
_gdk_monitors[0] = temp;
|
||||
}
|
||||
|
||||
(*index)++;
|
||||
@@ -115,23 +102,21 @@ enum_monitor (HMONITOR hmonitor,
|
||||
}
|
||||
#endif /* HAVE_MONITOR_INFO */
|
||||
|
||||
GdkDisplay *
|
||||
gdk_display_open (const gchar *display_name)
|
||||
void
|
||||
_gdk_monitor_init (void)
|
||||
{
|
||||
HMODULE user32;
|
||||
|
||||
if (_gdk_display != NULL)
|
||||
return NULL; /* single display only */
|
||||
|
||||
_gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL);
|
||||
_gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);
|
||||
|
||||
#ifdef HAVE_MONITOR_INFO
|
||||
user32 = GetModuleHandle ("user32.dll");
|
||||
g_assert (user32 != NULL);
|
||||
static HMODULE user32 = NULL;
|
||||
|
||||
p_EnumDisplayMonitors = (t_EnumDisplayMonitors) GetProcAddress (user32, "EnumDisplayMonitors");
|
||||
p_GetMonitorInfoA = (t_GetMonitorInfoA) GetProcAddress (user32, "GetMonitorInfoA");
|
||||
if (user32 == NULL)
|
||||
{
|
||||
user32 = GetModuleHandle ("user32.dll");
|
||||
|
||||
g_assert (user32 != NULL);
|
||||
|
||||
p_EnumDisplayMonitors = (t_EnumDisplayMonitors) GetProcAddress (user32, "EnumDisplayMonitors");
|
||||
p_GetMonitorInfoA = (t_GetMonitorInfoA) GetProcAddress (user32, "GetMonitorInfoA");
|
||||
}
|
||||
|
||||
if (p_EnumDisplayMonitors != NULL && p_GetMonitorInfoA != NULL)
|
||||
{
|
||||
@@ -141,10 +126,11 @@ gdk_display_open (const gchar *display_name)
|
||||
|
||||
(*p_EnumDisplayMonitors) (NULL, NULL, count_monitor, (LPARAM) &_gdk_num_monitors);
|
||||
|
||||
_gdk_monitors = g_new (GdkRectangle, _gdk_num_monitors);
|
||||
_gdk_monitors = g_renew (GdkRectangle, _gdk_monitors, _gdk_num_monitors);
|
||||
|
||||
index = 0;
|
||||
(*p_EnumDisplayMonitors) (NULL, NULL, enum_monitor, (LPARAM) &index);
|
||||
#if 1
|
||||
|
||||
_gdk_offset_x = G_MININT;
|
||||
_gdk_offset_y = G_MININT;
|
||||
|
||||
@@ -167,24 +153,38 @@ gdk_display_open (const gchar *display_name)
|
||||
_gdk_monitors[i].height,
|
||||
_gdk_monitors[i].x, _gdk_monitors[i].y));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_MONITOR_INFO */
|
||||
{
|
||||
RECT rect;
|
||||
unsigned int width, height;
|
||||
|
||||
_gdk_num_monitors = 1;
|
||||
_gdk_monitors = g_new (GdkRectangle, 1);
|
||||
SystemParametersInfo (SPI_GETWORKAREA, 0, &rect, 0);
|
||||
_gdk_monitors[0].x = rect.left;
|
||||
_gdk_monitors[0].y = rect.top;
|
||||
_gdk_monitors[0].width = rect.right - rect.left;
|
||||
_gdk_monitors[0].height = rect.bottom - rect.top;
|
||||
_gdk_monitors = g_renew (GdkRectangle, _gdk_monitors, 1);
|
||||
|
||||
width = GetSystemMetrics (SM_CXSCREEN);
|
||||
height = GetSystemMetrics (SM_CYSCREEN);
|
||||
|
||||
_gdk_monitors[0].x = 0;
|
||||
_gdk_monitors[0].y = 0;
|
||||
_gdk_monitors[0].width = width;
|
||||
_gdk_monitors[0].height = height;
|
||||
_gdk_offset_x = 0;
|
||||
_gdk_offset_y = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GdkDisplay *
|
||||
gdk_display_open (const gchar *display_name)
|
||||
{
|
||||
if (_gdk_display != NULL)
|
||||
return NULL; /* single display only */
|
||||
|
||||
_gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL);
|
||||
_gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);
|
||||
|
||||
_gdk_monitor_init ();
|
||||
_gdk_visual_init ();
|
||||
gdk_screen_set_default_colormap (_gdk_screen,
|
||||
gdk_screen_get_system_colormap (_gdk_screen));
|
||||
|
||||
@@ -65,7 +65,7 @@ typedef enum {
|
||||
#ifdef OLE2_DND
|
||||
|
||||
#define PRINT_GUID(guid) \
|
||||
g_print ("guid = %.08x-%.04x-%.04x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x", \
|
||||
g_print ("guid = %.08lx-%.04x-%.04x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x", \
|
||||
((gulong *) guid)[0], \
|
||||
((gushort *) guid)[2], \
|
||||
((gushort *) guid)[3], \
|
||||
@@ -88,6 +88,9 @@ static int nformats;
|
||||
* this is used on both source and destination sides.
|
||||
*/
|
||||
struct _GdkDragContextPrivateWin32 {
|
||||
#ifdef OLE2_DND
|
||||
gint ref_count;
|
||||
#endif
|
||||
guint16 last_x; /* Coordinates from last event */
|
||||
guint16 last_y;
|
||||
HWND dest_xid;
|
||||
@@ -139,6 +142,9 @@ gdk_drag_context_init (GdkDragContext *dragcontext)
|
||||
GdkDragContextPrivateWin32 *private = g_new0 (GdkDragContextPrivateWin32, 1);
|
||||
|
||||
dragcontext->windowing_data = private;
|
||||
#ifdef OLE2_DND
|
||||
private->ref_count = 1;
|
||||
#endif
|
||||
|
||||
contexts = g_list_prepend (contexts, dragcontext);
|
||||
}
|
||||
@@ -668,7 +674,7 @@ ienumformatetc_next (LPENUMFORMATETC This,
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
int i, n;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_next %p %d %d\n", This, en->ix, celt));
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_next %p %d %ld\n", This, en->ix, celt));
|
||||
|
||||
n = 0;
|
||||
for (i = 0; i < celt; i++)
|
||||
@@ -694,7 +700,7 @@ ienumformatetc_skip (LPENUMFORMATETC This,
|
||||
{
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_skip %p %d %d\n", This, en->ix, celt));
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_skip %p %d %ld\n", This, en->ix, celt));
|
||||
en->ix += celt;
|
||||
|
||||
return S_OK;
|
||||
@@ -1244,7 +1250,6 @@ gdk_drag_begin (GdkWindow *window,
|
||||
HRESULT hResult;
|
||||
DWORD dwEffect;
|
||||
HGLOBAL global;
|
||||
FORMATETC format;
|
||||
STGMEDIUM medium;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
@@ -1285,7 +1290,7 @@ gdk_drag_begin (GdkWindow *window,
|
||||
(hResult == DRAGDROP_S_DROP ? "DRAGDROP_S_DROP" :
|
||||
(hResult == DRAGDROP_S_CANCEL ? "DRAGDROP_S_CANCEL" :
|
||||
(hResult == E_UNEXPECTED ? "E_UNEXPECTED" :
|
||||
g_strdup_printf ("%#.8x", hResult))))));
|
||||
g_strdup_printf ("%#.8lx", hResult))))));
|
||||
|
||||
dobj->ido.lpVtbl->Release (&dobj->ido);
|
||||
ctx->ids.lpVtbl->Release (&ctx->ids);
|
||||
@@ -1362,8 +1367,8 @@ gdk_drag_find_window_for_screen (GdkDragContext *context,
|
||||
{
|
||||
find_window_enum_arg a;
|
||||
|
||||
a.x = x_root;
|
||||
a.y = y_root;
|
||||
a.x = x_root - _gdk_offset_x;
|
||||
a.y = y_root - _gdk_offset_y;
|
||||
a.ignore = drag_window ? GDK_WINDOW_HWND (drag_window) : NULL;
|
||||
a.result = NULL;
|
||||
|
||||
|
||||
@@ -1032,7 +1032,7 @@ gdk_win32_draw_text (GdkDrawable *drawable,
|
||||
{
|
||||
const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_FONT;
|
||||
wchar_t *wcstr, wc;
|
||||
gint wlen;
|
||||
glong wlen;
|
||||
gdk_draw_text_arg arg;
|
||||
|
||||
if (text_length == 0)
|
||||
@@ -1058,15 +1058,11 @@ gdk_win32_draw_text (GdkDrawable *drawable,
|
||||
}
|
||||
else
|
||||
{
|
||||
wcstr = g_new (wchar_t, text_length);
|
||||
if ((wlen = _gdk_utf8_to_ucs2 (wcstr, text, text_length, text_length)) == -1)
|
||||
g_warning ("gdk_win32_draw_text: _gdk_utf8_to_ucs2 failed");
|
||||
else
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_draw_text_handler, &arg);
|
||||
wcstr = g_utf8_to_utf16 (text, text_length, NULL, &wlen, NULL);
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_draw_text_handler, &arg);
|
||||
g_free (wcstr);
|
||||
}
|
||||
|
||||
|
||||
gdk_win32_hdc_release (drawable, gc, mask);
|
||||
}
|
||||
|
||||
|
||||
+153
-72
@@ -112,6 +112,9 @@ static gboolean gdk_event_dispatch (GSource *source,
|
||||
GSourceFunc callback,
|
||||
gpointer user_data);
|
||||
|
||||
static void append_event (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
|
||||
/* Private variable declarations
|
||||
*/
|
||||
|
||||
@@ -159,7 +162,6 @@ static HKL latin_locale = NULL;
|
||||
#endif
|
||||
|
||||
static gboolean in_ime_composition = FALSE;
|
||||
static gboolean resizing = FALSE;
|
||||
static UINT resize_timer;
|
||||
|
||||
static int debug_indent = 0;
|
||||
@@ -226,11 +228,24 @@ _gdk_win32_get_next_tick (gulong suggested_tick)
|
||||
if (suggested_tick == 0)
|
||||
suggested_tick = GetTickCount ();
|
||||
if (suggested_tick <= cur_tick)
|
||||
return ++cur_tick;
|
||||
return cur_tick;
|
||||
else
|
||||
return cur_tick = suggested_tick;
|
||||
}
|
||||
|
||||
static void
|
||||
generate_focus_event (GdkWindow *window,
|
||||
gboolean in)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->focus_change.window = window;
|
||||
event->focus_change.in = in;
|
||||
|
||||
append_event (gdk_drawable_get_display (window), event);
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
inner_window_procedure (HWND hwnd,
|
||||
UINT message,
|
||||
@@ -533,13 +548,13 @@ gdk_pointer_grab (GdkWindow *window,
|
||||
hcursor = NULL;
|
||||
else if ((hcursor = CopyCursor (cursor_private->hcursor)) == NULL)
|
||||
WIN32_API_FAILED ("CopyCursor");
|
||||
#if 0
|
||||
|
||||
return_val = _gdk_input_grab_pointer (window,
|
||||
owner_events,
|
||||
event_mask,
|
||||
confine_to,
|
||||
time);
|
||||
#endif
|
||||
|
||||
if (return_val == GDK_GRAB_SUCCESS)
|
||||
{
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
@@ -615,9 +630,8 @@ gdk_display_pointer_ungrab (GdkDisplay *display,
|
||||
GDK_NOTE (EVENTS, g_print ("%sgdk_display_pointer_ungrab%s",
|
||||
(debug_indent > 0 ? "\n" : ""),
|
||||
(debug_indent == 0 ? "\n" : "")));
|
||||
#if 0
|
||||
|
||||
_gdk_input_ungrab_pointer (time);
|
||||
#endif
|
||||
|
||||
if (GetCapture () != NULL)
|
||||
ReleaseCapture ();
|
||||
@@ -718,6 +732,8 @@ gdk_keyboard_grab (GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
guint32 time)
|
||||
{
|
||||
GdkWindow *real_focus_window, *grab_focus_window;
|
||||
|
||||
gint return_val;
|
||||
|
||||
g_return_val_if_fail (window != NULL, 0);
|
||||
@@ -735,7 +751,31 @@ gdk_keyboard_grab (GdkWindow *window,
|
||||
return_val = GDK_GRAB_ALREADY_GRABBED;
|
||||
|
||||
if (return_val == GDK_GRAB_SUCCESS)
|
||||
k_grab_window = window;
|
||||
{
|
||||
k_grab_window = window;
|
||||
|
||||
if (!k_grab_owner_events)
|
||||
{
|
||||
real_focus_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) GetFocus ());
|
||||
if (real_focus_window)
|
||||
real_focus_window = gdk_window_get_toplevel (real_focus_window);
|
||||
grab_focus_window = gdk_window_get_toplevel (k_grab_window);
|
||||
if (real_focus_window != grab_focus_window)
|
||||
{
|
||||
/* Generate events for focus change from the window that really
|
||||
* has focus to the grabber.
|
||||
*/
|
||||
if (real_focus_window && !GDK_WINDOW_DESTROYED (real_focus_window)
|
||||
&& (((GdkWindowObject *) real_focus_window)->event_mask
|
||||
& GDK_FOCUS_CHANGE_MASK))
|
||||
generate_focus_event (real_focus_window, FALSE);
|
||||
|
||||
if (((GdkWindowObject *) grab_focus_window)->event_mask
|
||||
& GDK_FOCUS_CHANGE_MASK)
|
||||
generate_focus_event (grab_focus_window, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return return_val;
|
||||
}
|
||||
@@ -744,10 +784,39 @@ void
|
||||
gdk_display_keyboard_ungrab (GdkDisplay *display,
|
||||
guint32 time)
|
||||
{
|
||||
GdkWindow *real_focus_window, *grab_focus_window;
|
||||
|
||||
g_return_if_fail (display == gdk_display_get_default ());
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("gdk_keyboard_ungrab\n"));
|
||||
|
||||
if (k_grab_window && !k_grab_owner_events)
|
||||
{
|
||||
real_focus_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) GetFocus ());
|
||||
if (real_focus_window)
|
||||
real_focus_window = gdk_window_get_toplevel (real_focus_window);
|
||||
if (!GDK_WINDOW_DESTROYED (k_grab_window))
|
||||
grab_focus_window = gdk_window_get_toplevel (k_grab_window);
|
||||
else
|
||||
grab_focus_window = NULL;
|
||||
if (real_focus_window != grab_focus_window)
|
||||
{
|
||||
/* Generate events for focus change from grabber to the window that
|
||||
* really has focus. Important for example if a new window is created
|
||||
* while focus is grabbed.
|
||||
*/
|
||||
if (grab_focus_window
|
||||
&& (((GdkWindowObject *) grab_focus_window)->event_mask
|
||||
& GDK_FOCUS_CHANGE_MASK))
|
||||
generate_focus_event (grab_focus_window, FALSE);
|
||||
|
||||
if (real_focus_window && !GDK_WINDOW_DESTROYED (real_focus_window)
|
||||
&& (((GdkWindowObject *) real_focus_window)->event_mask
|
||||
& GDK_FOCUS_CHANGE_MASK))
|
||||
generate_focus_event (real_focus_window, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
k_grab_window = NULL;
|
||||
}
|
||||
|
||||
@@ -1557,6 +1626,9 @@ translate_mouse_coords (GdkWindow *window1,
|
||||
msg->lParam = MAKELPARAM (pt.x, pt.y);
|
||||
}
|
||||
|
||||
/* The check_extended flag controls whether to check if the windows want
|
||||
* events from extended input devices and if the message should be skipped
|
||||
* because an extended input device is active */
|
||||
static gboolean
|
||||
propagate (GdkWindow **window,
|
||||
MSG *msg,
|
||||
@@ -1564,13 +1636,24 @@ propagate (GdkWindow **window,
|
||||
gboolean grab_owner_events,
|
||||
gint grab_mask,
|
||||
gboolean (*doesnt_want_it) (gint mask,
|
||||
MSG *msg))
|
||||
MSG *msg),
|
||||
gboolean check_extended)
|
||||
{
|
||||
gboolean in_propagation = FALSE;
|
||||
|
||||
if (grab_window != NULL && !grab_owner_events)
|
||||
{
|
||||
/* Event source is grabbed with owner_events FALSE */
|
||||
|
||||
/* See if the event should be ignored because an extended input device
|
||||
* is used */
|
||||
if (check_extended &&
|
||||
((GdkWindowObject *) grab_window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored for grabber)"));
|
||||
return FALSE;
|
||||
}
|
||||
if ((*doesnt_want_it) (grab_mask, msg))
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (grabber doesn't want it)"));
|
||||
@@ -1585,7 +1668,16 @@ propagate (GdkWindow **window,
|
||||
}
|
||||
while (TRUE)
|
||||
{
|
||||
if ((*doesnt_want_it) (((GdkWindowObject *) *window)->event_mask, msg))
|
||||
/* See if the event should be ignored because an extended input device
|
||||
* is used */
|
||||
if (check_extended &&
|
||||
((GdkWindowObject *) *window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
return FALSE;
|
||||
}
|
||||
if ((*doesnt_want_it) (((GdkWindowObject *) *window)->event_mask, msg))
|
||||
{
|
||||
/* Owner doesn't want it, propagate to parent. */
|
||||
GdkWindow *parent = gdk_window_get_parent (*window);
|
||||
@@ -1595,6 +1687,16 @@ propagate (GdkWindow **window,
|
||||
if (grab_window != NULL)
|
||||
{
|
||||
/* Event source is grabbed with owner_events TRUE */
|
||||
|
||||
/* See if the event should be ignored because an extended
|
||||
* input device is used */
|
||||
if (check_extended &&
|
||||
((GdkWindowObject *) grab_window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored for grabber)"));
|
||||
return FALSE;
|
||||
}
|
||||
if ((*doesnt_want_it) (grab_mask, msg))
|
||||
{
|
||||
/* Grabber doesn't want it either */
|
||||
@@ -1691,8 +1793,12 @@ handle_configure_event (MSG *msg,
|
||||
point.x = client_rect.left; /* always 0 */
|
||||
point.y = client_rect.top;
|
||||
/* top level windows need screen coords */
|
||||
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
|
||||
ClientToScreen (msg->hwnd, &point);
|
||||
if (gdk_window_get_parent (window) == _gdk_parent_root)
|
||||
{
|
||||
ClientToScreen (msg->hwnd, &point);
|
||||
point.x += _gdk_offset_x;
|
||||
point.y += _gdk_offset_y;
|
||||
}
|
||||
|
||||
GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->width = client_rect.right - client_rect.left;
|
||||
GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->height = client_rect.bottom - client_rect.top;
|
||||
@@ -1712,12 +1818,6 @@ handle_configure_event (MSG *msg,
|
||||
event->configure.x = point.x;
|
||||
event->configure.y = point.y;
|
||||
|
||||
if (gdk_window_get_parent (window) == _gdk_parent_root)
|
||||
{
|
||||
event->configure.x += _gdk_offset_x;
|
||||
event->configure.y += _gdk_offset_y;
|
||||
}
|
||||
|
||||
append_event (gdk_drawable_get_display (window), event);
|
||||
}
|
||||
}
|
||||
@@ -2024,10 +2124,18 @@ resize_timer_proc (HWND hwnd,
|
||||
UINT id,
|
||||
DWORD time)
|
||||
{
|
||||
if (resizing)
|
||||
if (_sizemove_in_progress)
|
||||
handle_stuff_while_moving_or_resizing ();
|
||||
}
|
||||
|
||||
static void
|
||||
handle_display_change (void)
|
||||
{
|
||||
_gdk_monitor_init ();
|
||||
_gdk_root_window_size_init ();
|
||||
g_signal_emit_by_name (_gdk_screen, "size_changed");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_event_translate (GdkDisplay *display,
|
||||
MSG *msg,
|
||||
@@ -2168,16 +2276,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
assign_object (&window, new_window);
|
||||
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_scroll))
|
||||
doesnt_want_scroll, TRUE))
|
||||
goto done;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2319,7 +2420,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
||||
doesnt_want_key))
|
||||
doesnt_want_key, FALSE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2401,7 +2502,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
||||
doesnt_want_char))
|
||||
doesnt_want_char, FALSE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2479,16 +2580,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
synthesize_crossing_events (window, GDK_CROSSING_NORMAL, msg);
|
||||
}
|
||||
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_press))
|
||||
doesnt_want_button_press, TRUE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2568,16 +2662,18 @@ gdk_event_translate (GdkDisplay *display,
|
||||
synthesize_crossing_events (window, GDK_CROSSING_NORMAL, msg);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_release))
|
||||
doesnt_want_button_release, TRUE))
|
||||
{
|
||||
}
|
||||
else if (!GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2640,16 +2736,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
synthesize_crossing_events (window, GDK_CROSSING_NORMAL, msg);
|
||||
}
|
||||
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_motion))
|
||||
doesnt_want_button_motion, TRUE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2747,16 +2836,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
assign_object (&window, new_window);
|
||||
}
|
||||
|
||||
if (((GdkWindowObject *) window)->extension_events != 0 &&
|
||||
_gdk_input_ignore_core)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (ignored)"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!propagate (&window, msg,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_scroll))
|
||||
doesnt_want_scroll, TRUE))
|
||||
break;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -2822,7 +2904,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
case WM_SETFOCUS:
|
||||
case WM_KILLFOCUS:
|
||||
if (p_grab_window != NULL && !p_grab_owner_events && !(p_grab_mask & GDK_FOCUS_CHANGE_MASK))
|
||||
if (k_grab_window != NULL && !k_grab_owner_events)
|
||||
break;
|
||||
|
||||
if (!(((GdkWindowObject *) window)->event_mask & GDK_FOCUS_CHANGE_MASK))
|
||||
@@ -2831,12 +2913,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
break;
|
||||
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->focus_change.window = window;
|
||||
event->focus_change.in = (msg->message == WM_SETFOCUS);
|
||||
|
||||
append_event (display, event);
|
||||
|
||||
generate_focus_event (window, (msg->message == WM_SETFOCUS));
|
||||
return_val = TRUE;
|
||||
break;
|
||||
|
||||
@@ -2964,12 +3041,12 @@ gdk_event_translate (GdkDisplay *display,
|
||||
break;
|
||||
|
||||
case WM_ENTERSIZEMOVE:
|
||||
resizing = TRUE;
|
||||
_sizemove_in_progress = TRUE;
|
||||
resize_timer = SetTimer (NULL, 0, 20, resize_timer_proc);
|
||||
break;
|
||||
|
||||
case WM_EXITSIZEMOVE:
|
||||
resizing = FALSE;
|
||||
_sizemove_in_progress = FALSE;
|
||||
KillTimer (NULL, resize_timer);
|
||||
break;
|
||||
|
||||
@@ -2977,7 +3054,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
/* Once we've entered the moving or sizing modal loop, we won't
|
||||
* return to the main loop until we're done sizing or moving.
|
||||
*/
|
||||
if (resizing &&
|
||||
if (_sizemove_in_progress &&
|
||||
GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD &&
|
||||
!GDK_WINDOW_DESTROYED (window))
|
||||
{
|
||||
@@ -2988,15 +3065,19 @@ gdk_event_translate (GdkDisplay *display,
|
||||
point.x = client_rect.left; /* always 0 */
|
||||
point.y = client_rect.top;
|
||||
/* top level windows need screen coords */
|
||||
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
|
||||
ClientToScreen (msg->hwnd, &point);
|
||||
if (gdk_window_get_parent (window) == _gdk_parent_root)
|
||||
{
|
||||
ClientToScreen (msg->hwnd, &point);
|
||||
point.x += _gdk_offset_x;
|
||||
point.y += _gdk_offset_y;
|
||||
}
|
||||
|
||||
GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->width = client_rect.right - client_rect.left;
|
||||
GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->height = client_rect.bottom - client_rect.top;
|
||||
|
||||
((GdkWindowObject *) window)->x = point.x;
|
||||
((GdkWindowObject *) window)->y = point.y;
|
||||
|
||||
|
||||
if (((GdkWindowObject *) window)->event_mask & GDK_STRUCTURE_MASK)
|
||||
{
|
||||
GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
|
||||
@@ -3009,12 +3090,6 @@ gdk_event_translate (GdkDisplay *display,
|
||||
event->configure.x = point.x;
|
||||
event->configure.y = point.y;
|
||||
|
||||
if (gdk_window_get_parent (window) == _gdk_parent_root)
|
||||
{
|
||||
event->configure.x += _gdk_offset_x;
|
||||
event->configure.y += _gdk_offset_y;
|
||||
}
|
||||
|
||||
if (((GdkWindowObject *) window)->resize_count > 1)
|
||||
((GdkWindowObject *) window)->resize_count -= 1;
|
||||
|
||||
@@ -3276,6 +3351,11 @@ gdk_event_translate (GdkDisplay *display,
|
||||
return_val = TRUE;
|
||||
break;
|
||||
|
||||
case WM_DISPLAYCHANGE:
|
||||
handle_display_change ();
|
||||
break;
|
||||
|
||||
|
||||
#ifdef HAVE_WINTAB
|
||||
/* Handle WINTAB events here, as we know that gdkinput.c will
|
||||
* use the fixed WT_DEFBASE as lcMsgBase, and we thus can use the
|
||||
@@ -3301,6 +3381,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
event = gdk_event_new (GDK_NOTHING);
|
||||
event->any.window = window;
|
||||
g_object_ref (window);
|
||||
if (_gdk_input_other_event (event, msg, window))
|
||||
append_event (display, event);
|
||||
else
|
||||
|
||||
@@ -1592,8 +1592,8 @@ gdk_text_extents (GdkFont *font,
|
||||
gint *descent)
|
||||
{
|
||||
gdk_text_size_arg arg;
|
||||
gint wlen;
|
||||
wchar_t *wcstr;
|
||||
glong wlen;
|
||||
wchar_t *wcstr, wc;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
g_return_if_fail (text != NULL);
|
||||
@@ -1617,22 +1617,18 @@ gdk_text_extents (GdkFont *font,
|
||||
|
||||
arg.total.cx = arg.total.cy = 0;
|
||||
|
||||
wcstr = g_new (wchar_t, text_length);
|
||||
if (text_length == 1)
|
||||
{
|
||||
wcstr[0] = (guchar) text[0];
|
||||
_gdk_wchar_text_handle (font, wcstr, 1, gdk_text_size_handler, &arg);
|
||||
wc = (guchar) text[0];
|
||||
_gdk_wchar_text_handle (font, &wc, 1, gdk_text_size_handler, &arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((wlen = _gdk_utf8_to_ucs2 (wcstr, text, text_length, text_length)) == -1)
|
||||
g_warning ("gdk_text_extents: _gdk_utf8_to_ucs2 failed");
|
||||
else
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, &arg);
|
||||
wcstr = g_utf8_to_utf16 (text, text_length, NULL, &wlen, NULL);
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, &arg);
|
||||
g_free (wcstr);
|
||||
}
|
||||
|
||||
g_free (wcstr);
|
||||
|
||||
/* XXX This is quite bogus */
|
||||
if (lbearing)
|
||||
*lbearing = 0;
|
||||
|
||||
@@ -34,7 +34,7 @@ GdkScreen *_gdk_screen = NULL;
|
||||
GdkWindow *_gdk_parent_root = NULL;
|
||||
|
||||
gint _gdk_num_monitors;
|
||||
GdkRectangle *_gdk_monitors;
|
||||
GdkRectangle *_gdk_monitors = NULL;
|
||||
|
||||
gint _gdk_offset_x, _gdk_offset_y;
|
||||
|
||||
@@ -51,8 +51,8 @@ WORD _cf_rtf;
|
||||
WORD _cf_utf8_string;
|
||||
|
||||
GdkAtom _utf8_string;
|
||||
GdkAtom _compound_text;
|
||||
GdkAtom _text_uri_list;
|
||||
GdkAtom _targets;
|
||||
|
||||
GdkAtom _local_dnd;
|
||||
GdkAtom _gdk_win32_dropfiles;
|
||||
@@ -64,5 +64,7 @@ GdkAtom _wm_transient_for;
|
||||
|
||||
DWORD _windows_version;
|
||||
|
||||
gint _gdk_input_ignore_wintab = TRUE;
|
||||
gint _gdk_input_ignore_wintab = FALSE;
|
||||
gint _gdk_max_colors = 0;
|
||||
|
||||
gboolean _sizemove_in_progress = FALSE;
|
||||
|
||||
+21
-307
@@ -1,6 +1,6 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
* Copyright (C) 1998-2002 Tor Lillqvist
|
||||
* Copyright (C) 1998-2004 Tor Lillqvist
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -58,321 +58,35 @@ gdk_set_locale (void)
|
||||
return g_win32_getlocale ();
|
||||
}
|
||||
|
||||
/*
|
||||
* gdk_wcstombs
|
||||
*
|
||||
* Returns a multi-byte string converted from the specified array
|
||||
* of wide characters. The string is newly allocated. The array of
|
||||
* wide characters must be null-terminated. If the conversion is
|
||||
* failed, it returns NULL.
|
||||
*
|
||||
* On Win32, we always use UTF-8.
|
||||
*/
|
||||
gchar *
|
||||
gdk_wcstombs (const GdkWChar *src)
|
||||
{
|
||||
gint len;
|
||||
const GdkWChar *wcp;
|
||||
guchar *mbstr, *bp;
|
||||
gchar *utf8;
|
||||
gchar *retval;
|
||||
const gchar *charset;
|
||||
|
||||
wcp = src;
|
||||
len = 0;
|
||||
while (*wcp)
|
||||
{
|
||||
const GdkWChar c = *wcp++;
|
||||
|
||||
if (c < 0x80)
|
||||
len += 1;
|
||||
else if (c < 0x800)
|
||||
len += 2;
|
||||
else if (c < 0x10000)
|
||||
len += 3;
|
||||
else if (c < 0x200000)
|
||||
len += 4;
|
||||
else if (c < 0x4000000)
|
||||
len += 5;
|
||||
else
|
||||
len += 6;
|
||||
}
|
||||
|
||||
mbstr = g_malloc (len + 1);
|
||||
|
||||
wcp = src;
|
||||
bp = mbstr;
|
||||
while (*wcp)
|
||||
{
|
||||
int first;
|
||||
GdkWChar c = *wcp++;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
first = 0;
|
||||
len = 1;
|
||||
}
|
||||
else if (c < 0x800)
|
||||
{
|
||||
first = 0xc0;
|
||||
len = 2;
|
||||
}
|
||||
else if (c < 0x10000)
|
||||
{
|
||||
first = 0xe0;
|
||||
len = 3;
|
||||
}
|
||||
else if (c < 0x200000)
|
||||
{
|
||||
first = 0xf0;
|
||||
len = 4;
|
||||
}
|
||||
else if (c < 0x4000000)
|
||||
{
|
||||
first = 0xf8;
|
||||
len = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
first = 0xfc;
|
||||
len = 6;
|
||||
}
|
||||
|
||||
/* Woo-hoo! */
|
||||
switch (len)
|
||||
{
|
||||
case 6: bp[5] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 5: bp[4] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 4: bp[3] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 3: bp[2] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 2: bp[1] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 1: bp[0] = c | first;
|
||||
}
|
||||
|
||||
bp += len;
|
||||
}
|
||||
*bp = 0;
|
||||
return mbstr;
|
||||
g_get_charset (&charset);
|
||||
return g_convert (src, -1, charset, "UCS-4LE", NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* A vesion that converts from wchar_t strings to UTF-8 */
|
||||
|
||||
gchar *
|
||||
_gdk_ucs2_to_utf8 (const wchar_t *src,
|
||||
gint src_len)
|
||||
{
|
||||
gint len;
|
||||
const wchar_t *wcp;
|
||||
guchar *mbstr, *bp;
|
||||
|
||||
wcp = src;
|
||||
len = 0;
|
||||
while (wcp < src + src_len)
|
||||
{
|
||||
const wchar_t c = *wcp++;
|
||||
|
||||
if (c < 0x80)
|
||||
len += 1;
|
||||
else if (c < 0x800)
|
||||
len += 2;
|
||||
else
|
||||
len += 3;
|
||||
}
|
||||
|
||||
mbstr = g_malloc (len + 1);
|
||||
|
||||
wcp = src;
|
||||
bp = mbstr;
|
||||
while (wcp < src + src_len)
|
||||
{
|
||||
int first;
|
||||
wchar_t c = *wcp++;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
first = 0;
|
||||
len = 1;
|
||||
}
|
||||
else if (c < 0x800)
|
||||
{
|
||||
first = 0xc0;
|
||||
len = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
first = 0xe0;
|
||||
len = 3;
|
||||
}
|
||||
|
||||
/* Woo-hoo! */
|
||||
switch (len)
|
||||
{
|
||||
case 3: bp[2] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 2: bp[1] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
||||
case 1: bp[0] = c | first;
|
||||
}
|
||||
|
||||
bp += len;
|
||||
}
|
||||
*bp = 0;
|
||||
|
||||
return mbstr;
|
||||
}
|
||||
|
||||
/* Convert from UTF-8 to GdkWChar */
|
||||
|
||||
gint
|
||||
_gdk_utf8_to_wcs (GdkWChar *dest,
|
||||
const gchar *src,
|
||||
gint src_len,
|
||||
gint dest_max)
|
||||
{
|
||||
guchar *cp, *end;
|
||||
gint n;
|
||||
|
||||
cp = (guchar *) src;
|
||||
end = cp + src_len;
|
||||
n = 0;
|
||||
while (cp != end && dest != dest + dest_max)
|
||||
{
|
||||
gint i, mask = 0, len;
|
||||
guchar c = *cp;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
len = 1;
|
||||
mask = 0x7f;
|
||||
}
|
||||
else if ((c & 0xe0) == 0xc0)
|
||||
{
|
||||
len = 2;
|
||||
mask = 0x1f;
|
||||
}
|
||||
else if ((c & 0xf0) == 0xe0)
|
||||
{
|
||||
len = 3;
|
||||
mask = 0x0f;
|
||||
}
|
||||
else if ((c & 0xf8) == 0xf0)
|
||||
{
|
||||
len = 4;
|
||||
mask = 0x07;
|
||||
}
|
||||
else if ((c & 0xfc) == 0xf8)
|
||||
{
|
||||
len = 5;
|
||||
mask = 0x03;
|
||||
}
|
||||
else if ((c & 0xfc) == 0xfc)
|
||||
{
|
||||
len = 6;
|
||||
mask = 0x01;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
|
||||
if (cp + len > end)
|
||||
return -1;
|
||||
|
||||
*dest = (cp[0] & mask);
|
||||
for (i = 1; i < len; i++)
|
||||
{
|
||||
if ((cp[i] & 0xc0) != 0x80)
|
||||
return -1;
|
||||
*dest <<= 6;
|
||||
*dest |= (cp[i] & 0x3f);
|
||||
}
|
||||
if (*dest == -1)
|
||||
return -1;
|
||||
|
||||
cp += len;
|
||||
dest++;
|
||||
n++;
|
||||
}
|
||||
if (cp != end)
|
||||
return -1;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* gdk_mbstowcs
|
||||
*
|
||||
* Converts the specified string into GDK wide characters, and,
|
||||
* returns the number of wide characters written. The string 'src'
|
||||
* must be null-terminated. If the conversion is failed, it returns
|
||||
* -1.
|
||||
*
|
||||
* On Win32, the string is assumed to be in UTF-8. Also note that
|
||||
* GdkWChar is 32 bits, while wchar_t, and the wide characters the
|
||||
* Windows API uses, are 16 bits!
|
||||
*/
|
||||
|
||||
gint
|
||||
gdk_mbstowcs (GdkWChar *dest,
|
||||
const gchar *src,
|
||||
gint dest_max)
|
||||
{
|
||||
return _gdk_utf8_to_wcs (dest, src, strlen (src), dest_max);
|
||||
}
|
||||
|
||||
|
||||
/* A version that converts to a wchar_t string */
|
||||
|
||||
gint
|
||||
_gdk_utf8_to_ucs2 (wchar_t *dest,
|
||||
const gchar *src,
|
||||
gint src_len,
|
||||
gint dest_max)
|
||||
{
|
||||
wchar_t *wcp;
|
||||
guchar *cp, *end;
|
||||
gint n;
|
||||
|
||||
wcp = dest;
|
||||
cp = (guchar *) src;
|
||||
end = cp + src_len;
|
||||
n = 0;
|
||||
while (cp != end && wcp != dest + dest_max)
|
||||
{
|
||||
gint i, mask = 0, len;
|
||||
guchar c = *cp;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
len = 1;
|
||||
mask = 0x7f;
|
||||
}
|
||||
else if ((c & 0xe0) == 0xc0)
|
||||
{
|
||||
len = 2;
|
||||
mask = 0x1f;
|
||||
}
|
||||
else if ((c & 0xf0) == 0xe0)
|
||||
{
|
||||
len = 3;
|
||||
mask = 0x0f;
|
||||
}
|
||||
else /* Other lengths are not possible with 16-bit wchar_t! */
|
||||
return -1;
|
||||
|
||||
if (cp + len > end)
|
||||
return -1;
|
||||
|
||||
*wcp = (cp[0] & mask);
|
||||
for (i = 1; i < len; i++)
|
||||
{
|
||||
if ((cp[i] & 0xc0) != 0x80)
|
||||
return -1;
|
||||
*wcp <<= 6;
|
||||
*wcp |= (cp[i] & 0x3f);
|
||||
}
|
||||
if (*wcp == 0xFFFF)
|
||||
return -1;
|
||||
|
||||
cp += len;
|
||||
wcp++;
|
||||
n++;
|
||||
}
|
||||
if (cp != end)
|
||||
return -1;
|
||||
|
||||
return n;
|
||||
gint retval;
|
||||
gsize nwritten;
|
||||
gint n_ucs4;
|
||||
gunichar *ucs4;
|
||||
const gchar *charset;
|
||||
|
||||
g_get_charset (&charset);
|
||||
ucs4 = g_convert (src, -1, "UCS-4LE", charset, NULL, &nwritten, NULL);
|
||||
n_ucs4 = nwritten * sizeof (GdkWChar);
|
||||
|
||||
retval = MIN (dest_max, n_ucs4);
|
||||
memmove (dest, ucs4, retval * sizeof (GdkWChar));
|
||||
g_free (ucs4);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
+150
-55
@@ -77,6 +77,16 @@ static GdkWindow *wintab_window;
|
||||
|
||||
#endif /* HAVE_WINTAB */
|
||||
|
||||
#ifdef HAVE_SOME_XINPUT
|
||||
|
||||
static GdkWindow *x_grab_window = NULL; /* Window that currently holds
|
||||
* the extended inputs grab
|
||||
*/
|
||||
static GdkEventMask x_grab_mask;
|
||||
static gboolean x_grab_owner_events;
|
||||
|
||||
#endif /* HAVE_SOME_XINPUT */
|
||||
|
||||
#ifdef HAVE_WINTAB
|
||||
|
||||
static GdkDevicePrivate *
|
||||
@@ -109,7 +119,6 @@ print_lc(LOGCONTEXT *lc)
|
||||
if (lc->lcOptions & CXO_MARGIN) g_print (" CXO_MARGIN");
|
||||
if (lc->lcOptions & CXO_MGNINSIDE) g_print (" CXO_MGNINSIDE");
|
||||
if (lc->lcOptions & CXO_CSRMESSAGES) g_print (" CXO_CSRMESSAGES");
|
||||
if (lc->lcOptions & CXO_CSRMESSAGES) g_print (" CXO_CSRMESSAGES");
|
||||
g_print ("\n");
|
||||
g_print ("lcStatus =");
|
||||
if (lc->lcStatus & CXS_DISABLED) g_print (" CXS_DISABLED");
|
||||
@@ -297,7 +306,8 @@ gdk_input_wintab_init (void)
|
||||
WTInfo (WTI_DDCTXS + devix, CTX_SENSY, &lc.lcSensY);
|
||||
WTInfo (WTI_DDCTXS + devix, CTX_SENSZ, &lc.lcSensZ);
|
||||
WTInfo (WTI_DDCTXS + devix, CTX_SYSMODE, &lc.lcSysMode);
|
||||
lc.lcSysOrgX = lc.lcSysOrgY = 0;
|
||||
WTInfo (WTI_DDCTXS + devix, CTX_SYSORGX, &lc.lcSysOrgX);
|
||||
WTInfo (WTI_DDCTXS + devix, CTX_SYSORGY, &lc.lcSysOrgY);
|
||||
WTInfo (WTI_DDCTXS + devix, CTX_SYSEXTX, &lc.lcSysExtX);
|
||||
WTInfo (WTI_DDCTXS + devix, CTX_SYSEXTY, &lc.lcSysExtY);
|
||||
WTInfo (WTI_DDCTXS + devix, CTX_SYSSENSX, &lc.lcSysSensX);
|
||||
@@ -346,6 +356,20 @@ gdk_input_wintab_init (void)
|
||||
GDK_NOTE (INPUT, (g_print("context for device %d after WTOpen:\n", devix),
|
||||
print_lc(&lc)));
|
||||
#endif
|
||||
/* Increase packet queue size to reduce the risk of lost packets */
|
||||
/* According to the specs, if the function fails we must try again */
|
||||
/* with a smaller queue size */
|
||||
GDK_NOTE (INPUT, g_print("Attempting to increase queue size\n"));
|
||||
for (i = 128; i >= 1; i >>= 1)
|
||||
{
|
||||
if (WTQueueSizeSet(*hctx, i))
|
||||
{
|
||||
GDK_NOTE (INPUT, g_print("Queue size set to %d\n", i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!i)
|
||||
GDK_NOTE (INPUT, g_print("Whoops, no queue size could be set\n"));
|
||||
for (cursorix = firstcsr; cursorix < firstcsr + ncsrtypes; cursorix++)
|
||||
{
|
||||
active = FALSE;
|
||||
@@ -399,7 +423,7 @@ gdk_input_wintab_init (void)
|
||||
gdkdev->axes[k].max_value = axis_x.axMax;
|
||||
gdkdev->info.axes[k].use = GDK_AXIS_X;
|
||||
gdkdev->info.axes[k].min = axis_x.axMin;
|
||||
gdkdev->info.axes[k].min = axis_x.axMax;
|
||||
gdkdev->info.axes[k].max = axis_x.axMax;
|
||||
k++;
|
||||
}
|
||||
if (gdkdev->pktdata & PK_Y)
|
||||
@@ -412,7 +436,7 @@ gdk_input_wintab_init (void)
|
||||
gdkdev->axes[k].max_value = axis_y.axMax;
|
||||
gdkdev->info.axes[k].use = GDK_AXIS_Y;
|
||||
gdkdev->info.axes[k].min = axis_y.axMin;
|
||||
gdkdev->info.axes[k].min = axis_y.axMax;
|
||||
gdkdev->info.axes[k].max = axis_y.axMax;
|
||||
k++;
|
||||
}
|
||||
if (gdkdev->pktdata & PK_NORMAL_PRESSURE)
|
||||
@@ -424,8 +448,9 @@ gdk_input_wintab_init (void)
|
||||
gdkdev->axes[k].xmax_value =
|
||||
gdkdev->axes[k].max_value = axis_npressure.axMax;
|
||||
gdkdev->info.axes[k].use = GDK_AXIS_PRESSURE;
|
||||
gdkdev->info.axes[k].min = axis_npressure.axMin;
|
||||
gdkdev->info.axes[k].min = axis_npressure.axMax;
|
||||
/* GIMP seems to expect values in the range 0-1 */
|
||||
gdkdev->info.axes[k].min = 0.0; /*axis_npressure.axMin;*/
|
||||
gdkdev->info.axes[k].max = 1.0; /*axis_npressure.axMax;*/
|
||||
k++;
|
||||
}
|
||||
if (gdkdev->pktdata & PK_ORIENTATION)
|
||||
@@ -447,7 +472,7 @@ gdk_input_wintab_init (void)
|
||||
gdkdev->axes[k].max_value = 1000;
|
||||
gdkdev->info.axes[k].use = axis;
|
||||
gdkdev->info.axes[k].min = -1000;
|
||||
gdkdev->info.axes[k].min = 1000;
|
||||
gdkdev->info.axes[k].max = 1000;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
@@ -533,7 +558,7 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
|
||||
gdouble *x_out,
|
||||
gdouble *y_out)
|
||||
{
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkWindowImplWin32 *impl, *root_impl;
|
||||
|
||||
int i;
|
||||
int x_axis = 0;
|
||||
@@ -566,8 +591,9 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
|
||||
|
||||
if (gdkdev->info.mode == GDK_MODE_SCREEN)
|
||||
{
|
||||
x_scale = GetSystemMetrics (SM_CXSCREEN) / device_width;
|
||||
y_scale = GetSystemMetrics (SM_CYSCREEN) / device_height;
|
||||
root_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (_gdk_parent_root)->impl);
|
||||
x_scale = root_impl->width / device_width;
|
||||
y_scale = root_impl->height / device_height;
|
||||
|
||||
x_offset = - input_window->root_x;
|
||||
y_offset = - input_window->root_y;
|
||||
@@ -634,9 +660,9 @@ gdk_input_get_root_relative_geometry (HWND w,
|
||||
GetWindowRect (w, &rect);
|
||||
|
||||
if (x_ret)
|
||||
*x_ret = rect.left;
|
||||
*x_ret = rect.left + _gdk_offset_x;
|
||||
if (y_ret)
|
||||
*y_ret = rect.top;
|
||||
*y_ret = rect.top + _gdk_offset_y;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -670,6 +696,31 @@ _gdk_input_enter_event (GdkWindow *window)
|
||||
input_window->root_y = root_y;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the currently active keyboard modifiers (ignoring the mouse buttons)
|
||||
* We could use gdk_window_get_pointer but that function does a lot of other
|
||||
* expensive things besides getting the modifiers. This code is somewhat based
|
||||
* on build_pointer_event_state from gdkevents-win32.c
|
||||
*/
|
||||
static guint
|
||||
get_modifier_key_state (void)
|
||||
{
|
||||
guint state;
|
||||
|
||||
state = 0;
|
||||
/* High-order bit is up/down, low order bit is toggled/untoggled */
|
||||
if (GetKeyState (VK_CONTROL) < 0)
|
||||
state |= GDK_CONTROL_MASK;
|
||||
if (GetKeyState (VK_SHIFT) < 0)
|
||||
state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
state |= GDK_LOCK_MASK;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_input_other_event (GdkEvent *event,
|
||||
MSG *msg,
|
||||
@@ -680,11 +731,11 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
GdkWindow *current_window;
|
||||
#endif
|
||||
GdkDisplay *display;
|
||||
GdkWindowObject *obj;
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkWindowObject *obj, *grab_obj;
|
||||
GdkInputWindow *input_window;
|
||||
GdkDevicePrivate *gdkdev = NULL;
|
||||
GdkEventMask masktest;
|
||||
guint key_state;
|
||||
POINT pt;
|
||||
|
||||
PACKET packet;
|
||||
@@ -727,12 +778,18 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
}
|
||||
|
||||
obj = GDK_WINDOW_OBJECT (window);
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
|
||||
|
||||
switch (msg->message)
|
||||
{
|
||||
case WT_PACKET:
|
||||
if (window == _gdk_parent_root)
|
||||
/* Don't produce any button or motion events while a window is being
|
||||
* moved or resized, see bug #151090. */
|
||||
if (_sizemove_in_progress)
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...ignored when moving/sizing\n"));
|
||||
return FALSE;
|
||||
}
|
||||
if (window == _gdk_parent_root && x_grab_window == NULL)
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...is root\n"));
|
||||
return FALSE;
|
||||
@@ -791,17 +848,46 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON3_MOTION_MASK;
|
||||
}
|
||||
|
||||
/* See if input is grabbed */
|
||||
/* FIXME: x_grab_owner_events should probably be handled somehow */
|
||||
if (x_grab_window != NULL)
|
||||
{
|
||||
grab_obj = GDK_WINDOW_OBJECT (x_grab_window);
|
||||
if (!GDK_WINDOW_IMPL_WIN32 (grab_obj->impl)->extension_events_selected
|
||||
|| !(grab_obj->extension_events & masktest)
|
||||
|| !(x_grab_mask && masktest))
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("...grabber doesn't want it\n"));
|
||||
return FALSE;
|
||||
}
|
||||
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...to grabber\n"));
|
||||
|
||||
g_object_ref(x_grab_window);
|
||||
g_object_unref(window);
|
||||
window = x_grab_window;
|
||||
obj = grab_obj;
|
||||
}
|
||||
/* Now we can check if the window wants the event, and
|
||||
* propagate if necessary.
|
||||
*/
|
||||
dijkstra:
|
||||
if (!impl->extension_events_selected
|
||||
if (!GDK_WINDOW_IMPL_WIN32 (obj->impl)->extension_events_selected
|
||||
|| !(obj->extension_events & masktest))
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...not selected\n"));
|
||||
|
||||
if (obj->parent == GDK_WINDOW_OBJECT (_gdk_parent_root))
|
||||
return FALSE;
|
||||
|
||||
/* It is not good to propagate the extended events up to the parent
|
||||
* if this window wants normal (not extended) motion/button events */
|
||||
if (obj->event_mask & masktest)
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("...wants ordinary event, ignoring this\n"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pt.x = x;
|
||||
pt.y = y;
|
||||
@@ -827,7 +913,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
return FALSE;
|
||||
|
||||
event->any.window = window;
|
||||
|
||||
key_state = get_modifier_key_state ();
|
||||
if (event->any.type == GDK_BUTTON_PRESS
|
||||
|| event->any.type == GDK_BUTTON_RELEASE)
|
||||
{
|
||||
@@ -841,16 +927,24 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
return FALSE;
|
||||
#endif
|
||||
#endif
|
||||
event->button.axes = g_new(gdouble, gdkdev->info.num_axes);
|
||||
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
gdkdev->last_axis_data,
|
||||
event->button.axes,
|
||||
&event->button.x,
|
||||
&event->button.y);
|
||||
|
||||
/* Also calculate root coordinates. Note that input_window->root_x
|
||||
is in GDK root coordinates. */
|
||||
event->button.x_root = event->button.x + input_window->root_x;
|
||||
event->button.y_root = event->button.y + input_window->root_y;
|
||||
|
||||
event->button.state = ((gdkdev->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
| GDK_BUTTON5_MASK))
|
||||
| key_state;
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB button %s:%d %g,%g\n",
|
||||
(event->button.type == GDK_BUTTON_PRESS ?
|
||||
@@ -864,16 +958,24 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.device = &gdkdev->info;
|
||||
|
||||
event->motion.axes = g_new(gdouble, gdkdev->info.num_axes);
|
||||
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
gdkdev->last_axis_data,
|
||||
event->motion.axes,
|
||||
&event->motion.x,
|
||||
&event->motion.y);
|
||||
|
||||
/* Also calculate root coordinates. Note that input_window->root_x
|
||||
is in GDK root coordinates. */
|
||||
event->motion.x_root = event->motion.x + input_window->root_x;
|
||||
event->motion.y_root = event->motion.y + input_window->root_y;
|
||||
|
||||
event->motion.state = ((gdkdev->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
| GDK_BUTTON5_MASK))
|
||||
| key_state;
|
||||
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB motion: %g,%g\n",
|
||||
@@ -885,7 +987,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
*/
|
||||
if ((gdkdev->pktdata & PK_NORMAL_PRESSURE
|
||||
&& (event->motion.state & GDK_BUTTON1_MASK)
|
||||
&& packet.pkNormalPressure <= MAX (0, gdkdev->npbtnmarks[0] - 2))
|
||||
&& packet.pkNormalPressure <= MAX (0, (gint) gdkdev->npbtnmarks[0] - 2))
|
||||
|| (gdkdev->pktdata & PK_NORMAL_PRESSURE
|
||||
&& !(event->motion.state & GDK_BUTTON1_MASK)
|
||||
&& packet.pkNormalPressure > gdkdev->npbtnmarks[1] + 2))
|
||||
@@ -904,7 +1006,8 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event2->button.state = ((gdkdev->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
| GDK_BUTTON5_MASK))
|
||||
| key_state;
|
||||
event2->button.button = 1;
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB synthesized button %s: %d %g,%gg\n",
|
||||
@@ -1008,6 +1111,11 @@ _gdk_input_grab_pointer (GdkWindow *window,
|
||||
if (new_window)
|
||||
{
|
||||
new_window->grabbed = TRUE;
|
||||
x_grab_window = window;
|
||||
x_grab_mask = event_mask;
|
||||
x_grab_owner_events = owner_events;
|
||||
|
||||
/* FIXME: Do we need to handle confine_to and time? */
|
||||
|
||||
tmp_list = _gdk_input_devices;
|
||||
while (tmp_list)
|
||||
@@ -1037,6 +1145,7 @@ _gdk_input_grab_pointer (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
x_grab_window = NULL;
|
||||
tmp_list = _gdk_input_devices;
|
||||
while (tmp_list)
|
||||
{
|
||||
@@ -1094,6 +1203,7 @@ _gdk_input_ungrab_pointer (guint32 time)
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
x_grab_window = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1134,42 +1244,27 @@ gdk_device_get_state (GdkDevice *device,
|
||||
GdkDevicePrivate *gdkdev;
|
||||
GdkInputWindow *input_window;
|
||||
|
||||
if (mask)
|
||||
gdk_window_get_pointer (window, NULL, NULL, mask);
|
||||
|
||||
gdkdev = (GdkDevicePrivate *)device;
|
||||
/* For now just use the last known button and axis state of the device.
|
||||
* Since graphical tablets send an insane amount of motion events each
|
||||
* second, the info should be fairly up to date */
|
||||
if (mask)
|
||||
{
|
||||
gdk_window_get_pointer (window, NULL, NULL, mask);
|
||||
*mask &= 0xFF; /* Mask away core pointer buttons */
|
||||
*mask |= ((gdkdev->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
}
|
||||
input_window = _gdk_input_window_find (window);
|
||||
g_return_if_fail (input_window != NULL);
|
||||
|
||||
#if 0 /* FIXME */
|
||||
state = XQueryDeviceState (gdk_display, gdkdev->xdevice);
|
||||
input_class = state->data;
|
||||
for (i = 0; i < state->num_classes; i++)
|
||||
{
|
||||
switch (input_class->class)
|
||||
{
|
||||
case ValuatorClass:
|
||||
if (axes)
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
((XValuatorState *)input_class)->valuators,
|
||||
axes, NULL, NULL);
|
||||
break;
|
||||
|
||||
case ButtonClass:
|
||||
if (mask)
|
||||
{
|
||||
*mask &= 0xFF;
|
||||
if (((XButtonState *)input_class)->num_buttons > 0)
|
||||
*mask |= ((XButtonState *)input_class)->buttons[0] << 7;
|
||||
/* GDK_BUTTON1_MASK = 1 << 8, and button n is stored
|
||||
* in bit 1<<(n%8) in byte n/8. n = 1,2,... */
|
||||
}
|
||||
break;
|
||||
}
|
||||
input_class = (XInputClass *)(((char *)input_class)+input_class->length);
|
||||
}
|
||||
XFreeDeviceState (state);
|
||||
#endif
|
||||
/* For some reason, input_window is sometimes NULL when I use The GIMP 2
|
||||
* (bug #141543?). Avoid crashing if debugging is disabled. */
|
||||
if (axes && gdkdev->last_axis_data && input_window)
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
gdkdev->last_axis_data,
|
||||
axes, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -203,8 +203,6 @@ update_keymap (void)
|
||||
*ksymp = GDK_KP_Separator; break;
|
||||
case VK_SUBTRACT:
|
||||
*ksymp = GDK_KP_Subtract; break;
|
||||
case VK_DECIMAL:
|
||||
*ksymp = GDK_KP_Decimal; break;
|
||||
case VK_DIVIDE:
|
||||
*ksymp = GDK_KP_Divide; break;
|
||||
case VK_F1:
|
||||
|
||||
@@ -115,8 +115,8 @@ _gdk_windowing_init (gint *argc,
|
||||
_cf_utf8_string = RegisterClipboardFormat ("UTF8_STRING");
|
||||
|
||||
_utf8_string = gdk_atom_intern ("UTF8_STRING", FALSE);
|
||||
_compound_text = gdk_atom_intern ("COMPOUND_TEXT", FALSE);
|
||||
_text_uri_list = gdk_atom_intern ("text/uri-list", FALSE);
|
||||
_targets = gdk_atom_intern ("TARGETS", FALSE);
|
||||
|
||||
_local_dnd = gdk_atom_intern ("LocalDndSelection", FALSE);
|
||||
_gdk_win32_dropfiles = gdk_atom_intern ("DROPFILES_DND", FALSE);
|
||||
|
||||
@@ -363,24 +363,10 @@ void _gdk_win32_adjust_client_rect (GdkWindow *window,
|
||||
void _gdk_win32_get_adjusted_client_rect (GdkWindow *window,
|
||||
RECT *RECT);
|
||||
|
||||
void _gdk_selection_property_store (GdkWindow *owner,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
guchar *data,
|
||||
gint length);
|
||||
|
||||
void _gdk_selection_property_delete (GdkWindow *);
|
||||
|
||||
void _gdk_dropfiles_store (gchar *data);
|
||||
|
||||
gint _gdk_utf8_to_ucs2 (wchar_t *dest,
|
||||
const gchar *src,
|
||||
gint src_len,
|
||||
gint dest_max);
|
||||
|
||||
gchar *_gdk_ucs2_to_utf8 (const wchar_t *src,
|
||||
gint src_len);
|
||||
|
||||
void _gdk_wchar_text_handle (GdkFont *font,
|
||||
const wchar_t *wcstr,
|
||||
int wclen,
|
||||
@@ -491,6 +477,7 @@ extern WORD _cf_utf8_string;
|
||||
extern GdkAtom _utf8_string;
|
||||
extern GdkAtom _compound_text;
|
||||
extern GdkAtom _text_uri_list;
|
||||
extern GdkAtom _targets;
|
||||
|
||||
/* DND selections */
|
||||
extern GdkAtom _local_dnd;
|
||||
@@ -510,8 +497,13 @@ extern gint _gdk_max_colors;
|
||||
|
||||
#define GDK_WIN32_COLORMAP_DATA(cmap) ((GdkColormapPrivateWin32 *) GDK_COLORMAP (cmap)->windowing_data)
|
||||
|
||||
/* TRUE while a user-initiated window move or resize operation is in progress */
|
||||
extern gboolean _sizemove_in_progress;
|
||||
|
||||
/* Initialization */
|
||||
void _gdk_windowing_window_init (void);
|
||||
void _gdk_root_window_size_init (void);
|
||||
void _gdk_monitor_init(void);
|
||||
void _gdk_visual_init (void);
|
||||
void _gdk_dnd_init (void);
|
||||
void _gdk_windowing_image_init (void);
|
||||
|
||||
@@ -198,12 +198,10 @@ find_common_locale (const guchar *data,
|
||||
* bytes for each Unicode char should be enough, Windows code pages
|
||||
* are either single- or double-byte.
|
||||
*/
|
||||
*bufp = g_malloc ((nchars+1) * 2);
|
||||
wcs = g_new (wchar_t, nchars+1);
|
||||
*bufp = g_malloc ((nchars+1)*2);
|
||||
|
||||
/* Convert to Windows wide chars into temp buf */
|
||||
_gdk_utf8_to_ucs2 (wcs, data, nelements, nchars);
|
||||
wcs[nchars] = 0;
|
||||
wcs = g_utf8_to_utf16 (data, nelements, NULL, NULL, NULL);
|
||||
|
||||
/* For each code page that is the default for an installed locale: */
|
||||
for (i = 0; i < G_N_ELEMENTS (locales); i++)
|
||||
@@ -254,7 +252,8 @@ gdk_property_change (GdkWindow *window,
|
||||
gchar *prop_name, *type_name;
|
||||
guchar *ucptr, *buf = NULL;
|
||||
wchar_t *wcptr;
|
||||
enum { PLAIN_ASCII, UNICODE_TEXT, SINGLE_LOCALE, RICH_TEXT } method;
|
||||
glong wclen;
|
||||
enum { SYSTEM_CODEPAGE, UNICODE_TEXT, SINGLE_LOCALE, RICH_TEXT } method;
|
||||
gboolean ok = TRUE;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
@@ -279,7 +278,8 @@ gdk_property_change (GdkWindow *window,
|
||||
g_free (type_name)));
|
||||
|
||||
if (property == _gdk_selection_property
|
||||
&& type == GDK_TARGET_STRING
|
||||
&& ((type == GDK_TARGET_STRING && GetACP () == 1252) ||
|
||||
type == _utf8_string)
|
||||
&& format == 8
|
||||
&& mode == GDK_PROP_MODE_REPLACE)
|
||||
{
|
||||
@@ -289,22 +289,31 @@ gdk_property_change (GdkWindow *window,
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if only ASCII */
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200)
|
||||
break;
|
||||
if (type == _utf8_string)
|
||||
{
|
||||
/* Check if only ASCII */
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200)
|
||||
break;
|
||||
}
|
||||
else /* if (type == GDK_TARGET_STRING) */
|
||||
{
|
||||
/* Check that no 0200..0240 chars present, as they
|
||||
* differ between ISO-8859-1 and CP1252.
|
||||
*/
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200 && data[i] < 0240)
|
||||
break;
|
||||
}
|
||||
nchars = g_utf8_strlen (data, nelements);
|
||||
|
||||
if (i == nelements)
|
||||
nchars = nelements;
|
||||
else
|
||||
nchars = g_utf8_strlen (data, nelements);
|
||||
|
||||
GDK_NOTE (DND, g_print ("...nchars:%d\n", nchars));
|
||||
|
||||
if (i == nelements)
|
||||
{
|
||||
/* If only ASCII, use CF_TEXT and the data as such. */
|
||||
method = PLAIN_ASCII;
|
||||
/* If UTF-8 and only ASCII, or if STRING (ISO-8859-1) and
|
||||
* system codepage is CP1252, use CF_TEXT and the data as
|
||||
* such.
|
||||
*/
|
||||
method = SYSTEM_CODEPAGE;
|
||||
size = nelements;
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] == '\n')
|
||||
@@ -314,9 +323,15 @@ gdk_property_change (GdkWindow *window,
|
||||
}
|
||||
else if (IS_WIN_NT ())
|
||||
{
|
||||
/* On NT, use CF_UNICODETEXT if any non-ASCII char present */
|
||||
/* On NT, use CF_UNICODETEXT if any non-system codepage char
|
||||
* present.
|
||||
*/
|
||||
method = UNICODE_TEXT;
|
||||
size = (nchars + 1) * 2;
|
||||
|
||||
wcptr = g_utf8_to_utf16 (data, nelements, NULL, &wclen, NULL);
|
||||
|
||||
wclen++; /* Terminating 0 */
|
||||
size = wclen * 2;
|
||||
GDK_NOTE (DND, g_print ("...as Unicode\n"));
|
||||
}
|
||||
else if (find_common_locale (data, nelements, nchars, &lcid, &buf, &size))
|
||||
@@ -347,7 +362,7 @@ gdk_property_change (GdkWindow *window,
|
||||
rtf = g_string_append_c (rtf, *p);
|
||||
p++;
|
||||
}
|
||||
else if (*p < 0200)
|
||||
else if (*p < 0200 && *p >= ' ')
|
||||
{
|
||||
rtf = g_string_append_c (rtf, *p);
|
||||
p++;
|
||||
@@ -388,7 +403,7 @@ gdk_property_change (GdkWindow *window,
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case PLAIN_ASCII:
|
||||
case SYSTEM_CODEPAGE:
|
||||
cf = CF_TEXT;
|
||||
for (i = 0; i < nelements; i++)
|
||||
{
|
||||
@@ -401,10 +416,8 @@ gdk_property_change (GdkWindow *window,
|
||||
|
||||
case UNICODE_TEXT:
|
||||
cf = CF_UNICODETEXT;
|
||||
wcptr = (wchar_t *) ucptr;
|
||||
if (_gdk_utf8_to_ucs2 (wcptr, data, nelements, nchars) == -1)
|
||||
g_warning ("_gdk_utf8_to_ucs2() failed");
|
||||
wcptr[nchars] = 0;
|
||||
memmove (ucptr, wcptr, size);
|
||||
g_free (wcptr);
|
||||
break;
|
||||
|
||||
case SINGLE_LOCALE:
|
||||
|
||||
+230
-226
@@ -41,7 +41,7 @@
|
||||
|
||||
typedef struct {
|
||||
guchar *data;
|
||||
gint length;
|
||||
gsize length;
|
||||
gint format;
|
||||
GdkAtom type;
|
||||
} GdkSelProp;
|
||||
@@ -62,7 +62,73 @@ _gdk_win32_selection_init (void)
|
||||
sel_owner_table = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
/* The specifications for COMPOUND_TEXT and STRING specify that C0 and
|
||||
* C1 are not allowed except for \n and \t, however the X conversions
|
||||
* routines for COMPOUND_TEXT only enforce this in one direction,
|
||||
* causing cut-and-paste of \r and \r\n separated text to fail.
|
||||
* This routine strips out all non-allowed C0 and C1 characters
|
||||
* from the input string and also canonicalizes \r, and \r\n to \n
|
||||
*/
|
||||
static gchar *
|
||||
sanitize_utf8 (const gchar *src,
|
||||
gint length)
|
||||
{
|
||||
GString *result = g_string_sized_new (length + 1);
|
||||
const gchar *p = src;
|
||||
const gchar *endp = src + length;
|
||||
|
||||
while (p < endp)
|
||||
{
|
||||
if (*p == '\r')
|
||||
{
|
||||
p++;
|
||||
if (*p == '\n')
|
||||
p++;
|
||||
|
||||
g_string_append_c (result, '\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
gunichar ch = g_utf8_get_char (p);
|
||||
char buf[7];
|
||||
gint buflen;
|
||||
|
||||
if (!((ch < 0x20 && ch != '\t' && ch != '\n') || (ch >= 0x7f && ch < 0xa0)))
|
||||
{
|
||||
buflen = g_unichar_to_utf8 (ch, buf);
|
||||
g_string_append_len (result, buf, buflen);
|
||||
}
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
}
|
||||
}
|
||||
g_string_append_c (result, '\0');
|
||||
|
||||
return g_string_free (result, FALSE);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
_gdk_utf8_to_string_target_internal (const gchar *str,
|
||||
gint length)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
gchar *tmp_str = sanitize_utf8 (str, length);
|
||||
gchar *result = g_convert_with_fallback (tmp_str, -1,
|
||||
"ISO-8859-1", "UTF-8",
|
||||
NULL, NULL, NULL, &error);
|
||||
if (!result)
|
||||
{
|
||||
g_warning ("Error converting from UTF-8 to STRING: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
g_free (tmp_str);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_selection_property_store (GdkWindow *owner,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
@@ -78,8 +144,27 @@ _gdk_selection_property_store (GdkWindow *owner,
|
||||
g_hash_table_remove (sel_prop_table, GDK_WINDOW_HWND (owner));
|
||||
}
|
||||
prop = g_new (GdkSelProp, 1);
|
||||
prop->data = data;
|
||||
prop->length = length;
|
||||
|
||||
if (type == GDK_TARGET_STRING)
|
||||
{
|
||||
/* We know that data is UTF-8 */
|
||||
prop->data = _gdk_utf8_to_string_target_internal (data, length);
|
||||
g_free (data);
|
||||
|
||||
if (!prop->data)
|
||||
{
|
||||
g_free (prop);
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
prop->length = strlen (prop->data) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
prop->data = data;
|
||||
prop->length = length;
|
||||
}
|
||||
prop->format = format;
|
||||
prop->type = type;
|
||||
g_hash_table_insert (sel_prop_table, GDK_WINDOW_HWND (owner), prop);
|
||||
@@ -120,7 +205,8 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
|
||||
GdkEvent tmp_event;
|
||||
gchar *sel_name;
|
||||
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), FALSE);
|
||||
g_return_val_if_fail (display == _gdk_display, FALSE);
|
||||
g_return_val_if_fail (selection != GDK_NONE, FALSE);
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
@@ -176,7 +262,7 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
|
||||
tmp_event.selection.window = owner;
|
||||
tmp_event.selection.send_event = FALSE;
|
||||
tmp_event.selection.selection = selection;
|
||||
tmp_event.selection.target = GDK_TARGET_STRING;
|
||||
tmp_event.selection.target = _utf8_string;
|
||||
tmp_event.selection.property = _gdk_selection_property;
|
||||
tmp_event.selection.requestor = (guint32) hwnd;
|
||||
tmp_event.selection.time = time;
|
||||
@@ -194,12 +280,13 @@ gdk_selection_owner_get_for_display (GdkDisplay *display,
|
||||
GdkWindow *window;
|
||||
gchar *sel_name;
|
||||
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
g_return_val_if_fail (selection != GDK_NONE, NULL);
|
||||
|
||||
/* Return NULL for CLIPBOARD, because otherwise cut&paste
|
||||
* inside the same application doesn't work. We must pretend to gtk
|
||||
* that we don't have the selection, so that we always fetch it from
|
||||
* the Windows clipboard. See also comments in
|
||||
/* Return NULL for CLIPBOARD, because otherwise cut&paste inside the
|
||||
* same application doesn't work. We must pretend to gtk that we
|
||||
* don't have the selection, so that we always fetch it from the
|
||||
* Windows clipboard. See also comments in
|
||||
* gdk_selection_send_notify().
|
||||
*/
|
||||
if (selection == GDK_SELECTION_CLIPBOARD)
|
||||
@@ -247,8 +334,11 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
HGLOBAL hdata;
|
||||
GdkAtom property = _gdk_selection_property;
|
||||
gchar *sel_name, *tgt_name;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_if_fail (selection != GDK_NONE);
|
||||
g_return_if_fail (requestor != NULL);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (requestor))
|
||||
return;
|
||||
|
||||
@@ -262,8 +352,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
g_free (sel_name),
|
||||
g_free (tgt_name)));
|
||||
|
||||
if (selection == GDK_SELECTION_CLIPBOARD &&
|
||||
target == gdk_atom_intern ("TARGETS", FALSE))
|
||||
if (selection == GDK_SELECTION_CLIPBOARD && target == _targets)
|
||||
{
|
||||
/* He wants to know what formats are on the clipboard. If there
|
||||
* is some kind of text, tell him so.
|
||||
@@ -276,7 +365,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
IsClipboardFormatAvailable (CF_TEXT))
|
||||
{
|
||||
GdkAtom *data = g_new (GdkAtom, 1);
|
||||
*data = GDK_TARGET_STRING;
|
||||
*data = _utf8_string;
|
||||
_gdk_selection_property_store (requestor, GDK_SELECTION_TYPE_ATOM,
|
||||
32, (guchar *) data, 1 * sizeof (GdkAtom));
|
||||
}
|
||||
@@ -286,36 +375,36 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
API_CALL (CloseClipboard, ());
|
||||
}
|
||||
else if (selection == GDK_SELECTION_CLIPBOARD &&
|
||||
(target == _compound_text ||
|
||||
target == GDK_TARGET_STRING))
|
||||
(target == GDK_TARGET_STRING ||
|
||||
target == _utf8_string))
|
||||
{
|
||||
/* Converting the CLIPBOARD selection means he wants the
|
||||
* contents of the clipboard. Get the clipboard data,
|
||||
* and store it for later.
|
||||
* contents of the clipboard. Get the clipboard data, and store
|
||||
* it for later.
|
||||
*/
|
||||
if (!API_CALL (OpenClipboard, (GDK_WINDOW_HWND (requestor))))
|
||||
return;
|
||||
|
||||
/* Try various formats. First the simplest, CF_UNICODETEXT. */
|
||||
if ((hdata = GetClipboardData (CF_UNICODETEXT)) != NULL)
|
||||
if (IS_WIN_NT () && (hdata = GetClipboardData (CF_UNICODETEXT)) != NULL)
|
||||
{
|
||||
wchar_t *ptr, *wcs, *p, *q;
|
||||
guchar *data;
|
||||
gint length, wclen;
|
||||
glong length, wclen;
|
||||
|
||||
if ((ptr = GlobalLock (hdata)) != NULL)
|
||||
{
|
||||
length = GlobalSize (hdata);
|
||||
|
||||
GDK_NOTE (DND, g_print ("...CF_UNICODETEXT: %d bytes\n",
|
||||
GDK_NOTE (DND, g_print ("...CF_UNICODETEXT: %ld bytes\n",
|
||||
length));
|
||||
|
||||
/* Strip out \r */
|
||||
wcs = g_new (wchar_t, (length + 1) * 2);
|
||||
wcs = g_new (wchar_t, length / 2 + 1);
|
||||
p = ptr;
|
||||
q = wcs;
|
||||
wclen = 0;
|
||||
while (*p)
|
||||
while (p < ptr + length / 2)
|
||||
{
|
||||
if (*p != '\r')
|
||||
{
|
||||
@@ -325,11 +414,16 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
p++;
|
||||
}
|
||||
|
||||
data = _gdk_ucs2_to_utf8 (wcs, wclen);
|
||||
data = g_utf16_to_utf8 (wcs, wclen, NULL, NULL, &error);
|
||||
g_free (wcs);
|
||||
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, strlen (data) + 1);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, strlen (data) + 1);
|
||||
GlobalUnlock (hdata);
|
||||
}
|
||||
}
|
||||
@@ -347,7 +441,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
length, ptr));
|
||||
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
g_strdup (ptr), strlen (ptr) + 1);
|
||||
g_memdup (ptr, length), length);
|
||||
GlobalUnlock (hdata);
|
||||
}
|
||||
}
|
||||
@@ -361,13 +455,13 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
UINT cp = CP_ACP;
|
||||
wchar_t *wcs, *wcs2, *p, *q;
|
||||
guchar *ptr, *data;
|
||||
gint length, wclen;
|
||||
glong length, wclen, wclen2;
|
||||
|
||||
if ((ptr = GlobalLock (hdata)) != NULL)
|
||||
{
|
||||
length = GlobalSize (hdata);
|
||||
|
||||
GDK_NOTE (DND, g_print ("...CF_TEXT: %d bytes: %.10s\n",
|
||||
GDK_NOTE (DND, g_print ("...CF_TEXT: %ld bytes: %.10s\n",
|
||||
length, ptr));
|
||||
|
||||
if ((hlcid = GetClipboardData (CF_LOCALE)) != NULL)
|
||||
@@ -385,30 +479,33 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
}
|
||||
|
||||
wcs = g_new (wchar_t, length + 1);
|
||||
wclen = MultiByteToWideChar (cp, 0, ptr, -1,
|
||||
wclen = MultiByteToWideChar (cp, 0, ptr, length,
|
||||
wcs, length + 1);
|
||||
|
||||
/* Strip out \r */
|
||||
wcs2 = g_new (wchar_t, wclen);
|
||||
p = wcs;
|
||||
q = wcs2;
|
||||
wclen = 0;
|
||||
while (*p)
|
||||
wclen2 = 0;
|
||||
while (p < wcs + wclen)
|
||||
{
|
||||
if (*p != '\r')
|
||||
{
|
||||
*q++ = *p;
|
||||
wclen++;
|
||||
wclen2++;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
g_free (wcs);
|
||||
|
||||
data = _gdk_ucs2_to_utf8 (wcs2, wclen);
|
||||
data = g_utf16_to_utf8 (wcs2, wclen2, NULL, &length, &error);
|
||||
g_free (wcs2);
|
||||
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, strlen (data) + 1);
|
||||
|
||||
if (!data)
|
||||
g_error_free (error);
|
||||
else
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, length + 1);
|
||||
GlobalUnlock (hdata);
|
||||
}
|
||||
}
|
||||
@@ -498,16 +595,16 @@ _gdk_selection_property_delete (GdkWindow *window)
|
||||
|
||||
void
|
||||
gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
guint32 requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
guint32 requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
{
|
||||
GdkEvent tmp_event;
|
||||
gchar *sel_name, *tgt_name, *prop_name;
|
||||
|
||||
g_return_if_fail (display == gdk_display_get_default ());
|
||||
g_return_if_fail (display == _gdk_display);
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
@@ -522,12 +619,13 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
g_free (tgt_name),
|
||||
g_free (prop_name)));
|
||||
|
||||
/* Send ourselves a selection clear message so that gtk thinks we don't
|
||||
* have the selection, and will claim it anew when needed, and
|
||||
/* Send ourselves a selection clear message so that gtk thinks we
|
||||
* don't have the selection, and will claim it anew when needed, and
|
||||
* we thus get a chance to store data in the Windows clipboard.
|
||||
* Otherwise, if a gtkeditable does a copy to CLIPBOARD several times
|
||||
* only the first one actually gets copied to the Windows clipboard,
|
||||
* as only the first one causes a call to gdk_property_change().
|
||||
* Otherwise, if a gtkeditable does a copy to CLIPBOARD several
|
||||
* times only the first one actually gets copied to the Windows
|
||||
* clipboard, as only the first one causes a call to
|
||||
* gdk_property_change().
|
||||
*
|
||||
* Hmm, there is something fishy with this. Cut and paste inside the
|
||||
* same app didn't work, the gtkeditable immediately forgot the
|
||||
@@ -548,19 +646,25 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
gdk_event_put (&tmp_event);
|
||||
}
|
||||
|
||||
/* Simplistic implementations of text list and compound text functions */
|
||||
|
||||
/* It's hard to say whether implementing this actually is of any use
|
||||
* on the Win32 platform? gtk calls only
|
||||
* gdk_text_property_to_utf8_list_for_display().
|
||||
*/
|
||||
gint
|
||||
gdk_text_property_to_text_list_for_display (GdkDisplay *display,
|
||||
gdk_text_property_to_text_list_for_display (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gchar *enc_name;
|
||||
gchar *result;
|
||||
const gchar *charset;
|
||||
const gchar *source_charset = NULL;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
g_return_val_if_fail (display == _gdk_display, 0);
|
||||
|
||||
GDK_NOTE (DND, (enc_name = gdk_atom_name (encoding),
|
||||
g_print ("gdk_text_property_to_text_list: %s %d %.20s %d\n",
|
||||
@@ -570,8 +674,25 @@ gdk_text_property_to_text_list_for_display (GdkDisplay *display,
|
||||
if (!list)
|
||||
return 0;
|
||||
|
||||
if (encoding == GDK_TARGET_STRING)
|
||||
source_charset = "ISO-8859-1";
|
||||
else if (encoding == _utf8_string)
|
||||
source_charset = "UTF-8";
|
||||
else
|
||||
source_charset = gdk_atom_name (encoding);
|
||||
|
||||
g_get_charset (&charset);
|
||||
|
||||
result = g_convert (text, length, charset, source_charset,
|
||||
NULL, NULL, &error);
|
||||
if (!result)
|
||||
{
|
||||
g_error_free (error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*list = g_new (gchar *, 1);
|
||||
**list = g_strdup (text);
|
||||
**list = result;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -585,47 +706,6 @@ gdk_free_text_list (gchar **list)
|
||||
g_free (list);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_string_to_compound_text_for_display (GdkDisplay *display,
|
||||
const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
{
|
||||
g_return_val_if_fail (str != NULL, 0);
|
||||
g_return_val_if_fail (length >= 0, 0);
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
|
||||
GDK_NOTE (DND, g_print ("gdk_string_to_compound_text: %.20s\n", str));
|
||||
|
||||
if (encoding)
|
||||
*encoding = _compound_text;
|
||||
|
||||
if (format)
|
||||
*format = 8;
|
||||
|
||||
if (ctext)
|
||||
*ctext = g_strdup (str);
|
||||
|
||||
if (length)
|
||||
*length = strlen (str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_free_compound_text (guchar *ctext)
|
||||
{
|
||||
g_free (ctext);
|
||||
}
|
||||
|
||||
/* These are lifted from gdkselection-x11.c, just to get GTK+ to build.
|
||||
* These functions probably don't make much sense at all in Windows.
|
||||
*/
|
||||
|
||||
/* FIXME */
|
||||
|
||||
static gint
|
||||
make_list (const gchar *text,
|
||||
gint length,
|
||||
@@ -705,7 +785,7 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
||||
{
|
||||
g_return_val_if_fail (text != NULL, 0);
|
||||
g_return_val_if_fail (length >= 0, 0);
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), 0);
|
||||
g_return_val_if_fail (display == _gdk_display, 0);
|
||||
|
||||
if (encoding == GDK_TARGET_STRING)
|
||||
{
|
||||
@@ -717,164 +797,88 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar **local_list;
|
||||
gint local_count;
|
||||
gint i;
|
||||
const gchar *charset = NULL;
|
||||
gboolean need_conversion = g_get_charset (&charset);
|
||||
gint count = 0;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Probably COMPOUND text, we fall back to Xlib routines
|
||||
*/
|
||||
local_count = gdk_text_property_to_text_list (encoding,
|
||||
format,
|
||||
text,
|
||||
length,
|
||||
&local_list);
|
||||
if (list)
|
||||
*list = g_new (gchar *, local_count + 1);
|
||||
|
||||
for (i=0; i<local_count; i++)
|
||||
{
|
||||
/* list contains stuff in our default encoding
|
||||
*/
|
||||
if (need_conversion)
|
||||
{
|
||||
gchar *utf = g_convert (local_list[i], -1,
|
||||
"UTF-8", charset,
|
||||
NULL, NULL, &error);
|
||||
if (utf)
|
||||
{
|
||||
if (list)
|
||||
(*list)[count++] = utf;
|
||||
else
|
||||
g_free (utf);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Error converting to UTF-8 from '%s': %s",
|
||||
charset, error->message);
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (list)
|
||||
(*list)[count++] = g_strdup (local_list[i]);
|
||||
}
|
||||
}
|
||||
|
||||
gdk_free_text_list (local_list);
|
||||
(*list)[count] = NULL;
|
||||
g_warning ("gdk_text_property_to_utf8_list_for_display: encoding %s not handled\n", gdk_atom_name (encoding));
|
||||
|
||||
return count;
|
||||
if (list)
|
||||
*list = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* The specifications for COMPOUND_TEXT and STRING specify that C0 and
|
||||
* C1 are not allowed except for \n and \t, however the X conversions
|
||||
* routines for COMPOUND_TEXT only enforce this in one direction,
|
||||
* causing cut-and-paste of \r and \r\n separated text to fail.
|
||||
* This routine strips out all non-allowed C0 and C1 characters
|
||||
* from the input string and also canonicalizes \r, and \r\n to \n
|
||||
*/
|
||||
static gchar *
|
||||
sanitize_utf8 (const gchar *src)
|
||||
gint
|
||||
gdk_string_to_compound_text_for_display (GdkDisplay *display,
|
||||
const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
{
|
||||
gint len = strlen (src);
|
||||
GString *result = g_string_sized_new (len);
|
||||
const gchar *p = src;
|
||||
g_return_val_if_fail (str != NULL, 0);
|
||||
g_return_val_if_fail (length >= 0, 0);
|
||||
g_return_val_if_fail (display == _gdk_display, 0);
|
||||
|
||||
while (*p)
|
||||
{
|
||||
if (*p == '\r')
|
||||
{
|
||||
p++;
|
||||
if (*p == '\n')
|
||||
p++;
|
||||
GDK_NOTE (DND, g_print ("gdk_string_to_compound_text_for_display: %.20s\n", str));
|
||||
|
||||
g_string_append_c (result, '\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
gunichar ch = g_utf8_get_char (p);
|
||||
char buf[7];
|
||||
gint buflen;
|
||||
|
||||
if (!((ch < 0x20 && ch != '\t' && ch != '\n') || (ch >= 0x7f && ch < 0xa0)))
|
||||
{
|
||||
buflen = g_unichar_to_utf8 (ch, buf);
|
||||
g_string_append_len (result, buf, buflen);
|
||||
}
|
||||
/* Always fail on Win32. No COMPOUND_TEXT support. */
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
}
|
||||
}
|
||||
if (encoding)
|
||||
*encoding = GDK_NONE;
|
||||
|
||||
return g_string_free (result, FALSE);
|
||||
if (format)
|
||||
*format = 0;
|
||||
|
||||
if (ctext)
|
||||
*ctext = NULL;
|
||||
|
||||
if (length)
|
||||
*length = 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_utf8_to_string_target (const gchar *str)
|
||||
{
|
||||
return sanitize_utf8 (str);
|
||||
return _gdk_utf8_to_string_target_internal (str, strlen (str));
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
|
||||
gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
|
||||
const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
{
|
||||
gboolean need_conversion;
|
||||
const gchar *charset;
|
||||
gchar *locale_str, *tmp_str;
|
||||
GError *error = NULL;
|
||||
gboolean result;
|
||||
|
||||
g_return_val_if_fail (str != NULL, FALSE);
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), FALSE);
|
||||
g_return_val_if_fail (display == _gdk_display, FALSE);
|
||||
|
||||
need_conversion = !g_get_charset (&charset);
|
||||
GDK_NOTE (DND, g_print ("gdk_utf8_to_compound_text_for_display: %.20s\n", str));
|
||||
|
||||
tmp_str = sanitize_utf8 (str);
|
||||
/* Always fail on Win32. No COMPOUND_TEXT support. */
|
||||
|
||||
if (need_conversion)
|
||||
{
|
||||
locale_str = g_convert_with_fallback (tmp_str, -1,
|
||||
charset, "UTF-8",
|
||||
NULL, NULL, NULL, &error);
|
||||
g_free (tmp_str);
|
||||
if (encoding)
|
||||
*encoding = GDK_NONE;
|
||||
|
||||
if (!locale_str)
|
||||
{
|
||||
g_warning ("Error converting from UTF-8 to '%s': %s",
|
||||
charset, error->message);
|
||||
g_error_free (error);
|
||||
|
||||
if (encoding)
|
||||
*encoding = GDK_NONE;
|
||||
if (format)
|
||||
*format = GPOINTER_TO_UINT (GDK_ATOM_TO_POINTER (GDK_NONE));
|
||||
if (ctext)
|
||||
*ctext = NULL;
|
||||
if (length)
|
||||
*length = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
locale_str = tmp_str;
|
||||
|
||||
result = gdk_string_to_compound_text (locale_str,
|
||||
encoding, format, ctext, length);
|
||||
if (format)
|
||||
*format = 0;
|
||||
|
||||
g_free (locale_str);
|
||||
if (ctext)
|
||||
*ctext = NULL;
|
||||
|
||||
return result;
|
||||
if (length)
|
||||
*length = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_free_compound_text (guchar *ctext)
|
||||
{
|
||||
/* As we never generate anything claimed to be COMPOUND_TEXT, this
|
||||
* should never be called. Or if it is called, ctext should be the
|
||||
* NULL returned for conversions to COMPOUND_TEXT above.
|
||||
*/
|
||||
g_return_if_fail (ctext == NULL);
|
||||
}
|
||||
|
||||
+114
-27
@@ -279,20 +279,32 @@ gdk_window_impl_win32_get_visible_region (GdkDrawable *drawable)
|
||||
return gdk_region_rectangle (&result_rect);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_root_window_size_init (void)
|
||||
{
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkRectangle rect;
|
||||
int i;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) _gdk_parent_root)->impl);
|
||||
rect = _gdk_monitors[0];
|
||||
for (i = 1; i < _gdk_num_monitors; i++)
|
||||
gdk_rectangle_union (&rect, _gdk_monitors+i, &rect);
|
||||
|
||||
impl->width = rect.width;
|
||||
impl->height = rect.height;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_windowing_window_init (void)
|
||||
{
|
||||
GdkWindowObject *private;
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkDrawableImplWin32 *draw_impl;
|
||||
GdkRectangle rect;
|
||||
gint i;
|
||||
|
||||
g_assert (_gdk_parent_root == NULL);
|
||||
|
||||
_gdk_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
private = (GdkWindowObject *)_gdk_parent_root;
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
||||
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (private->impl);
|
||||
|
||||
draw_impl->handle = _gdk_root_window;
|
||||
@@ -303,13 +315,8 @@ _gdk_windowing_window_init (void)
|
||||
private->window_type = GDK_WINDOW_ROOT;
|
||||
private->depth = gdk_visual_get_system ()->depth;
|
||||
|
||||
rect = _gdk_monitors[0];
|
||||
for (i = 1; i < _gdk_num_monitors; i++)
|
||||
gdk_rectangle_union (&rect, _gdk_monitors+i, &rect);
|
||||
|
||||
impl->width = rect.width;
|
||||
impl->height = rect.height;
|
||||
|
||||
_gdk_root_window_size_init ();
|
||||
|
||||
_gdk_window_init_position (GDK_WINDOW (private));
|
||||
|
||||
gdk_win32_handle_table_insert (&_gdk_root_window, _gdk_parent_root);
|
||||
@@ -448,10 +455,11 @@ RegisterGdkClass (GdkWindowType wtype)
|
||||
return klass;
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
gdk_window_new (GdkWindow *parent,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
static GdkWindow*
|
||||
gdk_window_new_internal (GdkWindow *parent,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask,
|
||||
gboolean from_set_skip_taskbar_hint)
|
||||
{
|
||||
HANDLE hparent;
|
||||
ATOM klass = 0;
|
||||
@@ -529,7 +537,19 @@ gdk_window_new (GdkWindow *parent,
|
||||
impl->width = (attributes->width > 1) ? (attributes->width) : (1);
|
||||
impl->height = (attributes->height > 1) ? (attributes->height) : (1);
|
||||
impl->extension_events_selected = FALSE;
|
||||
private->window_type = attributes->window_type;
|
||||
if (attributes->wclass == GDK_INPUT_ONLY)
|
||||
{
|
||||
/* Backwards compatiblity - we've always ignored
|
||||
* attributes->window_type for input-only windows
|
||||
* before
|
||||
*/
|
||||
if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_ROOT)
|
||||
private->window_type = GDK_WINDOW_TEMP;
|
||||
else
|
||||
private->window_type = GDK_WINDOW_CHILD;
|
||||
}
|
||||
else
|
||||
private->window_type = attributes->window_type;
|
||||
|
||||
if (attributes->wclass == GDK_INPUT_OUTPUT)
|
||||
{
|
||||
@@ -720,6 +740,9 @@ gdk_window_new (GdkWindow *parent,
|
||||
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
|
||||
#endif
|
||||
|
||||
if (!from_set_skip_taskbar_hint && private->window_type == GDK_WINDOW_TEMP)
|
||||
gdk_window_set_skip_taskbar_hint (window, TRUE);
|
||||
|
||||
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
|
||||
(attributes->cursor) :
|
||||
NULL));
|
||||
@@ -727,6 +750,14 @@ gdk_window_new (GdkWindow *parent,
|
||||
return window;
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
gdk_window_new (GdkWindow *parent,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
{
|
||||
return gdk_window_new_internal (parent, attributes, attributes_mask, FALSE);
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
gdk_window_foreign_new_for_display (GdkDisplay *display,
|
||||
GdkNativeWindow anid)
|
||||
@@ -1977,14 +2008,6 @@ gdk_window_get_frame_extents (GdkWindow *window,
|
||||
private = (GdkWindowObject*) private->parent;
|
||||
|
||||
hwnd = GDK_WINDOW_HWND (window);
|
||||
|
||||
/* find the frame window */
|
||||
while (HWND_DESKTOP != GetParent (hwnd))
|
||||
{
|
||||
hwnd = GetParent (hwnd);
|
||||
g_return_if_fail (NULL != hwnd);
|
||||
}
|
||||
|
||||
API_CALL (GetWindowRect, (hwnd, &r));
|
||||
|
||||
rect->x = r.left + _gdk_offset_x;
|
||||
@@ -3078,7 +3101,7 @@ gdk_window_set_skip_taskbar_hint (GdkWindow *window,
|
||||
wa.wclass = GDK_INPUT_OUTPUT;
|
||||
wa.width = wa.height = 1;
|
||||
wa.event_mask = 0;
|
||||
owner = gdk_window_new (NULL, &wa, 0);
|
||||
owner = gdk_window_new_internal (NULL, &wa, 0, TRUE);
|
||||
}
|
||||
|
||||
SetWindowLong (GDK_WINDOW_HWND (window), GWL_HWNDPARENT,
|
||||
@@ -3175,12 +3198,63 @@ gdk_window_begin_resize_drag (GdkWindow *window,
|
||||
gint root_y,
|
||||
guint32 timestamp)
|
||||
{
|
||||
WPARAM winedge;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
/* XXX: isn't all this default on win32 ... */
|
||||
/* Tell Windows to start interactively resizing the window by pretending that
|
||||
* the left pointer button was clicked in the suitable edge or corner. This
|
||||
* will only work if the button is down when this function is called, and
|
||||
* will only work with button 1 (left), since Windows only allows window
|
||||
* dragging using the left mouse button */
|
||||
if (button != 1)
|
||||
return;
|
||||
|
||||
/* Must break the automatic grab that occured when the button was pressed,
|
||||
* otherwise it won't work */
|
||||
gdk_display_pointer_ungrab (gdk_display_get_default (), 0);
|
||||
|
||||
switch (edge)
|
||||
{
|
||||
case GDK_WINDOW_EDGE_NORTH_WEST:
|
||||
winedge = HTTOPLEFT;
|
||||
break;
|
||||
|
||||
case GDK_WINDOW_EDGE_NORTH:
|
||||
winedge = HTTOP;
|
||||
break;
|
||||
|
||||
case GDK_WINDOW_EDGE_NORTH_EAST:
|
||||
winedge = HTTOPRIGHT;
|
||||
break;
|
||||
|
||||
case GDK_WINDOW_EDGE_WEST:
|
||||
winedge = HTLEFT;
|
||||
break;
|
||||
|
||||
case GDK_WINDOW_EDGE_EAST:
|
||||
winedge = HTRIGHT;
|
||||
break;
|
||||
|
||||
case GDK_WINDOW_EDGE_SOUTH_WEST:
|
||||
winedge = HTBOTTOMLEFT;
|
||||
break;
|
||||
|
||||
case GDK_WINDOW_EDGE_SOUTH:
|
||||
winedge = HTBOTTOM;
|
||||
break;
|
||||
|
||||
case GDK_WINDOW_EDGE_SOUTH_EAST:
|
||||
default:
|
||||
winedge = HTBOTTOMRIGHT;
|
||||
break;
|
||||
}
|
||||
|
||||
DefWindowProc (GDK_WINDOW_HWND (window), WM_NCLBUTTONDOWN, winedge,
|
||||
MAKELPARAM (root_x - _gdk_offset_x, root_y - _gdk_offset_y));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3195,7 +3269,20 @@ gdk_window_begin_move_drag (GdkWindow *window,
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
/* XXX: isn't all this default on win32 ... */
|
||||
/* Tell Windows to start interactively moving the window by pretending that
|
||||
* the left pointer button was clicked in the titlebar. This will only work
|
||||
* if the button is down when this function is called, and will only work
|
||||
* with button 1 (left), since Windows only allows window dragging using the
|
||||
* left mouse button */
|
||||
if (button != 1)
|
||||
return;
|
||||
|
||||
/* Must break the automatic grab that occured when the button was pressed,
|
||||
* otherwise it won't work */
|
||||
gdk_display_pointer_ungrab (gdk_display_get_default (), 0);
|
||||
|
||||
DefWindowProc (GDK_WINDOW_HWND (window), WM_NCLBUTTONDOWN, HTCAPTION,
|
||||
MAKELPARAM (root_x - _gdk_offset_x, root_y - _gdk_offset_y));
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
|
||||
+23
-15
@@ -305,16 +305,14 @@ gdk_cursor_get_display (GdkCursor *cursor)
|
||||
#ifdef HAVE_XCURSOR
|
||||
|
||||
static XcursorImage*
|
||||
create_cursor_image (GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
create_cursor_image (GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
guint width, height, rowstride, n_channels;
|
||||
guchar *pixels, *src;
|
||||
XcursorImage *xcimage;
|
||||
XcursorPixel *dest;
|
||||
guchar a;
|
||||
gint i, j;
|
||||
|
||||
width = gdk_pixbuf_get_width (pixbuf);
|
||||
height = gdk_pixbuf_get_height (pixbuf);
|
||||
@@ -324,27 +322,37 @@ create_cursor_image (GdkPixbuf *pixbuf,
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
|
||||
xcimage = XcursorImageCreate (width, height);
|
||||
|
||||
|
||||
xcimage->xhot = x;
|
||||
xcimage->yhot = y;
|
||||
|
||||
dest = xcimage->pixels;
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
if (n_channels == 3)
|
||||
{
|
||||
src = pixels + j * rowstride;
|
||||
for (i = 0; i < width; i++)
|
||||
{
|
||||
if (n_channels == 3)
|
||||
a = 0xff;
|
||||
else
|
||||
a = src[3];
|
||||
|
||||
*dest = (a << 24) | (src[0] << 16) | (src[1] << 8) | src[2];
|
||||
gint i, j;
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
||||
src = pixels + j * rowstride;
|
||||
for (i = 0; i < width; i++)
|
||||
{
|
||||
*dest = (0xff << 24) | (src[0] << 16) | (src[1] << 8) | src[2];
|
||||
}
|
||||
|
||||
src += n_channels;
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_gdk_x11_convert_to_format (pixels, rowstride,
|
||||
(guchar *) dest, 4 * width,
|
||||
GDK_X11_FORMAT_ARGB,
|
||||
(G_BYTE_ORDER == G_BIG_ENDIAN) ?
|
||||
GDK_MSB_FIRST : GDK_LSB_FIRST,
|
||||
width, height);
|
||||
}
|
||||
|
||||
return xcimage;
|
||||
}
|
||||
|
||||
@@ -187,6 +187,8 @@ gdk_display_open (const gchar *display_name)
|
||||
|
||||
display_x11->leader_gdk_window = gdk_window_new (GDK_SCREEN_X11 (display_x11->default_screen)->root_window,
|
||||
&attr, GDK_WA_X | GDK_WA_Y);
|
||||
(_gdk_x11_window_get_toplevel (display_x11->leader_gdk_window))->is_leader = TRUE;
|
||||
|
||||
display_x11->leader_window = GDK_WINDOW_XID (display_x11->leader_gdk_window);
|
||||
|
||||
display_x11->leader_window_title_set = FALSE;
|
||||
@@ -813,7 +815,7 @@ _gdk_windowing_set_default_display (GdkDisplay *display)
|
||||
}
|
||||
}
|
||||
|
||||
char*
|
||||
static char*
|
||||
escape_for_xmessage (const char *str)
|
||||
{
|
||||
GString *retval;
|
||||
|
||||
@@ -2193,7 +2193,10 @@ xdnd_send_xevent (GdkDragContext *context,
|
||||
temp_event.any.window = window;
|
||||
|
||||
if ((*xdnd_filters[i].func) (event_send, &temp_event, NULL) == GDK_FILTER_TRANSLATE)
|
||||
gdk_event_put (&temp_event);
|
||||
{
|
||||
gdk_event_put (&temp_event);
|
||||
g_object_unref (temp_event.dnd.context);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+31
-37
@@ -921,14 +921,8 @@ gdk_x11_drawable_get_xid (GdkDrawable *drawable)
|
||||
* what's the fastest depending on the available picture formats,
|
||||
* whether we can used shared pixmaps, etc.
|
||||
*/
|
||||
typedef enum {
|
||||
FORMAT_NONE,
|
||||
FORMAT_EXACT_MASK,
|
||||
FORMAT_ARGB_MASK,
|
||||
FORMAT_ARGB
|
||||
} FormatType;
|
||||
|
||||
static FormatType
|
||||
static GdkX11FormatType
|
||||
select_format (GdkDisplay *display,
|
||||
XRenderPictFormat **format,
|
||||
XRenderPictFormat **mask)
|
||||
@@ -937,7 +931,7 @@ select_format (GdkDisplay *display,
|
||||
XRenderPictFormat pf;
|
||||
|
||||
if (!_gdk_x11_have_render (display))
|
||||
return FORMAT_NONE;
|
||||
return GDK_X11_FORMAT_NONE;
|
||||
|
||||
/* Look for a 32-bit xRGB and Axxx formats that exactly match the
|
||||
* in memory data format. We can use them as pixmap and mask
|
||||
@@ -993,7 +987,7 @@ select_format (GdkDisplay *display,
|
||||
0);
|
||||
|
||||
if (*format && *mask)
|
||||
return FORMAT_EXACT_MASK;
|
||||
return GDK_X11_FORMAT_EXACT_MASK;
|
||||
|
||||
/* OK, that failed, now look for xRGB and Axxx formats in
|
||||
* RENDER's preferred order
|
||||
@@ -1023,7 +1017,7 @@ select_format (GdkDisplay *display,
|
||||
0);
|
||||
|
||||
if (*format && *mask)
|
||||
return FORMAT_ARGB_MASK;
|
||||
return GDK_X11_FORMAT_ARGB_MASK;
|
||||
|
||||
/* Finally, if neither of the above worked, fall back to
|
||||
* looking for combined ARGB -- we'll premultiply ourselves.
|
||||
@@ -1048,9 +1042,9 @@ select_format (GdkDisplay *display,
|
||||
*mask = NULL;
|
||||
|
||||
if (*format)
|
||||
return FORMAT_ARGB;
|
||||
return GDK_X11_FORMAT_ARGB;
|
||||
|
||||
return FORMAT_NONE;
|
||||
return GDK_X11_FORMAT_NONE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -1081,15 +1075,15 @@ list_formats (XRenderPictFormat *pf)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
convert_to_format (guchar *src_buf,
|
||||
gint src_rowstride,
|
||||
guchar *dest_buf,
|
||||
gint dest_rowstride,
|
||||
FormatType dest_format,
|
||||
GdkByteOrder dest_byteorder,
|
||||
gint width,
|
||||
gint height)
|
||||
void
|
||||
_gdk_x11_convert_to_format (guchar *src_buf,
|
||||
gint src_rowstride,
|
||||
guchar *dest_buf,
|
||||
gint dest_rowstride,
|
||||
GdkX11FormatType dest_format,
|
||||
GdkByteOrder dest_byteorder,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
gint i;
|
||||
|
||||
@@ -1097,14 +1091,14 @@ convert_to_format (guchar *src_buf,
|
||||
{
|
||||
switch (dest_format)
|
||||
{
|
||||
case FORMAT_EXACT_MASK:
|
||||
case GDK_X11_FORMAT_EXACT_MASK:
|
||||
{
|
||||
memcpy (dest_buf + i * dest_rowstride,
|
||||
src_buf + i * src_rowstride,
|
||||
width * 4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_ARGB_MASK:
|
||||
case GDK_X11_FORMAT_ARGB_MASK:
|
||||
{
|
||||
guchar *row = src_buf + i * src_rowstride;
|
||||
if (((gsize)row & 3) != 0)
|
||||
@@ -1182,7 +1176,7 @@ convert_to_format (guchar *src_buf,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FORMAT_ARGB:
|
||||
case GDK_X11_FORMAT_ARGB:
|
||||
{
|
||||
guchar *p = (src_buf + i * src_rowstride);
|
||||
guchar *q = (dest_buf + i * dest_rowstride);
|
||||
@@ -1218,7 +1212,7 @@ convert_to_format (guchar *src_buf,
|
||||
#undef MULT
|
||||
break;
|
||||
}
|
||||
case FORMAT_NONE:
|
||||
case GDK_X11_FORMAT_NONE:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
@@ -1228,7 +1222,7 @@ convert_to_format (guchar *src_buf,
|
||||
static void
|
||||
draw_with_images (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
FormatType format_type,
|
||||
GdkX11FormatType format_type,
|
||||
XRenderPictFormat *format,
|
||||
XRenderPictFormat *mask_format,
|
||||
guchar *src_rgb,
|
||||
@@ -1273,10 +1267,10 @@ draw_with_images (GdkDrawable *drawable,
|
||||
|
||||
image = _gdk_image_get_scratch (screen, width1, height1, 32, &xs0, &ys0);
|
||||
|
||||
convert_to_format (src_rgb + y0 * src_rowstride + 4 * x0, src_rowstride,
|
||||
(guchar *)image->mem + ys0 * image->bpl + xs0 * image->bpp, image->bpl,
|
||||
format_type, image->byte_order,
|
||||
width1, height1);
|
||||
_gdk_x11_convert_to_format (src_rgb + y0 * src_rowstride + 4 * x0, src_rowstride,
|
||||
(guchar *)image->mem + ys0 * image->bpl + xs0 * image->bpp, image->bpl,
|
||||
format_type, image->byte_order,
|
||||
width1, height1);
|
||||
|
||||
gdk_draw_image (pix, pix_gc,
|
||||
image, xs0, ys0, x0, y0, width1, height1);
|
||||
@@ -1352,7 +1346,7 @@ get_shm_pixmap_for_image (Display *xdisplay,
|
||||
static gboolean
|
||||
draw_with_pixmaps (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
FormatType format_type,
|
||||
GdkX11FormatType format_type,
|
||||
XRenderPictFormat *format,
|
||||
XRenderPictFormat *mask_format,
|
||||
guchar *src_rgb,
|
||||
@@ -1386,10 +1380,10 @@ draw_with_pixmaps (GdkDrawable *drawable,
|
||||
if (!get_shm_pixmap_for_image (xdisplay, image, format, mask_format, &pix, &pict, &mask))
|
||||
return FALSE;
|
||||
|
||||
convert_to_format (src_rgb + y0 * src_rowstride + 4 * x0, src_rowstride,
|
||||
(guchar *)image->mem + ys0 * image->bpl + xs0 * image->bpp, image->bpl,
|
||||
format_type, image->byte_order,
|
||||
width1, height1);
|
||||
_gdk_x11_convert_to_format (src_rgb + y0 * src_rowstride + 4 * x0, src_rowstride,
|
||||
(guchar *)image->mem + ys0 * image->bpl + xs0 * image->bpp, image->bpl,
|
||||
format_type, image->byte_order,
|
||||
width1, height1);
|
||||
|
||||
XRenderComposite (xdisplay, PictOpOver, pict, mask, dest_pict,
|
||||
xs0, ys0, xs0, ys0, x0 + dest_x, y0 + dest_y,
|
||||
@@ -1415,7 +1409,7 @@ gdk_x11_draw_pixbuf (GdkDrawable *drawable,
|
||||
gint x_dither,
|
||||
gint y_dither)
|
||||
{
|
||||
FormatType format_type;
|
||||
GdkX11FormatType format_type;
|
||||
XRenderPictFormat *format, *mask_format;
|
||||
gint rowstride;
|
||||
#ifdef USE_SHM
|
||||
@@ -1425,7 +1419,7 @@ gdk_x11_draw_pixbuf (GdkDrawable *drawable,
|
||||
format_type = select_format (gdk_drawable_get_display (drawable),
|
||||
&format, &mask_format);
|
||||
|
||||
if (format_type == FORMAT_NONE ||
|
||||
if (format_type == GDK_X11_FORMAT_NONE ||
|
||||
!gdk_pixbuf_get_has_alpha (pixbuf) ||
|
||||
gdk_drawable_get_depth (drawable) == 1 ||
|
||||
(dither == GDK_RGB_DITHER_MAX && gdk_drawable_get_depth (drawable) != 24) ||
|
||||
|
||||
@@ -41,6 +41,14 @@ extern "C" {
|
||||
/* Drawable implementation for X11
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_X11_FORMAT_NONE,
|
||||
GDK_X11_FORMAT_EXACT_MASK,
|
||||
GDK_X11_FORMAT_ARGB_MASK,
|
||||
GDK_X11_FORMAT_ARGB
|
||||
} GdkX11FormatType;
|
||||
|
||||
typedef struct _GdkDrawableImplX11 GdkDrawableImplX11;
|
||||
typedef struct _GdkDrawableImplX11Class GdkDrawableImplX11Class;
|
||||
|
||||
@@ -73,6 +81,15 @@ struct _GdkDrawableImplX11Class
|
||||
|
||||
GType _gdk_drawable_impl_x11_get_type (void);
|
||||
|
||||
void _gdk_x11_convert_to_format (guchar *src_buf,
|
||||
gint src_rowstride,
|
||||
guchar *dest_buf,
|
||||
gint dest_rowstride,
|
||||
GdkX11FormatType dest_format,
|
||||
GdkByteOrder dest_byteorder,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
+14
-3
@@ -455,12 +455,15 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
|
||||
{
|
||||
gulong *desktop;
|
||||
|
||||
type = None;
|
||||
gdk_error_trap_push ();
|
||||
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
|
||||
GDK_WINDOW_XID (window),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type,
|
||||
&format, &nitems,
|
||||
&bytes_after, (guchar **)&desktop);
|
||||
gdk_error_trap_pop ();
|
||||
|
||||
if (type != None)
|
||||
{
|
||||
@@ -494,10 +497,13 @@ gdk_check_wm_state_changed (GdkWindow *window)
|
||||
toplevel->have_maxhorz = FALSE;
|
||||
toplevel->have_fullscreen = FALSE;
|
||||
|
||||
type = None;
|
||||
gdk_error_trap_push ();
|
||||
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
|
||||
0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems,
|
||||
&bytes_after, (guchar **)&atoms);
|
||||
gdk_error_trap_pop ();
|
||||
|
||||
if (type != None)
|
||||
{
|
||||
@@ -783,14 +789,14 @@ get_real_window (GdkDisplay *display,
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static const char notify_modes[][18] = {
|
||||
static const char notify_modes[][19] = {
|
||||
"NotifyNormal",
|
||||
"NotifyGrab",
|
||||
"NotifyUngrab",
|
||||
"NotifyWhileGrabbed"
|
||||
};
|
||||
|
||||
static const char notify_details[][22] = {
|
||||
static const char notify_details[][23] = {
|
||||
"NotifyAncestor",
|
||||
"NotifyVirtual",
|
||||
"NotifyInferior",
|
||||
@@ -1999,7 +2005,12 @@ gdk_wm_protocols_filter (GdkXEvent *xev,
|
||||
{
|
||||
XEvent *xevent = (XEvent *)xev;
|
||||
GdkWindow *win = event->any.window;
|
||||
GdkDisplay *display = GDK_WINDOW_DISPLAY (win);
|
||||
GdkDisplay *display;
|
||||
|
||||
if (!win)
|
||||
return GDK_FILTER_REMOVE;
|
||||
|
||||
display = GDK_WINDOW_DISPLAY (win);
|
||||
|
||||
if ((Atom) xevent->xclient.data.l[0] == gdk_x11_get_xatom_by_name_for_display (display, "WM_DELETE_WINDOW"))
|
||||
{
|
||||
|
||||
@@ -866,7 +866,7 @@ gdk_window_postmove (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
expose_serial_predicate (Display *xdisplay,
|
||||
XEvent *xev,
|
||||
XPointer arg)
|
||||
|
||||
+22
-8
@@ -206,12 +206,26 @@ gdk_keymap_get_for_display (GdkDisplay *display)
|
||||
}
|
||||
|
||||
/* Find the index of the group/level pair within the keysyms for a key.
|
||||
* We round up the number of keysyms per keycode to the next even number,
|
||||
* otherwise we lose a whole group of keys
|
||||
*/
|
||||
#define KEYSYM_INDEX(keymap_impl, group, level) \
|
||||
(2 * ((group) % (keymap_impl->keysyms_per_keycode / 2)) + (level))
|
||||
(2 * ((group) % (int)((keymap_impl->keysyms_per_keycode + 1) / 2)) + (level))
|
||||
#define KEYSYM_IS_KEYPAD(s) (((s) >= 0xff80 && (s) <= 0xffbd) || \
|
||||
((s) >= 0x11000000 && (s) <= 0x1100ffff))
|
||||
|
||||
static int
|
||||
get_symbol (const KeySym *syms, GdkKeymapX11 *keymap_x11, int group, int level)
|
||||
{
|
||||
int index;
|
||||
|
||||
index = KEYSYM_INDEX(keymap_x11, group, level);
|
||||
if (index > keymap_x11->keysyms_per_keycode)
|
||||
return NoSymbol;
|
||||
|
||||
return syms[index];
|
||||
}
|
||||
|
||||
static void
|
||||
update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
{
|
||||
@@ -256,7 +270,7 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
/* Check both groups */
|
||||
for (i = 0 ; i < 2 ; i++)
|
||||
{
|
||||
if (syms[KEYSYM_INDEX (keymap_x11, i, 0)] == GDK_Tab)
|
||||
if (get_symbol (syms, keymap_x11, i, 0) == GDK_Tab)
|
||||
syms[KEYSYM_INDEX (keymap_x11, i, 1)] = GDK_ISO_Left_Tab;
|
||||
}
|
||||
|
||||
@@ -264,12 +278,12 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
* If there is one keysym and the key symbol has upper and lower
|
||||
* case variants fudge the keymap
|
||||
*/
|
||||
if (syms[KEYSYM_INDEX (keymap_x11, 0, 1)] == 0)
|
||||
if (get_symbol (syms, keymap_x11, 0, 1) == 0)
|
||||
{
|
||||
guint lower;
|
||||
guint upper;
|
||||
|
||||
gdk_keyval_convert_case (syms[KEYSYM_INDEX (keymap_x11, 0, 0)], &lower, &upper);
|
||||
gdk_keyval_convert_case (get_symbol (syms, keymap_x11, 0, 0), &lower, &upper);
|
||||
if (lower != upper)
|
||||
{
|
||||
syms[KEYSYM_INDEX (keymap_x11, 0, 0)] = lower;
|
||||
@@ -380,9 +394,9 @@ get_keymap (GdkKeymapX11 *keymap_x11)
|
||||
|
||||
#define GET_EFFECTIVE_KEYMAP(keymap) get_effective_keymap ((keymap), G_STRFUNC)
|
||||
|
||||
GdkKeymap *
|
||||
static GdkKeymap *
|
||||
get_effective_keymap (GdkKeymap *keymap,
|
||||
const char *function)
|
||||
const char *function)
|
||||
{
|
||||
if (!keymap)
|
||||
{
|
||||
@@ -845,7 +859,7 @@ gdk_keymap_lookup_key (GdkKeymap *keymap,
|
||||
{
|
||||
const KeySym *map = get_keymap (keymap_x11);
|
||||
const KeySym *syms = map + (key->keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode;
|
||||
return syms [KEYSYM_INDEX (keymap_x11, key->group, key->level)];
|
||||
return get_symbol (syms, keymap_x11, key->group, key->level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -995,7 +1009,7 @@ translate_keysym (GdkKeymapX11 *keymap_x11,
|
||||
const KeySym *map = get_keymap (keymap_x11);
|
||||
const KeySym *syms = map + (hardware_keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode;
|
||||
|
||||
#define SYM(k,g,l) syms[KEYSYM_INDEX (k,g,l)]
|
||||
#define SYM(k,g,l) get_symbol (syms, k,g,l)
|
||||
|
||||
GdkModifierType shift_modifiers;
|
||||
gint shift_level;
|
||||
|
||||
@@ -515,7 +515,15 @@ make_list (const gchar *text,
|
||||
}
|
||||
}
|
||||
else
|
||||
str = g_strndup (p, q - p);
|
||||
{
|
||||
str = g_strndup (p, q - p);
|
||||
if (!g_utf8_validate (str, -1, NULL))
|
||||
{
|
||||
g_warning ("Error converting selection from UTF8_STRING");
|
||||
g_free (str);
|
||||
str = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (str)
|
||||
{
|
||||
@@ -634,14 +642,20 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
||||
else
|
||||
{
|
||||
if (list)
|
||||
(*list)[count++] = g_strdup (local_list[i]);
|
||||
{
|
||||
if (g_utf8_validate (local_list[i], -1, NULL))
|
||||
(*list)[count++] = g_strdup (local_list[i]);
|
||||
else
|
||||
g_warning ("Error converting selection");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (local_count)
|
||||
gdk_free_text_list (local_list);
|
||||
|
||||
(*list)[count] = NULL;
|
||||
|
||||
if (list)
|
||||
(*list)[count] = NULL;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
+69
-14
@@ -105,6 +105,14 @@ static gpointer parent_class = NULL;
|
||||
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
||||
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
|
||||
|
||||
/* Return whether time1 is considered later than time2 as far as xserver
|
||||
* time is concerned. Accounts for wraparound.
|
||||
*/
|
||||
#define XSERVER_TIME_IS_LATER(time1, time2) \
|
||||
( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) || \
|
||||
(( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \
|
||||
)
|
||||
|
||||
GType
|
||||
gdk_window_impl_x11_get_type (void)
|
||||
{
|
||||
@@ -799,6 +807,9 @@ gdk_window_foreign_new_for_display (GdkDisplay *display,
|
||||
|
||||
display_x11 = GDK_DISPLAY_X11 (display);
|
||||
|
||||
if (gdk_xid_table_lookup_for_display (display, anid) != NULL)
|
||||
g_warning ("XID %#lx already known", anid);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
result = XGetWindowAttributes (display_x11->xdisplay, anid, &attrs);
|
||||
if (gdk_error_trap_pop () || !result)
|
||||
@@ -1018,6 +1029,7 @@ update_wm_hints (GdkWindow *window,
|
||||
XWMHints wm_hints;
|
||||
|
||||
if (!force &&
|
||||
!toplevel->is_leader &&
|
||||
private->state & GDK_WINDOW_STATE_WITHDRAWN)
|
||||
return;
|
||||
|
||||
@@ -1099,6 +1111,20 @@ set_initial_hints (GdkWindow *window)
|
||||
++i;
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_ABOVE)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_ABOVE");
|
||||
++i;
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_BELOW)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_BELOW");
|
||||
++i;
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_STICKY)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
@@ -1173,6 +1199,8 @@ show_window_internal (GdkWindow *window,
|
||||
gboolean raise)
|
||||
{
|
||||
GdkWindowObject *private;
|
||||
GdkDisplayX11 *display_x11;
|
||||
GdkToplevelX11 *toplevel;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -1197,6 +1225,17 @@ show_window_internal (GdkWindow *window,
|
||||
|
||||
g_assert (GDK_WINDOW_IS_MAPPED (window));
|
||||
|
||||
if (WINDOW_IS_TOPLEVEL (window))
|
||||
{
|
||||
display_x11 = GDK_DISPLAY_X11 (gdk_drawable_get_display (window));
|
||||
toplevel = _gdk_x11_window_get_toplevel (window);
|
||||
|
||||
if (toplevel->user_time != 0 &&
|
||||
display_x11->user_time != 0 &&
|
||||
XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time))
|
||||
_gdk_x11_window_set_user_time (window, display_x11->user_time);
|
||||
}
|
||||
|
||||
if (impl->position_info.mapped)
|
||||
XMapWindow (xdisplay, xwindow);
|
||||
}
|
||||
@@ -1708,9 +1747,9 @@ gdk_window_focus (GdkWindow *window,
|
||||
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_ACTIVE_WINDOW");
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.data.l[0] = 0;
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = 0;
|
||||
xev.xclient.data.l[0] = 1; /* requestor type; we're an app */
|
||||
xev.xclient.data.l[1] = timestamp;
|
||||
xev.xclient.data.l[2] = None; /* currently active window */
|
||||
xev.xclient.data.l[3] = 0;
|
||||
xev.xclient.data.l[4] = 0;
|
||||
|
||||
@@ -3335,6 +3374,8 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDisplayX11 *display_x11;
|
||||
GdkToplevelX11 *toplevel;
|
||||
glong timestamp_long = (glong)timestamp;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -3344,14 +3385,17 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
|
||||
|
||||
display = gdk_drawable_get_display (window);
|
||||
display_x11 = GDK_DISPLAY_X11 (display);
|
||||
toplevel = _gdk_x11_window_get_toplevel (window);
|
||||
|
||||
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"),
|
||||
XA_CARDINAL, 32, PropModeReplace,
|
||||
(guchar *)×tamp, 1);
|
||||
(guchar *)×tamp_long, 1);
|
||||
|
||||
if (timestamp != GDK_CURRENT_TIME)
|
||||
display_x11->user_time = timestamp;
|
||||
if (timestamp_long != GDK_CURRENT_TIME)
|
||||
display_x11->user_time = timestamp_long;
|
||||
|
||||
toplevel->user_time = timestamp_long;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3953,10 +3997,15 @@ gdk_window_set_keep_above (GdkWindow *window, gboolean setting)
|
||||
return;
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
gdk_wmspec_change_state (setting, window,
|
||||
gdk_atom_intern ("_NET_WM_STATE_ABOVE", setting),
|
||||
setting ? gdk_atom_intern ("_NET_WM_STATE_BELOW", FALSE)
|
||||
: GDK_NONE);
|
||||
{
|
||||
if (setting)
|
||||
gdk_wmspec_change_state (FALSE, window,
|
||||
gdk_atom_intern ("_NET_WM_STATE_BELOW", FALSE),
|
||||
GDK_NONE);
|
||||
gdk_wmspec_change_state (setting, window,
|
||||
gdk_atom_intern ("_NET_WM_STATE_ABOVE", FALSE),
|
||||
GDK_NONE);
|
||||
}
|
||||
else
|
||||
gdk_synthesize_window_state (window,
|
||||
setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE,
|
||||
@@ -3989,10 +4038,15 @@ gdk_window_set_keep_below (GdkWindow *window, gboolean setting)
|
||||
return;
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
gdk_wmspec_change_state (setting, window,
|
||||
gdk_atom_intern ("_NET_WM_STATE_BELOW", setting),
|
||||
setting ? gdk_atom_intern ("_NET_WM_STATE_ABOVE", FALSE)
|
||||
: GDK_NONE);
|
||||
{
|
||||
if (setting)
|
||||
gdk_wmspec_change_state (FALSE, window,
|
||||
gdk_atom_intern ("_NET_WM_STATE_ABOVE", FALSE),
|
||||
GDK_NONE);
|
||||
gdk_wmspec_change_state (setting, window,
|
||||
gdk_atom_intern ("_NET_WM_STATE_BELOW", FALSE),
|
||||
GDK_NONE);
|
||||
}
|
||||
else
|
||||
gdk_synthesize_window_state (window,
|
||||
setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW,
|
||||
@@ -4066,6 +4120,7 @@ gdk_window_set_group (GdkWindow *window,
|
||||
if (toplevel->group_leader)
|
||||
g_object_unref (toplevel->group_leader);
|
||||
toplevel->group_leader = g_object_ref (leader);
|
||||
(_gdk_x11_window_get_toplevel (leader))->is_leader = TRUE;
|
||||
}
|
||||
|
||||
update_wm_hints (window, FALSE);
|
||||
|
||||
@@ -107,6 +107,8 @@ struct _GdkToplevelX11
|
||||
guint have_maxhorz : 1; /* _NET_WM_STATE_MAXIMIZED_HORZ */
|
||||
guint have_fullscreen : 1; /* _NET_WM_STATE_FULLSCREEN */
|
||||
|
||||
guint is_leader : 1;
|
||||
|
||||
gulong map_serial; /* Serial of last transition from unmapped */
|
||||
|
||||
GdkPixmap *icon_pixmap;
|
||||
@@ -114,6 +116,9 @@ struct _GdkToplevelX11
|
||||
GdkPixmap *icon_window;
|
||||
GdkWindow *group_leader;
|
||||
|
||||
/* Time of most recent user interaction. */
|
||||
gulong user_time;
|
||||
|
||||
/* We use an extra X window for toplevel windows that we XSetInputFocus()
|
||||
* to in order to avoid getting keyboard events redirected to subwindows
|
||||
* that might not even be part of this app
|
||||
|
||||
+4
-2
@@ -14,7 +14,7 @@ zip $ZIP -@ <<EOF
|
||||
COPYING.LIB-2
|
||||
etc/gtk-2.0/gdk-pixbuf.loaders
|
||||
etc/gtk-2.0/gtkrc
|
||||
etc/gtk-2.0/gtk.immodues
|
||||
etc/gtk-2.0/gtk.immodules
|
||||
$DLLDIR/libgdk_pixbuf-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
$DLLDIR/libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
$DLLDIR/libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
@@ -22,7 +22,9 @@ EOF
|
||||
|
||||
zip $ZIP lib/gtk-2.0/@GTK_BINARY_VERSION@/loaders/*.dll lib/gtk-2.0/@GTK_BINARY_VERSION@/immodules/*.dll
|
||||
|
||||
zip $ZIP share/themes/{Default,Emacs}/gtk-2.0{,-key}/gtkrc
|
||||
zip $ZIP share/themes/Default/gtk-2.0/gtkrc
|
||||
zip $ZIP share/themes/Default/gtk-2.0-key/gtkrc
|
||||
zip $ZIP share/themes/Emacs/gtk-2.0-key/gtkrc
|
||||
|
||||
zip -r $ZIP lib/locale/*/LC_MESSAGES/gtk20.mo
|
||||
|
||||
|
||||
+80
-79
@@ -79,7 +79,8 @@ get_unescaped_char (const char **str,
|
||||
static gboolean
|
||||
gtk_fnmatch_intern (const char *pattern,
|
||||
const char *string,
|
||||
gboolean component_start)
|
||||
gboolean component_start,
|
||||
gboolean no_leading_period)
|
||||
{
|
||||
const char *p = pattern, *n = string;
|
||||
|
||||
@@ -97,7 +98,7 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
return FALSE;
|
||||
else if (nc == G_DIR_SEPARATOR)
|
||||
return FALSE;
|
||||
else if (nc == '.' && component_start)
|
||||
else if (nc == '.' && component_start && no_leading_period)
|
||||
return FALSE;
|
||||
break;
|
||||
case '\\':
|
||||
@@ -107,7 +108,7 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
return FALSE;
|
||||
break;
|
||||
case '*':
|
||||
if (nc == '.' && component_start)
|
||||
if (nc == '.' && component_start && no_leading_period)
|
||||
return FALSE;
|
||||
|
||||
{
|
||||
@@ -148,7 +149,7 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
for (p = last_p; nc != '\0';)
|
||||
{
|
||||
if ((c == '[' || nc == c) &&
|
||||
gtk_fnmatch_intern (p, last_n, component_start))
|
||||
gtk_fnmatch_intern (p, last_n, component_start, no_leading_period))
|
||||
return TRUE;
|
||||
|
||||
component_start = (nc == G_DIR_SEPARATOR);
|
||||
@@ -168,7 +169,7 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
if (nc == '\0' || nc == G_DIR_SEPARATOR)
|
||||
return FALSE;
|
||||
|
||||
if (nc == '.' && component_start)
|
||||
if (nc == '.' && component_start && no_leading_period)
|
||||
return FALSE;
|
||||
|
||||
not = (*p == '!' || *p == '^');
|
||||
@@ -245,116 +246,116 @@ gtk_fnmatch_intern (const char *pattern,
|
||||
*
|
||||
* FNM_FILE_NAME - always set
|
||||
* FNM_LEADING_DIR - never set
|
||||
* FNM_PERIOD - always set
|
||||
* FNM_NOESCAPE - set only on windows
|
||||
* FNM_CASEFOLD - set only on windows
|
||||
*/
|
||||
gboolean
|
||||
_gtk_fnmatch (const char *pattern,
|
||||
const char *string)
|
||||
const char *string,
|
||||
gboolean no_leading_period)
|
||||
{
|
||||
return gtk_fnmatch_intern (pattern, string, TRUE);
|
||||
return gtk_fnmatch_intern (pattern, string, TRUE, no_leading_period);
|
||||
}
|
||||
|
||||
#undef FNMATCH_TEST_CASES
|
||||
#ifdef FNMATCH_TEST_CASES
|
||||
|
||||
#define TEST(pat, str, result) \
|
||||
g_assert (_gtk_fnmatch ((pat), (str)) == result)
|
||||
#define TEST(pat, str, no_leading_period, result) \
|
||||
g_assert (_gtk_fnmatch ((pat), (str), (no_leading_period)) == result)
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
TEST ("[a-]", "-", TRUE);
|
||||
TEST ("[a-]", "-", TRUE, TRUE);
|
||||
|
||||
TEST ("a", "a", TRUE);
|
||||
TEST ("a", "b", FALSE);
|
||||
TEST ("a", "a", TRUE, TRUE);
|
||||
TEST ("a", "b", TRUE, FALSE);
|
||||
|
||||
/* Test what ? matches */
|
||||
TEST ("?", "a", TRUE);
|
||||
TEST ("?", ".", FALSE);
|
||||
TEST ("a?", "a.", TRUE);
|
||||
TEST ("a/?", "a/b", TRUE);
|
||||
TEST ("a/?", "a/.", FALSE);
|
||||
TEST ("?", "/", FALSE);
|
||||
TEST ("?", "a", TRUE, TRUE);
|
||||
TEST ("?", ".", TRUE, FALSE);
|
||||
TEST ("a?", "a.", TRUE, TRUE);
|
||||
TEST ("a/?", "a/b", TRUE, TRUE);
|
||||
TEST ("a/?", "a/.", TRUE, FALSE);
|
||||
TEST ("?", "/", TRUE, FALSE);
|
||||
|
||||
/* Test what * matches */
|
||||
TEST ("*", "a", TRUE);
|
||||
TEST ("*", ".", FALSE);
|
||||
TEST ("a*", "a.", TRUE);
|
||||
TEST ("a/*", "a/b", TRUE);
|
||||
TEST ("a/*", "a/.", FALSE);
|
||||
TEST ("*", "/", FALSE);
|
||||
TEST ("*", "a", TRUE, TRUE);
|
||||
TEST ("*", ".", TRUE, FALSE);
|
||||
TEST ("a*", "a.", TRUE, TRUE);
|
||||
TEST ("a/*", "a/b", TRUE, TRUE);
|
||||
TEST ("a/*", "a/.", TRUE, FALSE);
|
||||
TEST ("*", "/", TRUE, FALSE);
|
||||
|
||||
/* Range tests */
|
||||
TEST ("[ab]", "a", TRUE);
|
||||
TEST ("[ab]", "c", FALSE);
|
||||
TEST ("[^ab]", "a", FALSE);
|
||||
TEST ("[!ab]", "a", FALSE);
|
||||
TEST ("[^ab]", "c", TRUE);
|
||||
TEST ("[!ab]", "c", TRUE);
|
||||
TEST ("[a-c]", "b", TRUE);
|
||||
TEST ("[a-c]", "d", FALSE);
|
||||
TEST ("[a-]", "-", TRUE);
|
||||
TEST ("[]]", "]", TRUE);
|
||||
TEST ("[^]]", "a", TRUE);
|
||||
TEST ("[!]]", "a", TRUE);
|
||||
TEST ("[ab]", "a", TRUE, TRUE);
|
||||
TEST ("[ab]", "c", TRUE, FALSE);
|
||||
TEST ("[^ab]", "a", TRUE, FALSE);
|
||||
TEST ("[!ab]", "a", TRUE, FALSE);
|
||||
TEST ("[^ab]", "c", TRUE, TRUE);
|
||||
TEST ("[!ab]", "c", TRUE, TRUE);
|
||||
TEST ("[a-c]", "b", TRUE, TRUE);
|
||||
TEST ("[a-c]", "d", TRUE, FALSE);
|
||||
TEST ("[a-]", "-", TRUE, TRUE);
|
||||
TEST ("[]]", "]", TRUE, TRUE);
|
||||
TEST ("[^]]", "a", TRUE, TRUE);
|
||||
TEST ("[!]]", "a", TRUE, TRUE);
|
||||
|
||||
/* Various unclosed ranges */
|
||||
TEST ("[ab", "a", FALSE);
|
||||
TEST ("[a-", "a", FALSE);
|
||||
TEST ("[ab", "c", FALSE);
|
||||
TEST ("[a-", "c", FALSE);
|
||||
TEST ("[^]", "a", FALSE);
|
||||
TEST ("[ab", "a", TRUE, FALSE);
|
||||
TEST ("[a-", "a", TRUE, FALSE);
|
||||
TEST ("[ab", "c", TRUE, FALSE);
|
||||
TEST ("[a-", "c", TRUE, FALSE);
|
||||
TEST ("[^]", "a", TRUE, FALSE);
|
||||
|
||||
/* Ranges and special no-wildcard matches */
|
||||
TEST ("[.]", ".", FALSE);
|
||||
TEST ("a[.]", "a.", TRUE);
|
||||
TEST ("a/[.]", "a/.", FALSE);
|
||||
TEST ("[/]", "/", FALSE);
|
||||
TEST ("[^/]", "a", TRUE);
|
||||
TEST ("[.]", ".", TRUE, FALSE);
|
||||
TEST ("a[.]", "a.", TRUE, TRUE);
|
||||
TEST ("a/[.]", "a/.", TRUE, FALSE);
|
||||
TEST ("[/]", "/", TRUE, FALSE);
|
||||
TEST ("[^/]", "a", TRUE, TRUE);
|
||||
|
||||
/* Basic tests of * (and combinations of * and ?) */
|
||||
TEST ("a*b", "ab", TRUE);
|
||||
TEST ("a*b", "axb", TRUE);
|
||||
TEST ("a*b", "axxb", TRUE);
|
||||
TEST ("a**b", "ab", TRUE);
|
||||
TEST ("a**b", "axb", TRUE);
|
||||
TEST ("a**b", "axxb", TRUE);
|
||||
TEST ("a*?*b", "ab", FALSE);
|
||||
TEST ("a*?*b", "axb", TRUE);
|
||||
TEST ("a*?*b", "axxb", TRUE);
|
||||
TEST ("a*b", "ab", TRUE, TRUE);
|
||||
TEST ("a*b", "axb", TRUE, TRUE);
|
||||
TEST ("a*b", "axxb", TRUE, TRUE);
|
||||
TEST ("a**b", "ab", TRUE, TRUE);
|
||||
TEST ("a**b", "axb", TRUE, TRUE);
|
||||
TEST ("a**b", "axxb", TRUE, TRUE);
|
||||
TEST ("a*?*b", "ab", TRUE, FALSE);
|
||||
TEST ("a*?*b", "axb", TRUE, TRUE);
|
||||
TEST ("a*?*b", "axxb", TRUE, TRUE);
|
||||
|
||||
/* Test of *[range] */
|
||||
TEST ("a*[cd]", "ac", TRUE);
|
||||
TEST ("a*[cd]", "axc", TRUE);
|
||||
TEST ("a*[cd]", "axx", FALSE);
|
||||
TEST ("a*[cd]", "ac", TRUE, TRUE);
|
||||
TEST ("a*[cd]", "axc", TRUE, TRUE);
|
||||
TEST ("a*[cd]", "axx", TRUE, FALSE);
|
||||
|
||||
TEST ("a/[.]", "a/.", FALSE);
|
||||
TEST ("a*[.]", "a/.", FALSE);
|
||||
TEST ("a/[.]", "a/.", TRUE, FALSE);
|
||||
TEST ("a*[.]", "a/.", TRUE, FALSE);
|
||||
|
||||
/* Test of UTF-8 */
|
||||
|
||||
TEST ("ä", "ä", TRUE); /* TEST ("ä", "ä", TRUE); */
|
||||
TEST ("?", "ä", TRUE); /* TEST ("?", "ä", TRUE); */
|
||||
TEST ("*ö", "äö", TRUE); /* TEST ("*ö", "äö", TRUE); */
|
||||
TEST ("*ö", "ääö", TRUE); /* TEST ("*ö", "ääö", TRUE); */
|
||||
TEST ("[ä]", "ä", TRUE); /* TEST ("[ä]", "ä", TRUE); */
|
||||
TEST ("[ä-ö]", "é", TRUE); /* TEST ("[ä-ö]", "é", TRUE); */
|
||||
TEST ("[ä-ö]", "a", FALSE); /* TEST ("[ä-ö]", "a", FALSE); */
|
||||
TEST ("ä", "ä", TRUE, TRUE); /* TEST ("ä", "ä", TRUE); */
|
||||
TEST ("?", "ä", TRUE, TRUE); /* TEST ("?", "ä", TRUE); */
|
||||
TEST ("*ö", "äö", TRUE, TRUE); /* TEST ("*ö", "äö", TRUE); */
|
||||
TEST ("*ö", "ääö", TRUE, TRUE); /* TEST ("*ö", "ääö", TRUE); */
|
||||
TEST ("[ä]", "ä", TRUE, TRUE); /* TEST ("[ä]", "ä", TRUE); */
|
||||
TEST ("[ä-ö]", "é", TRUE, TRUE); /* TEST ("[ä-ö]", "é", TRUE); */
|
||||
TEST ("[ä-ö]", "a", TRUE, FALSE); /* TEST ("[ä-ö]", "a", FALSE); */
|
||||
|
||||
#ifdef DO_ESCAPE
|
||||
/* Tests of escaping */
|
||||
TEST ("\\\\", "\\", TRUE);
|
||||
TEST ("\\?", "?", TRUE);
|
||||
TEST ("\\?", "a", FALSE);
|
||||
TEST ("\\*", "*", TRUE);
|
||||
TEST ("\\*", "a", FALSE);
|
||||
TEST ("\\[a-b]", "[a-b]", TRUE);
|
||||
TEST ("[\\\\]", "\\", TRUE);
|
||||
TEST ("[\\^a]", "a", TRUE);
|
||||
TEST ("[a\\-c]", "b", FALSE);
|
||||
TEST ("[a\\-c]", "-", TRUE);
|
||||
TEST ("[a\\]", "a", FALSE);
|
||||
TEST ("\\\\", "\\", TRUE, TRUE);
|
||||
TEST ("\\?", "?", TRUE, TRUE);
|
||||
TEST ("\\?", "a", TRUE, FALSE);
|
||||
TEST ("\\*", "*", TRUE, TRUE);
|
||||
TEST ("\\*", "a", TRUE, FALSE);
|
||||
TEST ("\\[a-b]", "[a-b]", TRUE, TRUE);
|
||||
TEST ("[\\\\]", "\\", TRUE, TRUE);
|
||||
TEST ("[\\^a]", "a", TRUE, TRUE);
|
||||
TEST ("[a\\-c]", "b", TRUE, FALSE);
|
||||
TEST ("[a\\-c]", "-", TRUE, TRUE);
|
||||
TEST ("[a\\]", "a", TRUE, FALSE);
|
||||
#endif /* DO_ESCAPE */
|
||||
|
||||
return 0;
|
||||
|
||||
+2
-2
@@ -121,7 +121,7 @@ _gtk_accel_path_is_valid (const gchar *accel_path)
|
||||
accel_path[1] == '<' || accel_path[1] == '>' || !accel_path[1])
|
||||
return FALSE;
|
||||
p = strchr (accel_path, '>');
|
||||
if (!p || p[1] != '/')
|
||||
if (!p || (p[1] != 0 && p[1] != '/'))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -364,7 +364,7 @@ internal_change_entry (const gchar *accel_path,
|
||||
if (!removable)
|
||||
goto break_loop_step5;
|
||||
if (ag_entry[i].accel_path_quark)
|
||||
replace_list = g_slist_prepend (replace_list, GUINT_TO_POINTER (ag_entry->accel_path_quark));
|
||||
replace_list = g_slist_prepend (replace_list, GUINT_TO_POINTER (ag_entry[i].accel_path_quark));
|
||||
}
|
||||
}
|
||||
break_loop_step5:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user