Compare commits
459 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6efdc2c552 | |||
| 22ac220190 | |||
| 952d3f505b | |||
| ca353b7fa2 | |||
| 8d16cc8c49 | |||
| 6c043829a9 | |||
| 0daf22bbd1 | |||
| 4cc60fd507 | |||
| d6a421f195 | |||
| 9e99955f55 | |||
| 09b07f3434 | |||
| f8de71ef6f | |||
| d17b2fae5b | |||
| c1a16ec063 | |||
| dcbacacfd4 | |||
| cdb6103689 | |||
| b6a15f21e2 | |||
| 4329dc904a | |||
| e72974371a | |||
| 055e32ece3 | |||
| 4b5ca53b32 | |||
| b407d73073 | |||
| 9061e6eceb | |||
| 85051bd972 | |||
| cfc4004862 | |||
| 8e5a93108b | |||
| 9cb0020230 | |||
| 2dbb188a5e | |||
| d600a38627 | |||
| 908364e30d | |||
| 650ade3e2d | |||
| 45e74e7742 | |||
| 981f7c3269 | |||
| ff92fd244a | |||
| 57d5b11d24 | |||
| fe87e35ac8 | |||
| f794cb4259 | |||
| a89315e38e | |||
| ca9070915a | |||
| a2de78cfea | |||
| 6a6f059c99 | |||
| 5f15e342f9 | |||
| 4465f7aabd | |||
| 0a86c2230e | |||
| 6f97292648 | |||
| 188b3d5f38 | |||
| 360c357f8f | |||
| 574f875146 | |||
| aeeaede190 | |||
| f4b56d140c | |||
| bfe6864c03 | |||
| 866096d039 | |||
| 71737f4d14 | |||
| 34579a11b3 | |||
| a9a49698fc | |||
| 8188594b73 | |||
| 3582604c0e | |||
| f1867cd355 | |||
| 62fdaec47e | |||
| 864fd11cdf | |||
| dd219a5112 | |||
| eb9862f889 | |||
| e17b6d1a2e | |||
| b14fb3091a | |||
| 552a69bc1e | |||
| 09e8356f96 | |||
| 4b25e80f50 | |||
| 35211e0e34 | |||
| 0ffc25735f | |||
| 27683d3c57 | |||
| 1216a77dd3 | |||
| 2d2ad5b7a8 | |||
| b5b6495c40 | |||
| 18383df52d | |||
| 9c44dfb07c | |||
| 91dc02591a | |||
| 94b2571215 | |||
| d9c56a2daa | |||
| 4261d83c9f | |||
| 9017c02a76 | |||
| 585a031032 | |||
| 5987ee1302 | |||
| 4117e38789 | |||
| e3e93f6362 | |||
| f01fdf1ba8 | |||
| e2a7d8519b | |||
| dc61c7e769 | |||
| 2a8da05d05 | |||
| 6c827aef8a | |||
| 746d28a9dd | |||
| b04368dba1 | |||
| 11167a98bd | |||
| 7de7ba548f | |||
| fb1a0b7d62 | |||
| d083357669 | |||
| 8da809253a | |||
| c4d17a42df | |||
| 3a0e00aa1f | |||
| 7c1a21d928 | |||
| abe51903b7 | |||
| 5a7f184e57 | |||
| f7c32f0e6d | |||
| 757e9830ff | |||
| 7feb206d02 | |||
| 04719c5da6 | |||
| a645b473ba | |||
| 13633e0d89 | |||
| d6a45265a4 | |||
| ea2eef7bd4 | |||
| 0075b342e9 | |||
| 1c39be5abb | |||
| 1dfa0ef23b | |||
| 7c0ed9ea8a | |||
| f91a9055ff | |||
| 5ad5e9aa62 | |||
| 2f6eea91c6 | |||
| a3a972d4fd | |||
| 5a23ae1fcb | |||
| d8d9bf88af | |||
| e4b64fdcfc | |||
| 6fea756129 | |||
| 433a163a1f | |||
| 05137fb63d | |||
| 5197f0c19d | |||
| 1da89e3efc | |||
| 871b511660 | |||
| 51420fcc03 | |||
| 8e33776188 | |||
| f9e2c279e3 | |||
| 441acdaec2 | |||
| 8eae55ec10 | |||
| 0d9115e303 | |||
| 74ce92f524 | |||
| 8d49bd81d6 | |||
| b0e90d1858 | |||
| 14fdea7c4f | |||
| a85841e827 | |||
| b5fbd51495 | |||
| a3c4bfba73 | |||
| dfbd07cb46 | |||
| a71eb3f768 | |||
| c80bca65f0 | |||
| 4f4dad93f0 | |||
| aa9d95a1d1 | |||
| 0202b6aaef | |||
| 981b10dd24 | |||
| c2698fbc8e | |||
| 8f4b598071 | |||
| 42da415403 | |||
| 8c5556808b | |||
| 218b29cf59 | |||
| 343aaa612a | |||
| 52c4bda3e9 | |||
| 1c60e7ba45 | |||
| fe86606062 | |||
| 95a1a84cb4 | |||
| a5dbedacc4 | |||
| b2b1f5e8ba | |||
| 5da99208c6 | |||
| 3b7138fb49 | |||
| 6707e385b7 | |||
| 03e3a60c39 | |||
| 31c1c86f48 | |||
| d06b2f19d5 | |||
| b6d93de016 | |||
| c0c79f82f5 | |||
| 6802957a0c | |||
| 3f029fc402 | |||
| 0dbd180a16 | |||
| 5302da5ff5 | |||
| 99e112a7a4 | |||
| f1b5dac5ac | |||
| 8a747e4449 | |||
| d583224137 | |||
| 772f13a3e2 | |||
| e4613b06b9 | |||
| cc084c1518 | |||
| d9bf1f407a | |||
| 70325ffeb0 | |||
| 96862220d3 | |||
| 3fee1b835f | |||
| 3b8e32e309 | |||
| f1b2404f13 | |||
| e0637869c0 | |||
| 28dd23beb6 | |||
| 70e9ffa6ff | |||
| f621767dc3 | |||
| 143e8cf48d | |||
| cff5ffc5ca | |||
| dc257f4003 | |||
| 84222a1a1a | |||
| eae0dee702 | |||
| 65e35529b1 | |||
| e3a98c525b | |||
| c07ed89395 | |||
| cae2bd114f | |||
| af9dc2e105 | |||
| 684afa1353 | |||
| d24163028e | |||
| 2d6203c0a3 | |||
| b0f0c30f1b | |||
| 65e58f5db1 | |||
| a8acc04415 | |||
| 749a1639cc | |||
| cec2b23e6b | |||
| f361d10ca1 | |||
| ff76a7c353 | |||
| 5582c1f311 | |||
| 37a25985d1 | |||
| 82b355f5a8 | |||
| c5e483055c | |||
| b0f8c022a3 | |||
| f29f8665fd | |||
| 071ba60b6e | |||
| d9d3beb099 | |||
| f85c1d6f26 | |||
| e71cac0e1a | |||
| 28235d58b4 | |||
| 0bc92be1c2 | |||
| 398405fdac | |||
| 658c98d77a | |||
| a672bb715a | |||
| 2042a08ab0 | |||
| 9e38c2e5ec | |||
| dd0f5b6567 | |||
| 69c615fcb1 | |||
| 643006f533 | |||
| f2bfc7d2c7 | |||
| 7904d1d663 | |||
| 25dc1c37fe | |||
| fbbc6bb79b | |||
| ca4cc77b50 | |||
| b096092530 | |||
| 09ffe845d9 | |||
| 57c4adc842 | |||
| e7fd4ff587 | |||
| 5b6c1d4f92 | |||
| 73ffaf1b0d | |||
| 31a101fb95 | |||
| 58f1891795 | |||
| f4d3373525 | |||
| 3b8378fb2f | |||
| 1b44a18767 | |||
| 8cfb7a3a7f | |||
| 2c67a17bc5 | |||
| c1dc8eed15 | |||
| f1e4445bce | |||
| c4f5ad3a0f | |||
| e067c2a9c4 | |||
| 609b29d2a8 | |||
| 45664bc0f6 | |||
| 6ee45ace1b | |||
| 5f425b9f27 | |||
| 2fe21816cc | |||
| adc808729b | |||
| 94946ec0e4 | |||
| b8c0aff312 | |||
| bf033cc8e6 | |||
| 81ecb7e80a | |||
| 87943c865c | |||
| 582a76843a | |||
| e44ece4e36 | |||
| 60baed1179 | |||
| 1457497c10 | |||
| 3a259d847d | |||
| 9aff7ba8e5 | |||
| 0d37ee8e59 | |||
| ab237e4a09 | |||
| 549ed2d785 | |||
| 09065c7696 | |||
| 39c59caa9d | |||
| f7d4be45ff | |||
| f84c758861 | |||
| 9af4e2c2c1 | |||
| 387cbde678 | |||
| 9e783527b3 | |||
| 472348534f | |||
| 35fbd14600 | |||
| a66732b586 | |||
| cf694bc246 | |||
| e3585dacce | |||
| 2696fbc98f | |||
| 1dc1b2c93f | |||
| 1d7f1372d0 | |||
| ec0e05525f | |||
| 9c8d313f38 | |||
| bf4292b24c | |||
| ceea5ef8fe | |||
| 56bc856b71 | |||
| 31be1165be | |||
| 36446419a3 | |||
| dafcd60b6c | |||
| 0c27054e73 | |||
| 8c5d2437f7 | |||
| 57fbd241ff | |||
| 610a91de25 | |||
| 138d13b2a4 | |||
| 4d8116d641 | |||
| 432d618f51 | |||
| ca8c78aecf | |||
| 5fc9179fce | |||
| 7e9215c616 | |||
| 51d3f7330c | |||
| dfbb9d64b5 | |||
| f0032274a8 | |||
| f7b6505060 | |||
| e4d9682836 | |||
| c994d518a8 | |||
| a8ebb5a029 | |||
| bd67c09866 | |||
| cac66b0176 | |||
| 18d5d86346 | |||
| 8ed5317593 | |||
| f2167ac6fe | |||
| 09d622339a | |||
| d922c751d5 | |||
| 529b689a35 | |||
| 50ad2bb2e7 | |||
| 70b686742c | |||
| 0c0f6961cb | |||
| 55fcbecc93 | |||
| 8dedc77abd | |||
| 45fe0becc7 | |||
| 5530d73ca0 | |||
| e80f1861d0 | |||
| c7fab5a23d | |||
| 8aea6870a7 | |||
| f677652d7d | |||
| a27ca7142b | |||
| 8ee4f373fe | |||
| 1a53f723c4 | |||
| 6c1036e9e9 | |||
| bfa5cea589 | |||
| 2d3fabf22f | |||
| 9d432c2f96 | |||
| cd20b58e1b | |||
| 057bccc78e | |||
| 62f50bfa0e | |||
| 028d675264 | |||
| adccef1bd0 | |||
| eacffc9508 | |||
| d89fd19f87 | |||
| 78dc4e83a2 | |||
| 5cb0f9b3a5 | |||
| 85bb7d41e1 | |||
| 66dd5d22e6 | |||
| a367726d57 | |||
| 0a474992c2 | |||
| 05f883f5b6 | |||
| 08cc81743b | |||
| c6e0fe3855 | |||
| 46f5b022e5 | |||
| 301e78d7db | |||
| de549ecdd3 | |||
| d8880ebb77 | |||
| 383ddaa39e | |||
| ebb80c587e | |||
| c50b3669ee | |||
| 2a0c24e934 | |||
| 44bb96f2c8 | |||
| 8a846eb737 | |||
| 1209ae2cc8 | |||
| ce69e17c53 | |||
| c577abf769 | |||
| 4794f2b309 | |||
| 6fe89cc83a | |||
| edf587b5d0 | |||
| cef800524a | |||
| 44fb34e048 | |||
| fa5b3494ce | |||
| 980b21ed3a | |||
| 565c6e3ba5 | |||
| de4153065e | |||
| a7cef089a8 | |||
| c2a0b5322c | |||
| 1b4ae4ff25 | |||
| 0d4e66328c | |||
| 91ba6c2dc6 | |||
| a57801b074 | |||
| c1b5a2d0ef | |||
| 785183c7fb | |||
| c2929809ff | |||
| 840d2ef409 | |||
| a9274b2f0c | |||
| 32931e7d08 | |||
| 410b70f907 | |||
| 0aa1bd5e97 | |||
| d7542b9af8 | |||
| 859145de52 | |||
| 5d2db8f012 | |||
| 1fa83a74f5 | |||
| cb9aff42c7 | |||
| 1124ea7c72 | |||
| ec80b47977 | |||
| 1fd687f7c2 | |||
| f1fa35441e | |||
| d7b7242847 | |||
| a2e485757c | |||
| 2c79e71d98 | |||
| c2d9124553 | |||
| 806bb88530 | |||
| ea696a2362 | |||
| 87234fd57b | |||
| 31ec94faa5 | |||
| 2dcfebc67f | |||
| d81b18a210 | |||
| 185087e553 | |||
| 26f74e40f6 | |||
| ff76bf8ba7 | |||
| 099100a9d3 | |||
| 94d05dfaf8 | |||
| f10a6beefc | |||
| fa7fc23f44 | |||
| f34a1f4807 | |||
| 8b4829abab | |||
| f21dfb358d | |||
| 5a1a08f160 | |||
| 0cc2d916f1 | |||
| dbe2343a7d | |||
| bd118b7212 | |||
| 175116ac7d | |||
| 12cf52e468 | |||
| c5162fa6e8 | |||
| 8aa2e2453e | |||
| 2488bbf9fc | |||
| 4dd906e7a7 | |||
| 4e3c34eab6 | |||
| 2083f3e262 | |||
| c400e38f98 | |||
| b2e2fe6ea3 | |||
| 115418d968 | |||
| 64fb36c3d8 | |||
| 2255a7225d | |||
| f4dc453e09 | |||
| a8749b2614 | |||
| 1c92d4b28d | |||
| 15c38b93e2 | |||
| 1fc3556064 | |||
| 31b514d831 | |||
| 752742d044 | |||
| e49d754fdc | |||
| 22f7b3ee23 | |||
| a704364549 | |||
| 21c7e08b21 | |||
| 2d509b1d84 | |||
| 5ef9c5a5bf | |||
| 77d170539a | |||
| 9255c12c87 | |||
| f2b3c6e6a3 | |||
| f6238492bc | |||
| fab341df09 | |||
| e11dcc5426 | |||
| bee067608a | |||
| 9eea275ed7 | |||
| 39e60a0564 | |||
| ac5905d0db | |||
| c962023b0d | |||
| a9d9b8581b | |||
| 78bd6b2844 |
+2234
File diff suppressed because it is too large
Load Diff
+2234
File diff suppressed because it is too large
Load Diff
+2234
File diff suppressed because it is too large
Load Diff
+2234
File diff suppressed because it is too large
Load Diff
+2234
File diff suppressed because it is too large
Load Diff
@@ -20,8 +20,8 @@ GTK+ requires the following packages:
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-2.0.2.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.0.2 # change to the toplevel directory
|
||||
% gzip -cd gtk+-2.0.9.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.0.9 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
|
||||
+1
-3
@@ -13,17 +13,15 @@ EXTRA_DIST = \
|
||||
NEWS.pre-1-0 \
|
||||
ChangeLog.pre-1-0 \
|
||||
ChangeLog.pre-1-2 \
|
||||
ChangeLog.pre-2-0 \
|
||||
README.cvs-commits \
|
||||
README.win32 \
|
||||
README.nanox \
|
||||
config.h.win32 \
|
||||
gtk-zip.sh \
|
||||
sanitize-la.sh \
|
||||
po/README.tools \
|
||||
po/README.translators \
|
||||
po/desk.pl \
|
||||
po/makefile.mingw \
|
||||
po/update.pl \
|
||||
po/po2tbl.sed.in \
|
||||
examples/aspectframe/Makefile \
|
||||
examples/aspectframe/aspectframe.c \
|
||||
|
||||
@@ -1,3 +1,140 @@
|
||||
Overview of Changes in GTK+ 2.0.9
|
||||
=================================
|
||||
* Fix colormap refcounting, which caused frequent metacity crashes
|
||||
[Christopher James Lahey]
|
||||
* Lots of work on the Win32 backend [Tor Lillqvist]
|
||||
- Scrolling fixes
|
||||
- GdkGC clipping fixes and improvements
|
||||
- Started implementing all fill styles
|
||||
* GtkTreeView bug fixes [Kristian Rietveld]
|
||||
- Make TreeView reordering work on FreeBSD/Solaris [Heiner Eichmann]
|
||||
* Various bug fixes
|
||||
|
||||
Other contributors: Matthias Clasen, Arnaud Charlet, Vitaly Tishkov,
|
||||
Josh Parsons, Peter Bloomfield
|
||||
|
||||
Overview of Changes in GTK+ 2.0.8
|
||||
=================================
|
||||
* Fix typo in io-gif.c that broke loading GIFS [Akira Tagoh]
|
||||
* Improve redraws when scrolling on Win32 [Tor Lillqvist]
|
||||
* Fix problem with RENDER and XFree86-4.1 [Owen Taylor, Jamie Zawinski]
|
||||
* Fix problem with GtkImage placement [Owen, Sven Neumann, Soeren Sandmann]
|
||||
* Updated translation (el)
|
||||
|
||||
Overview of Changes in GTK+ 2.0.7
|
||||
=================================
|
||||
* Fix some memory leaks in gdk-pixbuf [Sven Neumann]
|
||||
* Pixbuf loader fixes [Federico Mena Quintero, Elliot Lee]
|
||||
* Support depth 8 StaticColor in GdkRGB [Matthias Clasen]
|
||||
* Win32 fixes and improvements [Tor Lillqvist]
|
||||
- Keyboard handling fixes [Florian Dugent]
|
||||
- Fixes for building and running on Cygwin [Masahiro Sakai]
|
||||
- Fix gdk_window_scroll(), other GdkWindow fixes
|
||||
- Misc bug and build fixes [Soren Andersen, Florent, Tim Evans,
|
||||
J. Ali Harlow, Andreas Holzmann, Iwasa Kazmi]
|
||||
* Improve tracking of toplevel focus state [Owen]
|
||||
* XIM input method fixes [Takuro Ashie, HideToshi Tajima]
|
||||
* Fix the longstanding problem with <,> keys and XIM [Owen Taylor]
|
||||
* Fix GtkIMContextSimple for us-intl keyboards [Alexandre Oliva]
|
||||
* GtkIMContextSimple updates for Eastern Europe [Stanislav Brabec]
|
||||
* Fix the "key bindings randomly stop working" problem [Sebastian Ritau]
|
||||
* GtkTextView fixes [Gustavo Giraldez, Padraig O'Briain, Shivaram Upadhyayula]
|
||||
* GtkTreeView bugfixes [Jonathan Blandford, Kristian Rietveld]
|
||||
- Various memleak, ref counting fixes [Jonathan, Jorn Baayen, Daniel
|
||||
Elstner, Morten Welinder]
|
||||
- gtk_tree_selection_selected_foreach now immediately returns if
|
||||
the model is being changed [Havoc Pennington]
|
||||
- Fix evil bug with insertions to GtkTreeModelSort [Hans Petter Jansson]
|
||||
* GtkCombo fixes [Marco Pesenti Gritti, Zimler Attila, Matthias, Owen]
|
||||
* Fix 64-bit problem with GtkFundamentalType [Ross Alexander, Manish Singh]
|
||||
* New and updated translations (am,be,bg,ca,cs,da,de,el,es,el,fa,fr,hi,hu,
|
||||
ja,ko,lv,ms,nl,no,pl,pt,pt_BR,ru,sk,sv,vi,zh_TW)
|
||||
* Many miscellaneous bug fixes
|
||||
|
||||
Other contributors: Jacob Berkman, Alvert Chin, Chema Celorio,
|
||||
David L. Cooper II, Brent Fox, Tim Janik, Marco Pesenti Gritti,
|
||||
Alex Larsson, Zenith Lau, Thomas Leonard, Gaute Lindkvist,
|
||||
Paolo Maggi, Andy Wingo, Jami Pekannen, Joshua N Pritikin,
|
||||
Soeren Sandmann, Vitaly Tishkov, Morten Welinder
|
||||
|
||||
Overview of Changes in GTK+ 2.0.6
|
||||
=================================
|
||||
|
||||
* GtkTreeView bug fixes [Jonathan Blandford, Kristian Rietveld,
|
||||
Josh Green, Matthias Clasen]
|
||||
* Fix problem with keynav and insensitive menu items [Owen Taylor]
|
||||
* Fix pixbuf_from_drawable() for LSB -> MSB [Federico Mena Quintero]
|
||||
* Use GTK2_RC_FILES envvar instead of GTK_RC_FILES [Owen]
|
||||
* Focus check/radio buttons when activating with a mnemonic [Padraig O'Briain]
|
||||
* Cycle between multiple menubars with F10, not control-tab
|
||||
[Calum Benson, Padraig]
|
||||
* Misc bug fixes [Jacob Berkman, Matthias Clasen, Manuel Op de Coul,
|
||||
Bill Haneman, Norihiro UMEDA, Shivaram Upadhyayula, Yao Zhang]
|
||||
* Build fixes for cross-compiling and portability [Arnaud Charlet,
|
||||
J. Ali Harlow]
|
||||
* Updated translations (bg,ca,da,fr,ja,ko,lv,no,pl,ru,sk,sv,vi)
|
||||
|
||||
Overview of Changes in GTK+ 2.0.5
|
||||
=================================
|
||||
|
||||
* Fix a wrong assertion that broke gtk_file_selection_set_filename();
|
||||
also another fix from testing this function with non-UTF-8 filenames.
|
||||
* Fix incorrect property notification in GtkTextView. [James M. Cape]
|
||||
|
||||
Overview of Changes in GTK+ 2.0.4
|
||||
=================================
|
||||
|
||||
* Fix a number of types which were registered with the
|
||||
type system with the wrong names [James Henstridge, Jonathan Blandford]
|
||||
* Support missing data types in GtkList/TreeStore [Daniel Elstner]
|
||||
* Misc GtkTreeView bug fixes [Dave Camp, Jonathan, Daniel Elstner,
|
||||
Josh Parsons]
|
||||
* Drag and drop fixes, including a stuck grab. [Dave, Thomas Leonard,
|
||||
Owen Taylor]
|
||||
* Calculate screen size on win32 from the "logical DPI"
|
||||
[Joaquin Cuenca Abela, Tor Lillqvist]
|
||||
* Misc Win32 bug fixes. [Florent Duguet, Torn]
|
||||
* Fix theme changes for GtkMenu [Soeren Sandmann]
|
||||
* Fix gdk_pixbuf_from_drawable() for big endian. [Federico Mena Quintero]
|
||||
* Fix encoding handling for gtk_file_selection_set_filename()
|
||||
[Sebastian Ritau, Owen]
|
||||
* Fix crash with DND, Qt and Metacity [Cha Young-Ho, Havoc, Owen]
|
||||
* Fixes for DirectColor visuals [Shivaram Upadhyayula]
|
||||
* Memory leak and UMR fixes [Michael Meeks, Matthias Clasen, Valgrind]
|
||||
* Misc bug fixes
|
||||
* Updated translations (ca,cs,da,es,et,fr,ms,nl,pl,pt,pt_BR,ru,sv)
|
||||
|
||||
Other contributors: Nicholas Allen, Jacob Berkman, Remus Draica,
|
||||
Nano Golveia, Tim Janik, Sergey Kuzminov, George Lebl, Garrett Lesage,
|
||||
Robin Lu, Timo Meinen, Michel Selten, Boris Shingarov, Jeff Waugh
|
||||
|
||||
Overview of Changes in GTK+ 2.0.3
|
||||
=================================
|
||||
|
||||
* GtkTreeView fixes (Jonathan Blandford, Kristian Rietveld, Daniel Elstner)
|
||||
* Improve GdkRGB support for low color depths (Tor Lillqvist).
|
||||
* Tweak F10 behavior to focus GtkMenuBar. (Owen Taylor)
|
||||
* Include internal children when focusing. (Jonathan)
|
||||
* Win32 fixes (Tor Lillqvist, David Sterba)
|
||||
* Allow use of a pixmap as the drawable in gdk_pixmap_new(). (Kristian)
|
||||
* GdkPixbuf fixes (Matthias Clasen, Michael Natterer, Federico Mena Quintero)
|
||||
* GtkMenu fixes. (Soeren Sandmann)
|
||||
* Find gdk-pixbuf-csource when cross-compiling. (Michael Natterer)
|
||||
* Misc input-method related fixes (Yao Zhang, Federico)
|
||||
* Fix stuck grab during DND. (Dave Camp, Owen)
|
||||
* Remove in-bevel from scrolled-offscreen menus. (Ettore Perazzoli)
|
||||
* Various plug/socket fixes (Owen, Padraig O'Briain, Dave Camp,
|
||||
Michael Meeks)
|
||||
* Handle Xlib internal connections (HideToshi Tajima)
|
||||
* Many miscellaneous bug fixes.
|
||||
|
||||
Other contributors: Jacob Berkman, Abigail Brady, Rich Burridge,
|
||||
Anders Carlsson, Murray Cumming, Nalin Dahyabhai, James Henstridge,
|
||||
David Highley, Ben Liblitt, Tim Janik, Bill Jannsen, Lauris Kaplinski,
|
||||
Sergey Kuzminov, Alex Larsson, Sven Neumann, Havoc Pennington, Gareth Pearce,
|
||||
Simon Floery, Thomas Leonard, Detlef Reichl, Martin Schulze, Christophe Saout,
|
||||
Timo Sirainen, Graham Swallow.
|
||||
|
||||
Overview of Changes in GTK+ 2.0.2
|
||||
=================================
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 2.0.2. GTK+ is a multi-platform toolkit for
|
||||
This is GTK+ version 2.0.9. 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.
|
||||
|
||||
@@ -45,9 +45,6 @@
|
||||
#undef USE_GMODULE
|
||||
#undef USE_MMX
|
||||
|
||||
/* Define to use X11R6 additions to XIM */
|
||||
#undef USE_X11R6_XIM
|
||||
|
||||
/* Define to use XKB extension */
|
||||
#undef HAVE_XKB
|
||||
|
||||
|
||||
+5
-5
@@ -38,8 +38,8 @@ fi
|
||||
}
|
||||
|
||||
have_automake=false
|
||||
if automake --version < /dev/null > /dev/null 2>&1 ; then
|
||||
automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
|
||||
if automake-1.4 --version < /dev/null > /dev/null 2>&1 ; then
|
||||
automake_version=`automake-1.4 --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
|
||||
case $automake_version in
|
||||
1.2*|1.3*|1.4)
|
||||
;;
|
||||
@@ -78,7 +78,7 @@ esac
|
||||
|
||||
if test -z "$ACLOCAL_FLAGS"; then
|
||||
|
||||
acdir=`aclocal --print-ac-dir`
|
||||
acdir=`aclocal-1.4 --print-ac-dir`
|
||||
m4list="glib-2.0.m4 glib-gettext.m4"
|
||||
|
||||
for file in $m4list
|
||||
@@ -95,12 +95,12 @@ if test -z "$ACLOCAL_FLAGS"; then
|
||||
done
|
||||
fi
|
||||
|
||||
aclocal $ACLOCAL_FLAGS
|
||||
aclocal-1.4 $ACLOCAL_FLAGS
|
||||
|
||||
# optionally feature autoheader
|
||||
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
|
||||
|
||||
automake -a $am_opt
|
||||
automake-1.4 -a $am_opt
|
||||
autoconf
|
||||
cd $ORIGDIR
|
||||
|
||||
|
||||
+95
-60
@@ -1,3 +1,6 @@
|
||||
# require autoconf 2.52
|
||||
AC_PREREQ(2.52)
|
||||
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(gdk/gdktypes.h)
|
||||
|
||||
@@ -29,9 +32,9 @@ GLIB_AC_DIVERT_BEFORE_HELP([
|
||||
#
|
||||
GTK_MAJOR_VERSION=2
|
||||
GTK_MINOR_VERSION=0
|
||||
GTK_MICRO_VERSION=2
|
||||
GTK_INTERFACE_AGE=2
|
||||
GTK_BINARY_AGE=2
|
||||
GTK_MICRO_VERSION=9
|
||||
GTK_INTERFACE_AGE=9
|
||||
GTK_BINARY_AGE=9
|
||||
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
|
||||
dnl This is the X.Y used in -lgtk-FOO-X.Y
|
||||
GTK_API_VERSION=2.0
|
||||
@@ -77,7 +80,7 @@ AC_SUBST(GDK_PIXBUF_MICRO)
|
||||
AC_SUBST(GDK_PIXBUF_VERSION)
|
||||
|
||||
## Versions of dependencies
|
||||
GLIB_REQUIRED_VERSION=2.0.1
|
||||
GLIB_REQUIRED_VERSION=2.0.6
|
||||
PANGO_REQUIRED_VERSION=1.0.1
|
||||
ATK_REQUIRED_VERSION=1.0.1
|
||||
|
||||
@@ -169,8 +172,6 @@ AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]]
|
||||
, enable_ansi=no)
|
||||
AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
|
||||
, enable_xim="yes")
|
||||
AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
|
||||
, enable_xim_inst="maybe")
|
||||
AC_ARG_ENABLE(xkb, [ --enable-xkb support XKB [default=maybe]],
|
||||
, enable_xkb="maybe")
|
||||
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
|
||||
@@ -248,16 +249,44 @@ if test "x$GCC" = "xyes"; then
|
||||
*) CFLAGS="$CFLAGS -pedantic" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "$os_win32" = "yes"; then
|
||||
case "$CC $CFLAGS " in
|
||||
*[[\ \ ]]-fnative-struct[[\ \ ]]*) ;;
|
||||
*) CFLAGS="$CFLAGS -fnative-struct" ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
changequote([,])dnl
|
||||
|
||||
# Ensure MSVC-compatible struct packing convention is used when
|
||||
# compiling for Win32 with gcc.
|
||||
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
|
||||
# gcc2 uses "-fnative-struct".
|
||||
if test x"$os_win32" = xyes; then
|
||||
if test x"$GCC" = xyes; then
|
||||
msnative_struct=''
|
||||
AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
|
||||
if test -z "$ac_cv_prog_CC"; then
|
||||
our_gcc="$CC"
|
||||
else
|
||||
our_gcc="$ac_cv_prog_CC"
|
||||
fi
|
||||
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
|
||||
2.)
|
||||
if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
|
||||
msnative_struct='-fnative-struct'
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
|
||||
msnative_struct='-mms-bitfields'
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test x"$msnative_struct" = x ; then
|
||||
AC_MSG_RESULT([no way])
|
||||
AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
|
||||
else
|
||||
CFLAGS="$CFLAGS $msnative_struct"
|
||||
AC_MSG_RESULT([${msnative_struct}])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Honor aclocal flags
|
||||
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
|
||||
|
||||
@@ -310,7 +339,7 @@ AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
|
||||
# define a MAINT-like variable REBUILD which is set if Perl
|
||||
# and awk are found, so autogenerated sources can be rebuilt
|
||||
|
||||
AC_CHECK_PROGS(PERL, perl5 perl)
|
||||
AC_PATH_PROGS(PERL, perl5 perl)
|
||||
|
||||
# We would like indent, but don't require it.
|
||||
AC_CHECK_PROG(INDENT, indent, indent)
|
||||
@@ -323,7 +352,7 @@ if test "x$enable_rebuilds" = "xyes" && \
|
||||
fi
|
||||
AC_SUBST(REBUILD)
|
||||
|
||||
AC_CHECK_FUNCS(lstat mkstemp)
|
||||
AC_CHECK_FUNCS(lstat mkstemp flockfile)
|
||||
|
||||
# sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable
|
||||
AC_MSG_CHECKING(for sigsetjmp)
|
||||
@@ -352,7 +381,7 @@ AC_SUBST(STRIP_BEGIN)
|
||||
AC_SUBST(STRIP_END)
|
||||
|
||||
# i18n stuff
|
||||
ALL_LINGUAS="az ca cs cy da de el en_GB en@IPA es et eu fa fi fr ga gl he hr hu ia it ja ko lt ms nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
|
||||
ALL_LINGUAS="am ar az be bg ca cs cy da de el en_GB en@IPA es et eu fa fi fr ga gl he hi hr hu ia it ja ko lt lv ms nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
|
||||
@@ -431,7 +460,6 @@ LIBS=$gtk_save_LIBS
|
||||
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
|
||||
AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
|
||||
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
|
||||
AC_CHECK_HEADERS(winsock.h, AC_DEFINE(HAVE_WINSOCK_H))
|
||||
|
||||
if test "${with_ie55+set}" = set && test $with_ie55 != no; then
|
||||
AC_MSG_CHECKING([for dimm.h])
|
||||
@@ -500,6 +528,8 @@ AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
|
||||
saved_cflags="$CFLAGS"
|
||||
saved_ldflags="$LDFLAGS"
|
||||
|
||||
# check for bytesex stuff
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
@@ -736,6 +766,12 @@ dnl Test for libpng
|
||||
*** from CVS.])
|
||||
fi
|
||||
|
||||
REBUILD_PNGS=\#
|
||||
if test -z "$LIBPNG"; then
|
||||
REBUILD_PNGS=
|
||||
fi
|
||||
AC_SUBST(REBUILD_PNGS)
|
||||
|
||||
AC_SUBST(LIBTIFF)
|
||||
AC_SUBST(LIBJPEG)
|
||||
AC_SUBST(LIBPNG)
|
||||
@@ -774,7 +810,7 @@ INCLUDED_LOADER_DEFINE=
|
||||
|
||||
IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
|
||||
for loader in $included_loaders; do
|
||||
if echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
|
||||
if echo "$all_loaders" | egrep "(^|,)$loader(\$|,)" > /dev/null; then
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([the specified loader $loader does not exist])
|
||||
@@ -797,13 +833,13 @@ AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
|
||||
|
||||
if $dynworks ; then
|
||||
STATIC_LIB_DEPS=
|
||||
if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
|
||||
if echo "$included_loaders" | egrep '(^|,)tiff($|,)' > /dev/null; then
|
||||
STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
|
||||
fi
|
||||
if echo "$included_loaders" | grep "\(^\|\,\)jpeg\(\$\|\,\)" > /dev/null; then
|
||||
if echo "$included_loaders" | egrep '(^|,)jpeg($|,)' > /dev/null; then
|
||||
STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
|
||||
fi
|
||||
if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
|
||||
if echo "$included_loaders" | egrep '(^|,)png($|,)' > /dev/null; then
|
||||
STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
|
||||
fi
|
||||
else
|
||||
@@ -850,6 +886,16 @@ fi
|
||||
|
||||
AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
|
||||
|
||||
dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
|
||||
|
||||
if test $cross_compiling = yes; then
|
||||
AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
|
||||
if test x$GDK_PIXBUF_CSOURCE = xno; then
|
||||
AC_MSG_ERROR(Could not find a gdk-pixbuf-csource in your PATH)
|
||||
fi
|
||||
fi
|
||||
|
||||
GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
|
||||
GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
|
||||
@@ -940,7 +986,7 @@ if test "x$gdktarget" = "xx11"; then
|
||||
# then we need to repeat the checks.
|
||||
#
|
||||
x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
|
||||
case x_libs in
|
||||
case "$x_libs" in
|
||||
*-lX11*) pango_omitted_x_deps=no ;;
|
||||
*) pango_omitted_x_deps=yes ;;
|
||||
esac
|
||||
@@ -960,24 +1006,32 @@ if test "x$gdktarget" = "xx11"; then
|
||||
#
|
||||
# Checks for Xft/XRender
|
||||
#
|
||||
XFT_LIBS=""
|
||||
XFT_CFLAGS=""
|
||||
if test $have_xft = true ; then
|
||||
gtk_save_cppflags="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $x_cflags"
|
||||
have_xft=false
|
||||
|
||||
AC_CHECK_LIB(Xrender, XRenderFindFormat,
|
||||
[AC_CHECK_LIB(Xft, XftFontOpen,
|
||||
[AC_CHECK_HEADER(X11/Xft/XftFreetype.h,
|
||||
have_xft=true,:)],
|
||||
:,-lXrender -lXext $x_libs $FREETYPE_LIBS)]
|
||||
,:,-lXext $x_libs)
|
||||
if pkg-config --exists pangoxft '>=' 1.1.0 ; then
|
||||
x_libs="`pkg-config --libs xft` -lX11 $FREETYPE_LIBS $X_EXTRA_LIBS"
|
||||
have_xft=true
|
||||
else
|
||||
gtk_save_cppflags="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $x_cflags"
|
||||
|
||||
AC_CHECK_LIB(Xrender, XRenderFindFormat,
|
||||
[AC_CHECK_LIB(Xft, XftFontOpen,
|
||||
[AC_CHECK_HEADER(X11/Xft/XftFreetype.h,
|
||||
have_xft=true,:)],
|
||||
:,-lXrender -lXext $x_libs $FREETYPE_LIBS)]
|
||||
,:,-lXext $x_libs)
|
||||
|
||||
if $have_xft ; then
|
||||
x_libs="$X_LIBS -lXft -lXrender -lXext -lX11 $FREETYPE_LIBS $X_EXTRA_LIBS"
|
||||
fi
|
||||
|
||||
CPPFLAGS="$gtk_save_cppflags"
|
||||
CPPFLAGS="$gtk_save_cppflags"
|
||||
fi
|
||||
|
||||
if $have_xft ; then
|
||||
x_libs="$X_LIBS -lXft -lXrender -lXext -lX11 $FREETYPE_LIBS $X_EXTRA_LIBS"
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([pangoxft Pango backend found, but Xft not found])
|
||||
fi
|
||||
@@ -1017,7 +1071,7 @@ if test "x$gdktarget" = "xx11"; then
|
||||
|
||||
GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
|
||||
# Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
|
||||
GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs `$PKG_CONFIG --libs pangox`"
|
||||
GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs $x_libs"
|
||||
|
||||
# Check for shaped window extension
|
||||
|
||||
@@ -1038,31 +1092,8 @@ if test "x$gdktarget" = "xx11"; then
|
||||
|
||||
# Check for XIM support.
|
||||
|
||||
AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
|
||||
: ,
|
||||
enable_xim_inst="no",
|
||||
$x_libs_for_checks)
|
||||
|
||||
# On Solaris, calling XRegisterIMInstantiateCallback seems to
|
||||
# cause an immediate segfault, so we disable it, unless
|
||||
# the user specifically forces it to be on.
|
||||
|
||||
if test x$enable_xim_inst = xmaybe ; then
|
||||
case host in
|
||||
*-*-solaris*)
|
||||
enable_xim_inst="no"
|
||||
;;
|
||||
*)
|
||||
enable_xim_inst="yes"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_xim" = "xyes"; then
|
||||
GTK_XIM_FLAGS="-DUSE_XIM"
|
||||
if test "x$enable_xim_inst" = "xyes"; then
|
||||
AC_DEFINE(USE_X11R6_XIM)
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for XKB support.
|
||||
@@ -1137,6 +1168,9 @@ if test "x$gdktarget" = "xx11"; then
|
||||
|
||||
AM_CONDITIONAL(USE_X11, true)
|
||||
else
|
||||
AM_CONDITIONAL(HAVE_XFT, false)
|
||||
AM_CONDITIONAL(XINPUT_GXI, false)
|
||||
AM_CONDITIONAL(XINPUT_XFREE, false)
|
||||
AM_CONDITIONAL(USE_X11, false)
|
||||
fi
|
||||
|
||||
@@ -1177,7 +1211,7 @@ if test "x$gdktarget" = "xlinux-fb"; then
|
||||
fi
|
||||
|
||||
ft2_libs="`$PKG_CONFIG --libs pangoft2`"
|
||||
case ft2_libs in
|
||||
case "$ft2_libs" in
|
||||
*-lfreetype*) pango_omitted_ft2_deps=no ;;
|
||||
*) pango_omitted_ft2_deps=yes ;;
|
||||
esac
|
||||
@@ -1212,7 +1246,7 @@ fi
|
||||
|
||||
if test "x$gdktarget" = "xx11"; then
|
||||
if $have_xft = true ; then
|
||||
PANGO_PACKAGES="pangox pangoxft"
|
||||
PANGO_PACKAGES="pangoxft pangox"
|
||||
else
|
||||
PANGO_PACKAGES=pangox
|
||||
fi
|
||||
@@ -1474,6 +1508,7 @@ build/win32/Makefile
|
||||
build/win32/dirent/Makefile
|
||||
demos/Makefile
|
||||
demos/gtk-demo/Makefile
|
||||
demos/gtk-demo/geninclude.pl
|
||||
tests/Makefile
|
||||
docs/Makefile
|
||||
docs/reference/Makefile
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2002-08-06 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* Makefile.am (lib_LTLIBRARIES): link against xlib (bug #83442)
|
||||
|
||||
2002-01-25 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merge from gdk-pixbuf stable.
|
||||
|
||||
@@ -7,14 +7,13 @@ INCLUDES = @STRIP_BEGIN@ \
|
||||
@GDK_PIXBUF_XLIB_DEP_CFLAGS@ \
|
||||
@STRIP_END@
|
||||
|
||||
LDADDS = @STRIP_BEGIN@ \
|
||||
@GDK_PIXBUF_XLIB_DEP_LIBS@ \
|
||||
@STRIP_END@
|
||||
|
||||
libgdk_pixbuf_xlib_2_0_la_LDFLAGS = \
|
||||
-export-dynamic \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
|
||||
libgdk_pixbuf_xlib_2_0_la_LIBADD = \
|
||||
@GDK_PIXBUF_XLIB_DEP_LIBS@
|
||||
|
||||
libgdk_pixbuf_xlib_2_0_la_SOURCES = \
|
||||
gdk-pixbuf-xlib-private.h \
|
||||
gdk-pixbuf-xlib.c \
|
||||
|
||||
@@ -1145,7 +1145,7 @@ xlib_window_is_viewable (Window w)
|
||||
if (nchildren > 0)
|
||||
XFree (children);
|
||||
|
||||
if (parent == root)
|
||||
if ((parent == root) || (w == root))
|
||||
return TRUE;
|
||||
|
||||
w = parent;
|
||||
|
||||
+8
-3
@@ -32,11 +32,16 @@ noinst_PROGRAMS = \
|
||||
testpixbuf-scale \
|
||||
pixbuf-demo
|
||||
|
||||
test-inline-pixbufs.h: $(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource$(EXEEXT) apple-red.png gnome-foot.png
|
||||
if CROSS_COMPILING
|
||||
pixbuf_csource=$(GDK_PIXBUF_CSOURCE)
|
||||
else
|
||||
pixbuf_csource=GDK_PIXBUF_MODULEDIR=$$topdir/gdk-pixbuf/.libs $$topdir/gdk-pixbuf/gdk-pixbuf-csource
|
||||
endif
|
||||
|
||||
test-inline-pixbufs.h: $(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource apple-red.png gnome-foot.png
|
||||
(topdir=`cd $(top_builddir) && pwd` ; curdir=`pwd` ; \
|
||||
cd $(srcdir) && \
|
||||
GDK_PIXBUF_MODULEDIR=$$topdir/gdk-pixbuf/.libs \
|
||||
$$topdir/gdk-pixbuf/gdk-pixbuf-csource --build-list \
|
||||
$(pixbuf_csource) --build-list \
|
||||
apple_red apple-red.png gnome_foot gnome-foot.png >$$curdir/test-inline-pixbufs.h)
|
||||
|
||||
testpixbuf_DEPENDENCIES = $(DEPS)
|
||||
|
||||
@@ -55,7 +55,7 @@ EXTRA_DIST = \
|
||||
$(IMAGEFILES)
|
||||
|
||||
demos.h: $(demos) geninclude.pl
|
||||
(cd $(srcdir) && ./geninclude.pl $(demos) > demos.h)
|
||||
(cd $(srcdir) && $(PERL) ./geninclude.pl $(demos) > demos.h)
|
||||
|
||||
gtk_demo_SOURCES = \
|
||||
$(demos) \
|
||||
|
||||
@@ -158,7 +158,7 @@ cell_edited (GtkCellRendererText *cell,
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
|
||||
switch ((gint) column)
|
||||
switch (GPOINTER_TO_INT (column))
|
||||
{
|
||||
case COLUMN_NUMBER:
|
||||
{
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
print <<EOT;
|
||||
typedef GtkWidget *(*GDoDemoFunc) (void);
|
||||
|
||||
typedef struct _Demo Demo;
|
||||
|
||||
struct _Demo
|
||||
{
|
||||
gchar *title;
|
||||
gchar *filename;
|
||||
GDoDemoFunc func;
|
||||
Demo *children;
|
||||
};
|
||||
|
||||
EOT
|
||||
|
||||
for $file (@ARGV) {
|
||||
my %demo;
|
||||
|
||||
($basename = $file) =~ s/\.c$//;
|
||||
|
||||
open INFO_FILE, $file or die "Cannot open '$file'\n";
|
||||
$title = <INFO_FILE>;
|
||||
$title =~ s@^\s*/\*\s*@@;
|
||||
$title =~ s@\s*$@@;
|
||||
|
||||
close INFO_FILE;
|
||||
|
||||
print "GtkWidget *do_$basename (void);\n";
|
||||
|
||||
push @demos, {"title" => $title, "file" => $file,
|
||||
"func" => "do_$basename"};
|
||||
}
|
||||
|
||||
# generate a list of 'parent names'
|
||||
foreach $href (@demos) {
|
||||
if ($href->{"title"} =~ m|^([\w\s]+)/[\w\s]+$|) {
|
||||
my $parent_name = $1;
|
||||
my $do_next = 0;
|
||||
|
||||
# parent detected
|
||||
if (defined @parents) {
|
||||
foreach $foo (@parents) {
|
||||
if ($foo eq $parent_name) {
|
||||
$do_next = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($do_next) {
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
push @parents, $parent_name;
|
||||
|
||||
$tmp = (defined @child_arrays)?($#child_arrays + 1):0;
|
||||
push @child_arrays, "child$tmp";
|
||||
|
||||
push @demos, {"title" => $parent_name, "file" => "NULL",
|
||||
"func" => "NULL"};
|
||||
}
|
||||
}
|
||||
|
||||
if (defined @parents) {
|
||||
$i = 0;
|
||||
for ($i = 0; $i <= $#parents; $i++) {
|
||||
$first = 1;
|
||||
|
||||
print "\nDemo ", $child_arrays[$i], "[] = {\n";
|
||||
|
||||
$j = 0;
|
||||
for ($j = 0; $j <= $#demos; $j++) {
|
||||
$href = $demos[$j];
|
||||
|
||||
if (!defined $demos[$j]) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($demos[$j]{"title"} =~ m|^$parents[$i]/([\w\s]+)$|) {
|
||||
if ($first) {
|
||||
$first = 0;
|
||||
} else {
|
||||
print ",\n";
|
||||
}
|
||||
|
||||
print qq ( { "$1", "$demos[$j]{file}", $demos[$j]{func}, NULL });
|
||||
|
||||
# hack ... ugly
|
||||
$demos[$j]{"title"} = "foo";
|
||||
}
|
||||
}
|
||||
|
||||
print ",\n";
|
||||
print qq ( { NULL } );
|
||||
print "\n};\n";
|
||||
}
|
||||
}
|
||||
|
||||
# sort @demos
|
||||
@demos_old = @demos;
|
||||
|
||||
@demos = sort {
|
||||
$a->{"title"} cmp $b->{"title"};
|
||||
} @demos_old;
|
||||
|
||||
# sort the child arrays
|
||||
if (defined @child_arrays) {
|
||||
for ($i = 0; $i <= $#child_arrays; $i++) {
|
||||
@foo_old = @{$child_arrays[$i]};
|
||||
|
||||
@{$child_arrays[$i]} = sort {
|
||||
$a->{"title"} cmp $b->{"title"};
|
||||
} @foo_old;
|
||||
}
|
||||
}
|
||||
|
||||
# toplevel
|
||||
print "\nDemo testgtk_demos[] = {\n";
|
||||
|
||||
$first = 1;
|
||||
foreach $href (@demos) {
|
||||
$handled = 0;
|
||||
|
||||
# ugly evil hack
|
||||
if ($href->{title} eq "foo") {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($first) {
|
||||
$first = 0;
|
||||
} else {
|
||||
print ", \n";
|
||||
}
|
||||
|
||||
if (defined @parents) {
|
||||
for ($i = 0; $i <= $#parents; $i++) {
|
||||
if ($parents[$i] eq $href->{title}) {
|
||||
|
||||
if ($href->{file} eq 'NULL') {
|
||||
print qq ( { "$href->{title}", NULL, $href->{func}, $child_arrays[$i] });
|
||||
} else {
|
||||
print qq ( { "$href->{title}", "$href->{file}", $href->{func}, $child_arrays[$i] });
|
||||
}
|
||||
|
||||
$handled = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($handled) {
|
||||
next;
|
||||
}
|
||||
|
||||
print qq ( { "$href->{title}", "$href->{file}", $href->{func}, NULL });
|
||||
}
|
||||
|
||||
print ",\n";
|
||||
print qq ( { NULL } );
|
||||
print "\n};\n";
|
||||
|
||||
exit 0;
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!@PERL@ -w
|
||||
|
||||
print <<EOT;
|
||||
typedef GtkWidget *(*GDoDemoFunc) (void);
|
||||
|
||||
@@ -86,7 +86,7 @@ read_line (FILE *stream, GString *str)
|
||||
{
|
||||
int n_read = 0;
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
flockfile (stream);
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,7 @@ read_line (FILE *stream, GString *str)
|
||||
case '\r':
|
||||
case '\n':
|
||||
{
|
||||
#ifndef G_OS_WIN32
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
int next_c = getc_unlocked (stream);
|
||||
#else
|
||||
int next_c = getc (stream);
|
||||
@@ -132,7 +132,7 @@ read_line (FILE *stream, GString *str)
|
||||
|
||||
done:
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
funlockfile (stream);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1,3 +1,38 @@
|
||||
2002-11-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkfilesel.sgml: The label is "Folders" now, not
|
||||
"Directories". (#97224, Vitaly Tishkov)
|
||||
|
||||
* gtk/tree_widget.sgml (select): use GTK_SELECTION_SINGLE, not
|
||||
GTK_SELECT_SINGLE. (#96516, Erik Grinaker)
|
||||
|
||||
Mon Jul 29 22:36:06 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkfilesel.sgml: Fix up the example program
|
||||
a bit. (#88814, Johnson Wong)
|
||||
|
||||
2002-07-16 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* gdk/tmpl/rgb.sgml: fixed the example code (return TRUE from the
|
||||
expose_event handler).
|
||||
|
||||
2002-04-24 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/tmpl/gtksocket.sgml:
|
||||
* gtk/tmpl/gtkdrawingarea.sgml:
|
||||
* gtk/tmpl/gtktreemodel.sgml:
|
||||
* gtk/tmpl/gtkradiomenuitem.sgml:
|
||||
* gtk/tmpl/gtkwidget.sgml:
|
||||
* gtk/tmpl/gtkdialog.sgml:
|
||||
* gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml:
|
||||
* gtk/text_widget.sgml:
|
||||
* gtk/tree_widget.sgml:
|
||||
* gtk/gtk-sections.txt:
|
||||
* gdk/tmpl/properties.sgml: Documentation fixes. (#79001, #67818,
|
||||
#79080, #78661, #78392, #75588, #72312, #74439)
|
||||
|
||||
Tue Mar 26 15:41:49 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/building.sgml: Add a mention of running ldconfig.
|
||||
|
||||
@@ -10,7 +10,8 @@ Application-driven progressive image loading.
|
||||
process of loading an image, by letting them send the image data
|
||||
directly to the loader instead of having the loader read the data
|
||||
from a file. Applications can use this functionality instead of
|
||||
gdk_pixbuf_new_from_file() when they need to parse image data in
|
||||
gdk_pixbuf_new_from_file() or gdk_pixbuf_animation_new_from_file()
|
||||
when they need to parse image data in
|
||||
small chunks. For example, it should be used when reading an
|
||||
image from a (potentially) slow network connection, or when
|
||||
loading an extremely large file.
|
||||
@@ -47,31 +48,18 @@ Application-driven progressive image loading.
|
||||
<title>Loading an animation</title>
|
||||
|
||||
<para>
|
||||
Loading an animation is a little more complex then loading an
|
||||
image. In addition to the above signals, there is also a "<link
|
||||
linkend="GdkPixbufLoader-frame-done">frame_done</link>" signal,
|
||||
as well as an "<link
|
||||
linkend="GdkPixbufLoader-animation-done">animation_done</link>"
|
||||
signal. The first lets the application know that it is dealing
|
||||
with an animation, instead of a static image. It also passes a
|
||||
#GdkPixbufFrame in the signal. As before, if you want to keep
|
||||
the frame, you need to ref it. Once the first "<link
|
||||
linkend="GdkPixbufLoader-frame-done">frame_done</link>" signal
|
||||
Loading an animation is almost as easy as loading an
|
||||
image. Once the first "<link
|
||||
linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" signal
|
||||
has been emitted, you can call gdk_pixbuf_loader_get_animation()
|
||||
to get the #GdkPixbufAnimation struct. Each subsequent frame
|
||||
goes through a similar lifecycle. For example "<link
|
||||
linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" is
|
||||
re-emitted. Then "<link
|
||||
linkend="GdkPixbufLoader-area-updated">area_updated</link>" is
|
||||
emitted as many times as necessary. Finally, "<link
|
||||
linkend="GdkPixbufLoader-animation-done">animation_done</link>"
|
||||
is emitted as soon as all frames are done.
|
||||
to get the #GdkPixbufAnimation struct and gdk_pixbuf_animation_get_iter()
|
||||
to get an #GdkPixbufAnimationIter for displaying it.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
gdk_pixbuf_new_from_file()
|
||||
gdk_pixbuf_new_from_file(), gdk_pixbuf_animation_new_from_file()
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gdk_pixbuf_loader_new ##### -->
|
||||
|
||||
@@ -545,25 +545,6 @@ relation to the baseline. See gdk_text_extents().
|
||||
@Returns: the height of the character in pixels.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_font_full_name_get ##### -->
|
||||
<para>
|
||||
Returns a comma-separated list of XLFDs for the
|
||||
fonts making up a given #GdkFont.
|
||||
</para>
|
||||
|
||||
@font: a #GdkFont
|
||||
@Returns: a newly-allocated string containing a list of XLFDs,
|
||||
should be freed with gdk_font_full_name_free() when no longer needed.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_font_full_name_free ##### -->
|
||||
<para>
|
||||
Frees a full font name obtained from gdk_font_full_name_get().
|
||||
</para>
|
||||
|
||||
@name: a full font name.
|
||||
|
||||
|
||||
<!-- ##### TYPEDEF GdkWChar ##### -->
|
||||
<para>
|
||||
Specifies a wide character type, used to represent character codes.
|
||||
|
||||
@@ -596,6 +596,23 @@ status information, so the application does not need to do anything.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_font_full_name_free ##### -->
|
||||
<para>
|
||||
Frees a full font name obtained from gdk_font_full_name_get().
|
||||
</para>
|
||||
|
||||
@name: a full font name.
|
||||
|
||||
<!-- ##### FUNCTION gdk_font_full_name_get ##### -->
|
||||
<para>
|
||||
Returns a comma-separated list of XLFDs for the
|
||||
fonts making up a given #GdkFont.
|
||||
</para>
|
||||
|
||||
@font: a #GdkFont
|
||||
@Returns: a newly-allocated string containing a list of XLFDs,
|
||||
should be freed with gdk_font_full_name_free() when no longer needed.
|
||||
|
||||
<!-- ##### FUNCTION gdk_get_client_window ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -244,10 +244,10 @@ Changes the contents of a property on a window.
|
||||
@window: a #GdkWindow.
|
||||
@property: the property to change.
|
||||
@type: the new type for the property. If @mode is
|
||||
%GDK_PROP_MODE_REPLACE or %GDK_PROP_MODE_APPEND, then this
|
||||
%GDK_PROP_MODE_PREPEND or %GDK_PROP_MODE_APPEND, then this
|
||||
must match the existing type or an error will occur.
|
||||
@format: the new format for the property. If @mode is
|
||||
%GDK_PROP_MODE_REPLACE or %GDK_PROP_MODE_APPEND, then this
|
||||
%GDK_PROP_MODE_PREPEND or %GDK_PROP_MODE_APPEND, then this
|
||||
must match the existing format or an error will occur.
|
||||
@mode: a value describing how the new data is to be combined
|
||||
with the current data.
|
||||
|
||||
@@ -90,6 +90,8 @@ on_darea_expose (GtkWidget *widget,
|
||||
gdk_draw_rgb_image (widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
|
||||
0, 0, IMAGE_WIDTH, IMAGE_HEIGHT,
|
||||
GDK_RGB_DITHER_MAX, rgbbuf, IMAGE_WIDTH * 3);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
@@ -1690,7 +1690,6 @@ GTK_OBJECT_TYPE_NAME
|
||||
GtkObjectFlags
|
||||
GTK_OBJECT_FLAGS
|
||||
GTK_OBJECT_FLOATING
|
||||
GTK_OBJECT_CONNECTED
|
||||
GtkArgFlags
|
||||
gtk_object_new
|
||||
gtk_object_sink
|
||||
@@ -3447,6 +3446,7 @@ gtk_vseparator_get_type
|
||||
<FILE>gtkwidget</FILE>
|
||||
<TITLE>GtkWidget</TITLE>
|
||||
GtkWidget
|
||||
GtkWidgetClass
|
||||
GtkWidgetFlags
|
||||
GTK_WIDGET_TYPE
|
||||
GTK_WIDGET_STATE
|
||||
|
||||
@@ -162,7 +162,7 @@ font and foreground color &mdash use standard
|
||||
functions such as
|
||||
<link linkend="gtk-widget-modify-font">gtk_widget_modify_font()</link>
|
||||
or
|
||||
<link linkend="gtk-widget-modify-fg">gtk_widget_modify_fg()</link>.
|
||||
<link linkend="gtk-widget-modify-fg">gtk_widget_modify_text()</link>.
|
||||
For other attributes there are dedicated methods on
|
||||
<link linkend="GtkTextView">GtkTextView</link> such as
|
||||
<link linkend="gtk-text-view-set-tabs">gtk_text_view_set_tabs()</link>.
|
||||
@@ -170,6 +170,7 @@ For other attributes there are dedicated methods on
|
||||
<informalexample><programlisting>
|
||||
GtkWidget *view;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start, end;
|
||||
PangoFontDescription *font_desc;
|
||||
GdkColor color;
|
||||
GtkTextTag *tag;
|
||||
@@ -187,7 +188,7 @@ For other attributes there are dedicated methods on
|
||||
|
||||
/* Change default color throughout the widget */
|
||||
gdk_color_parse ("green", &color);
|
||||
gtk_widget_modify_fg (view, GTK_STATE_NORMAL, &color);
|
||||
gtk_widget_modify_text (view, GTK_STATE_NORMAL, &color);
|
||||
|
||||
/* Change left margin throughout the widget */
|
||||
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 30);
|
||||
|
||||
@@ -585,6 +585,42 @@ Define a function pointer. Deprecated.
|
||||
@arg:
|
||||
@arg_id:
|
||||
|
||||
<!-- ##### ARG GtkBox:expand ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkBox:fill ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkBox:pack-type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkBox:padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkBox:position ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkButtonBox:secondary ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkCellRendererTextPixbuf ##### -->
|
||||
<para>
|
||||
|
||||
@@ -817,6 +853,18 @@ You may not attach these to signals created with the
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkFixed:x ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkFixed:y ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkFontFilterType ##### -->
|
||||
<para>
|
||||
A set of bit flags used to specify the filter being set
|
||||
@@ -877,6 +925,18 @@ a RC file.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkLayout:x ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkLayout:y ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuBar::cycle-focus ##### -->
|
||||
<para>
|
||||
|
||||
@@ -885,6 +945,42 @@ a RC file.
|
||||
@menubar: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### ARG GtkNotebook:menu-label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkNotebook:position ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-expand ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-fill ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-pack ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkObject:object-signal ##### -->
|
||||
<para>
|
||||
Setting this with a GtkType of GTK_TYPE_SIGNAL connects
|
||||
@@ -1190,6 +1286,54 @@ Holds the data for a statusbar message. <structfield>text</structfield> holds th
|
||||
@_gtk_reserved11:
|
||||
@_gtk_reserved12:
|
||||
|
||||
<!-- ##### ARG GtkTable:bottom-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkTable:left-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkTable:right-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkTable:top-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkTable:x-options ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkTable:x-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkTable:y-options ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkTable:y-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTextBTreeNode ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -5,40 +5,40 @@ GtkButton
|
||||
A widget that creates a signal when clicked on.
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkButton widget is generally used to attach a function to that
|
||||
is called when the button is pressed. The various signals and how to use
|
||||
them are outlined below.
|
||||
</para>
|
||||
<para>
|
||||
The #GtkButton widget can hold any valid child widget. That is it can
|
||||
hold most any other standard #GtkWidget. The most commonly used child is
|
||||
the #GtkLabel.
|
||||
<para>
|
||||
The #GtkButton widget is generally used to attach a function to that
|
||||
is called when the button is pressed. The various signals and how to use
|
||||
them are outlined below.
|
||||
</para>
|
||||
<para>
|
||||
The #GtkButton widget can hold any valid child widget. That is it can
|
||||
hold most any other standard #GtkWidget. The most commonly used child is
|
||||
the #GtkLabel.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### STRUCT GtkButton ##### -->
|
||||
<para>
|
||||
This should not be accessed directly. Use the accessor functions below.
|
||||
<para>
|
||||
This should not be accessed directly. Use the accessor functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_new ##### -->
|
||||
<para>
|
||||
Creates a new #GtkButton widget.
|
||||
<para>
|
||||
Creates a new #GtkButton widget.
|
||||
</para>
|
||||
|
||||
@Returns: The newly created #GtkButton widget.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_new_with_label ##### -->
|
||||
<para>
|
||||
Creates a #GtkButton widget with a #GtkLabel child containing the given
|
||||
text.
|
||||
<para>
|
||||
Creates a #GtkButton widget with a #GtkLabel child containing the given
|
||||
text.
|
||||
</para>
|
||||
|
||||
@label: The text you want the #GtkLabel to hold.
|
||||
@@ -64,52 +64,52 @@ text.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_pressed ##### -->
|
||||
<para>
|
||||
Emits a #GtkButton::pressed signal to the given #GtkButton.
|
||||
<para>
|
||||
Emits a #GtkButton::pressed signal to the given #GtkButton.
|
||||
</para>
|
||||
|
||||
@button: The #GtkButton you want to send the signal to.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_released ##### -->
|
||||
<para>
|
||||
Emits a #GtkButton::released signal to the given #GtkButton.
|
||||
<para>
|
||||
Emits a #GtkButton::released signal to the given #GtkButton.
|
||||
</para>
|
||||
|
||||
@button: The #GtkButton you want to send the signal to.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_clicked ##### -->
|
||||
<para>
|
||||
Emits a #GtkButton::clicked signal to the given #GtkButton.
|
||||
<para>
|
||||
Emits a #GtkButton::clicked signal to the given #GtkButton.
|
||||
</para>
|
||||
|
||||
@button: The #GtkButton you want to send the signal to.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_enter ##### -->
|
||||
<para>
|
||||
Emits a #GtkButton::enter signal to the given #GtkButton.
|
||||
<para>
|
||||
Emits a #GtkButton::enter signal to the given #GtkButton.
|
||||
</para>
|
||||
|
||||
@button: The #GtkButton you want to send the signal to.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_leave ##### -->
|
||||
<para>
|
||||
Emits a #GtkButton::leave signal to the given #GtkButton.
|
||||
<para>
|
||||
Emits a #GtkButton::leave signal to the given #GtkButton.
|
||||
</para>
|
||||
|
||||
@button: The #GtkButton you want to send the signal to.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_set_relief ##### -->
|
||||
<para>
|
||||
Sets the relief style of the edges of the given #GtkButton widget.
|
||||
Three styles exist, GTK_RELIEF_NORMAL, GTK_RELIEF_HALF, GTK_RELIEF_NONE.
|
||||
The default style is, as one can guess, GTK_RELIEF_NORMAL.
|
||||
|
||||
<!-- FIXME: put pictures of each style -->
|
||||
<para>
|
||||
Sets the relief style of the edges of the given #GtkButton widget.
|
||||
Three styles exist, GTK_RELIEF_NORMAL, GTK_RELIEF_HALF, GTK_RELIEF_NONE.
|
||||
The default style is, as one can guess, GTK_RELIEF_NORMAL.
|
||||
|
||||
<!-- FIXME: put pictures of each style -->
|
||||
</para>
|
||||
|
||||
@button: The #GtkButton you want to set relief styles of.
|
||||
@@ -117,8 +117,8 @@ The default style is, as one can guess, GTK_RELIEF_NORMAL.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_button_get_relief ##### -->
|
||||
<para>
|
||||
Returns the current relief style of the given #GtkButton.
|
||||
<para>
|
||||
Returns the current relief style of the given #GtkButton.
|
||||
</para>
|
||||
|
||||
@button: The #GtkButton you want the #GtkReliefStyle from.
|
||||
@@ -191,52 +191,52 @@ Returns the current relief style of the given #GtkButton.
|
||||
@button: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkButton::clicked ##### -->
|
||||
<para>
|
||||
Emitted when a button clicked on by the mouse and the cursor stays on the
|
||||
button. If the cursor is not on the button when the mouse button is released,
|
||||
the signal is not emitted.
|
||||
<para>
|
||||
Emitted when a button clicked on by the mouse and the cursor stays on the
|
||||
button. If the cursor is not on the button when the mouse button is released,
|
||||
the signal is not emitted.
|
||||
</para>
|
||||
|
||||
@button: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkButton::enter ##### -->
|
||||
<para>
|
||||
Emitted when the mouse cursor enters the region of the button.
|
||||
<para>
|
||||
Emitted when the mouse cursor enters the region of the button.
|
||||
</para>
|
||||
|
||||
@button: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkButton::leave ##### -->
|
||||
<para>
|
||||
Emitted when the mouse cursor leaves the region of the button.
|
||||
<para>
|
||||
Emitted when the mouse cursor leaves the region of the button.
|
||||
</para>
|
||||
|
||||
@button: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkButton::pressed ##### -->
|
||||
<para>
|
||||
Emitted when the button is initially pressed.
|
||||
<para>
|
||||
Emitted when the button is initially pressed.
|
||||
</para>
|
||||
|
||||
@button: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkButton::released ##### -->
|
||||
<para>
|
||||
Emitted when a button which is pressed is released, no matter where the
|
||||
mouse cursor is.
|
||||
<para>
|
||||
Emitted when a button which is pressed is released, no matter where the
|
||||
mouse cursor is.
|
||||
</para>
|
||||
|
||||
@button: the object which received the signal.
|
||||
|
||||
<!-- ##### ARG GtkButton:label ##### -->
|
||||
<para>
|
||||
The text within the child #GtkLabel of the #GtkButton. Only useful if
|
||||
there is actually a #GtkLabel inside of the #GtkButton.
|
||||
<para>
|
||||
The text within the child #GtkLabel of the #GtkButton. Only useful if
|
||||
there is actually a #GtkLabel inside of the #GtkButton.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkButton:relief ##### -->
|
||||
<para>
|
||||
The #GtkReliefStyle as outlined in gtk_button_set_relief().
|
||||
<para>
|
||||
The #GtkReliefStyle as outlined in gtk_button_set_relief().
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkButton:use-underline ##### -->
|
||||
|
||||
@@ -82,7 +82,7 @@ void quick_message (gchar *message) {
|
||||
dialog = gtk_dialog_new_with_buttons ("Message",
|
||||
main_application_window,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_STOCK_BUTTON_OK,
|
||||
GTK_STOCK_OK,
|
||||
GTK_RESPONSE_NONE,
|
||||
NULL);
|
||||
label = gtk_label_new (message);
|
||||
|
||||
@@ -53,7 +53,7 @@ that drawing is implicitly clipped to the exposed area.
|
||||
<title>Simple <structname>GtkDrawingArea</structname> usage.</title>
|
||||
<programlisting>
|
||||
gboolean
|
||||
expose_event_callback (GdkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
expose_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
{
|
||||
gdk_draw_arc (widget->window,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
@@ -64,7 +64,7 @@ expose_event_callback (GdkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
return TRUE;
|
||||
}
|
||||
[...]
|
||||
GtkWidget *drawing_area = gtk_drawing_area_new (<!>);
|
||||
GtkWidget *drawing_area = gtk_drawing_area_new (<!-- -->);
|
||||
gtk_widget_set_size_request (drawing_area, 100, 100);
|
||||
g_signal_connect (G_OBJECT (drawing_area), "expose_event",
|
||||
G_CALLBACK (expose_event_callback), NULL);
|
||||
|
||||
@@ -34,15 +34,17 @@ Simple file operations; create directory, delete file, and rename file, are avai
|
||||
|
||||
/* The file selection widget and the string to store the chosen filename */
|
||||
|
||||
GtkWidget *file_selector;
|
||||
gchar *selected_filename;
|
||||
void store_filename (GtkFileSelection *file_selector, gpointer user_data) {
|
||||
const gchar *selected_filename;
|
||||
|
||||
void store_filename (GtkFileSelection *selector, gpointer user_data) {
|
||||
selected_filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_selector));
|
||||
g_print ("Selected filename: %s\n", selected_filename);
|
||||
}
|
||||
|
||||
void create_file_selection (void) {
|
||||
|
||||
GtkWidget *file_selector;
|
||||
|
||||
/* Create the selector */
|
||||
|
||||
file_selector = gtk_file_selection_new ("Please select a file for editing.");
|
||||
@@ -133,12 +135,10 @@ Creates a new file selection dialog box. By default it will contain a #GtkCList
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_set_filename ##### -->
|
||||
<para>
|
||||
Sets a default path for the file requestor. If @filename includes a directory path, then the requestor will open with that path as its current working directory.
|
||||
|
||||
</para>
|
||||
|
||||
@filesel: a #GtkFileSelection.
|
||||
@filename: a string to set as the default file name.
|
||||
@filesel:
|
||||
@filename:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_get_filename ##### -->
|
||||
@@ -154,7 +154,7 @@ Retrieves the currently selected filename from the file selection dialog. If no
|
||||
<para>
|
||||
Will attempt to match @pattern to a valid filenames or subdirectories in the current directory. If a match can be made, the matched filename will appear in the text entry field of the file selection dialog.
|
||||
If a partial match can be made, the "Files" list will contain those
|
||||
file names which have been partially matched, and the "Directories"
|
||||
file names which have been partially matched, and the "Folders"
|
||||
list those directories which have been partially matched.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ for(i = 0; i < 5; i++)
|
||||
<listitem><para>because a radio menu item is a menu item.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>#GtkCheckItem</term>
|
||||
<term>#GtkCheckMenuItem</term>
|
||||
<listitem><para>to know how to handle the check.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -29,7 +29,7 @@ The set of these <firstterm>default</firstterm> files
|
||||
can be retrieved with gtk_rc_get_default_files()
|
||||
and modified with gtk_rc_add_default_file() and
|
||||
gtk_rc_set_default_files().
|
||||
Additionally, the <envar>GTK_RC_FILES</envar> environment variable
|
||||
Additionally, the <envar>GTK2_RC_FILES</envar> environment variable
|
||||
can be set to a #G_SEARCHPATH_SEPARATOR_S-separated list of files
|
||||
in order to overwrite the set of default files at runtime.
|
||||
</para>
|
||||
@@ -792,11 +792,9 @@ otherwise %NULL.
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_get_module_dir ##### -->
|
||||
<para>
|
||||
Returns the directory in which GTK+ will look for
|
||||
theme engines.
|
||||
</para>
|
||||
|
||||
@Returns: The directory. (Must be freed with g_free())
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_get_im_module_path ##### -->
|
||||
|
||||
@@ -25,7 +25,7 @@ have been added to its parent.
|
||||
<example>
|
||||
<title>Obtaining the window ID of a socket.</title>
|
||||
<programlisting>
|
||||
GtkWidget *socket = gtk_socket_new (<!>);
|
||||
GtkWidget *socket = gtk_socket_new (<!-- -->);
|
||||
gtk_widget_show (socket);
|
||||
gtk_container_add (GTK_CONTAINER (parent), socket);
|
||||
|
||||
@@ -62,6 +62,13 @@ to be destroyed at any time when the main event loop
|
||||
is running.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The communication between a #GtkSocket and a #GtkPlug follows the
|
||||
<ulink url="http://www.freedesktop.org/standards/xembed.html">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>
|
||||
|
||||
<para>
|
||||
A socket can also be used to swallow arbitrary
|
||||
pre-existing top-level windows using gtk_socket_steal(),
|
||||
@@ -77,6 +84,11 @@ as between a #GtkPlug and a #GtkSocket.</para>
|
||||
<listitem><para>the widget that plugs into a #GtkSocket.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><ulink url="http://www.freedesktop.org/standards/xembed.html">XEmbed</ulink></term>
|
||||
<listitem><para>the XEmbed Protocol Specification.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ enum
|
||||
gchar *str_data;
|
||||
gint int_data;
|
||||
|
||||
/* Make sure you terminate calls to gtk_tree_model_get(<!>)
|
||||
/* Make sure you terminate calls to gtk_tree_model_get(<!-- -->)
|
||||
* with a '-1' value
|
||||
*/
|
||||
gtk_tree_model_get (list_store, &iter,
|
||||
@@ -190,7 +190,7 @@ enum
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkTreeView, #GtkTreeStore, #GtkListStore, #GtkTreeDnd, #GtkTreeSortable
|
||||
#GtkTreeView, #GtkTreeStore, #GtkListStore, <link linkend="gtk-GtkTreeView-drag-and-drop">GtkTreeDnd</link>, #GtkTreeSortable
|
||||
</para>
|
||||
|
||||
<!-- ##### STRUCT GtkTreeModel ##### -->
|
||||
|
||||
@@ -23,29 +23,13 @@ information about the type is held in a private struct named
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkFundamentalType ##### -->
|
||||
<!-- ##### TYPEDEF GtkFundamentalType ##### -->
|
||||
<para>
|
||||
#GtkFundamentalType is an enumerated type which lists all the possible
|
||||
fundamental types (e.g. <type>char</type>, <type>uchar</type>, <type>int</type>,
|
||||
<type>long</type>, <type>float</type>, etc).
|
||||
</para>
|
||||
|
||||
@GTK_TYPE_INVALID:
|
||||
@GTK_TYPE_NONE:
|
||||
@GTK_TYPE_ENUM:
|
||||
@GTK_TYPE_FLAGS:
|
||||
@GTK_TYPE_CHAR:
|
||||
@GTK_TYPE_UCHAR:
|
||||
@GTK_TYPE_BOOL:
|
||||
@GTK_TYPE_INT:
|
||||
@GTK_TYPE_UINT:
|
||||
@GTK_TYPE_LONG:
|
||||
@GTK_TYPE_ULONG:
|
||||
@GTK_TYPE_FLOAT:
|
||||
@GTK_TYPE_DOUBLE:
|
||||
@GTK_TYPE_STRING:
|
||||
@GTK_TYPE_BOXED:
|
||||
@GTK_TYPE_POINTER:
|
||||
|
||||
<!-- ##### MACRO GTK_CLASS_NAME ##### -->
|
||||
<para>
|
||||
|
||||
@@ -20,14 +20,20 @@ GtkWidget
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkWidgetClass ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkWidgetFlags ##### -->
|
||||
<para>
|
||||
Tells about certain properties of the widget.
|
||||
</para>
|
||||
|
||||
@GTK_TOPLEVEL:
|
||||
widgets without a real parent, as there are #GtkWindow<!>s and
|
||||
#GtkMenu<!>s have this flag set throughout their lifetime.
|
||||
widgets without a real parent, as there are #GtkWindow<!-- -->s and
|
||||
#GtkMenu<!-- -->s have this flag set throughout their lifetime.
|
||||
Toplevel widgets always contain their own #GdkWindow.
|
||||
@GTK_NO_WINDOW:
|
||||
Indicative for a widget that does not provide its own #GdkWindow.
|
||||
@@ -929,7 +935,12 @@ Equivalent to <literal>gtk_widget_set_style (widget, NULL)</literal>.
|
||||
|
||||
<!-- ##### FUNCTION gtk_widget_reset_rc_styles ##### -->
|
||||
<para>
|
||||
Calls gtk_widget_set_rc_style() recursively on all descendants.
|
||||
Reset the styles of @widget and all descendents, so when
|
||||
they are looked up again, they get the correct values
|
||||
for the currently loaded RC file settings.
|
||||
</para>
|
||||
<para>
|
||||
This function is not useful for applications.
|
||||
</para>
|
||||
|
||||
@widget: a #GtkWidget.
|
||||
@@ -1760,6 +1771,8 @@ a widget changes from un-anchored to anchored or vice-versa.
|
||||
|
||||
@widget: the object which received the signal.
|
||||
@widget:
|
||||
<!-- # Unused Parameters # -->
|
||||
@widget2:
|
||||
|
||||
<!-- ##### SIGNAL GtkWidget::key-press-event ##### -->
|
||||
<para>
|
||||
|
||||
@@ -220,7 +220,7 @@ static void tree_selection_changed_cb (GtkTreeSelection *selection, gpointer dat
|
||||
GtkTreeSelection *select;
|
||||
|
||||
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree));
|
||||
gtk_tree_selection_set_mode (select, GTK_SELECT_SINGLE);
|
||||
gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
|
||||
g_signal_connect (G_OBJECT (select), "changed",
|
||||
G_CALLBACK (tree_selection_changed_cb),
|
||||
NULL);
|
||||
@@ -287,7 +287,7 @@ setup_tree (void)
|
||||
populate_tree_model (store);
|
||||
|
||||
/* Create a view */
|
||||
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
|
||||
tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
|
||||
|
||||
/* The view now holds a reference. We can get rid of our own
|
||||
* reference */
|
||||
|
||||
@@ -1,3 +1,186 @@
|
||||
Wed Nov 6 15:19:53 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* io-gif.c (CHECK_LZW_SP): Fix trailing semicolon on macro,
|
||||
clean up a bit.
|
||||
|
||||
Tue Nov 5 14:03:08 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* io-gif.c: Fix LZWP_SP typo. (#97758, Akira Tagoh)
|
||||
|
||||
2002-11-04 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* io-bmp.c (DecodeHeader): removed redundant code that did nothing,
|
||||
caused a compiler warning and is also not in the HEAD branch.
|
||||
|
||||
2002-10-23 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-gif.c (lzw_read_byte): Check for stack overflow throughout.
|
||||
(#91808, Elliot Lee)
|
||||
|
||||
Thu Oct 3 18:25:57 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* io-jpeg.c (gdk_pixbuf__jpeg_image_save):
|
||||
Fix memory leak. (#94399)
|
||||
|
||||
Tue Oct 1 17:35:43 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdkpixdata.c: Patch from Andy Wingo to always
|
||||
escape ? to avoid accidentally generating trigraphs
|
||||
in the output (#94631)
|
||||
|
||||
2002-09-28 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* pixops/*.S: Don't use .type on Cygwin, either (#91597, Masahiro
|
||||
Sakai).
|
||||
|
||||
2002-09-27 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* io-ico.c (gdk_pixbuf__ico_image_begin_load): Free the context if
|
||||
we cannot allocate the HeaderBuf.
|
||||
|
||||
2002-09-27 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* io-bmp.c (OneLine): Fix the update region notification to handle
|
||||
top-to-bottom and bottom-to-top BMPs correctly.
|
||||
|
||||
2002-09-25 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* io-jpeg.c: Merged the CMYK changes from HEAD.
|
||||
|
||||
2002-09-16 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* test-images.h: line-wrap all images to avoid problems with
|
||||
line-length-limited compilers. (#90662)
|
||||
|
||||
2002-08-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* Makefile.am (libgdk_pixbuf_2_0_la_DEPENDENCIES): Add
|
||||
gdk_pixbuf_win32res_lo. (#87101, J. Ali Harlow)
|
||||
|
||||
2002-08-22 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-png.c (gdk_pixbuf__png_image_save): Plug a memory
|
||||
leak. (#91422, Sven Neumann)
|
||||
|
||||
2002-07-31 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* gdk-pixdata.c (gdk_pixdata_to_csource): free the result of
|
||||
gdk_pixdata_serialize() (bug #89411).
|
||||
|
||||
Mon Jul 29 23:06:10 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk-pixbuf-scale.c: Fix some warnings by adding
|
||||
casts to PixopsInterpType. (#85839, David L. Cooper, II.)
|
||||
|
||||
2002-07-16 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Support for compressed ras images (#84994):
|
||||
|
||||
* io-ras.c (RAS2State): Error on unsupported ras variations.
|
||||
(OneLine8): Fix colormap indexing.
|
||||
(OneLine): Call updated_func with proper region.
|
||||
(DoCompressed): New function, handles compressed ras data.
|
||||
(gdk_pixbuf__ras_image_load_increment): Handle compressed ras
|
||||
images.
|
||||
|
||||
2002-07-07 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-ico.c (DecodeHeader): Correct computation of image height.
|
||||
(OneLine): Correct update notification.
|
||||
|
||||
2002-07-06 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-tiff.c (tiff_set_error): Handle global_error == NULL
|
||||
better.
|
||||
(tiff_image_parse): Don't trust TIFFRGBAImageBegin to set
|
||||
the "put" routine. (Fixes #87384)
|
||||
(gdk_pixbuf__tiff_image_stop_load): Don't call TIFFClose too
|
||||
early.
|
||||
|
||||
2002-07-02 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-bmp.c (grow_buffer): New function to avoid crashes
|
||||
on unchecked reallocs.
|
||||
(DecodeHeader, DecodeColormap, decode_bitmasks,
|
||||
DoCompressed): Use grow_buffer instead of g_realloc
|
||||
throughout. Change signatures where necessary to pass the
|
||||
errors up. (#85448)
|
||||
(OneLine16): Fix loading of 16bpp BI_RGB bmps. (#86286)
|
||||
|
||||
2002-06-28 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* gdk-pixbuf-csource.c (print_blurb): converted a Tab to spaces.
|
||||
|
||||
Thu Jun 13 18:11:11 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* pixops/pixops.c: Fix problem where when no alpha was
|
||||
involved, we scaled rather than composited, but then
|
||||
went ahead and composited anyways. (#76958, Patch
|
||||
from Matthias Clasen) Needs to be merged to GNOME
|
||||
1.4 gdk-pixbuf.
|
||||
|
||||
2002-06-07 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* io-bmp.c (lsb_32):
|
||||
(lsb_16): New functions to fetch 32 or 16-bit little-endian values
|
||||
starting at a specific memory location. We do this instead of
|
||||
GINT32_FROM_LE() as the latter is simply dereferences a cast,
|
||||
which doesn't work on platforms with alignment requirements.
|
||||
Fixes #84083.
|
||||
|
||||
2002-06-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-io.c (pixbuf_check_xbm): Accept xbms starting
|
||||
with a C comment - those seem to be not uncommon, e.g. the Gimp
|
||||
produces them. (#82706)
|
||||
|
||||
* io-xbm.c (read_bitmap_file_data): Don't leak memory on certain
|
||||
invalid inputs.
|
||||
(gdk_pixbuf__xbm_image_load_real): Don't leak memory on valid inputs.
|
||||
|
||||
2002-05-22 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* io-xpm.c (pixbuf_create_from_xpm): Ahem, take the rowstride into
|
||||
account!!! Fixes #82515.
|
||||
|
||||
[This bug is not present in the GNOME 1.4 branch as its XPM loader
|
||||
does not use gdk_pixbuf_new(); rather it malloc()s a buffer with
|
||||
no row padding and then uses gdk_pixbuf_new_from_data() on it.]
|
||||
|
||||
[IMPORTANT: The comment above is to make my life easier when
|
||||
merging stuff across branches. If you make changes to gdk-pixbuf
|
||||
in either branch, please include a comment in the ChangeLog that
|
||||
indicates whether this should be merged into the other branch.
|
||||
Thanks!]
|
||||
|
||||
2002-05-22 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk-pixbuf-io.c (get_libdir): Use GTK_BINARY_VERSION (and not
|
||||
GTK_VERSION) in the path to the loaders on Win32, too.
|
||||
|
||||
* Makefile.am: Pass GTK_BINARY_VERSION.
|
||||
|
||||
2002-05-18 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-tiff.c (tiff_image_parse): fix packing order on bigendian
|
||||
systems. (#81702)
|
||||
|
||||
Thu May 16 15:17:30 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* pixops/pixops.c: Patch from Matthias Clasen to fix some typos
|
||||
(#77246)
|
||||
|
||||
Thu May 16 15:02:46 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk-pixdata.c (gdk_pixdata_to_csource): Fix 64-bit warning.
|
||||
(#78258)
|
||||
|
||||
2002-05-07 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* gdk-pixbuf/Makefile.am: build the static pixbuf loaders
|
||||
conditionally like the dynamic ones so --without-lib<foo> is
|
||||
honored when building with --disable-modules. (#66867)
|
||||
|
||||
2002-04-11 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
More fixes for #77807:
|
||||
|
||||
+28
-15
@@ -17,7 +17,7 @@ gdk_pixbuf-win32res.lo : gdk_pixbuf.rc
|
||||
install-libtool-import-lib:
|
||||
$(INSTALL) .libs/libgdk_pixbuf-$(GTK_API_VERSION).dll.a $(DESTDIR)$(libdir)
|
||||
uninstall-libtool-import-lib:
|
||||
-rm $(DESTDIR)$(libdir)/libdk_pixbuf-$(GTK_API_VERSION).dll.a
|
||||
-rm $(DESTDIR)$(libdir)/libgdk_pixbuf-$(GTK_API_VERSION).dll.a
|
||||
else
|
||||
install-libtool-import-lib:
|
||||
uninstall-libtool-import-lib:
|
||||
@@ -144,33 +144,45 @@ libpixbufloader_tga_la_LIBADD = $(module_libs)
|
||||
|
||||
if HAVE_PNG
|
||||
PNG_LIB = libpixbufloader-png.la
|
||||
STATIC_PNG_LIB = libpixbufloader-static-png.la
|
||||
endif
|
||||
|
||||
if HAVE_JPEG
|
||||
JPEG_LIB = libpixbufloader-jpeg.la
|
||||
STATIC_JPEG_LIB = libpixbufloader-static-jpeg.la
|
||||
endif
|
||||
|
||||
GIF_LIB = libpixbufloader-gif.la
|
||||
STATIC_GIF_LIB = libpixbufloader-static-gif.la
|
||||
|
||||
ICO_LIB = libpixbufloader-ico.la
|
||||
STATIC_ICO_LIB = libpixbufloader-static-ico.la
|
||||
|
||||
RAS_LIB = libpixbufloader-ras.la
|
||||
STATIC_RAS_LIB = libpixbufloader-static-ras.la
|
||||
|
||||
if HAVE_TIFF
|
||||
TIFF_LIB = libpixbufloader-tiff.la
|
||||
STATIC_TIFF_LIB = libpixbufloader-static-tiff.la
|
||||
endif
|
||||
|
||||
XPM_LIB = libpixbufloader-xpm.la
|
||||
STATIC_XPM_LIB = libpixbufloader-static-xpm.la
|
||||
|
||||
PNM_LIB = libpixbufloader-pnm.la
|
||||
STATIC_PNM_LIB = libpixbufloader-static-pnm.la
|
||||
|
||||
BMP_LIB = libpixbufloader-bmp.la
|
||||
STATIC_BMP_LIB = libpixbufloader-static-bmp.la
|
||||
|
||||
WBMP_LIB = libpixbufloader-wbmp.la
|
||||
STATIC_WBMP_LIB = libpixbufloader-static-wbmp.la
|
||||
|
||||
XBM_LIB = libpixbufloader-xbm.la
|
||||
STATIC_XBM_LIB = libpixbufloader-static-xbm.la
|
||||
|
||||
TGA_LIB = libpixbufloader-tga.la
|
||||
STATIC_TGA_LIB = libpixbufloader-static-tga.la
|
||||
|
||||
if BUILD_DYNAMIC_MODULES
|
||||
|
||||
@@ -194,19 +206,19 @@ builtin_objs =
|
||||
else
|
||||
loader_LTLIBRARIES =
|
||||
|
||||
noinst_LTLIBRARIES = \
|
||||
libpixbufloader-static-png.la \
|
||||
libpixbufloader-static-jpeg.la \
|
||||
libpixbufloader-static-gif.la \
|
||||
libpixbufloader-static-ico.la \
|
||||
libpixbufloader-static-ras.la \
|
||||
libpixbufloader-static-tiff.la \
|
||||
libpixbufloader-static-xpm.la \
|
||||
libpixbufloader-static-pnm.la \
|
||||
libpixbufloader-static-bmp.la \
|
||||
libpixbufloader-static-wbmp.la \
|
||||
libpixbufloader-static-xbm.la \
|
||||
libpixbufloader-static-tga.la
|
||||
noinst_LTLIBRARIES = \
|
||||
$(STATIC_PNG_LIB) \
|
||||
$(STATIC_JPEG_LIB) \
|
||||
$(STATIC_GIF_LIB) \
|
||||
$(STATIC_ICO_LIB) \
|
||||
$(STATIC_RAS_LIB) \
|
||||
$(STATIC_XPM_LIB) \
|
||||
$(STATIC_TIFF_LIB) \
|
||||
$(STATIC_PNM_LIB) \
|
||||
$(STATIC_BMP_LIB) \
|
||||
$(STATIC_WBMP_LIB) \
|
||||
$(STATIC_XBM_LIB) \
|
||||
$(STATIC_TGA_LIB)
|
||||
|
||||
builtin_objs = @INCLUDED_LOADER_OBJ@
|
||||
|
||||
@@ -219,6 +231,7 @@ INCLUDES = @STRIP_BEGIN@ \
|
||||
-I$(top_srcdir)/gdk-pixbuf \
|
||||
-I$(top_builddir)/gdk-pixbuf \
|
||||
-DGTK_VERSION=\"@GTK_VERSION@\" \
|
||||
-DGTK_BINARY_VERSION=\"@GTK_BINARY_VERSION@\" \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_PIXBUF_DISABLE_DEPRECATED \
|
||||
@INCLUDED_LOADER_DEFINE@ \
|
||||
@@ -268,7 +281,7 @@ libgdk_pixbuf_2_0_la_LDFLAGS = @STRIP_BEGIN@ \
|
||||
@STRIP_END@
|
||||
|
||||
libgdk_pixbuf_2_0_la_LIBADD = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_win32res_lo) $(GDK_PIXBUF_DEP_LIBS)
|
||||
libgdk_pixbuf_2_0_la_DEPENDENCIES = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_def)
|
||||
libgdk_pixbuf_2_0_la_DEPENDENCIES = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_def) $(gdk_pixbuf_win32res_lo)
|
||||
|
||||
gdk_pixbuf_headers = \
|
||||
gdk-pixbuf.h \
|
||||
|
||||
@@ -277,7 +277,7 @@ print_blurb (FILE *bout,
|
||||
fprintf (bout, " --static generate static symbols\n");
|
||||
fprintf (bout, " --decoder provide rle decoder\n");
|
||||
fprintf (bout, " --name=identifier C macro/variable name\n");
|
||||
fprintf (bout, " --build-list parse (name, image) pairs\n");
|
||||
fprintf (bout, " --build-list parse (name, image) pairs\n");
|
||||
fprintf (bout, " -h, --help show this help message\n");
|
||||
fprintf (bout, " -v, --version print version informations\n");
|
||||
fprintf (bout, " --g-fatal-warnings make warnings fatal (abort)\n");
|
||||
|
||||
+14
-10
@@ -193,17 +193,21 @@ pixbuf_check_xbm (guchar *buffer, int size)
|
||||
if (size < 20)
|
||||
return FALSE;
|
||||
|
||||
if (buffer [0] != '#'
|
||||
|| buffer [1] != 'd'
|
||||
|| buffer [2] != 'e'
|
||||
|| buffer [3] != 'f'
|
||||
|| buffer [4] != 'i'
|
||||
|| buffer [5] != 'n'
|
||||
|| buffer [6] != 'e'
|
||||
|| buffer [7] != ' ')
|
||||
return FALSE;
|
||||
if (buffer [0] == '#'
|
||||
&& buffer [1] == 'd'
|
||||
&& buffer [2] == 'e'
|
||||
&& buffer [3] == 'f'
|
||||
&& buffer [4] == 'i'
|
||||
&& buffer [5] == 'n'
|
||||
&& buffer [6] == 'e'
|
||||
&& buffer [7] == ' ')
|
||||
return TRUE;
|
||||
|
||||
if (buffer [0] == '/'
|
||||
&& buffer [1] != '*')
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -269,7 +273,7 @@ get_libdir (void)
|
||||
|
||||
if (libdir == NULL)
|
||||
libdir = g_win32_get_package_installation_subdirectory
|
||||
(GETTEXT_PACKAGE, dll_name, "lib\\gtk-2.0\\" GTK_VERSION "\\loaders");
|
||||
(GETTEXT_PACKAGE, dll_name, "lib\\gtk-2.0\\" GTK_BINARY_VERSION "\\loaders");
|
||||
|
||||
return libdir;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ gdk_pixbuf_scale (const GdkPixbuf *src,
|
||||
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, interp_type);
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +129,7 @@ gdk_pixbuf_composite (const GdkPixbuf *src,
|
||||
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, interp_type, overall_alpha);
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,7 +197,7 @@ gdk_pixbuf_composite_color (const GdkPixbuf *src,
|
||||
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, interp_type, overall_alpha, check_x, check_y,
|
||||
scale_x, scale_y, (PixopsInterpType)interp_type, overall_alpha, check_x, check_y,
|
||||
check_size, color1, color2);
|
||||
}
|
||||
|
||||
|
||||
+19
-18
@@ -505,7 +505,7 @@ save_uchar (CSourceData *cdata,
|
||||
cdata->pad = FALSE;
|
||||
}
|
||||
}
|
||||
if (d < 33 || d > 126)
|
||||
if (d < 33 || d > 126 || d == '?')
|
||||
{
|
||||
APPEND (gstring, "\\%o", d);
|
||||
cdata->pos += 1 + 1 + (d > 7) + (d > 63);
|
||||
@@ -594,7 +594,7 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
||||
guint bpp, width, height, rowstride;
|
||||
gboolean rle_encoded;
|
||||
gchar *macro_name;
|
||||
guint8 *img_buffer, *img_buffer_end, *stream;
|
||||
guint8 *img_buffer, *img_buffer_end, *stream = NULL;
|
||||
guint stream_length;
|
||||
GString *gstring;
|
||||
|
||||
@@ -707,9 +707,9 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
||||
cdata.static_prefix, cdata.const_prefix, name);
|
||||
APPEND (gstring, " 0x%x, /* Pixbuf magic: 'GdkP' */\n",
|
||||
GDK_PIXBUF_MAGIC_NUMBER);
|
||||
APPEND (gstring, " %u + %u, /* header length + pixel_data length */\n",
|
||||
APPEND (gstring, " %u + %lu, /* header length + pixel_data length */\n",
|
||||
GDK_PIXDATA_HEADER_LENGTH,
|
||||
rle_encoded ? img_buffer_end - img_buffer : rowstride * height);
|
||||
rle_encoded ? (glong)(img_buffer_end - img_buffer) : (glong)rowstride * height);
|
||||
APPEND (gstring, " 0x%x, /* pixdata_type */\n",
|
||||
pixdata->pixdata_type);
|
||||
APPEND (gstring, " %u, /* rowstride */\n",
|
||||
@@ -725,6 +725,7 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
||||
guint pix_length = img_buffer_end - img_buffer;
|
||||
|
||||
stream = gdk_pixdata_serialize (pixdata, &stream_length);
|
||||
img_buffer = stream;
|
||||
img_buffer_end = stream + stream_length;
|
||||
|
||||
APPEND (gstring, "%s%s%s %s[] = \n",
|
||||
@@ -734,34 +735,33 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
||||
APPEND (gstring, "{ \"\"\n /* Pixbuf magic (0x%x) */\n \"",
|
||||
GDK_PIXBUF_MAGIC_NUMBER);
|
||||
cdata.pos = 3;
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
APPEND (gstring, "\"\n /* length: header (%u) + pixel_data (%u) */\n \"",
|
||||
GDK_PIXDATA_HEADER_LENGTH,
|
||||
rle_encoded ? pix_length : rowstride * height);
|
||||
cdata.pos = 3;
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
APPEND (gstring, "\"\n /* pixdata_type (0x%x) */\n \"",
|
||||
pixdata->pixdata_type);
|
||||
cdata.pos = 3;
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
APPEND (gstring, "\"\n /* rowstride (%u) */\n \"",
|
||||
rowstride);
|
||||
cdata.pos = 3;
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
APPEND (gstring, "\"\n /* width (%u) */\n \"", width);
|
||||
cdata.pos = 3;
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
APPEND (gstring, "\"\n /* height (%u) */\n \"", height);
|
||||
cdata.pos = 3;
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||
APPEND (gstring, "\"\n /* pixel_data: */\n");
|
||||
img_buffer = stream;
|
||||
}
|
||||
|
||||
/* pixel_data intro
|
||||
@@ -812,8 +812,9 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
||||
|
||||
/* cleanup
|
||||
*/
|
||||
g_free (stream);
|
||||
g_free (macro_name);
|
||||
|
||||
|
||||
return gstring;
|
||||
}
|
||||
|
||||
|
||||
+80
-30
@@ -233,14 +233,26 @@ static GdkPixbuf *gdk_pixbuf__bmp_image_load(FILE * f, GError **error)
|
||||
return pb;
|
||||
}
|
||||
|
||||
static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
|
||||
struct bmp_progressive_state *State,
|
||||
/* Picks up a 32-bit little-endian integer starting at the specified location.
|
||||
* Does it by hand instead of dereferencing a simple (gint *) cast due to
|
||||
* alignment constraints many platforms.
|
||||
*/
|
||||
static int
|
||||
lsb_32 (guchar *src)
|
||||
{
|
||||
return src[0] | (src[1] << 8) | (src[2] << 16) | (src[3] << 24);
|
||||
}
|
||||
|
||||
/* Same as above, but for 16-bit little-endian integers. */
|
||||
static short
|
||||
lsb_16 (guchar *src)
|
||||
{
|
||||
return src[0] | (src[1] << 8);
|
||||
}
|
||||
|
||||
static gboolean grow_buffer (struct bmp_progressive_state *State,
|
||||
GError **error)
|
||||
{
|
||||
/* FIXME this is totally unrobust against bogus image data. */
|
||||
|
||||
if (State->BufferSize < GUINT32_FROM_LE (* (guint32 *) &BIH[0]) + 14) {
|
||||
State->BufferSize = GUINT32_FROM_LE (* (guint32 *) &BIH[0]) + 14;
|
||||
State->buff = g_try_realloc (State->buff, State->BufferSize);
|
||||
if (State->buff == NULL) {
|
||||
g_set_error (error,
|
||||
@@ -251,22 +263,35 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
|
||||
struct bmp_progressive_state *State,
|
||||
GError **error)
|
||||
{
|
||||
/* FIXME this is totally unrobust against bogus image data. */
|
||||
|
||||
if (State->BufferSize < lsb_32 (&BIH[0]) + 14) {
|
||||
State->BufferSize = lsb_32 (&BIH[0]) + 14;
|
||||
if (!grow_buffer (State, error))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if DUMPBIH
|
||||
DumpBIH(BIH);
|
||||
#endif
|
||||
|
||||
State->Header.size = GUINT32_FROM_LE (* (guint32 *) &BIH[0]);
|
||||
State->Header.size = lsb_32 (&BIH[0]);
|
||||
if (State->Header.size == 40) {
|
||||
State->Header.width = GINT32_FROM_LE (* (gint32 *) &BIH[4]);
|
||||
State->Header.height = GINT32_FROM_LE (* (gint32 *) &BIH[8]);
|
||||
State->Header.depth = GUINT16_FROM_LE (* (guint16 *) &BIH[14]);
|
||||
State->Compressed = GUINT32_FROM_LE (* (guint32 *) &BIH[16]);
|
||||
State->Header.width = lsb_32 (&BIH[4]);
|
||||
State->Header.height = lsb_32 (&BIH[8]);
|
||||
State->Header.depth = lsb_16 (&BIH[14]);
|
||||
State->Compressed = lsb_32 (&BIH[16]);
|
||||
} else if (State->Header.size == 12) {
|
||||
State->Header.width = GUINT16_FROM_LE (* (guint16 *) &BIH[4]);
|
||||
State->Header.height = GUINT16_FROM_LE (* (guint16 *) &BIH[6]);
|
||||
State->Header.depth = GUINT16_FROM_LE (* (guint16 *) &BIH[10]);
|
||||
State->Header.width = lsb_16 (&BIH[4]);
|
||||
State->Header.height = lsb_16 (&BIH[6]);
|
||||
State->Header.depth = lsb_16 (&BIH[10]);
|
||||
State->Compressed = BI_RGB;
|
||||
} else {
|
||||
g_set_error (error,
|
||||
@@ -368,7 +393,7 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
|
||||
State->BufferDone = 0;
|
||||
if (State->Type <= 8) {
|
||||
State->read_state = READ_STATE_PALETTE;
|
||||
State->BufferSize = GUINT32_FROM_LE (* (guint32 *) &BFH[10]) - 14 - State->Header.size;
|
||||
State->BufferSize = lsb_32 (&BFH[10]) - 14 - State->Header.size;
|
||||
} else if (State->Compressed == BI_RGB) {
|
||||
State->read_state = READ_STATE_DATA;
|
||||
State->BufferSize = State->LineWidth;
|
||||
@@ -384,12 +409,13 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
State->buff = g_realloc (State->buff, State->BufferSize);
|
||||
if (!grow_buffer (State, error))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void DecodeColormap (guchar *buff,
|
||||
static gboolean DecodeColormap (guchar *buff,
|
||||
struct bmp_progressive_state *State,
|
||||
GError **error)
|
||||
{
|
||||
@@ -404,6 +430,12 @@ static void DecodeColormap (guchar *buff,
|
||||
State->Colormap[i][0] = buff[i * (State->Header.size == 12 ? 3 : 4)];
|
||||
State->Colormap[i][1] = buff[i * (State->Header.size == 12 ? 3 : 4) + 1];
|
||||
State->Colormap[i][2] = buff[i * (State->Header.size == 12 ? 3 : 4) + 2];
|
||||
#ifdef DUMPCMAP
|
||||
g_print ("color %d %x %x %x\n", i,
|
||||
State->Colormap[i][0],
|
||||
State->Colormap[i][1],
|
||||
State->Colormap[i][2]);
|
||||
#endif
|
||||
}
|
||||
|
||||
State->read_state = READ_STATE_DATA;
|
||||
@@ -414,7 +446,10 @@ static void DecodeColormap (guchar *buff,
|
||||
else
|
||||
State->BufferSize = State->LineWidth;
|
||||
|
||||
State->buff = g_realloc (State->buff, State->BufferSize);
|
||||
if (!grow_buffer (State, error))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Finds the lowest set bit and the number of set bits */
|
||||
@@ -433,8 +468,10 @@ find_bits (int n, int *lowest, int *n_set)
|
||||
}
|
||||
|
||||
/* Decodes the 3 shorts that follow for the bitmasks for BI_BITFIELDS coding */
|
||||
static void
|
||||
decode_bitmasks (struct bmp_progressive_state *State, guchar *buf)
|
||||
static gboolean
|
||||
decode_bitmasks (guchar *buf,
|
||||
struct bmp_progressive_state *State,
|
||||
GError **error)
|
||||
{
|
||||
State->r_mask = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
|
||||
buf += 4;
|
||||
@@ -462,7 +499,10 @@ decode_bitmasks (struct bmp_progressive_state *State, guchar *buf)
|
||||
State->read_state = READ_STATE_DATA;
|
||||
State->BufferDone = 0;
|
||||
State->BufferSize = State->LineWidth;
|
||||
State->buff = g_realloc (State->buff, State->BufferSize);
|
||||
if (!grow_buffer (State, error))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -677,6 +717,8 @@ static void OneLine16(struct bmp_progressive_state *context)
|
||||
*pixels++ = (r << 3) | (r >> 2);
|
||||
*pixels++ = (g << 3) | (g >> 2);
|
||||
*pixels++ = (b << 3) | (b >> 2);
|
||||
|
||||
src += 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -799,7 +841,9 @@ static void OneLine(struct bmp_progressive_state *context)
|
||||
if (context->updated_func != NULL) {
|
||||
(*context->updated_func) (context->pixbuf,
|
||||
0,
|
||||
context->Lines,
|
||||
(context->Header.Negative ?
|
||||
(context->Lines - 1) :
|
||||
(context->Header.height - context->Lines)),
|
||||
context->Header.width,
|
||||
1,
|
||||
context->user_data);
|
||||
@@ -807,8 +851,8 @@ static void OneLine(struct bmp_progressive_state *context)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DoCompressed(struct bmp_progressive_state *context)
|
||||
static gboolean
|
||||
DoCompressed(struct bmp_progressive_state *context, GError **error)
|
||||
{
|
||||
gint count, pos;
|
||||
switch (context->compr.phase) {
|
||||
@@ -881,7 +925,8 @@ DoCompressed(struct bmp_progressive_state *context)
|
||||
if (context->Type == 8)
|
||||
context->compr.RunCount *= 2;
|
||||
context->BufferSize = (context->compr.RunCount + 3) / 4 * 2;
|
||||
context->buff = g_realloc (context->buff, context->BufferSize);
|
||||
if (!grow_buffer (context, error))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
context->BufferDone = 0;
|
||||
@@ -927,13 +972,16 @@ DoCompressed(struct bmp_progressive_state *context)
|
||||
}
|
||||
context->compr.phase = 0;
|
||||
context->BufferSize = 2;
|
||||
context->buff = g_realloc (context->buff, context->BufferSize);
|
||||
if (!grow_buffer (context, error))
|
||||
return FALSE;
|
||||
context->BufferDone = 0;
|
||||
break;
|
||||
case 2:
|
||||
context->BufferDone = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -988,18 +1036,20 @@ gdk_pixbuf__bmp_image_load_increment(gpointer data,
|
||||
break;
|
||||
|
||||
case READ_STATE_PALETTE:
|
||||
DecodeColormap (context->buff, context, error);
|
||||
if (!DecodeColormap (context->buff, context, error))
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case READ_STATE_BITMASKS:
|
||||
decode_bitmasks (context, context->buff);
|
||||
if (!decode_bitmasks (context->buff, context, error))
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case READ_STATE_DATA:
|
||||
if (context->Compressed == BI_RGB || context->Compressed == BI_BITFIELDS)
|
||||
OneLine (context);
|
||||
else
|
||||
DoCompressed (context);
|
||||
else if (!DoCompressed (context, error))
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
+15
-2
@@ -534,6 +534,17 @@ gif_lzw_clear_code (GifContext *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define CHECK_LZW_SP() G_STMT_START { \
|
||||
if ((guchar *)context->lzw_sp >= \
|
||||
(guchar *)context->lzw_stack + sizeof (context->lzw_stack)) { \
|
||||
g_set_error (context->error, \
|
||||
GDK_PIXBUF_ERROR, \
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE, \
|
||||
_("Stack overflow")); \
|
||||
return -2; \
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
||||
static int
|
||||
lzw_read_byte (GifContext *context)
|
||||
{
|
||||
@@ -608,19 +619,20 @@ lzw_read_byte (GifContext *context)
|
||||
incode = code;
|
||||
|
||||
if (code >= context->lzw_max_code) {
|
||||
CHECK_LZW_SP ();
|
||||
*(context->lzw_sp)++ = context->lzw_firstcode;
|
||||
code = context->lzw_oldcode;
|
||||
}
|
||||
|
||||
while (code >= context->lzw_clear_code) {
|
||||
if ((code >= (1 << MAX_LZW_BITS))
|
||||
|| (context->lzw_sp >= context->lzw_stack + ((1 << (MAX_LZW_BITS)) * 2 + 1))) {
|
||||
if (code >= (1 << MAX_LZW_BITS)) {
|
||||
g_set_error (context->error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("Bad code encountered"));
|
||||
return -2;
|
||||
}
|
||||
CHECK_LZW_SP ();
|
||||
*(context->lzw_sp)++ = context->lzw_table[1][code];
|
||||
|
||||
if (code == context->lzw_table[0][code]) {
|
||||
@@ -633,6 +645,7 @@ lzw_read_byte (GifContext *context)
|
||||
code = context->lzw_table[0][code];
|
||||
}
|
||||
|
||||
CHECK_LZW_SP ();
|
||||
*(context->lzw_sp)++ = context->lzw_firstcode = context->lzw_table[1][code];
|
||||
|
||||
if ((code = context->lzw_max_code) < (1 << MAX_LZW_BITS)) {
|
||||
|
||||
+4
-3
@@ -341,7 +341,7 @@ static void DecodeHeader(guchar *Data, gint Bytes,
|
||||
return;
|
||||
}
|
||||
State->Header.height =
|
||||
(int)(BIH[11] << 24) + (BIH[10] << 16) + (BIH[9] << 8) + (BIH[8])/2;
|
||||
(int)((BIH[11] << 24) + (BIH[10] << 16) + (BIH[9] << 8) + (BIH[8]))/2;
|
||||
/* /2 because the BIH height includes the transparency mask */
|
||||
if (State->Header.height == 0) {
|
||||
g_set_error (error,
|
||||
@@ -493,6 +493,7 @@ gdk_pixbuf__ico_image_begin_load(ModulePreparedNotifyFunc prepared_func,
|
||||
context->HeaderSize = 54;
|
||||
context->HeaderBuf = g_try_malloc(14 + 40 + 4*256 + 512);
|
||||
if (!context->HeaderBuf) {
|
||||
g_free (context);
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
||||
@@ -795,9 +796,9 @@ static void OneLine(struct ico_progressive_state *context)
|
||||
if (context->updated_func != NULL) {
|
||||
(*context->updated_func) (context->pixbuf,
|
||||
0,
|
||||
context->Lines,
|
||||
context->Lines % context->Header.height,
|
||||
context->Header.width,
|
||||
context->Header.height,
|
||||
1,
|
||||
context->user_data);
|
||||
|
||||
}
|
||||
|
||||
+113
-35
@@ -26,21 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Progressive file loading notes (11/03/1999) <drmike@redhat.com>...
|
||||
|
||||
These are issues I know of and will be dealing with shortly:
|
||||
|
||||
- Currently does not handle progressive jpegs - this
|
||||
requires a change in the way image_load_increment () calls
|
||||
libjpeg. Progressive jpegs are rarer but I will add this
|
||||
support asap.
|
||||
|
||||
- error handling is not as good as it should be
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -150,6 +135,7 @@ explode_gray_into_buf (struct jpeg_decompress_struct *cinfo,
|
||||
|
||||
g_return_if_fail (cinfo != NULL);
|
||||
g_return_if_fail (cinfo->output_components == 1);
|
||||
g_return_if_fail (cinfo->out_color_space == JCS_GRAYSCALE);
|
||||
|
||||
/* Expand grey->colour. Expand from the end of the
|
||||
* memory down, so we can use the same buffer.
|
||||
@@ -170,6 +156,43 @@ explode_gray_into_buf (struct jpeg_decompress_struct *cinfo,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
convert_cmyk_to_rgb (struct jpeg_decompress_struct *cinfo,
|
||||
guchar **lines)
|
||||
{
|
||||
gint i, j;
|
||||
|
||||
g_return_if_fail (cinfo != NULL);
|
||||
g_return_if_fail (cinfo->output_components == 4);
|
||||
g_return_if_fail (cinfo->out_color_space == JCS_CMYK);
|
||||
|
||||
for (i = cinfo->rec_outbuf_height - 1; i >= 0; i--) {
|
||||
guchar *p;
|
||||
|
||||
p = lines[i];
|
||||
for (j = 0; j < cinfo->image_width; j++) {
|
||||
int c, m, y, k;
|
||||
c = p[0];
|
||||
m = p[1];
|
||||
y = p[2];
|
||||
k = p[3];
|
||||
if (cinfo->saw_Adobe_marker) {
|
||||
p[0] = k*c / 255;
|
||||
p[1] = k*m / 255;
|
||||
p[2] = k*y / 255;
|
||||
}
|
||||
else {
|
||||
p[0] = (255 - k)*(255 - c) / 255;
|
||||
p[1] = (255 - k)*(255 - m) / 255;
|
||||
p[2] = (255 - k)*(255 - y) / 255;
|
||||
}
|
||||
p[3] = 255;
|
||||
p += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_source_mgr pub; /* public fields */
|
||||
|
||||
@@ -234,6 +257,20 @@ stdio_term_source (j_decompress_ptr cinfo)
|
||||
{
|
||||
}
|
||||
|
||||
static gchar *
|
||||
colorspace_name (const J_COLOR_SPACE jpeg_color_space)
|
||||
{
|
||||
switch (jpeg_color_space) {
|
||||
case JCS_UNKNOWN: return "UNKNOWN";
|
||||
case JCS_GRAYSCALE: return "GRAYSCALE";
|
||||
case JCS_RGB: return "RGB";
|
||||
case JCS_YCbCr: return "YCbCr";
|
||||
case JCS_CMYK: return "CMYK";
|
||||
case JCS_YCCK: return "YCCK";
|
||||
default: return "invalid";
|
||||
}
|
||||
}
|
||||
|
||||
/* Shared library entry point */
|
||||
static GdkPixbuf *
|
||||
gdk_pixbuf__jpeg_image_load (FILE *f, GError **error)
|
||||
@@ -292,8 +329,10 @@ gdk_pixbuf__jpeg_image_load (FILE *f, GError **error)
|
||||
cinfo.do_fancy_upsampling = FALSE;
|
||||
cinfo.do_block_smoothing = FALSE;
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, cinfo.output_width, cinfo.output_height);
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
|
||||
cinfo.out_color_components == 4 ? TRUE : FALSE,
|
||||
8, cinfo.output_width, cinfo.output_height);
|
||||
|
||||
if (!pixbuf) {
|
||||
jpeg_destroy_decompress (&cinfo);
|
||||
|
||||
@@ -313,7 +352,6 @@ gdk_pixbuf__jpeg_image_load (FILE *f, GError **error)
|
||||
dptr = pixbuf->pixels;
|
||||
|
||||
/* decompress all the lines, a few at a time */
|
||||
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
lptr = lines;
|
||||
for (i = 0; i < cinfo.rec_outbuf_height; i++) {
|
||||
@@ -323,8 +361,29 @@ gdk_pixbuf__jpeg_image_load (FILE *f, GError **error)
|
||||
|
||||
jpeg_read_scanlines (&cinfo, lines, cinfo.rec_outbuf_height);
|
||||
|
||||
if (cinfo.output_components == 1)
|
||||
explode_gray_into_buf (&cinfo, lines);
|
||||
switch (cinfo.out_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
explode_gray_into_buf (&cinfo, lines);
|
||||
break;
|
||||
case JCS_RGB:
|
||||
/* do nothing */
|
||||
break;
|
||||
case JCS_CMYK:
|
||||
convert_cmyk_to_rgb (&cinfo, lines);
|
||||
break;
|
||||
default:
|
||||
g_object_unref (pixbuf);
|
||||
if (error && *error == NULL) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Unsupported JPEG color space (%s)"),
|
||||
colorspace_name (cinfo.out_color_space));
|
||||
}
|
||||
|
||||
jpeg_destroy_decompress (&cinfo);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
jpeg_finish_decompress (&cinfo);
|
||||
@@ -587,8 +646,17 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
|
||||
context->got_header = TRUE;
|
||||
|
||||
} else if (!context->did_prescan) {
|
||||
int rc;
|
||||
|
||||
/* start decompression */
|
||||
cinfo->buffered_image = TRUE;
|
||||
rc = jpeg_start_decompress (cinfo);
|
||||
cinfo->do_fancy_upsampling = FALSE;
|
||||
cinfo->do_block_smoothing = FALSE;
|
||||
|
||||
context->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB,
|
||||
FALSE,
|
||||
cinfo->output_components == 4 ? TRUE : FALSE,
|
||||
8,
|
||||
cinfo->image_width,
|
||||
cinfo->image_height);
|
||||
@@ -609,15 +677,6 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
NULL,
|
||||
context->user_data);
|
||||
|
||||
} else if (!context->did_prescan) {
|
||||
int rc;
|
||||
|
||||
/* start decompression */
|
||||
cinfo->buffered_image = TRUE;
|
||||
rc = jpeg_start_decompress (cinfo);
|
||||
cinfo->do_fancy_upsampling = FALSE;
|
||||
cinfo->do_block_smoothing = FALSE;
|
||||
|
||||
if (rc == JPEG_SUSPENDED)
|
||||
continue;
|
||||
|
||||
@@ -653,10 +712,28 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
if (nlines == 0)
|
||||
break;
|
||||
|
||||
/* handle gray */
|
||||
if (cinfo->output_components == 1)
|
||||
explode_gray_into_buf (cinfo, lines);
|
||||
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
explode_gray_into_buf (cinfo, lines);
|
||||
break;
|
||||
case JCS_RGB:
|
||||
/* do nothing */
|
||||
break;
|
||||
case JCS_CMYK:
|
||||
convert_cmyk_to_rgb (cinfo, lines);
|
||||
break;
|
||||
default:
|
||||
if (error && *error == NULL) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Unsupported JPEG color space (%s)"),
|
||||
colorspace_name (cinfo->out_color_space));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
context->dptr += nlines * context->pixbuf->rowstride;
|
||||
|
||||
/* send updated signal */
|
||||
@@ -810,7 +887,8 @@ gdk_pixbuf__jpeg_image_save (FILE *f,
|
||||
}
|
||||
|
||||
/* finish off */
|
||||
jpeg_finish_compress (&cinfo);
|
||||
jpeg_finish_compress (&cinfo);
|
||||
jpeg_destroy_compress(&cinfo);
|
||||
g_free (buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -859,7 +859,7 @@ gdk_pixbuf__png_image_save (FILE *f,
|
||||
png_write_end (png_ptr, info_ptr);
|
||||
|
||||
cleanup:
|
||||
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
|
||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
||||
|
||||
if (num_keys > 0) {
|
||||
for (i = 0; i < num_keys; i++)
|
||||
|
||||
+58
-7
@@ -85,7 +85,7 @@ struct ras_progressive_state {
|
||||
8 = 8 bit colormapped
|
||||
1 = 1 bit bitonal
|
||||
*/
|
||||
|
||||
gint DecoderState;
|
||||
|
||||
struct rasterfile Header; /* Decoded (BE->CPU) header */
|
||||
|
||||
@@ -181,6 +181,14 @@ static gboolean RAS2State(struct rasterfile *RAS,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (State->Header.type > 2 || State->Header.maptype > 1) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("unsupported RAS image variation"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Now pad the line to be a multiple of 16 bits */
|
||||
if ((State->LineWidth & 1) != 0)
|
||||
State->LineWidth++;
|
||||
@@ -266,7 +274,8 @@ gdk_pixbuf__ras_image_begin_load(ModulePreparedNotifyFunc prepared_func,
|
||||
context->Lines = 0;
|
||||
|
||||
context->RasType = 0;
|
||||
|
||||
context->DecoderState = 0;
|
||||
|
||||
memset(&context->Header, 0, sizeof(struct rasterfile));
|
||||
|
||||
|
||||
@@ -349,6 +358,7 @@ static void OneLine8(struct ras_progressive_state *context)
|
||||
{
|
||||
gint X;
|
||||
guchar *Pixels;
|
||||
int offset = context->Header.maplength / 3;
|
||||
|
||||
X = 0;
|
||||
Pixels = context->pixbuf->pixels + context->pixbuf->rowstride * context->Lines;
|
||||
@@ -357,9 +367,9 @@ static void OneLine8(struct ras_progressive_state *context)
|
||||
Pixels[X * 3 + 0] =
|
||||
context->HeaderBuf[context->LineBuf[X] + 32];
|
||||
Pixels[X * 3 + 1] =
|
||||
context->HeaderBuf[context->LineBuf[X] + 256 + 32];
|
||||
context->HeaderBuf[context->LineBuf[X] + offset + 32];
|
||||
Pixels[X * 3 + 2] =
|
||||
context->HeaderBuf[context->LineBuf[X] + 512 + 32];
|
||||
context->HeaderBuf[context->LineBuf[X] + 2*offset + 32];
|
||||
X++;
|
||||
}
|
||||
}
|
||||
@@ -410,12 +420,48 @@ static void OneLine(struct ras_progressive_state *context)
|
||||
0,
|
||||
context->Lines,
|
||||
context->Header.width,
|
||||
context->Header.height,
|
||||
1,
|
||||
context->user_data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
DoCompressed (struct ras_progressive_state *context,
|
||||
const guchar * buf, guint size,
|
||||
GError **error)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
switch (context->DecoderState) {
|
||||
case 0:
|
||||
if (buf[i] == 0x80)
|
||||
context->DecoderState = 1;
|
||||
else
|
||||
context->LineBuf[context->LineDone++] = buf[i];
|
||||
break;
|
||||
case 1:
|
||||
if (buf[i] == 0) {
|
||||
context->LineBuf[context->LineDone++] = 0x80;
|
||||
context->DecoderState = 0;
|
||||
}
|
||||
else
|
||||
context->DecoderState = buf[i] + 1;
|
||||
break;
|
||||
default:
|
||||
for (; context->DecoderState; context->DecoderState--) {
|
||||
context->LineBuf[context->LineDone++] = buf[i];
|
||||
if ((context->LineDone >= context->LineWidth) && (context->LineWidth > 0))
|
||||
OneLine(context);
|
||||
}
|
||||
}
|
||||
if ((context->LineDone >= context->LineWidth) && (context->LineWidth > 0))
|
||||
OneLine(context);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* context - from image_begin_load
|
||||
* buf - new image data
|
||||
@@ -448,8 +494,13 @@ gdk_pixbuf__ras_image_load_increment(gpointer data,
|
||||
buf += BytesToCopy;
|
||||
context->HeaderDone += BytesToCopy;
|
||||
|
||||
} else {
|
||||
/* Pixeldata only */
|
||||
} else if (context->Header.type == 2) {
|
||||
if (!DoCompressed (context, buf, size, error)) {
|
||||
return FALSE;
|
||||
}
|
||||
size = 0;
|
||||
}
|
||||
else {
|
||||
BytesToCopy =
|
||||
context->LineWidth - context->LineDone;
|
||||
if (BytesToCopy > size)
|
||||
|
||||
+35
-4
@@ -119,16 +119,20 @@ tiff_set_error (GError **error,
|
||||
/* Take the error message from libtiff and merge it with
|
||||
* some context we provide.
|
||||
*/
|
||||
if (global_error) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
error_code,
|
||||
"%s%s%s",
|
||||
msg, global_error ? ": " : "", global_error);
|
||||
"%s%s%s", msg, ": ", global_error);
|
||||
|
||||
if (global_error) {
|
||||
g_free (global_error);
|
||||
global_error = NULL;
|
||||
}
|
||||
else {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
error_code, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -256,6 +260,14 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
||||
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;
|
||||
@@ -268,6 +280,21 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
||||
TIFFRGBAImageGet (&img, (uint32 *)pixels, width, height);
|
||||
TIFFRGBAImageEnd (&img);
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
/* 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
|
||||
|
||||
G_UNLOCK (tiff_loader);
|
||||
if (context)
|
||||
(* context->update_func) (pixbuf, 0, 0, width, height, context->user_data);
|
||||
@@ -461,16 +488,20 @@ gdk_pixbuf__tiff_image_stop_load (gpointer data,
|
||||
if (pixbuf)
|
||||
g_object_unref (pixbuf);
|
||||
retval = pixbuf != NULL;
|
||||
TIFFClose (tiff);
|
||||
if (global_error)
|
||||
{
|
||||
tiff_set_error (error,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Failed to load TIFF image"));
|
||||
tiff_pop_handlers ();
|
||||
|
||||
retval = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (tiff)
|
||||
TIFFClose (tiff);
|
||||
|
||||
g_assert (!global_error);
|
||||
|
||||
g_free (context->buffer);
|
||||
|
||||
@@ -244,6 +244,7 @@ read_bitmap_file_data (FILE *fstream,
|
||||
*ptr=value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bits)
|
||||
@@ -323,6 +324,7 @@ gdk_pixbuf__xbm_image_load_real (FILE *f, XBMData *context, GError **error)
|
||||
}
|
||||
pixels += row_stride;
|
||||
}
|
||||
g_free (data);
|
||||
|
||||
if (context) {
|
||||
(* context->update_func) (pixbuf, 0, 0, w, h, context->user_data);
|
||||
|
||||
+3
-3
@@ -1209,7 +1209,7 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
|
||||
GError **error)
|
||||
{
|
||||
gint w, h, n_col, cpp;
|
||||
gint cnt, xcnt, ycnt, wbytes, n, ns;
|
||||
gint cnt, xcnt, ycnt, wbytes, n;
|
||||
gint is_trans = FALSE;
|
||||
const gchar *buffer;
|
||||
gchar *name_buf;
|
||||
@@ -1322,9 +1322,10 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
|
||||
}
|
||||
|
||||
wbytes = w * cpp;
|
||||
pixtmp = pixbuf->pixels;
|
||||
|
||||
for (ycnt = 0; ycnt < h; ycnt++) {
|
||||
pixtmp = pixbuf->pixels + ycnt * pixbuf->rowstride;
|
||||
|
||||
buffer = (*get_buf) (op_body, handle);
|
||||
if ((!buffer) || (strlen (buffer) < wbytes))
|
||||
continue;
|
||||
@@ -1332,7 +1333,6 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
|
||||
for (n = 0, cnt = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
|
||||
strncpy (pixel_str, &buffer[n], cpp);
|
||||
pixel_str[cpp] = 0;
|
||||
ns = 0;
|
||||
|
||||
color = g_hash_table_lookup (color_hash, pixel_str);
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
|
||||
#ifndef __MINGW32__
|
||||
|
||||
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
.globl pixops_composite_line_22_4a4_mmx
|
||||
.type pixops_composite_line_22_4a4_mmx,@function
|
||||
pixops_composite_line_22_4a4_mmx:
|
||||
|
||||
@@ -4,7 +4,7 @@ gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
|
||||
.globl pixops_composite_line_color_22_4a4_mmx
|
||||
.type pixops_composite_line_color_22_4a4_mmx,@function
|
||||
|
||||
@@ -4,7 +4,7 @@ gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
|
||||
.globl pixops_have_mmx
|
||||
.type pixops_have_mmx,@function
|
||||
|
||||
+15
-10
@@ -493,13 +493,13 @@ composite_line_22_4a4 (int *weights, int n_x, int n_y,
|
||||
b += ta * q0[6];
|
||||
a += ta;
|
||||
|
||||
ta = w3 * q0[3];
|
||||
r += ta * q0[0];
|
||||
g += ta * q0[1];
|
||||
b += ta * q0[2];
|
||||
ta = w3 * q1[3];
|
||||
r += ta * q1[0];
|
||||
g += ta * q1[1];
|
||||
b += ta * q1[2];
|
||||
a += ta;
|
||||
|
||||
ta += w4 * q1[7];
|
||||
ta = w4 * q1[7];
|
||||
r += ta * q1[4];
|
||||
g += ta * q1[5];
|
||||
b += ta * q1[6];
|
||||
@@ -881,16 +881,15 @@ scale_line_22_33 (int *weights, int n_x, int n_y,
|
||||
g += w3 * q1[1];
|
||||
b += w3 * q1[2];
|
||||
|
||||
r += w4 * q1[4];
|
||||
g += w4 * q1[5];
|
||||
b += w4 * q1[6];
|
||||
r += w4 * q1[3];
|
||||
g += w4 * q1[4];
|
||||
b += w4 * q1[5];
|
||||
|
||||
dest[0] = (r + 0x8000) >> 16;
|
||||
dest[1] = (g + 0x8000) >> 16;
|
||||
dest[2] = (b + 0x8000) >> 16;
|
||||
|
||||
dest += 3;
|
||||
|
||||
x += x_step;
|
||||
}
|
||||
|
||||
@@ -1430,10 +1429,13 @@ pixops_composite_color (guchar *dest_buf,
|
||||
return;
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (interp_type)
|
||||
{
|
||||
@@ -1481,7 +1483,7 @@ pixops_composite_color (guchar *dest_buf,
|
||||
* @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
|
||||
* @render_x1: x1 of region of scaled source to store into @dest_buf
|
||||
* @render_y1: x1 of region of scaled source to store into @dest_buf
|
||||
* @render_y1: y1 of region of scaled source to store into @dest_buf
|
||||
* @dest_rowstride: rowstride of @dest_buf
|
||||
* @dest_channels: number of channels in @dest_buf
|
||||
* @dest_has_alpha: whether @dest_buf has alpha
|
||||
@@ -1533,10 +1535,13 @@ pixops_composite (guchar *dest_buf,
|
||||
return;
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (interp_type)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
|
||||
.globl pixops_scale_line_22_33_mmx
|
||||
.type pixops_scale_line_22_33_mmx,@function
|
||||
|
||||
+1567
-875
File diff suppressed because one or more lines are too long
@@ -11,3 +11,4 @@ gdkenumtypes.[ch]
|
||||
libgdk.la
|
||||
gdkconfig.h
|
||||
stamp-gc-h
|
||||
stamp-gdkenumtypes.h
|
||||
|
||||
+28
-9
@@ -42,7 +42,7 @@ gdk_win32_symbols = -export-symbols gdk.def
|
||||
install-libtool-import-lib:
|
||||
$(INSTALL) .libs/libgdk-win32-$(GTK_API_VERSION).dll.a $(DESTDIR)$(libdir)
|
||||
uninstall-libtool-import-lib:
|
||||
-rm $(DESTDIR)$(libdir)/libdk-win32-$(GTK_API_VERSION).dll.a
|
||||
-rm $(DESTDIR)$(libdir)/libgdk-win32-$(GTK_API_VERSION).dll.a
|
||||
else
|
||||
install-libtool-import-lib:
|
||||
uninstall-libtool-import-lib:
|
||||
@@ -68,6 +68,7 @@ endif
|
||||
# since automake doesn't support conditionalized libsomething_la_LDFLAGS
|
||||
# we use the general approach here
|
||||
LDFLAGS = @STRIP_BEGIN@ \
|
||||
@LDFLAGS@ \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
-export-dynamic \
|
||||
-rpath $(libdir) \
|
||||
@@ -164,7 +165,7 @@ lib_LTLIBRARIES = $(gdktargetlib)
|
||||
|
||||
EXTRA_LTLIBRARIES = libgdk-x11-2.0.la libgdk-linux-fb-2.0.la libgdk-win32-2.0.la
|
||||
|
||||
MAINTAINERCLEANFILES =
|
||||
MAINTAINERCLEANFILES = gdkenumtypes.h stamp-gdkenumtypes.h
|
||||
EXTRA_HEADERS =
|
||||
|
||||
#
|
||||
@@ -185,15 +186,33 @@ if DISABLE_EXPLICIT_DEPS
|
||||
endif
|
||||
|
||||
#note: not gdkconfig.h
|
||||
BUILT_SOURCES = stamp-gc-h @REBUILD@ gdkenumtypes.c gdkenumtypes.h
|
||||
BUILT_SOURCES = stamp-gc-h @REBUILD@ gdkenumtypes.h
|
||||
|
||||
gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) $(srcdir)/makeenums.pl
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) ./makeenums.pl include $(gdk_public_h_sources) > gdkenumtypes.h
|
||||
# Generate built header without using automake-1.4 BUILT_SOURCES
|
||||
$(libgdk_x11_2_0_la_OBJECTS) $(libgdk_linux_fb_2_0_la_OBJECTS) $(libgdk_win32_2_0_la_OBJECTS): gdkenumtypes.h
|
||||
|
||||
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) $(srcdir)/makeenums.pl
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) ./makeenums.pl cfile $(gdk_public_h_sources) > gdkenumtypes.c
|
||||
$(srcdir)/gdkenumtypes.h: stamp-gdkenumtypes.h
|
||||
@true
|
||||
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) Makefile
|
||||
( cd $(srcdir) && glib-mkenums \
|
||||
--fhead "#ifndef __GDK_ENUM_TYPES_H__\n#define __GDK_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
|
||||
--fprod "/* enumerations from \"@filename@\" */\n" \
|
||||
--vhead "GType @enum_name@_get_type (void);\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
|
||||
--ftail "G_END_DECLS\n\n#endif /* __GDK_ENUM_TYPES_H__ */" \
|
||||
$(gdk_public_h_sources) ) >> xgen-geth \
|
||||
&& (cmp -s xgen-geth $(srcdir)/gdkenumtypes.h || cp xgen-geth $(srcdir)/gdkenumtypes.h ) \
|
||||
&& rm -f xgen-geth \
|
||||
&& echo timestamp > $(@F)
|
||||
$(srcdir)/gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) Makefile
|
||||
( cd $(srcdir) && glib-mkenums \
|
||||
--fhead "#define GDK_ENABLE_BROKEN\n#include \"gdk.h\"" \
|
||||
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
|
||||
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
|
||||
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
|
||||
$(gdk_public_h_sources) ) > xgen-getc \
|
||||
&& cp xgen-getc $(srcdir)/gdkenumtypes.c \
|
||||
&& rm -f xgen-getc
|
||||
|
||||
gdkconfig.h: stamp-gc-h
|
||||
@if test -f gdkconfig.h; then :; \
|
||||
|
||||
@@ -136,8 +136,6 @@ EXPORTS
|
||||
gdk_flush
|
||||
gdk_font_equal
|
||||
gdk_font_from_description
|
||||
gdk_font_full_name_free
|
||||
gdk_font_full_name_get
|
||||
gdk_font_get_type
|
||||
gdk_font_id
|
||||
gdk_font_load
|
||||
|
||||
@@ -92,12 +92,6 @@ void gdk_string_extents (GdkFont *font,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
/* Ditto temporary */
|
||||
gchar* gdk_font_full_name_get (GdkFont *font);
|
||||
void gdk_font_full_name_free (gchar *name);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
+9
-3
@@ -104,9 +104,15 @@ gdk_gc_new_with_values (GdkDrawable *drawable,
|
||||
if (values_mask & GDK_GC_TS_Y_ORIGIN)
|
||||
gc->ts_y_origin = values->ts_y_origin;
|
||||
|
||||
gc->colormap = gdk_drawable_get_colormap (drawable);
|
||||
if (gc->colormap)
|
||||
g_object_ref (G_OBJECT (gc->colormap));
|
||||
/* gc->colormap will already be set if gdk_gc_new_with_values()
|
||||
* recurses - as in GdkPixmap => impl object.
|
||||
*/
|
||||
if (!gc->colormap)
|
||||
{
|
||||
gc->colormap = gdk_drawable_get_colormap (drawable);
|
||||
if (gc->colormap)
|
||||
g_object_ref (G_OBJECT (gc->colormap));
|
||||
}
|
||||
|
||||
return gc;
|
||||
}
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
|
||||
tmp.green = foreground->green;
|
||||
}
|
||||
|
||||
fg_gc = gdk_pango_get_gc (drawable, context, fg_set ? &tmp : NULL,
|
||||
fg_gc = gdk_pango_get_gc (drawable, context, (fg_set || foreground) ? &tmp : NULL,
|
||||
stipple, gc);
|
||||
}
|
||||
else
|
||||
|
||||
+35
-34
@@ -204,9 +204,9 @@ rgb1 (GdkImage *image,
|
||||
(0x80 >> (xx & 7)) :
|
||||
(1 << (xx & 7)));
|
||||
|
||||
*o++ = colormap->colors[data].red;
|
||||
*o++ = colormap->colors[data].green;
|
||||
*o++ = colormap->colors[data].blue;
|
||||
*o++ = colormap->colors[data].red >> 8;
|
||||
*o++ = colormap->colors[data].green >> 8;
|
||||
*o++ = colormap->colors[data].blue >> 8;
|
||||
}
|
||||
srow += bpl;
|
||||
orow += rowstride;
|
||||
@@ -251,9 +251,9 @@ rgb1a (GdkImage *image,
|
||||
(0x80 >> (xx & 7)) :
|
||||
(1 << (xx & 7)));
|
||||
|
||||
*o++ = colormap->colors[data].red;
|
||||
*o++ = colormap->colors[data].green;
|
||||
*o++ = colormap->colors[data].blue;
|
||||
*o++ = colormap->colors[data].red >> 8;
|
||||
*o++ = colormap->colors[data].green >> 8;
|
||||
*o++ = colormap->colors[data].blue >> 8;
|
||||
*o++ = 255;
|
||||
}
|
||||
srow += bpl;
|
||||
@@ -296,9 +296,9 @@ rgb8 (GdkImage *image,
|
||||
for (xx = x1; xx < x2; xx++)
|
||||
{
|
||||
data = *s++ & mask;
|
||||
*o++ = colormap->colors[data].red;
|
||||
*o++ = colormap->colors[data].green;
|
||||
*o++ = colormap->colors[data].blue;
|
||||
*o++ = colormap->colors[data].red >> 8;
|
||||
*o++ = colormap->colors[data].green >> 8;
|
||||
*o++ = colormap->colors[data].blue >> 8;
|
||||
}
|
||||
srow += bpl;
|
||||
orow += rowstride;
|
||||
@@ -338,14 +338,14 @@ rgb8a (GdkImage *image,
|
||||
{
|
||||
#ifdef LITTLE
|
||||
remap[xx] = 0xff000000
|
||||
| colormap->colors[xx].blue << 16
|
||||
| colormap->colors[xx].green << 8
|
||||
| colormap->colors[xx].red;
|
||||
| (colormap->colors[xx].blue & 0xff00) << 8
|
||||
| (colormap->colors[xx].green & 0xff00)
|
||||
| (colormap->colors[xx].red >> 8);
|
||||
#else
|
||||
remap[xx] = 0xff
|
||||
| colormap->colors[xx].red << 24
|
||||
| colormap->colors[xx].green << 16
|
||||
| colormap->colors[xx].blue << 8;
|
||||
| (colormap->colors[xx].red & 0xff00) << 16
|
||||
| (colormap->colors[xx].green & 0xff00) << 8
|
||||
| (colormap->colors[xx].blue & 0xff00);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -437,14 +437,15 @@ rgb565lsb (GdkImage *image,
|
||||
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
|
||||
#else
|
||||
/* swap endianness first */
|
||||
data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
|
||||
data = s[1] << 24 | s[0] << 16 | s[3] << 8 | s[2];
|
||||
s += 4;
|
||||
*o++ = (data & 0xf800) | (data & 0xe000) >> 5
|
||||
| (data & 0x7e0) >> 3 | (data & 0x600) >> 9;
|
||||
*o++ = (data & 0x1f) << 11 | (data & 0x1c) << 6
|
||||
| (data & 0xf8000000) >> 24 | (data & 0xe0000000) >> 29;
|
||||
*o++ = (data & 0x7e00000) >> 11 | (data & 0x6000000) >> 17
|
||||
| (data & 0x1f0000) >> 13 | (data & 0x1c0000) >> 18;
|
||||
|
||||
*o++ = (data & 0xf8000000) >> 16 | (data & 0xe0000000) >> 21
|
||||
| (data & 0x7e00000) >> 19 | (data & 0x6000000) >> 25;
|
||||
*o++ = (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10
|
||||
| (data & 0xf800) >> 8 | (data & 0xe000) >> 13;
|
||||
*o++ = (data & 0x7e0) << 5 | (data & 0x600) >> 1
|
||||
| (data & 0x1f) << 3 | (data & 0x1c) >> 2;
|
||||
#endif
|
||||
}
|
||||
/* check for last remaining pixel */
|
||||
@@ -544,12 +545,12 @@ rgb565msb (GdkImage *image,
|
||||
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
|
||||
#else
|
||||
data = *s++;
|
||||
*o++ = (data & 0xf800) | (data & 0xe000) >> 5
|
||||
| (data & 0x7e0) >> 3 | (data & 0x600) >> 9;
|
||||
*o++ = (data & 0x1f) << 11 | (data & 0x1c) << 6
|
||||
| (data & 0xf8000000) >> 24 | (data & 0xe0000000) >> 29;
|
||||
*o++ = (data & 0x7e00000) >> 11 | (data & 0x6000000) >> 17
|
||||
| (data & 0x1f0000) >> 13 | (data & 0x1c0000) >> 18;
|
||||
*o++ = (data & 0xf8000000) >> 16 | (data & 0xe0000000) >> 21
|
||||
| (data & 0x7e00000) >> 19 | (data & 0x6000000) >> 25;
|
||||
*o++ = (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10
|
||||
| (data & 0xf800) >> 8 | (data & 0xe000) >> 13;
|
||||
*o++ = (data & 0x7e0) << 5 | (data & 0x600) >> 1
|
||||
| (data & 0x1f) << 3 | (data & 0x1c) >> 2;
|
||||
#endif
|
||||
}
|
||||
/* check for last remaining pixel */
|
||||
@@ -1235,9 +1236,9 @@ convert_real_slow (GdkImage *image,
|
||||
case GDK_VISUAL_GRAYSCALE:
|
||||
case GDK_VISUAL_STATIC_COLOR:
|
||||
case GDK_VISUAL_PSEUDO_COLOR:
|
||||
*o++ = cmap->colors[pixel].red;
|
||||
*o++ = cmap->colors[pixel].green;
|
||||
*o++ = cmap->colors[pixel].blue;
|
||||
*o++ = cmap->colors[pixel].red >> 8;
|
||||
*o++ = cmap->colors[pixel].green >> 8;
|
||||
*o++ = cmap->colors[pixel].blue >> 8;
|
||||
break;
|
||||
case GDK_VISUAL_TRUE_COLOR:
|
||||
/* This is odd because it must sometimes shift left (otherwise
|
||||
@@ -1258,9 +1259,9 @@ convert_real_slow (GdkImage *image,
|
||||
*o++ = component;
|
||||
break;
|
||||
case GDK_VISUAL_DIRECT_COLOR:
|
||||
*o++ = cmap->colors[((pixel & v->red_mask) << (32 - v->red_shift - v->red_prec)) >> 24].red;
|
||||
*o++ = cmap->colors[((pixel & v->green_mask) << (32 - v->green_shift - v->green_prec)) >> 24].green;
|
||||
*o++ = cmap->colors[((pixel & v->blue_mask) << (32 - v->blue_shift - v->blue_prec)) >> 24].blue;
|
||||
*o++ = cmap->colors[((pixel & v->red_mask) << (32 - v->red_shift - v->red_prec)) >> 24].red >> 8;
|
||||
*o++ = cmap->colors[((pixel & v->green_mask) << (32 - v->green_shift - v->green_prec)) >> 24].green >> 8;
|
||||
*o++ = cmap->colors[((pixel & v->blue_mask) << (32 - v->blue_shift - v->blue_prec)) >> 24].blue >> 8;
|
||||
break;
|
||||
}
|
||||
if (alpha)
|
||||
|
||||
+12
-5
@@ -180,7 +180,7 @@ gdk_rgb_make_colorcube (GdkRgbInfo *image_info, gulong *pixels,
|
||||
{
|
||||
image_info->colorcube[i] = pixels[rt[i >> 8] + gt[(i >> 4) & 0x0f] + bt[i & 0x0f]];
|
||||
#ifdef VERBOSE
|
||||
g_print ("%03x %02x %x %x %x\n", i, image-info->colorcube[i], rt[i >> 8], gt[(i >> 4) & 0x0f], bt[i & 0x0f]);
|
||||
g_print ("%03x %02x %x %x %x\n", i, image_info->colorcube[i], rt[i >> 8], gt[(i >> 4) & 0x0f], bt[i & 0x0f]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -268,7 +268,8 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (colors_needed)
|
||||
if (colors_needed &&
|
||||
image_info->visual->type != GDK_VISUAL_STATIC_COLOR)
|
||||
{
|
||||
if (!gdk_colors_alloc (cmap, 0, NULL, 0, junk, colors_needed))
|
||||
{
|
||||
@@ -637,7 +638,8 @@ gdk_rgb_create_info (GdkVisual *visual, GdkColormap *colormap)
|
||||
|
||||
gdk_rgb_colorcube_222 (image_info);
|
||||
}
|
||||
else if (image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR)
|
||||
else if (image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR
|
||||
|| image_info->visual->type == GDK_VISUAL_STATIC_COLOR)
|
||||
{
|
||||
if (!image_info->cmap &&
|
||||
(gdk_rgb_install_cmap || image_info->visual != gdk_visual_get_system ()))
|
||||
@@ -2991,7 +2993,9 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info)
|
||||
}
|
||||
else if (bpp == 8 &&
|
||||
depth <= 8 &&
|
||||
depth > 4 &&
|
||||
(vtype == GDK_VISUAL_PSEUDO_COLOR
|
||||
|| vtype == GDK_VISUAL_STATIC_COLOR
|
||||
#ifdef ENABLE_GRAYSCALE
|
||||
|| vtype == GDK_VISUAL_GRAYSCALE
|
||||
#endif
|
||||
@@ -3314,6 +3318,7 @@ gdk_draw_gray_image (GdkDrawable *drawable,
|
||||
if (image_info->bpp == 1 &&
|
||||
image_info->gray_cmap == NULL &&
|
||||
(image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR ||
|
||||
image_info->visual->type == GDK_VISUAL_STATIC_COLOR ||
|
||||
image_info->visual->type == GDK_VISUAL_GRAYSCALE))
|
||||
gdk_rgb_make_gray_cmap (image_info);
|
||||
|
||||
@@ -3337,9 +3342,10 @@ gdk_rgb_cmap_get_info (GdkRgbCmap *cmap,
|
||||
int i, j;
|
||||
guint32 rgb;
|
||||
|
||||
/* We only need a LUT for pseudo-color and grayscale cmaps */
|
||||
/* We don't need a LUT for TrueColor or DirectColor visuals */
|
||||
if (image_info->bpp != 1 ||
|
||||
!(image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR ||
|
||||
image_info->visual->type == GDK_VISUAL_STATIC_COLOR ||
|
||||
image_info->visual->type == GDK_VISUAL_GRAYSCALE))
|
||||
return NULL;
|
||||
|
||||
@@ -3363,7 +3369,7 @@ gdk_rgb_cmap_get_info (GdkRgbCmap *cmap,
|
||||
((rgb & 0xf000) >> 8) |
|
||||
((rgb & 0xf0) >> 4);
|
||||
#ifdef VERBOSE
|
||||
g_print ("%d %x %x %d\n", i, j, image_info->colorcube[j]);
|
||||
g_print ("%d %x %x\n", i, j, image_info->colorcube[j]);
|
||||
#endif
|
||||
cmap_info->lut[i] = image_info->colorcube[j];
|
||||
}
|
||||
@@ -3403,6 +3409,7 @@ gdk_rgb_cmap_free (GdkRgbCmap *cmap)
|
||||
GdkRgbCmapInfo *cmap_info = tmp_list->data;
|
||||
cmap_info->image_info->cmap_info_list = g_slist_remove (cmap_info->image_info->cmap_info_list, cmap_info);
|
||||
g_free (cmap_info);
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
g_slist_free (cmap->info_list);
|
||||
|
||||
|
||||
@@ -2148,7 +2148,9 @@ gdk_window_process_all_updates (void)
|
||||
static gboolean
|
||||
gdk_window_update_idle (gpointer data)
|
||||
{
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_window_process_all_updates ();
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,6 @@ INCLUDES = @STRIP_BEGIN@ \
|
||||
@GTK_DEBUG_FLAGS@ \
|
||||
@STRIP_END@
|
||||
|
||||
LDFLAGS = @STRIP_BEGIN@ \
|
||||
@GDK_DEP_LIBS@ \
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
|
||||
noinst_LTLIBRARIES = libgdk-linux-fb.la
|
||||
|
||||
libgdkinclude_HEADERS= \
|
||||
|
||||
@@ -117,92 +117,6 @@ gdk_colormap_finalize (GObject *object)
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gint
|
||||
palette_size (HPALETTE hpal)
|
||||
{
|
||||
WORD npal = 0;
|
||||
|
||||
if (!GetObject (hpal, sizeof (npal), &npal))
|
||||
WIN32_GDI_FAILED ("GetObject (HPALETTE)");
|
||||
|
||||
return npal;
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
gchar *
|
||||
gdk_win32_color_to_string (const GdkColor *color)
|
||||
{
|
||||
static char buf[100];
|
||||
|
||||
sprintf (buf, "(%.04x,%.04x,%.04x):%.06x",
|
||||
color->red, color->green, color->blue, color->pixel);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
|
||||
const int nentries)
|
||||
{
|
||||
char buf[20];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nentries; i++)
|
||||
g_print (" %3d %02x: %02x %02x %02x%s\n",
|
||||
i, i,
|
||||
pep[i].peRed, pep[i].peGreen, pep[i].peBlue,
|
||||
(pep[i].peFlags == 0 ? "" :
|
||||
(pep[i].peFlags == PC_EXPLICIT ? " PC_EXPLICIT" :
|
||||
(pep[i].peFlags == PC_NOCOLLAPSE ? " PC_NOCOLLAPSE" :
|
||||
(pep[i].peFlags == PC_RESERVED ? " PC_RESERVED" :
|
||||
(sprintf (buf, " %d", pep[i].peFlags), buf))))));
|
||||
}
|
||||
|
||||
void
|
||||
gdk_win32_print_system_palette (void)
|
||||
{
|
||||
PALETTEENTRY *pe;
|
||||
int k;
|
||||
|
||||
k = GetSystemPaletteEntries (gdk_display_hdc, 0, 0, NULL);
|
||||
pe = g_new (PALETTEENTRY, k);
|
||||
k = GetSystemPaletteEntries (gdk_display_hdc, 0, k, pe);
|
||||
|
||||
if (!k)
|
||||
g_print ("GetSystemPaletteEntries failed: %s\n",
|
||||
g_win32_error_message (GetLastError ()));
|
||||
else
|
||||
{
|
||||
g_print ("System palette: %d entries\n", k);
|
||||
gdk_win32_print_paletteentries (pe, k);
|
||||
}
|
||||
g_free (pe);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_win32_print_hpalette (HPALETTE hpal)
|
||||
{
|
||||
PALETTEENTRY *pe;
|
||||
gint n, npal;
|
||||
|
||||
npal = palette_size (hpal);
|
||||
pe = g_new (PALETTEENTRY, npal);
|
||||
n = GetPaletteEntries (hpal, 0, npal, pe);
|
||||
|
||||
if (!n)
|
||||
g_print ("HPALETTE %p: GetPaletteEntries failed: %s\n",
|
||||
hpal, g_win32_error_message (GetLastError ()));
|
||||
else
|
||||
{
|
||||
g_print ("HPALETTE %p: %d (%d) entries\n", hpal, n, npal);
|
||||
gdk_win32_print_paletteentries (pe, n);
|
||||
}
|
||||
g_free (pe);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Mimics XAllocColorCells. Allocate read/write color cells. */
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -977,7 +977,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
|
||||
|
||||
event->dnd.x_root = pt.x;
|
||||
event->dnd.y_root = pt.y;
|
||||
event->dnd.time = msg->time;
|
||||
event->dnd.time = _gdk_win32_get_next_tick (msg->time);
|
||||
|
||||
nfiles = DragQueryFile (hdrop, 0xFFFFFFFF, NULL, 0);
|
||||
|
||||
|
||||
+598
-236
File diff suppressed because it is too large
Load Diff
+332
-594
File diff suppressed because it is too large
Load Diff
+12
-404
@@ -123,332 +123,6 @@ charset_name (DWORD charset)
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static gint num_fonts;
|
||||
static gint font_names_size;
|
||||
static gchar **xfontnames;
|
||||
|
||||
static gchar *
|
||||
logfont_to_xlfd (const LOGFONT *lfp,
|
||||
int size,
|
||||
int res,
|
||||
int avg_width)
|
||||
{
|
||||
const gchar *weight;
|
||||
const gchar *registry, *encoding;
|
||||
int point_size;
|
||||
static int logpixelsy = 0;
|
||||
gchar facename[LF_FACESIZE*5];
|
||||
gchar *utf8_facename;
|
||||
gchar *p;
|
||||
const gchar *q;
|
||||
|
||||
if (logpixelsy == 0)
|
||||
{
|
||||
logpixelsy = GetDeviceCaps (gdk_display_hdc, LOGPIXELSY);
|
||||
}
|
||||
|
||||
if (lfp->lfWeight >= FW_HEAVY)
|
||||
weight = "heavy";
|
||||
else if (lfp->lfWeight >= FW_EXTRABOLD)
|
||||
weight = "extrabold";
|
||||
else if (lfp->lfWeight >= FW_BOLD)
|
||||
weight = "bold";
|
||||
#ifdef FW_DEMIBOLD
|
||||
else if (lfp->lfWeight >= FW_DEMIBOLD)
|
||||
weight = "demibold";
|
||||
#endif
|
||||
else if (lfp->lfWeight >= FW_MEDIUM)
|
||||
weight = "medium";
|
||||
else if (lfp->lfWeight >= FW_NORMAL)
|
||||
weight = "normal";
|
||||
else if (lfp->lfWeight >= FW_LIGHT)
|
||||
weight = "light";
|
||||
else if (lfp->lfWeight >= FW_EXTRALIGHT)
|
||||
weight = "extralight";
|
||||
else if (lfp->lfWeight >= FW_THIN)
|
||||
weight = "thin";
|
||||
else
|
||||
weight = "regular";
|
||||
|
||||
switch (lfp->lfCharSet)
|
||||
{
|
||||
case ANSI_CHARSET:
|
||||
registry = "iso8859";
|
||||
encoding = "1";
|
||||
break;
|
||||
case SHIFTJIS_CHARSET:
|
||||
registry = "jisx0208.1983";
|
||||
encoding = "0";
|
||||
break;
|
||||
case HANGEUL_CHARSET:
|
||||
registry = "ksc5601.1987";
|
||||
encoding = "0";
|
||||
break;
|
||||
case GB2312_CHARSET:
|
||||
registry = "gb2312.1980";
|
||||
encoding = "0";
|
||||
break;
|
||||
case CHINESEBIG5_CHARSET:
|
||||
registry = "big5";
|
||||
encoding = "0";
|
||||
break;
|
||||
case GREEK_CHARSET:
|
||||
registry = "iso8859";
|
||||
encoding = "7";
|
||||
break;
|
||||
case TURKISH_CHARSET:
|
||||
registry = "iso8859";
|
||||
encoding = "9";
|
||||
break;
|
||||
#if 0 /* Not a good idea, I think, to use ISO8859-8 and -6 for the Windows
|
||||
* hebrew and arabic codepages, they differ too much.
|
||||
*/
|
||||
case HEBREW_CHARSET:
|
||||
registry = "iso8859";
|
||||
encoding = "8";
|
||||
break;
|
||||
case ARABIC_CHARSET:
|
||||
registry = "iso8859";
|
||||
encoding = "6";
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
registry = "microsoft";
|
||||
encoding = charset_name (lfp->lfCharSet);
|
||||
}
|
||||
|
||||
point_size = (int) (((double) size/logpixelsy) * 720.);
|
||||
|
||||
if (res == -1)
|
||||
res = logpixelsy;
|
||||
|
||||
/* Convert the facename Windows fives us from the locale-dependent
|
||||
* codepage to UTF-8.
|
||||
*/
|
||||
utf8_facename = g_filename_to_utf8 (lfp->lfFaceName, -1, NULL, NULL, NULL);
|
||||
|
||||
/* Replace characters illegal in an XLFD with hex escapes. */
|
||||
p = facename;
|
||||
q = utf8_facename;
|
||||
while (*q)
|
||||
{
|
||||
if (*q == '-' || *q == '*' || *q == '?' || *q == '%')
|
||||
p += sprintf (p, "%%%.02x", *q);
|
||||
else
|
||||
*p++ = *q;
|
||||
q++;
|
||||
}
|
||||
*p = '\0';
|
||||
g_free (utf8_facename);
|
||||
|
||||
return g_strdup_printf
|
||||
("-%s-%s-%s-%s-%s-%s-%d-%d-%d-%d-%s-%d-%s-%s",
|
||||
"unknown",
|
||||
facename,
|
||||
weight,
|
||||
(lfp->lfItalic ?
|
||||
((lfp->lfPitchAndFamily & 0xF0) == FF_ROMAN
|
||||
|| (lfp->lfPitchAndFamily & 0xF0) == FF_SCRIPT ?
|
||||
"i" : "o") : "r"),
|
||||
"normal",
|
||||
"",
|
||||
size,
|
||||
point_size,
|
||||
res,
|
||||
res,
|
||||
((lfp->lfPitchAndFamily & 0x03) == FIXED_PITCH ? "m" : "p"),
|
||||
avg_width,
|
||||
registry, encoding);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_font_full_name_get (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivateWin32 *private;
|
||||
GdkWin32SingleFont *singlefont;
|
||||
GSList *list;
|
||||
GString *string;
|
||||
gchar *result;
|
||||
gchar *xlfd;
|
||||
LOGFONT logfont;
|
||||
|
||||
g_return_val_if_fail (font != NULL, NULL);
|
||||
|
||||
private = (GdkFontPrivateWin32 *) font;
|
||||
|
||||
list = private->fonts;
|
||||
string = g_string_new ("");
|
||||
|
||||
while (list)
|
||||
{
|
||||
singlefont = (GdkWin32SingleFont *) list->data;
|
||||
|
||||
if (GetObject (singlefont->hfont, sizeof (LOGFONT), &logfont) == 0)
|
||||
{
|
||||
WIN32_GDI_FAILED ("GetObject");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
xlfd = logfont_to_xlfd (&logfont, logfont.lfHeight, -1, 0);
|
||||
string = g_string_append (string, xlfd);
|
||||
g_free (xlfd);
|
||||
list = list->next;
|
||||
if (list)
|
||||
string = g_string_append_c (string, ',');
|
||||
}
|
||||
result = string->str;
|
||||
g_string_free (string, FALSE);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_font_full_name_free (gchar *name)
|
||||
{
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pattern_match (const gchar *pattern,
|
||||
const gchar *string)
|
||||
{
|
||||
const gchar *p = pattern, *n = string;
|
||||
gchar c, c1;
|
||||
|
||||
/* Common case first */
|
||||
if ((pattern[0] == '*'
|
||||
&& pattern[1] == '\0')
|
||||
|| (pattern[0] == '-'
|
||||
&& pattern[1] == '*'
|
||||
&& pattern[2] == '\0'))
|
||||
return TRUE;
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
c = tolower (c);
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '?':
|
||||
if (*n == '\0')
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
|
||||
if (c == '?' && *n == '\0')
|
||||
return FALSE;
|
||||
|
||||
if (c == '\0')
|
||||
return TRUE;
|
||||
|
||||
c1 = tolower (c);
|
||||
for (--p; *n != '\0'; ++n)
|
||||
if (tolower (*n) == c1
|
||||
&& pattern_match (p, n))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
|
||||
default:
|
||||
if (c != tolower (*n))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
++n;
|
||||
}
|
||||
|
||||
if (*n == '\0')
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int CALLBACK
|
||||
InnerEnumFontFamExProc (const LOGFONT *lfp,
|
||||
const TEXTMETRIC *metrics,
|
||||
DWORD fontType,
|
||||
LPARAM lParam)
|
||||
{
|
||||
int size;
|
||||
gchar *xlfd;
|
||||
|
||||
if (fontType == TRUETYPE_FONTTYPE)
|
||||
{
|
||||
size = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = lfp->lfHeight;
|
||||
}
|
||||
|
||||
xlfd = logfont_to_xlfd (lfp, size, 0, 0);
|
||||
|
||||
if (!pattern_match ((gchar *) lParam, xlfd))
|
||||
{
|
||||
g_free (xlfd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
num_fonts++;
|
||||
if (num_fonts == font_names_size)
|
||||
{
|
||||
font_names_size *= 2;
|
||||
xfontnames = g_realloc (xfontnames, font_names_size * sizeof (gchar *));
|
||||
}
|
||||
xfontnames[num_fonts-1] = xlfd;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int CALLBACK
|
||||
EnumFontFamExProc (const LOGFONT *lfp,
|
||||
const TEXTMETRIC *metrics,
|
||||
DWORD fontType,
|
||||
LPARAM lParam)
|
||||
{
|
||||
if (fontType == TRUETYPE_FONTTYPE)
|
||||
{
|
||||
LOGFONT lf;
|
||||
|
||||
lf = *lfp;
|
||||
|
||||
EnumFontFamiliesEx (gdk_display_hdc, &lf, InnerEnumFontFamExProc, lParam, 0);
|
||||
}
|
||||
else
|
||||
InnerEnumFontFamExProc (lfp, metrics, fontType, lParam);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
gchar **
|
||||
gdk_font_list_new (const gchar *font_pattern,
|
||||
gint *n_returned)
|
||||
{
|
||||
LOGFONT logfont;
|
||||
gchar **result;
|
||||
|
||||
num_fonts = 0;
|
||||
font_names_size = 100;
|
||||
xfontnames = g_new (gchar *, font_names_size);
|
||||
memset (&logfont, 0, sizeof (logfont));
|
||||
logfont.lfCharSet = DEFAULT_CHARSET;
|
||||
EnumFontFamiliesEx (gdk_display_hdc, &logfont, EnumFontFamExProc,
|
||||
(LPARAM) font_pattern, 0);
|
||||
|
||||
result = g_new (gchar *, num_fonts + 1);
|
||||
memmove (result, xfontnames, num_fonts * sizeof (gchar *));
|
||||
result[num_fonts] = NULL;
|
||||
g_free (xfontnames);
|
||||
|
||||
*n_returned = num_fonts;
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_font_list_free (gchar **font_list)
|
||||
{
|
||||
g_strfreev (font_list);
|
||||
}
|
||||
|
||||
/* This table classifies Unicode characters according to the Microsoft
|
||||
* Unicode subset numbering. This is based on the table in "Developing
|
||||
* International Software for Windows 95 and Windows NT". This is almost,
|
||||
@@ -1230,8 +904,8 @@ gdk_font_load_logfont (LOGFONT *lfp)
|
||||
else
|
||||
singlefont->codepage = 0;
|
||||
|
||||
GDK_NOTE (MISC, (g_print ("... = %#x %s cs %s cp%d\n",
|
||||
(guint) singlefont->hfont, face,
|
||||
GDK_NOTE (MISC, (g_print ("... = %p %s cs %s cp%d\n",
|
||||
singlefont->hfont, face,
|
||||
charset_name (singlefont->charset),
|
||||
singlefont->codepage),
|
||||
g_print ("... Unicode subranges:"),
|
||||
@@ -1676,8 +1350,8 @@ _gdk_font_destroy (GdkFont *font)
|
||||
GSList *list;
|
||||
|
||||
singlefont = (GdkWin32SingleFont *) private->fonts->data;
|
||||
GDK_NOTE (MISC, g_print ("_gdk_font_destroy %#x\n",
|
||||
(guint)singlefont->hfont));
|
||||
GDK_NOTE (MISC, g_print ("_gdk_font_destroy %p\n",
|
||||
singlefont->hfont));
|
||||
|
||||
gdk_font_hash_remove (font->type, font);
|
||||
|
||||
@@ -1840,9 +1514,9 @@ _gdk_wchar_text_handle (GdkFont *font,
|
||||
if (!list)
|
||||
singlefont = NULL;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("%d:%d:%d:%#x ",
|
||||
GDK_NOTE (MISC, g_print ("%d:%d:%d:%p ",
|
||||
start-wcstr, wcp-wcstr, block,
|
||||
(singlefont ? (guint) singlefont->hfont : 0)));
|
||||
(singlefont ? singlefont->hfont : 0)));
|
||||
|
||||
/* Call the callback function */
|
||||
(*handler) (singlefont, start, wcp+1 - start, arg);
|
||||
@@ -1881,57 +1555,16 @@ gdk_text_size_handler (GdkWin32SingleFont *singlefont,
|
||||
arg->total.cy = MAX (arg->total.cy, this_size.cy);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_text_size (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length,
|
||||
gdk_text_size_arg *arg)
|
||||
{
|
||||
gint wlen;
|
||||
wchar_t *wcstr;
|
||||
|
||||
g_return_val_if_fail (font != NULL, FALSE);
|
||||
g_return_val_if_fail (text != NULL, FALSE);
|
||||
|
||||
if (text_length == 0)
|
||||
return 0;
|
||||
|
||||
g_assert (font->type == GDK_FONT_FONT || font->type == GDK_FONT_FONTSET);
|
||||
|
||||
wcstr = g_new (wchar_t, text_length);
|
||||
if (text_length == 1)
|
||||
{
|
||||
/* For single characters, don't try to interpret as UTF-8.
|
||||
*/
|
||||
wcstr[0] = (guchar) text[0];
|
||||
_gdk_wchar_text_handle (font, wcstr, 1, gdk_text_size_handler, arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((wlen = _gdk_utf8_to_ucs2 (wcstr, text, text_length, text_length)) == -1)
|
||||
g_warning ("gdk_text_size: _gdk_utf8_to_ucs2 failed");
|
||||
else
|
||||
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, arg);
|
||||
}
|
||||
|
||||
g_free (wcstr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_text_width (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length)
|
||||
{
|
||||
gdk_text_size_arg arg;
|
||||
gint width = -1;
|
||||
|
||||
arg.total.cx = arg.total.cy = 0;
|
||||
gdk_text_extents (font, text, text_length, NULL, NULL, &width, NULL, NULL);
|
||||
|
||||
if (!gdk_text_size (font, text, text_length, &arg))
|
||||
return -1;
|
||||
|
||||
return arg.total.cx;
|
||||
return width;
|
||||
}
|
||||
|
||||
gint
|
||||
@@ -1939,36 +1572,11 @@ gdk_text_width_wc (GdkFont *font,
|
||||
const GdkWChar *text,
|
||||
gint text_length)
|
||||
{
|
||||
gdk_text_size_arg arg;
|
||||
wchar_t *wcstr;
|
||||
gint i;
|
||||
gint width = -1;
|
||||
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (text != NULL, -1);
|
||||
gdk_text_extents_wc (font, text, text_length, NULL, NULL, &width, NULL, NULL);
|
||||
|
||||
if (text_length == 0)
|
||||
return 0;
|
||||
|
||||
g_assert (font->type == GDK_FONT_FONT || font->type == GDK_FONT_FONTSET);
|
||||
|
||||
if (sizeof (wchar_t) != sizeof (GdkWChar))
|
||||
{
|
||||
wcstr = g_new (wchar_t, text_length);
|
||||
for (i = 0; i < text_length; i++)
|
||||
wcstr[i] = text[i];
|
||||
}
|
||||
else
|
||||
wcstr = (wchar_t *) text;
|
||||
|
||||
arg.total.cx = arg.total.cy = 0;
|
||||
|
||||
_gdk_wchar_text_handle (font, wcstr, text_length,
|
||||
gdk_text_size_handler, &arg);
|
||||
|
||||
if (sizeof (wchar_t) != sizeof (GdkWChar))
|
||||
g_free (wcstr);
|
||||
|
||||
return arg.total.cx;
|
||||
return width;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+161
-329
@@ -96,8 +96,8 @@ gdk_gc_win32_finalize (GObject *object)
|
||||
{
|
||||
GdkGCWin32 *win32_gc = GDK_GC_WIN32 (object);
|
||||
|
||||
if (win32_gc->clip_region)
|
||||
gdk_region_destroy (win32_gc->clip_region);
|
||||
if (win32_gc->hcliprgn != NULL)
|
||||
DeleteObject (win32_gc->hcliprgn);
|
||||
|
||||
if (win32_gc->values_mask & GDK_GC_FONT)
|
||||
gdk_font_unref (win32_gc->font);
|
||||
@@ -148,14 +148,10 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values,
|
||||
win32_gc->font = values->font;
|
||||
if (win32_gc->font != NULL)
|
||||
{
|
||||
gchar *xlfd;
|
||||
|
||||
gdk_font_ref (win32_gc->font);
|
||||
win32_gc->values_mask |= GDK_GC_FONT;
|
||||
GDK_NOTE (GC, (xlfd = gdk_font_full_name_get (win32_gc->font),
|
||||
g_print ("%sfont=%s", s, xlfd),
|
||||
s = ",",
|
||||
gdk_font_full_name_free (xlfd)));
|
||||
GDK_NOTE (GC, (g_print ("%sfont=%p", s, win32_gc->font),
|
||||
s = ","));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -197,7 +193,8 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values,
|
||||
{
|
||||
win32_gc->fill_style = values->fill;
|
||||
win32_gc->values_mask |= GDK_GC_FILL;
|
||||
GDK_NOTE (GC, (g_print ("%sfill=%d", s, win32_gc->fill_style),
|
||||
GDK_NOTE (GC, (g_print ("%sfill=%s", s,
|
||||
gdk_win32_fill_style_to_string (win32_gc->fill_style)),
|
||||
s = ","));
|
||||
}
|
||||
|
||||
@@ -282,22 +279,12 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values,
|
||||
|
||||
if (mask & GDK_GC_CLIP_MASK)
|
||||
{
|
||||
if (win32_gc->clip_region != NULL)
|
||||
{
|
||||
gdk_region_destroy (win32_gc->clip_region);
|
||||
win32_gc->clip_region = NULL;
|
||||
}
|
||||
|
||||
if (win32_gc->hcliprgn != NULL)
|
||||
{
|
||||
DeleteObject (win32_gc->hcliprgn);
|
||||
win32_gc->hcliprgn = NULL;
|
||||
}
|
||||
DeleteObject (win32_gc->hcliprgn);
|
||||
|
||||
if (values->clip_mask != NULL)
|
||||
{
|
||||
win32_gc->hcliprgn =
|
||||
_gdk_win32_bitmap_to_region (values->clip_mask);
|
||||
win32_gc->hcliprgn = _gdk_win32_bitmap_to_hrgn (values->clip_mask);
|
||||
win32_gc->values_mask |= GDK_GC_CLIP_MASK;
|
||||
}
|
||||
else
|
||||
@@ -373,8 +360,6 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values,
|
||||
win32_gc->pen_num_dashes = 0;
|
||||
}
|
||||
win32_gc->pen_style &= ~(PS_STYLE_MASK);
|
||||
GDK_NOTE (GC, (g_print ("%sps|=LINE_SOLID", s),
|
||||
s = ","));
|
||||
win32_gc->pen_style |= PS_SOLID;
|
||||
break;
|
||||
case GDK_LINE_ON_OFF_DASH:
|
||||
@@ -386,12 +371,12 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values,
|
||||
* line endings ? --hb
|
||||
*/
|
||||
win32_gc->pen_style &= ~(PS_STYLE_MASK);
|
||||
GDK_NOTE (GC, (g_print ("%sps|=DASH", s),
|
||||
s = ","));
|
||||
win32_gc->pen_style |= PS_DASH;
|
||||
win32_gc->pen_style |= PS_DASH;
|
||||
}
|
||||
break;
|
||||
}
|
||||
GDK_NOTE (GC, (g_print ("%sps|=PS_STYLE_%s", s, gdk_win32_psstyle_to_string (win32_gc->pen_style)),
|
||||
s = ","));
|
||||
win32_gc->values_mask |= GDK_GC_LINE_STYLE;
|
||||
}
|
||||
|
||||
@@ -402,21 +387,17 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values,
|
||||
{
|
||||
case GDK_CAP_NOT_LAST: /* ??? */
|
||||
case GDK_CAP_BUTT:
|
||||
GDK_NOTE (GC, (g_print ("%sps|=ENDCAP_FLAT", s),
|
||||
s = ","));
|
||||
win32_gc->pen_style |= PS_ENDCAP_FLAT;
|
||||
break;
|
||||
case GDK_CAP_ROUND:
|
||||
GDK_NOTE (GC, (g_print ("%sps|=ENDCAP_ROUND", s),
|
||||
s = ","));
|
||||
win32_gc->pen_style |= PS_ENDCAP_ROUND;
|
||||
break;
|
||||
case GDK_CAP_PROJECTING:
|
||||
GDK_NOTE (GC, (g_print ("%sps|=ENDCAP_SQUARE", s),
|
||||
s = ","));
|
||||
win32_gc->pen_style |= PS_ENDCAP_SQUARE;
|
||||
break;
|
||||
}
|
||||
GDK_NOTE (GC, (g_print ("%sps|=PS_ENDCAP_%s", s, gdk_win32_psendcap_to_string (win32_gc->pen_style)),
|
||||
s = ","));
|
||||
win32_gc->values_mask |= GDK_GC_CAP_STYLE;
|
||||
}
|
||||
|
||||
@@ -426,24 +407,20 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values,
|
||||
switch (values->join_style)
|
||||
{
|
||||
case GDK_JOIN_MITER:
|
||||
GDK_NOTE (GC, (g_print ("%sps|=JOIN_MITER", s),
|
||||
s = ","));
|
||||
win32_gc->pen_style |= PS_JOIN_MITER;
|
||||
break;
|
||||
case GDK_JOIN_ROUND:
|
||||
GDK_NOTE (GC, (g_print ("%sps|=JOIN_ROUND", s),
|
||||
s = ","));
|
||||
win32_gc->pen_style |= PS_JOIN_ROUND;
|
||||
break;
|
||||
case GDK_JOIN_BEVEL:
|
||||
GDK_NOTE (GC, (g_print ("%sps|=JOIN_BEVEL", s),
|
||||
s = ","));
|
||||
win32_gc->pen_style |= PS_JOIN_BEVEL;
|
||||
break;
|
||||
}
|
||||
GDK_NOTE (GC, (g_print ("%sps|=PS_JOIN_%s", s, gdk_win32_psjoin_to_string (win32_gc->pen_style)),
|
||||
s = ","));
|
||||
win32_gc->values_mask |= GDK_GC_JOIN_STYLE;
|
||||
}
|
||||
GDK_NOTE (GC, g_print ("}\n"));
|
||||
GDK_NOTE (GC, g_print ("} mask=(%s)", gdk_win32_gcvalues_mask_to_string (win32_gc->values_mask)));
|
||||
}
|
||||
|
||||
GdkGC*
|
||||
@@ -462,8 +439,6 @@ _gdk_win32_gc_new (GdkDrawable *drawable,
|
||||
gc = g_object_new (_gdk_gc_win32_get_type (), NULL);
|
||||
win32_gc = GDK_GC_WIN32 (gc);
|
||||
|
||||
win32_gc->hdc = NULL;
|
||||
win32_gc->clip_region = NULL;
|
||||
win32_gc->hcliprgn = NULL;
|
||||
|
||||
/* Use the same default values as X11 does, even if they don't make
|
||||
@@ -483,13 +458,13 @@ _gdk_win32_gc_new (GdkDrawable *drawable,
|
||||
|
||||
win32_gc->values_mask = GDK_GC_FUNCTION | GDK_GC_FILL;
|
||||
|
||||
GDK_NOTE (GC, g_print ("_gdk_win32_gc_new: "));
|
||||
GDK_NOTE (GC, g_print ("_gdk_win32_gc_new: %p: ", win32_gc));
|
||||
gdk_win32_gc_values_to_win32values (values, mask, win32_gc);
|
||||
GDK_NOTE (GC, g_print ("\n"));
|
||||
|
||||
win32_gc->hdc = NULL;
|
||||
win32_gc->hwnd = NULL;
|
||||
|
||||
GDK_NOTE (GC, g_print (" = %p\n", gc));
|
||||
|
||||
return gc;
|
||||
}
|
||||
|
||||
@@ -586,9 +561,9 @@ gdk_win32_gc_set_values (GdkGC *gc,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
|
||||
GDK_NOTE (GC, g_print ("gdk_win32_gc_set_values: "));
|
||||
|
||||
GDK_NOTE (GC, g_print ("gdk_win32_gc_set_values: %p: ", GDK_GC_WIN32 (gc)));
|
||||
gdk_win32_gc_values_to_win32values (values, mask, GDK_GC_WIN32 (gc));
|
||||
GDK_NOTE (GC, g_print ("\n"));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -628,36 +603,35 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
|
||||
win32_gc = GDK_GC_WIN32 (gc);
|
||||
|
||||
if (win32_gc->hcliprgn)
|
||||
{
|
||||
DeleteObject (win32_gc->hcliprgn);
|
||||
win32_gc->hcliprgn = NULL;
|
||||
}
|
||||
|
||||
if (win32_gc->clip_region)
|
||||
gdk_region_destroy (win32_gc->clip_region);
|
||||
DeleteObject (win32_gc->hcliprgn);
|
||||
|
||||
if (rectangle)
|
||||
{
|
||||
GDK_NOTE (GC,
|
||||
g_print ("gdk_gc_set_clip_rectangle: %dx%d@+%d+%d\n",
|
||||
rectangle->width, rectangle->height,
|
||||
rectangle->x, rectangle->y));
|
||||
win32_gc->clip_region = gdk_region_rectangle (rectangle);
|
||||
GDK_NOTE (GC, g_print ("gdk_gc_set_clip_rectangle: %p: %s\n",
|
||||
win32_gc,
|
||||
gdk_win32_gdkrectangle_to_string (rectangle)));
|
||||
win32_gc->hcliprgn = CreateRectRgn (rectangle->x, rectangle->y,
|
||||
rectangle->x + rectangle->width,
|
||||
rectangle->y + rectangle->height);
|
||||
win32_gc->values_mask |= GDK_GC_CLIP_MASK;
|
||||
}
|
||||
else
|
||||
{
|
||||
GDK_NOTE (GC, g_print ("gdk_gc_set_clip_rectangle: NULL\n"));
|
||||
|
||||
win32_gc->clip_region = NULL;
|
||||
win32_gc->hcliprgn = NULL;
|
||||
win32_gc->values_mask &= ~GDK_GC_CLIP_MASK;
|
||||
}
|
||||
win32_gc->values_mask &= ~(GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
|
||||
|
||||
gc->clip_x_origin = 0;
|
||||
gc->clip_y_origin = 0;
|
||||
|
||||
win32_gc->values_mask &= ~(GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_clip_region (GdkGC *gc,
|
||||
GdkRegion *region)
|
||||
gdk_gc_set_clip_region (GdkGC *gc,
|
||||
GdkRegion *region)
|
||||
{
|
||||
GdkGCWin32 *win32_gc;
|
||||
|
||||
@@ -665,30 +639,29 @@ gdk_gc_set_clip_region (GdkGC *gc,
|
||||
|
||||
win32_gc = GDK_GC_WIN32 (gc);
|
||||
|
||||
if (win32_gc->clip_region)
|
||||
gdk_region_destroy (win32_gc->clip_region);
|
||||
if (win32_gc->hcliprgn)
|
||||
DeleteObject (win32_gc->hcliprgn);
|
||||
|
||||
if (region)
|
||||
{
|
||||
GDK_NOTE (GC, g_print ("gdk_gc_set_clip_region: %dx%d+%d+%d\n",
|
||||
region->extents.x2 - region->extents.x1,
|
||||
region->extents.y2 - region->extents.y1,
|
||||
region->extents.x1, region->extents.y1));
|
||||
GDK_NOTE (GC, g_print ("gdk_gc_set_clip_region: %p: %s\n",
|
||||
win32_gc,
|
||||
gdk_win32_gdkregion_to_string (region)));
|
||||
|
||||
win32_gc->clip_region = gdk_region_copy (region);
|
||||
win32_gc->hcliprgn = _gdk_win32_gdkregion_to_hrgn (region, 0, 0);
|
||||
win32_gc->values_mask |= GDK_GC_CLIP_MASK;
|
||||
}
|
||||
else
|
||||
{
|
||||
GDK_NOTE (GC, g_print ("gdk_gc_set_clip_region: NULL\n"));
|
||||
|
||||
win32_gc->clip_region = NULL;
|
||||
win32_gc->hcliprgn = NULL;
|
||||
win32_gc->values_mask &= ~GDK_GC_CLIP_MASK;
|
||||
}
|
||||
|
||||
gc->clip_x_origin = 0;
|
||||
gc->clip_y_origin = 0;
|
||||
|
||||
|
||||
win32_gc->values_mask &= ~(GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
|
||||
}
|
||||
|
||||
@@ -705,24 +678,32 @@ gdk_gc_copy (GdkGC *dst_gc,
|
||||
dst_win32_gc = GDK_GC_WIN32 (dst_gc);
|
||||
src_win32_gc = GDK_GC_WIN32 (src_gc);
|
||||
|
||||
if (dst_win32_gc->font != NULL)
|
||||
gdk_font_unref (dst_win32_gc->font);
|
||||
if (dst_win32_gc->tile != NULL)
|
||||
gdk_drawable_unref (dst_win32_gc->tile);
|
||||
if (dst_win32_gc->stipple != NULL)
|
||||
gdk_drawable_unref (dst_win32_gc->stipple);
|
||||
if (dst_win32_gc->clip_region != NULL)
|
||||
gdk_region_destroy (dst_win32_gc->clip_region);
|
||||
GDK_NOTE (GC, g_print ("gdk_gc_copy: %p := %p\n", dst_win32_gc, src_win32_gc));
|
||||
|
||||
if (dst_gc->colormap)
|
||||
g_object_unref (G_OBJECT (dst_gc->colormap));
|
||||
|
||||
if (dst_win32_gc->hcliprgn != NULL)
|
||||
DeleteObject (dst_win32_gc->hcliprgn);
|
||||
|
||||
if (dst_win32_gc->font != NULL)
|
||||
gdk_font_unref (dst_win32_gc->font);
|
||||
|
||||
if (dst_win32_gc->tile != NULL)
|
||||
gdk_drawable_unref (dst_win32_gc->tile);
|
||||
|
||||
if (dst_win32_gc->stipple != NULL)
|
||||
gdk_drawable_unref (dst_win32_gc->stipple);
|
||||
|
||||
if (dst_win32_gc->pen_dashes)
|
||||
g_free (dst_win32_gc->pen_dashes);
|
||||
|
||||
*dst_win32_gc = *src_win32_gc;
|
||||
dst_win32_gc->hdc = NULL;
|
||||
|
||||
if (dst_gc->colormap)
|
||||
g_object_ref (G_OBJECT (dst_gc->colormap));
|
||||
|
||||
if (dst_win32_gc->pen_dashes)
|
||||
dst_win32_gc->pen_dashes = g_memdup (src_win32_gc->pen_dashes,
|
||||
sizeof (DWORD) * src_win32_gc->pen_num_dashes);
|
||||
if (dst_win32_gc->hcliprgn)
|
||||
{
|
||||
/* create a new region, to copy to */
|
||||
@@ -731,14 +712,19 @@ gdk_gc_copy (GdkGC *dst_gc,
|
||||
CombineRgn (dst_win32_gc->hcliprgn, src_win32_gc->hcliprgn,
|
||||
NULL, RGN_COPY);
|
||||
}
|
||||
if (dst_win32_gc->clip_region != NULL)
|
||||
dst_win32_gc->clip_region = gdk_region_copy (dst_win32_gc->clip_region);
|
||||
|
||||
if (dst_win32_gc->font != NULL)
|
||||
gdk_font_ref (dst_win32_gc->font);
|
||||
|
||||
if (dst_win32_gc->tile != NULL)
|
||||
gdk_drawable_ref (dst_win32_gc->tile);
|
||||
|
||||
if (dst_win32_gc->stipple != NULL)
|
||||
gdk_drawable_ref (dst_win32_gc->stipple);
|
||||
|
||||
if (dst_win32_gc->pen_dashes)
|
||||
dst_win32_gc->pen_dashes = g_memdup (src_win32_gc->pen_dashes,
|
||||
sizeof (DWORD) * src_win32_gc->pen_num_dashes);
|
||||
}
|
||||
|
||||
static guint bitmask[9] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 };
|
||||
@@ -855,8 +841,11 @@ predraw_set_foreground (GdkGC *gc,
|
||||
case GDK_OPAQUE_STIPPLED:
|
||||
if (*ok && (hbr = CreatePatternBrush (GDK_PIXMAP_HBITMAP (win32_gc->stipple))) == NULL)
|
||||
WIN32_GDI_FAILED ("CreatePatternBrush"), *ok = FALSE;
|
||||
if (*ok && !SetBrushOrgEx(win32_gc->hdc, gc->ts_x_origin,
|
||||
gc->ts_y_origin, NULL))
|
||||
if (*ok && win32_gc->values_mask & (GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN) &&
|
||||
!SetBrushOrgEx(win32_gc->hdc,
|
||||
win32_gc->values_mask & GDK_GC_TS_X_ORIGIN ? gc->ts_x_origin : 0,
|
||||
win32_gc->values_mask & GDK_GC_TS_Y_ORIGIN ? gc->ts_y_origin : 0,
|
||||
NULL))
|
||||
WIN32_GDI_FAILED ("SetBrushOrgEx"), *ok = FALSE;
|
||||
|
||||
break;
|
||||
@@ -867,6 +856,7 @@ predraw_set_foreground (GdkGC *gc,
|
||||
WIN32_GDI_FAILED ("CreateSolidBrush"), *ok = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (*ok)
|
||||
{
|
||||
HBRUSH old_hbr = SelectObject (win32_gc->hdc, hbr);
|
||||
@@ -904,7 +894,6 @@ gdk_win32_hdc_get (GdkDrawable *drawable,
|
||||
GdkGCWin32 *win32_gc = (GdkGCWin32 *) gc;
|
||||
GdkDrawableImplWin32 *impl = NULL;
|
||||
gboolean ok = TRUE;
|
||||
int flag;
|
||||
|
||||
g_assert (win32_gc->hdc == NULL);
|
||||
|
||||
@@ -958,162 +947,51 @@ gdk_win32_hdc_get (GdkDrawable *drawable,
|
||||
if (SetROP2 (win32_gc->hdc, win32_gc->rop2) == 0)
|
||||
WIN32_GDI_FAILED ("SetROP2"), ok = FALSE;
|
||||
|
||||
if (win32_gc->values_mask & GDK_GC_CLIP_MASK)
|
||||
g_assert ((win32_gc->clip_region != NULL) != (win32_gc->hcliprgn != NULL));
|
||||
|
||||
if (ok
|
||||
&& (win32_gc->values_mask & GDK_GC_CLIP_MASK)
|
||||
&& win32_gc->clip_region != NULL)
|
||||
{
|
||||
HRGN hrgn;
|
||||
RGNDATA *rgndata;
|
||||
RECT *rect;
|
||||
GdkRegionBox *boxes = win32_gc->clip_region->rects;
|
||||
guint nbytes =
|
||||
sizeof (RGNDATAHEADER) + (sizeof (RECT) * win32_gc->clip_region->numRects);
|
||||
int i;
|
||||
|
||||
rgndata = g_malloc (nbytes);
|
||||
rgndata->rdh.dwSize = sizeof (RGNDATAHEADER);
|
||||
rgndata->rdh.iType = RDH_RECTANGLES;
|
||||
rgndata->rdh.nCount = rgndata->rdh.nRgnSize = 0;
|
||||
SetRect (&rgndata->rdh.rcBound,
|
||||
G_MAXSHORT, G_MAXSHORT, G_MINSHORT, G_MINSHORT);
|
||||
|
||||
for (i = 0; i < win32_gc->clip_region->numRects; i++)
|
||||
{
|
||||
rect = ((RECT *) rgndata->Buffer) + rgndata->rdh.nCount++;
|
||||
|
||||
rect->left = CLAMP (boxes[i].x1 + gc->clip_x_origin,
|
||||
G_MINSHORT, G_MAXSHORT);
|
||||
rect->right = CLAMP (boxes[i].x2 + gc->clip_x_origin,
|
||||
G_MINSHORT, G_MAXSHORT);
|
||||
rect->top = CLAMP (boxes[i].y1 + gc->clip_y_origin,
|
||||
G_MINSHORT, G_MAXSHORT);
|
||||
rect->bottom = CLAMP (boxes[i].y2 + gc->clip_y_origin,
|
||||
G_MINSHORT, G_MAXSHORT);
|
||||
|
||||
GDK_NOTE (GC, g_print ("clip rgn box %d: %ldx%ld@+%ld+%ld\n",
|
||||
i,
|
||||
rect->right-rect->left,
|
||||
rect->bottom-rect->top,
|
||||
rect->left, rect->top));
|
||||
|
||||
if (rect->left < rgndata->rdh.rcBound.left)
|
||||
rgndata->rdh.rcBound.left = rect->left;
|
||||
if (rect->right > rgndata->rdh.rcBound.right)
|
||||
rgndata->rdh.rcBound.right = rect->right;
|
||||
if (rect->top < rgndata->rdh.rcBound.top)
|
||||
rgndata->rdh.rcBound.top = rect->top;
|
||||
if (rect->bottom > rgndata->rdh.rcBound.bottom)
|
||||
rgndata->rdh.rcBound.bottom = rect->bottom;
|
||||
}
|
||||
if ((hrgn = ExtCreateRegion (NULL, nbytes, rgndata)) == NULL)
|
||||
WIN32_API_FAILED ("ExtCreateRegion"), ok = FALSE;
|
||||
|
||||
/*
|
||||
* XXX: combine the fillmode-stipple with the clip region possibly
|
||||
* this needs to be done with the hcliprgn below as well, but
|
||||
* the test case here were check boxes and radio buttons ...
|
||||
*/
|
||||
if ( (win32_gc->values_mask & GDK_GC_STIPPLE)
|
||||
&& (win32_gc->values_mask & GDK_GC_FILL) && (win32_gc->fill_style == GDK_STIPPLED))
|
||||
{
|
||||
HRGN hstipplergn = _gdk_win32_bitmap_to_region (win32_gc->stipple);
|
||||
|
||||
if (OffsetRgn (hstipplergn,
|
||||
win32_gc->values_mask & GDK_GC_TS_X_ORIGIN ? gc->ts_x_origin : 0,
|
||||
win32_gc->values_mask & GDK_GC_TS_Y_ORIGIN ? gc->ts_y_origin : 0) == ERROR)
|
||||
WIN32_API_FAILED ("OffsetRgn"), ok = FALSE;
|
||||
if (CombineRgn (hrgn, hrgn, hstipplergn, RGN_AND) == ERROR)
|
||||
WIN32_API_FAILED ("CombineRgn"), ok = FALSE;
|
||||
if (!DeleteObject (hstipplergn))
|
||||
WIN32_API_FAILED ("DeleteObject");
|
||||
}
|
||||
if (ok && SelectClipRgn (win32_gc->hdc, hrgn) == ERROR)
|
||||
WIN32_API_FAILED ("SelectClipRgn"), ok = FALSE;
|
||||
|
||||
if (hrgn != NULL)
|
||||
DeleteObject (hrgn);
|
||||
}
|
||||
else if (ok
|
||||
&& (win32_gc->values_mask & GDK_GC_CLIP_MASK)
|
||||
&& win32_gc->hcliprgn != NULL)
|
||||
if (ok &&
|
||||
(win32_gc->values_mask & GDK_GC_CLIP_MASK) &&
|
||||
win32_gc->hcliprgn != NULL)
|
||||
{
|
||||
if (SelectClipRgn (win32_gc->hdc, win32_gc->hcliprgn) == ERROR)
|
||||
WIN32_API_FAILED ("SelectClipRgn"), ok = FALSE;
|
||||
if (ok && !OffsetClipRgn (win32_gc->hdc,
|
||||
win32_gc->values_mask & GDK_GC_CLIP_X_ORIGIN ? gc->clip_x_origin : 0,
|
||||
win32_gc->values_mask & GDK_GC_CLIP_Y_ORIGIN ? gc->clip_y_origin : 0))
|
||||
|
||||
#if 0 /* No, this is totally bogus. The stipple should replicate in x
|
||||
* and y directions, not be just one copy of the bitmap. We must
|
||||
* handle stipples elsewhere.
|
||||
*/
|
||||
/* Combine the fillmode-stipple with the clip region */
|
||||
if (ok &&
|
||||
(win32_gc->values_mask & GDK_GC_STIPPLE) &&
|
||||
(win32_gc->values_mask & GDK_GC_FILL) &&
|
||||
(win32_gc->fill_style == GDK_STIPPLED))
|
||||
{
|
||||
HRGN hstipplergn;
|
||||
|
||||
if ((hstipplergn = _gdk_win32_bitmap_to_hrgn (win32_gc->stipple)) == NULL)
|
||||
;
|
||||
else if (win32_gc->values_mask & (GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN) &&
|
||||
OffsetRgn (hstipplergn,
|
||||
win32_gc->values_mask & GDK_GC_TS_X_ORIGIN ? gc->ts_x_origin : 0,
|
||||
win32_gc->values_mask & GDK_GC_TS_Y_ORIGIN ? gc->ts_y_origin : 0) == ERROR)
|
||||
WIN32_API_FAILED ("OffsetRgn");
|
||||
else if (ExtSelectClipRgn (win32_gc->hdc, hstipplergn, RGN_AND) == ERROR)
|
||||
WIN32_API_FAILED ("ExtSelectClipRgn");
|
||||
|
||||
if (hstipplergn != NULL && !DeleteObject (hstipplergn))
|
||||
WIN32_API_FAILED ("DeleteObject");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ok && win32_gc->values_mask & (GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN) &&
|
||||
OffsetClipRgn (win32_gc->hdc,
|
||||
win32_gc->values_mask & GDK_GC_CLIP_X_ORIGIN ? gc->clip_x_origin : 0,
|
||||
win32_gc->values_mask & GDK_GC_CLIP_Y_ORIGIN ? gc->clip_y_origin : 0) == ERROR)
|
||||
WIN32_API_FAILED ("OffsetClipRgn"), ok = FALSE;
|
||||
}
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (_gdk_debug_flags & GDK_DEBUG_GC)
|
||||
{
|
||||
HGDIOBJ obj;
|
||||
LOGBRUSH logbrush;
|
||||
EXTLOGPEN extlogpen;
|
||||
HRGN hrgn;
|
||||
RECT rect;
|
||||
|
||||
g_print ("gdk_win32_hdc_get: %p\n", win32_gc->hdc);
|
||||
obj = GetCurrentObject (win32_gc->hdc, OBJ_BRUSH);
|
||||
GetObject (obj, sizeof (LOGBRUSH), &logbrush);
|
||||
g_print ("brush: style: %s color: %06lx hatch: %#lx\n",
|
||||
(logbrush.lbStyle == BS_HOLLOW ? "HOLLOW" :
|
||||
(logbrush.lbStyle == BS_PATTERN ? "PATTERN" :
|
||||
(logbrush.lbStyle == BS_SOLID ? "SOLID" :
|
||||
"???"))),
|
||||
logbrush.lbColor,
|
||||
logbrush.lbHatch);
|
||||
obj = GetCurrentObject (win32_gc->hdc, OBJ_PEN);
|
||||
GetObject (obj, sizeof (EXTLOGPEN), &extlogpen);
|
||||
g_print ("pen: type: %s style: %s endcap: %s join: %s width: %d brush: %s\n",
|
||||
((extlogpen.elpPenStyle & PS_TYPE_MASK) ==
|
||||
PS_GEOMETRIC ? "GEOMETRIC" : "COSMETIC"),
|
||||
((extlogpen.elpPenStyle & PS_STYLE_MASK) ==
|
||||
PS_NULL ? "NULL" :
|
||||
((extlogpen.elpPenStyle & PS_STYLE_MASK) == PS_SOLID ? "SOLID" :
|
||||
((extlogpen.elpPenStyle & PS_STYLE_MASK) == PS_DOT ? "DOT" :
|
||||
((extlogpen.elpPenStyle & PS_STYLE_MASK) == PS_DASH ? "DASH" :
|
||||
"???")))),
|
||||
((extlogpen.elpPenStyle & PS_ENDCAP_MASK) ==
|
||||
PS_ENDCAP_FLAT ? "FLAT" :
|
||||
((extlogpen.elpPenStyle & PS_ENDCAP_MASK) ==
|
||||
PS_ENDCAP_ROUND ? "ROUND" :
|
||||
((extlogpen.elpPenStyle & PS_ENDCAP_MASK) ==
|
||||
PS_ENDCAP_SQUARE ? "ROUND" :
|
||||
((extlogpen.elpPenStyle & PS_ENDCAP_MASK) ==
|
||||
PS_ENDCAP_SQUARE ? "ROUND" : "???")))),
|
||||
((extlogpen.elpPenStyle & PS_JOIN_MASK) ==
|
||||
PS_JOIN_BEVEL ? "BEVEL" :
|
||||
((extlogpen.elpPenStyle & PS_JOIN_MASK) ==
|
||||
PS_JOIN_MITER ? "MITER" :
|
||||
((extlogpen.elpPenStyle & PS_JOIN_MASK) ==
|
||||
PS_JOIN_ROUND ? "ROUND" : "???"))),
|
||||
extlogpen.elpWidth,
|
||||
(extlogpen.elpBrushStyle == BS_DIBPATTERN ? "DIBPATTERN" :
|
||||
(extlogpen.elpBrushStyle == BS_DIBPATTERNPT ? "DIBPATTERNPT" :
|
||||
(extlogpen.elpBrushStyle == BS_HATCHED ? "HATCHED" :
|
||||
(extlogpen.elpBrushStyle == BS_HOLLOW ? "HOLLOW" :
|
||||
(extlogpen.elpBrushStyle == BS_PATTERN ? "PATTERN" :
|
||||
(extlogpen.elpBrushStyle == BS_SOLID ? "SOLID" : "???")))))));
|
||||
hrgn = CreateRectRgn (0, 0, 0, 0);
|
||||
if ((flag = GetClipRgn (win32_gc->hdc, hrgn)) == -1)
|
||||
WIN32_API_FAILED ("GetClipRgn");
|
||||
else if (flag == 0)
|
||||
g_print ("no clip region\n");
|
||||
else if (flag == 1)
|
||||
{
|
||||
GetRgnBox (hrgn, &rect);
|
||||
g_print ("clip region bbox: %ldx%ld@+%ld+%ld\n",
|
||||
rect.right - rect.left,
|
||||
rect.bottom - rect.top,
|
||||
rect.left, rect.top);
|
||||
}
|
||||
DeleteObject (hrgn);
|
||||
}
|
||||
#endif
|
||||
GDK_NOTE (GC, (g_print ("gdk_win32_hdc_get: %p (%s): ",
|
||||
win32_gc, gdk_win32_gcvalues_mask_to_string (usage)),
|
||||
gdk_win32_print_dc (win32_gc->hdc)));
|
||||
|
||||
return win32_gc->hdc;
|
||||
}
|
||||
|
||||
@@ -1127,7 +1005,9 @@ gdk_win32_hdc_release (GdkDrawable *drawable,
|
||||
HGDIOBJ hpen = NULL;
|
||||
HGDIOBJ hbr = NULL;
|
||||
|
||||
GDK_NOTE (GC, g_print ("gdk_win32_hdc_release: %p\n", win32_gc->hdc));
|
||||
GDK_NOTE (GC, g_print ("gdk_win32_hdc_release: %p: %p (%s)\n",
|
||||
win32_gc, win32_gc->hdc,
|
||||
gdk_win32_gcvalues_mask_to_string (usage)));
|
||||
|
||||
if (GDK_IS_DRAWABLE_IMPL_WIN32 (drawable))
|
||||
impl = GDK_DRAWABLE_IMPL_WIN32(drawable);
|
||||
@@ -1193,12 +1073,12 @@ gdk_win32_hdc_release (GdkDrawable *drawable,
|
||||
* bitmaps (and not pixmaps), with zero pixels being transparent.
|
||||
*/
|
||||
|
||||
/* _gdk_win32_bitmap_to_region : Create a region from the
|
||||
/* _gdk_win32_bitmap_to_hrgn : Create a region from the
|
||||
* "non-transparent" pixels of a bitmap.
|
||||
*/
|
||||
|
||||
HRGN
|
||||
_gdk_win32_bitmap_to_region (GdkPixmap *pixmap)
|
||||
_gdk_win32_bitmap_to_hrgn (GdkPixmap *pixmap)
|
||||
{
|
||||
HRGN hRgn = NULL;
|
||||
HRGN h;
|
||||
@@ -1304,100 +1184,52 @@ _gdk_win32_bitmap_to_region (GdkPixmap *pixmap)
|
||||
return hRgn;
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
gchar *
|
||||
gdk_win32_cap_style_to_string (GdkCapStyle cap_style)
|
||||
HRGN
|
||||
_gdk_win32_gdkregion_to_hrgn (GdkRegion *region,
|
||||
gint x_origin,
|
||||
gint y_origin)
|
||||
{
|
||||
switch (cap_style)
|
||||
{
|
||||
#define CASE(x) case x: return #x + strlen ("GDK_CAP_")
|
||||
CASE (GDK_CAP_NOT_LAST);
|
||||
CASE (GDK_CAP_BUTT);
|
||||
CASE (GDK_CAP_ROUND);
|
||||
CASE (GDK_CAP_PROJECTING);
|
||||
#undef CASE
|
||||
default: return ("illegal GdkCapStyle value");
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
HRGN hrgn;
|
||||
RGNDATA *rgndata;
|
||||
RECT *rect;
|
||||
GdkRegionBox *boxes = region->rects;
|
||||
guint nbytes =
|
||||
sizeof (RGNDATAHEADER) + (sizeof (RECT) * region->numRects);
|
||||
int i;
|
||||
|
||||
gchar *
|
||||
gdk_win32_fill_style_to_string (GdkFill fill)
|
||||
{
|
||||
switch (fill)
|
||||
{
|
||||
#define CASE(x) case x: return #x + strlen ("GDK_")
|
||||
CASE (GDK_SOLID);
|
||||
CASE (GDK_TILED);
|
||||
CASE (GDK_STIPPLED);
|
||||
CASE (GDK_OPAQUE_STIPPLED);
|
||||
#undef CASE
|
||||
default: return ("illegal GdkFill value");
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
rgndata = g_malloc (nbytes);
|
||||
rgndata->rdh.dwSize = sizeof (RGNDATAHEADER);
|
||||
rgndata->rdh.iType = RDH_RECTANGLES;
|
||||
rgndata->rdh.nCount = rgndata->rdh.nRgnSize = 0;
|
||||
SetRect (&rgndata->rdh.rcBound,
|
||||
G_MAXSHORT, G_MAXSHORT, G_MINSHORT, G_MINSHORT);
|
||||
|
||||
gchar *
|
||||
gdk_win32_function_to_string (GdkFunction function)
|
||||
{
|
||||
switch (function)
|
||||
for (i = 0; i < region->numRects; i++)
|
||||
{
|
||||
#define CASE(x) case x: return #x + strlen ("GDK_")
|
||||
CASE (GDK_COPY);
|
||||
CASE (GDK_INVERT);
|
||||
CASE (GDK_XOR);
|
||||
CASE (GDK_CLEAR);
|
||||
CASE (GDK_AND);
|
||||
CASE (GDK_AND_REVERSE);
|
||||
CASE (GDK_AND_INVERT);
|
||||
CASE (GDK_NOOP);
|
||||
CASE (GDK_OR);
|
||||
CASE (GDK_EQUIV);
|
||||
CASE (GDK_OR_REVERSE);
|
||||
CASE (GDK_COPY_INVERT);
|
||||
CASE (GDK_OR_INVERT);
|
||||
CASE (GDK_NAND);
|
||||
CASE (GDK_SET);
|
||||
#undef CASE
|
||||
default: return ("illegal GdkFunction value");
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
rect = ((RECT *) rgndata->Buffer) + rgndata->rdh.nCount++;
|
||||
|
||||
gchar *
|
||||
gdk_win32_join_style_to_string (GdkJoinStyle join_style)
|
||||
{
|
||||
switch (join_style)
|
||||
{
|
||||
#define CASE(x) case x: return #x + strlen ("GDK_JOIN_")
|
||||
CASE (GDK_JOIN_MITER);
|
||||
CASE (GDK_JOIN_ROUND);
|
||||
CASE (GDK_JOIN_BEVEL);
|
||||
#undef CASE
|
||||
default: return ("illegal GdkJoinStyle value");
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
rect->left = CLAMP (boxes[i].x1 + x_origin,
|
||||
G_MINSHORT, G_MAXSHORT);
|
||||
rect->right = CLAMP (boxes[i].x2 + x_origin,
|
||||
G_MINSHORT, G_MAXSHORT);
|
||||
rect->top = CLAMP (boxes[i].y1 + y_origin,
|
||||
G_MINSHORT, G_MAXSHORT);
|
||||
rect->bottom = CLAMP (boxes[i].y2 + y_origin,
|
||||
G_MINSHORT, G_MAXSHORT);
|
||||
|
||||
gchar *
|
||||
gdk_win32_line_style_to_string (GdkLineStyle line_style)
|
||||
{
|
||||
switch (line_style)
|
||||
{
|
||||
#define CASE(x) case x: return #x + strlen ("GDK_LINE_")
|
||||
CASE(GDK_LINE_SOLID);
|
||||
CASE(GDK_LINE_ON_OFF_DASH);
|
||||
CASE(GDK_LINE_DOUBLE_DASH);
|
||||
#undef CASE
|
||||
default: return ("illegal GdkLineStyle value");
|
||||
if (rect->left < rgndata->rdh.rcBound.left)
|
||||
rgndata->rdh.rcBound.left = rect->left;
|
||||
if (rect->right > rgndata->rdh.rcBound.right)
|
||||
rgndata->rdh.rcBound.right = rect->right;
|
||||
if (rect->top < rgndata->rdh.rcBound.top)
|
||||
rgndata->rdh.rcBound.top = rect->top;
|
||||
if (rect->bottom > rgndata->rdh.rcBound.bottom)
|
||||
rgndata->rdh.rcBound.bottom = rect->bottom;
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
if ((hrgn = ExtCreateRegion (NULL, nbytes, rgndata)) == NULL)
|
||||
WIN32_API_FAILED ("ExtCreateRegion");
|
||||
|
||||
#endif
|
||||
g_free (rgndata);
|
||||
|
||||
return (hrgn);
|
||||
}
|
||||
|
||||
+199
-87
@@ -39,6 +39,8 @@
|
||||
typedef struct _GdkWindowQueueItem GdkWindowQueueItem;
|
||||
typedef struct _GdkWindowParentPos GdkWindowParentPos;
|
||||
|
||||
#if 0
|
||||
|
||||
typedef enum {
|
||||
GDK_WINDOW_QUEUE_TRANSLATE,
|
||||
GDK_WINDOW_QUEUE_ANTIEXPOSE
|
||||
@@ -60,6 +62,8 @@ struct _GdkWindowQueueItem
|
||||
} u;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
struct _GdkWindowParentPos
|
||||
{
|
||||
gint x;
|
||||
@@ -69,11 +73,12 @@ struct _GdkWindowParentPos
|
||||
GdkRectangle clip_rect;
|
||||
};
|
||||
|
||||
static void gdk_window_compute_position (GdkWindowImplWin32 *window,
|
||||
static void gdk_window_compute_position (GdkWindowImplWin32 *window,
|
||||
GdkWindowParentPos *parent_pos,
|
||||
GdkWin32PositionInfo *info);
|
||||
static void gdk_window_compute_parent_pos (GdkWindowImplWin32 *window,
|
||||
GdkWindowParentPos *parent_pos);
|
||||
static void gdk_window_compute_parent_pos (GdkWindowImplWin32 *window,
|
||||
GdkWindowParentPos *parent_pos);
|
||||
|
||||
static void gdk_window_premove (GdkWindow *window,
|
||||
GdkWindowParentPos *parent_pos);
|
||||
static void gdk_window_postmove (GdkWindow *window,
|
||||
@@ -87,7 +92,9 @@ static void gdk_window_clip_changed (GdkWindow *window,
|
||||
GdkRectangle *old_clip,
|
||||
GdkRectangle *new_clip);
|
||||
|
||||
#if 0
|
||||
static GSList *translate_queue = NULL;
|
||||
#endif
|
||||
|
||||
void
|
||||
_gdk_windowing_window_get_offsets (GdkWindow *window,
|
||||
@@ -121,29 +128,55 @@ gdk_window_copy_area_scroll (GdkWindow *window,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
#if 0
|
||||
GdkWindowObject *obj = GDK_WINDOW_OBJECT (window);
|
||||
GList *tmp_list;
|
||||
#endif
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_copy_area_scroll: %p %s %d,%d\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
gdk_win32_gdkrectangle_to_string (dest_rect),
|
||||
dx, dy));
|
||||
|
||||
if (dest_rect->width > 0 && dest_rect->height > 0)
|
||||
{
|
||||
RECT clipRect;
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
RECT update_rect;
|
||||
#endif
|
||||
|
||||
clipRect.left = dest_rect->x;
|
||||
clipRect.top = dest_rect->y;
|
||||
clipRect.right = clipRect.left + dest_rect->width;
|
||||
clipRect.bottom = clipRect.top + dest_rect->height;
|
||||
|
||||
if (dx < 0)
|
||||
clipRect.right -= dx;
|
||||
else
|
||||
clipRect.left -= dx;
|
||||
if (dy < 0)
|
||||
clipRect.bottom -= dy;
|
||||
else
|
||||
clipRect.top -= dy;
|
||||
|
||||
gdk_window_queue_translation (window, dx, dy);
|
||||
|
||||
if (!ScrollWindowEx (GDK_WINDOW_HWND (window),
|
||||
dx, dy, /* in: scroll offsets */
|
||||
NULL, /* in: scroll rect, NULL == entire client area */
|
||||
&clipRect, /* in: restrict to */
|
||||
NULL, /* out: update region */
|
||||
NULL, /* in: update region */
|
||||
NULL, /* out: update rect */
|
||||
SW_INVALIDATE))
|
||||
SW_INVALIDATE | SW_SCROLLCHILDREN))
|
||||
WIN32_API_FAILED ("ScrollWindowEx");
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
(GetUpdateRect (GDK_WINDOW_HWND (window), &update_rect, FALSE),
|
||||
g_print ("gdk_window_copy_area_scroll: post-scroll update rect: %s\n",
|
||||
gdk_win32_rect_to_string (&update_rect))));
|
||||
}
|
||||
|
||||
#if 0
|
||||
tmp_list = obj->children;
|
||||
while (tmp_list)
|
||||
{
|
||||
@@ -154,6 +187,7 @@ gdk_window_copy_area_scroll (GdkWindow *window,
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -202,6 +236,8 @@ compute_intermediate_position (GdkWin32PositionInfo *position_info,
|
||||
new_position->height = new_y1 - new_y0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
static void
|
||||
gdk_window_guffaw_scroll (GdkWindow *window,
|
||||
gint dx,
|
||||
@@ -217,6 +253,9 @@ gdk_window_guffaw_scroll (GdkWindow *window,
|
||||
GdkWindowParentPos parent_pos;
|
||||
GList *tmp_list;
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("gdk_window_guffaw_scroll: %p %d,%d\n",
|
||||
GDK_WINDOW_HWND (window), dx, dy));
|
||||
|
||||
gdk_window_compute_parent_pos (impl, &parent_pos);
|
||||
gdk_window_compute_position (impl, &parent_pos, &new_info);
|
||||
|
||||
@@ -241,7 +280,7 @@ gdk_window_guffaw_scroll (GdkWindow *window,
|
||||
*/
|
||||
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
||||
new_position.x, new_position.y,
|
||||
new_position.width, new_position.height,
|
||||
new_position.width, new_position.height,
|
||||
SWP_NOACTIVATE | SWP_NOZORDER))
|
||||
WIN32_API_FAILED ("SetWindowPos");
|
||||
|
||||
@@ -282,27 +321,16 @@ gdk_window_guffaw_scroll (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_scroll:
|
||||
* @window: a #GdkWindow
|
||||
* @dx: Amount to scroll in the X direction
|
||||
* @dy: Amount to scroll in the Y direction
|
||||
*
|
||||
* Scroll the contents of @window, both pixels and children, by the given
|
||||
* amount. @window itself does not move. Portions of the window that the scroll
|
||||
* operation brings in from offscreen areas are invalidated. The invalidated
|
||||
* region may be bigger than what would strictly be necessary. (For Win32, a
|
||||
* minimum area will be invalidated if the window has no subwindows, or if the
|
||||
* edges of the window's parent do not extend beyond the edges of the window. In
|
||||
* other cases, a multi-step process is used to scroll the window which may
|
||||
* produce temporary visual artifacts and unnecessary invalidations.)
|
||||
**/
|
||||
#endif
|
||||
|
||||
void
|
||||
gdk_window_scroll (GdkWindow *window,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
#if 0
|
||||
gboolean can_guffaw_scroll = FALSE;
|
||||
#endif
|
||||
GdkRegion *invalidate_region;
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkWindowObject *obj;
|
||||
@@ -313,6 +341,9 @@ gdk_window_scroll (GdkWindow *window,
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("gdk_window_scroll: %p %d,%d\n",
|
||||
GDK_WINDOW_HWND (window), dx, dy));
|
||||
|
||||
obj = GDK_WINDOW_OBJECT (window);
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
|
||||
|
||||
@@ -341,7 +372,7 @@ gdk_window_scroll (GdkWindow *window,
|
||||
|
||||
gdk_window_invalidate_region (window, invalidate_region, TRUE);
|
||||
gdk_region_destroy (invalidate_region);
|
||||
|
||||
#if 0
|
||||
/* We can guffaw scroll if we are a child window, and the parent
|
||||
* does not extend beyond our edges. Otherwise, we use XCopyArea, then
|
||||
* move any children later
|
||||
@@ -352,11 +383,13 @@ gdk_window_scroll (GdkWindow *window,
|
||||
can_guffaw_scroll = ((dx == 0 || (obj->x <= 0 && obj->x + impl->width >= parent_impl->width)) &&
|
||||
(dy == 0 || (obj->y <= 0 && obj->y + impl->height >= parent_impl->height)));
|
||||
}
|
||||
|
||||
if (!obj->children || !can_guffaw_scroll)
|
||||
gdk_window_copy_area_scroll (window, &dest_rect, dx, dy);
|
||||
else
|
||||
gdk_window_guffaw_scroll (window, dx, dy);
|
||||
#else
|
||||
gdk_window_copy_area_scroll (window, &dest_rect, dx, dy);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -371,6 +404,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
GdkWin32PositionInfo new_info;
|
||||
GdkWindowParentPos parent_pos;
|
||||
GList *tmp_list;
|
||||
|
||||
gint d_xoffset, d_yoffset;
|
||||
gint dx, dy;
|
||||
gboolean is_move;
|
||||
@@ -379,9 +413,14 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
||||
obj = GDK_WINDOW_OBJECT (window);
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@+%d+%d %dx%d@+%d+%d\n",
|
||||
gdk_win32_drawable_description (window),
|
||||
obj->x, obj->y,
|
||||
width, height, x, y));
|
||||
|
||||
dx = x - obj->x;
|
||||
dy = y - obj->y;
|
||||
|
||||
@@ -389,8 +428,13 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
is_resize = impl->width != width || impl->height != height;
|
||||
|
||||
if (!is_move && !is_resize)
|
||||
return;
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("...neither move or resize\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
GDK_NOTE (MISC, g_print ("...%s%s\n", is_move ? "is_move " : "", is_resize ? "is_resize" : ""));
|
||||
|
||||
obj->x = x;
|
||||
obj->y = y;
|
||||
impl->width = width;
|
||||
@@ -414,6 +458,8 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
{
|
||||
GdkRectangle new_position;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("...d_xoffset=%d d_yoffset=%d\n", d_xoffset, d_yoffset));
|
||||
|
||||
gdk_window_set_static_gravities (window, TRUE);
|
||||
|
||||
if (d_xoffset < 0 || d_yoffset < 0)
|
||||
@@ -422,6 +468,9 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
compute_intermediate_position (&impl->position_info, &new_info, d_xoffset, d_yoffset,
|
||||
&new_position);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("...SetWindowPos(%p,%s)\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
gdk_win32_gdkrectangle_to_string (&new_position)));
|
||||
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
||||
new_position.x, new_position.y,
|
||||
new_position.width, new_position.height,
|
||||
@@ -435,6 +484,9 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
GDK_NOTE (MISC, g_print ("...SetWindowPos(%p,0x0@+%d+%d)\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
new_position.x + dx, new_position.y + dy));
|
||||
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
||||
new_position.x + dx, new_position.y + dy, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOREDRAW))
|
||||
@@ -443,6 +495,10 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
if (d_xoffset > 0 || d_yoffset > 0)
|
||||
gdk_window_queue_translation (window, MAX (d_xoffset, 0), MAX (d_yoffset, 0));
|
||||
|
||||
GDK_NOTE (MISC, g_print ("...SetWindowPos(%p,%dx%d@+%d+%d)\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
new_info.width, new_info.height,
|
||||
new_info.x, new_info.y));
|
||||
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
||||
new_info.x, new_info.y,
|
||||
new_info.width, new_info.height,
|
||||
@@ -453,7 +509,11 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
gdk_window_tmp_reset_bg (window);
|
||||
|
||||
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("...ShowWindow(%p, SW_SHOWNA)\n",
|
||||
GDK_WINDOW_HWND (window)));
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
|
||||
}
|
||||
|
||||
impl->position_info = new_info;
|
||||
|
||||
@@ -470,7 +530,11 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
gdk_window_set_static_gravities (window, FALSE);
|
||||
|
||||
if (impl->position_info.mapped && !new_info.mapped)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("...ShowWindow(%p, SW_HIDE)\n",
|
||||
GDK_WINDOW_HWND (window)));
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
|
||||
}
|
||||
|
||||
tmp_list = obj->children;
|
||||
while (tmp_list)
|
||||
@@ -479,10 +543,15 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
GDK_NOTE (MISC, g_print ("...SetWindowPos(%p,%dx%d@+%d+%d)\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
new_info.width, new_info.height,
|
||||
new_info.x, new_info.y));
|
||||
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
||||
new_info.x, new_info.y,
|
||||
new_info.width, new_info.height,
|
||||
SWP_NOACTIVATE | SWP_NOZORDER |
|
||||
(is_move ? 0 : SWP_NOMOVE) |
|
||||
(is_resize ? 0 : SWP_NOSIZE)))
|
||||
WIN32_API_FAILED ("SetWindowPos");
|
||||
|
||||
@@ -497,7 +566,11 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
||||
gdk_window_tmp_reset_bg (window);
|
||||
|
||||
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("...ShowWindow(%p, SW_SHOWNA)\n",
|
||||
GDK_WINDOW_HWND (window)));
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
|
||||
}
|
||||
|
||||
impl->position_info = new_info;
|
||||
}
|
||||
@@ -530,9 +603,9 @@ gdk_window_compute_position (GdkWindowImplWin32 *window,
|
||||
if (parent_pos->x + wrapper->x < -(SIZE_LIMIT/2))
|
||||
{
|
||||
if (parent_pos->x + wrapper->x + window->width < (SIZE_LIMIT/2))
|
||||
info->x = parent_pos->x + wrapper->x + window->width - SIZE_LIMIT - parent_pos->win32_x;
|
||||
info->x = parent_pos->x + wrapper->x + window->width - info->width - parent_pos->win32_x;
|
||||
else
|
||||
info->x = -(SIZE_LIMIT/2) - parent_pos->win32_y;
|
||||
info->x = -(SIZE_LIMIT/2) - parent_pos->win32_x;
|
||||
}
|
||||
else
|
||||
info->x = parent_pos->x + wrapper->x - parent_pos->win32_x;
|
||||
@@ -550,7 +623,7 @@ gdk_window_compute_position (GdkWindowImplWin32 *window,
|
||||
if (parent_pos->y + wrapper->y < -(SIZE_LIMIT/2))
|
||||
{
|
||||
if (parent_pos->y + wrapper->y + window->height < (SIZE_LIMIT/2))
|
||||
info->y = parent_pos->y + wrapper->y + window->height - SIZE_LIMIT - parent_pos->win32_y;
|
||||
info->y = parent_pos->y + wrapper->y + window->height - info->height - parent_pos->win32_y;
|
||||
else
|
||||
info->y = -(SIZE_LIMIT/2) - parent_pos->win32_y;
|
||||
}
|
||||
@@ -614,7 +687,8 @@ gdk_window_compute_parent_pos (GdkWindowImplWin32 *window,
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (window));
|
||||
|
||||
wrapper = GDK_WINDOW_OBJECT (GDK_DRAWABLE_IMPL_WIN32 (window)->wrapper);
|
||||
wrapper =
|
||||
GDK_WINDOW_OBJECT (GDK_DRAWABLE_IMPL_WIN32 (window)->wrapper);
|
||||
|
||||
parent_pos->x = 0;
|
||||
parent_pos->y = 0;
|
||||
@@ -701,6 +775,12 @@ gdk_window_premove (GdkWindow *window,
|
||||
compute_intermediate_position (&impl->position_info, &new_info, d_xoffset, d_yoffset,
|
||||
&new_position);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_premove: %s@+%d+%d\n"
|
||||
"...SetWindowPos(%s)\n",
|
||||
gdk_win32_drawable_description (window),
|
||||
obj->x, obj->y,
|
||||
gdk_win32_gdkrectangle_to_string (&new_position)));
|
||||
|
||||
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
||||
new_position.x, new_position.y,
|
||||
new_position.width, new_position.height,
|
||||
@@ -746,6 +826,13 @@ gdk_window_postmove (GdkWindow *window,
|
||||
if (d_xoffset > 0 || d_yoffset > 0)
|
||||
gdk_window_queue_translation (window, MAX (d_xoffset, 0), MAX (d_yoffset, 0));
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_postmove: %s@+%d+%d\n"
|
||||
"...SetWindowPos(%dx%d@+%d+%d)\n",
|
||||
gdk_win32_drawable_description (window),
|
||||
obj->x, obj->y,
|
||||
new_info.width, new_info.height,
|
||||
new_info.x, new_info.y));
|
||||
|
||||
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
||||
new_info.x, new_info.y,
|
||||
new_info.width, new_info.height,
|
||||
@@ -769,87 +856,88 @@ gdk_window_postmove (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
static void
|
||||
gdk_window_queue_append (GdkWindow *window,
|
||||
GdkWindowQueueItem *item)
|
||||
{
|
||||
if (g_slist_length (translate_queue) >= 128)
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("gdk_window_queue_append: length >= 128\n"));
|
||||
_gdk_window_process_expose (window, _gdk_win32_get_next_tick (0),
|
||||
&impl->position_info.clip_rect);
|
||||
}
|
||||
|
||||
item->window = window;
|
||||
item->serial = GetTickCount ();
|
||||
|
||||
GDK_NOTE (EVENTS, (g_print ("gdk_window_queue_append: %s %p %ld ",
|
||||
(item->type == GDK_WINDOW_QUEUE_TRANSLATE ?
|
||||
"TRANSLATE" : "ANTIEXPOSE"),
|
||||
GDK_WINDOW_HWND (window),
|
||||
item->serial),
|
||||
(item->type == GDK_WINDOW_QUEUE_TRANSLATE ?
|
||||
g_print ("%d,%d\n",
|
||||
item->u.translate.dx, item->u.translate.dy) :
|
||||
g_print ("%s\n",
|
||||
gdk_win32_gdkregion_to_string (item->u.antiexpose.area)))));
|
||||
|
||||
gdk_drawable_ref (window);
|
||||
translate_queue = g_slist_append (translate_queue, item) ;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
gdk_window_queue_translation (GdkWindow *window,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
#if 0
|
||||
GdkWindowQueueItem *item = g_new (GdkWindowQueueItem, 1);
|
||||
item->window = window;
|
||||
item->serial = GetMessageTime ();
|
||||
item->type = GDK_WINDOW_QUEUE_TRANSLATE;
|
||||
item->u.translate.dx = dx;
|
||||
item->u.translate.dy = dy;
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("gdk_window_queue_translation %#x %ld %d,%d\n",
|
||||
(guint) GDK_WINDOW_HWND (window),
|
||||
item->serial,
|
||||
dx, dy));
|
||||
|
||||
gdk_drawable_ref (window);
|
||||
translate_queue = g_slist_append (translate_queue, item);
|
||||
gdk_window_queue_append (window, item);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_windowing_window_queue_antiexpose (GdkWindow *window,
|
||||
GdkRegion *area)
|
||||
{
|
||||
#if 1
|
||||
GdkWindowQueueItem *item = g_new (GdkWindowQueueItem, 1);
|
||||
HRGN hrgn = _gdk_win32_gdkregion_to_hrgn (area, 0, 0);
|
||||
|
||||
item->window = window;
|
||||
item->serial = GetMessageTime ();
|
||||
item->type = GDK_WINDOW_QUEUE_ANTIEXPOSE;
|
||||
item->u.antiexpose.area = area;
|
||||
GDK_NOTE (EVENTS, g_print ("_gdk_windowing_window_queue_antiexpose: ValidateRgn %p %s\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
gdk_win32_gdkregion_to_string (area)));
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("_gdk_windowing_window_queue_antiexpose %#x %ld %dx%d@+%d+%d\n",
|
||||
(guint) GDK_WINDOW_HWND (window),
|
||||
item->serial,
|
||||
area->extents.x2 - area->extents.x1,
|
||||
area->extents.y2 - area->extents.y1,
|
||||
area->extents.x1, area->extents.y1));
|
||||
ValidateRgn (GDK_WINDOW_HWND (window), hrgn);
|
||||
|
||||
gdk_drawable_ref (window);
|
||||
translate_queue = g_slist_append (translate_queue, item);
|
||||
DeleteObject (hrgn);
|
||||
|
||||
return TRUE;
|
||||
#else
|
||||
GdkRectangle r;
|
||||
HRGN hrgn;
|
||||
|
||||
gdk_region_get_clipbox (area, &r);
|
||||
hrgn = CreateRectRgn(r.x, r.y, r.width+1, r.height+1);
|
||||
|
||||
g_return_val_if_fail (area != NULL, FALSE);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("_gdk_windowing_window_queue_antiexpose %#x\n",
|
||||
(guint) GDK_WINDOW_HWND (window)));
|
||||
|
||||
/* HB: not quite sure if this is the right thing to do.
|
||||
* (Region not to be proceesed by next WM_PAINT)
|
||||
*/
|
||||
ValidateRgn(GDK_WINDOW_HWND (window), hrgn);
|
||||
DeleteObject(hrgn);
|
||||
return TRUE;
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_window_process_expose (GdkWindow *window,
|
||||
gulong serial,
|
||||
GdkRectangle *area)
|
||||
GdkRegion *invalidate_region)
|
||||
{
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkRegion *invalidate_region = gdk_region_rectangle (area);
|
||||
GdkRegion *clip_region;
|
||||
#if 0
|
||||
GSList *tmp_list = translate_queue;
|
||||
|
||||
#endif
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("_gdk_window_process_expose %#x %ld %dx%d@+%d+%d\n",
|
||||
(guint) GDK_WINDOW_HWND (window), serial,
|
||||
area->width, area->height, area->x, area->y));
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("_gdk_window_process_expose: %p %s\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
gdk_win32_gdkregion_to_string (invalidate_region)));
|
||||
#if 0
|
||||
while (tmp_list)
|
||||
{
|
||||
GdkWindowQueueItem *item = tmp_list->data;
|
||||
@@ -860,15 +948,33 @@ _gdk_window_process_expose (GdkWindow *window,
|
||||
if (item->window == window)
|
||||
{
|
||||
if (item->type == GDK_WINDOW_QUEUE_TRANSLATE)
|
||||
gdk_region_offset (invalidate_region, - item->u.translate.dx, - item->u.translate.dy);
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print ("...item %ld xlating region by %d,%d\n",
|
||||
item->serial,
|
||||
item->u.translate.dx, item->u.translate.dy));
|
||||
gdk_region_offset (invalidate_region, - item->u.translate.dx, - item->u.translate.dy);
|
||||
}
|
||||
else /* anti-expose */
|
||||
gdk_region_subtract (invalidate_region, item->u.antiexpose.area);
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
GdkRectangle rect;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
(gdk_region_get_clipbox (item->u.antiexpose.area, &rect),
|
||||
g_print ("...item %ld antiexposing %s\n",
|
||||
item->serial,
|
||||
gdk_win32_gdkrectangle_to_string (&rect))));
|
||||
#endif
|
||||
gdk_region_subtract (invalidate_region, item->u.antiexpose.area);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GSList *tmp_link = translate_queue;
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("...item %ld being removed\n", item->serial));
|
||||
|
||||
translate_queue = g_slist_remove_link (translate_queue, translate_queue);
|
||||
gdk_drawable_unref (item->window);
|
||||
|
||||
@@ -880,13 +986,14 @@ _gdk_window_process_expose (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("...queue length now %d\n", g_slist_length (translate_queue)));
|
||||
#endif
|
||||
clip_region = gdk_region_rectangle (&impl->position_info.clip_rect);
|
||||
gdk_region_intersect (invalidate_region, clip_region);
|
||||
|
||||
if (!gdk_region_empty (invalidate_region))
|
||||
gdk_window_invalidate_region (window, invalidate_region, FALSE);
|
||||
|
||||
gdk_region_destroy (invalidate_region);
|
||||
gdk_region_destroy (clip_region);
|
||||
}
|
||||
|
||||
@@ -934,7 +1041,9 @@ gdk_window_tmp_reset_bg (GdkWindow *window)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_clip_changed (GdkWindow *window, GdkRectangle *old_clip, GdkRectangle *new_clip)
|
||||
gdk_window_clip_changed (GdkWindow *window,
|
||||
GdkRectangle *old_clip,
|
||||
GdkRectangle *new_clip)
|
||||
{
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkWindowObject *obj;
|
||||
@@ -966,6 +1075,9 @@ gdk_window_clip_changed (GdkWindow *window, GdkRectangle *old_clip, GdkRectangle
|
||||
if (!gdk_region_empty (new_clip_region))
|
||||
{
|
||||
gdk_window_tmp_unset_bg (window);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("gdk_window_clip_changed: invalidating region: %s\n",
|
||||
gdk_win32_gdkregion_to_string (new_clip_region)));
|
||||
gdk_window_invalidate_region (window, new_clip_region, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,5 +52,4 @@ GdkAtom _gdk_selection_property;
|
||||
DWORD windows_version;
|
||||
|
||||
gint gdk_input_ignore_wintab = FALSE;
|
||||
gint gdk_event_func_from_window_proc = FALSE;
|
||||
gint gdk_max_colors = 0;
|
||||
|
||||
@@ -142,7 +142,7 @@ _gdk_win32_setup_pixmap_image (GdkPixmap *pixmap,
|
||||
image->bpp = 4;
|
||||
break;
|
||||
default:
|
||||
g_warning ("_gdk_win32_setup_pixmap_image: depth=%d", image->depth);
|
||||
g_warning ("_gdk_win32_setup_pixmap_image: depth=%d", depth);
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
if (depth == 1)
|
||||
@@ -154,6 +154,9 @@ _gdk_win32_setup_pixmap_image (GdkPixmap *pixmap,
|
||||
image->bits_per_pixel = image->depth;
|
||||
image->mem = bits;
|
||||
|
||||
GDK_NOTE (IMAGE, g_print ("_gdk_win32_setup_pixmap_image: %dx%dx%d (bpl:%d) = %p\n",
|
||||
width, height, depth, image->bpl, image));
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
@@ -369,6 +372,9 @@ gdk_win32_image_destroy (GdkImage *image)
|
||||
|
||||
pixmap = image->windowing_data;
|
||||
|
||||
GDK_NOTE (IMAGE, g_print ("gdk_win32_image_destroy: %p pixmap=%p\n",
|
||||
image, pixmap));
|
||||
|
||||
if (pixmap == NULL) /* This means that _gdk_image_exit()
|
||||
* destroyed the image already, and
|
||||
* now we're called a second time from
|
||||
@@ -376,9 +382,6 @@ gdk_win32_image_destroy (GdkImage *image)
|
||||
*/
|
||||
return;
|
||||
|
||||
GDK_NOTE (IMAGE, g_print ("gdk_win32_image_destroy: %p\n",
|
||||
GDK_PIXMAP_HBITMAP (pixmap)));
|
||||
|
||||
gdk_pixmap_unref (pixmap);
|
||||
image->windowing_data = NULL;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ gdk_input_wintab_init (void)
|
||||
wa.window_type = GDK_WINDOW_TOPLEVEL;
|
||||
if ((wintab_window = gdk_window_new (NULL, &wa, GDK_WA_X|GDK_WA_Y)) == NULL)
|
||||
{
|
||||
g_warning ("_gdk_input_init: gdk_window_new failed");
|
||||
g_warning ("gdk_input_wintab_init: gdk_window_new failed");
|
||||
return;
|
||||
}
|
||||
gdk_drawable_ref (wintab_window);
|
||||
@@ -330,7 +330,7 @@ gdk_input_wintab_init (void)
|
||||
hctx = g_new (HCTX, 1);
|
||||
if ((*hctx = WTOpen (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL)
|
||||
{
|
||||
g_warning ("_gdk_input_init: WTOpen failed");
|
||||
g_warning ("gdk_input_wintab_init: WTOpen failed");
|
||||
return;
|
||||
}
|
||||
GDK_NOTE (INPUT, g_print ("opened Wintab device %d %p\n",
|
||||
@@ -566,8 +566,8 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
|
||||
|
||||
if (gdkdev->info.mode == GDK_MODE_SCREEN)
|
||||
{
|
||||
x_scale = gdk_screen_width() / device_width;
|
||||
y_scale = gdk_screen_height() / device_height;
|
||||
x_scale = GetSystemMetrics (SM_CXSCREEN) / device_width;
|
||||
y_scale = GetSystemMetrics (SM_CYSCREEN) / device_height;
|
||||
|
||||
x_offset = - input_window->root_x;
|
||||
y_offset = - input_window->root_y;
|
||||
@@ -846,7 +846,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
if (event->any.type == GDK_BUTTON_PRESS
|
||||
|| event->any.type == GDK_BUTTON_RELEASE)
|
||||
{
|
||||
event->button.time = msg->time;
|
||||
event->button.time = _gdk_win32_get_next_tick (msg->time);
|
||||
event->button.device = &gdkdev->info;
|
||||
|
||||
#if 0
|
||||
@@ -875,7 +875,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
event->motion.time = msg->time;
|
||||
event->motion.time = _gdk_win32_get_next_tick (msg->time);
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.device = &gdkdev->info;
|
||||
|
||||
@@ -944,7 +944,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event->proximity.type = GDK_PROXIMITY_IN;
|
||||
_gdk_input_ignore_core = TRUE;
|
||||
}
|
||||
event->proximity.time = msg->time;
|
||||
event->proximity.time = _gdk_win32_get_next_tick (msg->time);
|
||||
event->proximity.device = &gdkdev->info;
|
||||
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
|
||||
+25
-22
@@ -44,6 +44,30 @@ static GdkKeymap *default_keymap = NULL;
|
||||
|
||||
static guint *keysym_tab = NULL;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static void
|
||||
print_keysym_tab (void)
|
||||
{
|
||||
gint vk;
|
||||
|
||||
g_print ("keymap:\n");
|
||||
for (vk = 0; vk < 256; vk++)
|
||||
{
|
||||
gint state;
|
||||
|
||||
g_print ("%#.02x: ", vk);
|
||||
for (state = 0; state < 4; state++)
|
||||
{
|
||||
gchar *name = gdk_keyval_name (keysym_tab[vk*4 + state]);
|
||||
if (name == NULL)
|
||||
name = "(none)";
|
||||
g_print ("%s ", name);
|
||||
}
|
||||
g_print ("\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
update_keymap (void)
|
||||
{
|
||||
@@ -262,28 +286,7 @@ update_keymap (void)
|
||||
key_state[vk] = 0;
|
||||
}
|
||||
}
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (_gdk_debug_flags & GDK_DEBUG_EVENTS)
|
||||
{
|
||||
gint vk;
|
||||
|
||||
g_print ("keymap:\n");
|
||||
for (vk = 0; vk < 256; vk++)
|
||||
{
|
||||
gint state;
|
||||
|
||||
g_print ("%#.02x: ", vk);
|
||||
for (state = 0; state < 4; state++)
|
||||
{
|
||||
gchar *name = gdk_keyval_name (keysym_tab[vk*4 + state]);
|
||||
if (name == NULL)
|
||||
name = "(none)";
|
||||
g_print ("%s ", name);
|
||||
}
|
||||
g_print ("\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
GDK_NOTE (EVENTS, print_keysym_tab ());
|
||||
}
|
||||
|
||||
GdkKeymap*
|
||||
|
||||
+700
-15
@@ -34,6 +34,7 @@
|
||||
#include <io.h>
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkregion-generic.h"
|
||||
#include "gdkkeysyms.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
@@ -41,6 +42,14 @@
|
||||
|
||||
#include <objbase.h>
|
||||
|
||||
#if defined (__GNUC__) && defined (HAVE_DIMM_H)
|
||||
/* The w32api imm.h clashes a bit with the IE5.5 dimm.h */
|
||||
# define IMEMENUITEMINFOA hidden_IMEMENUITEMINFOA
|
||||
# define IMEMENUITEMINFOW hidden_IMEMENUITEMINFOW
|
||||
#endif
|
||||
|
||||
#include <imm.h>
|
||||
|
||||
static gboolean gdk_synchronize = FALSE;
|
||||
|
||||
GdkArgDesc _gdk_windowing_args[] = {
|
||||
@@ -49,17 +58,14 @@ GdkArgDesc _gdk_windowing_args[] = {
|
||||
(GdkArgFunc) NULL},
|
||||
{ "ignore-wintab", GDK_ARG_BOOL, &gdk_input_ignore_wintab,
|
||||
(GdkArgFunc) NULL},
|
||||
{ "event-func-from-window-proc",
|
||||
GDK_ARG_BOOL, &gdk_event_func_from_window_proc,
|
||||
(GdkArgFunc) NULL},
|
||||
{ "max-colors", GDK_ARG_INT, &gdk_max_colors, (GdkArgFunc) NULL},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
int __stdcall
|
||||
DllMain(HINSTANCE hinstDLL,
|
||||
DWORD dwReason,
|
||||
LPVOID reserved)
|
||||
DllMain (HINSTANCE hinstDLL,
|
||||
DWORD dwReason,
|
||||
LPVOID reserved)
|
||||
{
|
||||
gdk_dll_hinstance = hinstDLL;
|
||||
|
||||
@@ -76,8 +82,6 @@ _gdk_windowing_init_check (int argc,
|
||||
if (getenv ("GDK_IGNORE_WINTAB") != NULL)
|
||||
gdk_input_ignore_wintab = TRUE;
|
||||
#endif
|
||||
if (getenv ("GDK_EVENT_FUNC_FROM_WINDOW_PROC") != NULL)
|
||||
gdk_event_func_from_window_proc = TRUE;
|
||||
|
||||
if (gdk_synchronize)
|
||||
GdiSetBatchLimit (1);
|
||||
@@ -87,14 +91,19 @@ _gdk_windowing_init_check (int argc,
|
||||
gdk_root_window = GetDesktopWindow ();
|
||||
windows_version = GetVersion ();
|
||||
|
||||
if (getenv ("PRETEND_WIN9X"))
|
||||
windows_version = 0x80000004;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("Windows version: %08x\n", windows_version));
|
||||
|
||||
_gdk_input_locale = GetKeyboardLayout (0);
|
||||
GetLocaleInfo (MAKELCID (LOWORD (_gdk_input_locale), SORT_DEFAULT),
|
||||
LOCALE_IDEFAULTANSICODEPAGE,
|
||||
buf, sizeof (buf));
|
||||
_gdk_input_codepage = atoi (buf);
|
||||
GDK_NOTE (MISC, g_print ("input_locale: %#lx, codepage:%d\n",
|
||||
_gdk_input_locale, _gdk_input_codepage));
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("input_locale:%p, codepage:%d\n",
|
||||
_gdk_input_locale, _gdk_input_codepage));
|
||||
|
||||
CoInitialize (NULL);
|
||||
|
||||
cf_rtf = RegisterClipboardFormat ("Rich Text Format");
|
||||
@@ -219,7 +228,7 @@ gdk_screen_height (void)
|
||||
gint
|
||||
gdk_screen_width_mm (void)
|
||||
{
|
||||
return GetDeviceCaps (gdk_display_hdc, HORZSIZE);
|
||||
return (double) GetDeviceCaps (gdk_display_hdc, HORZRES) / GetDeviceCaps (gdk_display_hdc, LOGPIXELSX) * 25.4;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -240,19 +249,19 @@ gdk_screen_width_mm (void)
|
||||
gint
|
||||
gdk_screen_height_mm (void)
|
||||
{
|
||||
return GetDeviceCaps (gdk_display_hdc, VERTSIZE);
|
||||
return (double) GetDeviceCaps (gdk_display_hdc, VERTRES) / GetDeviceCaps (gdk_display_hdc, LOGPIXELSY) * 25.4;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_set_sm_client_id (const gchar* sm_client_id)
|
||||
{
|
||||
g_warning("gdk_set_sm_client_id %s", sm_client_id ? sm_client_id : "NULL");
|
||||
g_warning ("gdk_set_sm_client_id %s", sm_client_id ? sm_client_id : "NULL");
|
||||
}
|
||||
|
||||
void
|
||||
gdk_beep (void)
|
||||
{
|
||||
Beep(1000, 50);
|
||||
Beep (1000, 50);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -280,3 +289,679 @@ gdk_error_trap_pop (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
/*
|
||||
* Like g_strdup_printf, but to a static buffer. Return value does not
|
||||
* have to be g_free()d. The buffer is of bounded size and reused
|
||||
* cyclically. Thus the return value is valid only until that part of
|
||||
* the buffer happens to get reused. This doesn't matter as this
|
||||
* function's return value is used in debugging output right after the call,
|
||||
* and the return value isn't used after that.
|
||||
*/
|
||||
static gchar *
|
||||
static_printf (const gchar *format,
|
||||
...)
|
||||
{
|
||||
static gchar buf[10000];
|
||||
gchar *msg;
|
||||
static gchar *bufp = buf;
|
||||
gchar *retval;
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
msg = g_strdup_vprintf (format, args);
|
||||
va_end (args);
|
||||
|
||||
g_assert (strlen (msg) < sizeof (buf));
|
||||
|
||||
if (bufp + strlen (msg) + 1 > buf + sizeof (buf))
|
||||
bufp = buf;
|
||||
retval = bufp;
|
||||
|
||||
strcpy (bufp, msg);
|
||||
bufp += strlen (msg) + 1;
|
||||
g_free (msg);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_color_to_string (const GdkColor *color)
|
||||
{
|
||||
return static_printf ("(%.04x,%.04x,%.04x):%.06x",
|
||||
color->red, color->green,
|
||||
color->blue, color->pixel);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
|
||||
const int nentries)
|
||||
{
|
||||
char buf[20];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nentries; i++)
|
||||
g_print (" %3d %02x: %02x %02x %02x%s\n",
|
||||
i, i,
|
||||
pep[i].peRed, pep[i].peGreen, pep[i].peBlue,
|
||||
(pep[i].peFlags == 0 ? "" :
|
||||
(pep[i].peFlags == PC_EXPLICIT ? " PC_EXPLICIT" :
|
||||
(pep[i].peFlags == PC_NOCOLLAPSE ? " PC_NOCOLLAPSE" :
|
||||
(pep[i].peFlags == PC_RESERVED ? " PC_RESERVED" :
|
||||
(sprintf (buf, " %d", pep[i].peFlags), buf))))));
|
||||
}
|
||||
|
||||
void
|
||||
gdk_win32_print_system_palette (void)
|
||||
{
|
||||
PALETTEENTRY *pe;
|
||||
int k;
|
||||
|
||||
k = GetSystemPaletteEntries (gdk_display_hdc, 0, 0, NULL);
|
||||
pe = g_new (PALETTEENTRY, k);
|
||||
k = GetSystemPaletteEntries (gdk_display_hdc, 0, k, pe);
|
||||
|
||||
if (!k)
|
||||
g_print ("GetSystemPaletteEntries failed: %s\n",
|
||||
g_win32_error_message (GetLastError ()));
|
||||
else
|
||||
{
|
||||
g_print ("System palette: %d entries\n", k);
|
||||
gdk_win32_print_paletteentries (pe, k);
|
||||
}
|
||||
g_free (pe);
|
||||
}
|
||||
|
||||
static gint
|
||||
palette_size (HPALETTE hpal)
|
||||
{
|
||||
WORD npal = 0;
|
||||
|
||||
if (!GetObject (hpal, sizeof (npal), &npal))
|
||||
WIN32_GDI_FAILED ("GetObject (HPALETTE)");
|
||||
|
||||
return npal;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_win32_print_hpalette (HPALETTE hpal)
|
||||
{
|
||||
PALETTEENTRY *pe;
|
||||
gint n, npal;
|
||||
|
||||
npal = palette_size (hpal);
|
||||
pe = g_new (PALETTEENTRY, npal);
|
||||
n = GetPaletteEntries (hpal, 0, npal, pe);
|
||||
|
||||
if (!n)
|
||||
g_print ("HPALETTE %p: GetPaletteEntries failed: %s\n",
|
||||
hpal, g_win32_error_message (GetLastError ()));
|
||||
else
|
||||
{
|
||||
g_print ("HPALETTE %p: %d (%d) entries\n", hpal, n, npal);
|
||||
gdk_win32_print_paletteentries (pe, n);
|
||||
}
|
||||
g_free (pe);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_win32_print_dc (HDC hdc)
|
||||
{
|
||||
HGDIOBJ obj;
|
||||
LOGBRUSH logbrush;
|
||||
EXTLOGPEN extlogpen;
|
||||
HRGN hrgn;
|
||||
RECT rect;
|
||||
int flag;
|
||||
|
||||
g_print ("%p\n", hdc);
|
||||
obj = GetCurrentObject (hdc, OBJ_BRUSH);
|
||||
GetObject (obj, sizeof (LOGBRUSH), &logbrush);
|
||||
g_print ("brush: %s color=%06lx hatch=%p\n",
|
||||
gdk_win32_lbstyle_to_string (logbrush.lbStyle),
|
||||
logbrush.lbColor, (gpointer) logbrush.lbHatch);
|
||||
obj = GetCurrentObject (hdc, OBJ_PEN);
|
||||
GetObject (obj, sizeof (EXTLOGPEN), &extlogpen);
|
||||
g_print ("pen: %s %s %s %s w=%d %s\n",
|
||||
gdk_win32_pstype_to_string (extlogpen.elpPenStyle),
|
||||
gdk_win32_psstyle_to_string (extlogpen.elpPenStyle),
|
||||
gdk_win32_psendcap_to_string (extlogpen.elpPenStyle),
|
||||
gdk_win32_psjoin_to_string (extlogpen.elpPenStyle),
|
||||
extlogpen.elpWidth,
|
||||
gdk_win32_lbstyle_to_string (extlogpen.elpBrushStyle));
|
||||
g_print ("rop2: %s textcolor=%06lx\n",
|
||||
gdk_win32_rop2_to_string (GetROP2 (hdc)),
|
||||
GetTextColor (hdc));
|
||||
hrgn = CreateRectRgn (0, 0, 0, 0);
|
||||
if ((flag = GetClipRgn (hdc, hrgn)) == -1)
|
||||
WIN32_API_FAILED ("GetClipRgn");
|
||||
else if (flag == 0)
|
||||
g_print ("no clip region\n");
|
||||
else if (flag == 1)
|
||||
{
|
||||
GetRgnBox (hrgn, &rect);
|
||||
g_print ("clip region: %p bbox: %s\n",
|
||||
hrgn, gdk_win32_rect_to_string (&rect));
|
||||
}
|
||||
DeleteObject (hrgn);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_cap_style_to_string (GdkCapStyle cap_style)
|
||||
{
|
||||
switch (cap_style)
|
||||
{
|
||||
#define CASE(x) case GDK_CAP_##x: return #x
|
||||
CASE (NOT_LAST);
|
||||
CASE (BUTT);
|
||||
CASE (ROUND);
|
||||
CASE (PROJECTING);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", cap_style);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_fill_style_to_string (GdkFill fill)
|
||||
{
|
||||
switch (fill)
|
||||
{
|
||||
#define CASE(x) case GDK_##x: return #x
|
||||
CASE (SOLID);
|
||||
CASE (TILED);
|
||||
CASE (STIPPLED);
|
||||
CASE (OPAQUE_STIPPLED);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", fill);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_function_to_string (GdkFunction function)
|
||||
{
|
||||
switch (function)
|
||||
{
|
||||
#define CASE(x) case GDK_##x: return #x
|
||||
CASE (COPY);
|
||||
CASE (INVERT);
|
||||
CASE (XOR);
|
||||
CASE (CLEAR);
|
||||
CASE (AND);
|
||||
CASE (AND_REVERSE);
|
||||
CASE (AND_INVERT);
|
||||
CASE (NOOP);
|
||||
CASE (OR);
|
||||
CASE (EQUIV);
|
||||
CASE (OR_REVERSE);
|
||||
CASE (COPY_INVERT);
|
||||
CASE (OR_INVERT);
|
||||
CASE (NAND);
|
||||
CASE (SET);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", function);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_join_style_to_string (GdkJoinStyle join_style)
|
||||
{
|
||||
switch (join_style)
|
||||
{
|
||||
#define CASE(x) case GDK_JOIN_##x: return #x
|
||||
CASE (MITER);
|
||||
CASE (ROUND);
|
||||
CASE (BEVEL);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", join_style);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_line_style_to_string (GdkLineStyle line_style)
|
||||
{
|
||||
switch (line_style)
|
||||
{
|
||||
#define CASE(x) case GDK_LINE_##x: return #x
|
||||
CASE(SOLID);
|
||||
CASE(ON_OFF_DASH);
|
||||
CASE(DOUBLE_DASH);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", line_style);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask)
|
||||
{
|
||||
gchar buf[400];
|
||||
gchar *bufp = buf;
|
||||
gchar *s = "";
|
||||
|
||||
#define BIT(x) \
|
||||
if (mask & GDK_GC_##x) \
|
||||
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
|
||||
|
||||
BIT (FOREGROUND);
|
||||
BIT (BACKGROUND);
|
||||
BIT (FONT);
|
||||
BIT (FUNCTION);
|
||||
BIT (FILL);
|
||||
BIT (TILE);
|
||||
BIT (STIPPLE);
|
||||
BIT (CLIP_MASK);
|
||||
BIT (SUBWINDOW);
|
||||
BIT (TS_X_ORIGIN);
|
||||
BIT (TS_Y_ORIGIN);
|
||||
BIT (CLIP_X_ORIGIN);
|
||||
BIT (CLIP_Y_ORIGIN);
|
||||
BIT (EXPOSURES);
|
||||
BIT (LINE_WIDTH);
|
||||
BIT (LINE_STYLE);
|
||||
BIT (CAP_STYLE);
|
||||
BIT (JOIN_STYLE);
|
||||
#undef BIT
|
||||
|
||||
return static_printf ("%s", buf);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_rop2_to_string (int rop2)
|
||||
{
|
||||
switch (rop2)
|
||||
{
|
||||
#define CASE(x) case R2_##x: return #x
|
||||
CASE (BLACK);
|
||||
CASE (COPYPEN);
|
||||
CASE (MASKNOTPEN);
|
||||
CASE (MASKPEN);
|
||||
CASE (MASKPENNOT);
|
||||
CASE (MERGENOTPEN);
|
||||
CASE (MERGEPEN);
|
||||
CASE (MERGEPENNOT);
|
||||
CASE (NOP);
|
||||
CASE (NOT);
|
||||
CASE (NOTCOPYPEN);
|
||||
CASE (NOTMASKPEN);
|
||||
CASE (NOTMERGEPEN);
|
||||
CASE (NOTXORPEN);
|
||||
CASE (WHITE);
|
||||
CASE (XORPEN);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%x", rop2);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_lbstyle_to_string (UINT brush_style)
|
||||
{
|
||||
switch (brush_style)
|
||||
{
|
||||
#define CASE(x) case BS_##x: return #x
|
||||
CASE (DIBPATTERN);
|
||||
CASE (DIBPATTERNPT);
|
||||
CASE (HATCHED);
|
||||
CASE (HOLLOW);
|
||||
CASE (PATTERN);
|
||||
CASE (SOLID);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", brush_style);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_pstype_to_string (DWORD pen_style)
|
||||
{
|
||||
switch (pen_style & PS_TYPE_MASK)
|
||||
{
|
||||
case PS_GEOMETRIC: return "GEOMETRIC";
|
||||
case PS_COSMETIC: return "COSMETIC";
|
||||
default: return static_printf ("illegal_%d", pen_style & PS_TYPE_MASK);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_psstyle_to_string (DWORD pen_style)
|
||||
{
|
||||
switch (pen_style & PS_STYLE_MASK)
|
||||
{
|
||||
#define CASE(x) case PS_##x: return #x
|
||||
CASE (DASH);
|
||||
CASE (DASHDOT);
|
||||
CASE (DASHDOTDOT);
|
||||
CASE (DOT);
|
||||
CASE (INSIDEFRAME);
|
||||
CASE (NULL);
|
||||
CASE (SOLID);
|
||||
CASE (USERSTYLE);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", pen_style & PS_STYLE_MASK);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_psendcap_to_string (DWORD pen_style)
|
||||
{
|
||||
switch (pen_style & PS_ENDCAP_MASK)
|
||||
{
|
||||
#define CASE(x) case PS_ENDCAP_##x: return #x
|
||||
CASE (FLAT);
|
||||
CASE (ROUND);
|
||||
CASE (SQUARE);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", pen_style & PS_ENDCAP_MASK);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_psjoin_to_string (DWORD pen_style)
|
||||
{
|
||||
switch (pen_style & PS_JOIN_MASK)
|
||||
{
|
||||
#define CASE(x) case PS_JOIN_##x: return #x
|
||||
CASE (BEVEL);
|
||||
CASE (MITER);
|
||||
CASE (ROUND);
|
||||
#undef CASE
|
||||
default: return static_printf ("illegal_%d", pen_style & PS_JOIN_MASK);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_message_to_string (UINT msg)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
#define CASE(x) case x: return #x
|
||||
CASE (WM_NULL);
|
||||
CASE (WM_CREATE);
|
||||
CASE (WM_DESTROY);
|
||||
CASE (WM_MOVE);
|
||||
CASE (WM_SIZE);
|
||||
CASE (WM_ACTIVATE);
|
||||
CASE (WM_SETFOCUS);
|
||||
CASE (WM_KILLFOCUS);
|
||||
CASE (WM_ENABLE);
|
||||
CASE (WM_SETREDRAW);
|
||||
CASE (WM_SETTEXT);
|
||||
CASE (WM_GETTEXT);
|
||||
CASE (WM_GETTEXTLENGTH);
|
||||
CASE (WM_PAINT);
|
||||
CASE (WM_CLOSE);
|
||||
CASE (WM_QUERYENDSESSION);
|
||||
CASE (WM_QUERYOPEN);
|
||||
CASE (WM_ENDSESSION);
|
||||
CASE (WM_QUIT);
|
||||
CASE (WM_ERASEBKGND);
|
||||
CASE (WM_SYSCOLORCHANGE);
|
||||
CASE (WM_SHOWWINDOW);
|
||||
CASE (WM_WININICHANGE);
|
||||
CASE (WM_DEVMODECHANGE);
|
||||
CASE (WM_ACTIVATEAPP);
|
||||
CASE (WM_FONTCHANGE);
|
||||
CASE (WM_TIMECHANGE);
|
||||
CASE (WM_CANCELMODE);
|
||||
CASE (WM_SETCURSOR);
|
||||
CASE (WM_MOUSEACTIVATE);
|
||||
CASE (WM_CHILDACTIVATE);
|
||||
CASE (WM_QUEUESYNC);
|
||||
CASE (WM_GETMINMAXINFO);
|
||||
CASE (WM_PAINTICON);
|
||||
CASE (WM_ICONERASEBKGND);
|
||||
CASE (WM_NEXTDLGCTL);
|
||||
CASE (WM_SPOOLERSTATUS);
|
||||
CASE (WM_DRAWITEM);
|
||||
CASE (WM_MEASUREITEM);
|
||||
CASE (WM_DELETEITEM);
|
||||
CASE (WM_VKEYTOITEM);
|
||||
CASE (WM_CHARTOITEM);
|
||||
CASE (WM_SETFONT);
|
||||
CASE (WM_GETFONT);
|
||||
CASE (WM_SETHOTKEY);
|
||||
CASE (WM_GETHOTKEY);
|
||||
CASE (WM_QUERYDRAGICON);
|
||||
CASE (WM_COMPAREITEM);
|
||||
CASE (WM_GETOBJECT);
|
||||
CASE (WM_COMPACTING);
|
||||
CASE (WM_WINDOWPOSCHANGING);
|
||||
CASE (WM_WINDOWPOSCHANGED);
|
||||
CASE (WM_POWER);
|
||||
CASE (WM_COPYDATA);
|
||||
CASE (WM_CANCELJOURNAL);
|
||||
CASE (WM_NOTIFY);
|
||||
CASE (WM_INPUTLANGCHANGEREQUEST);
|
||||
CASE (WM_INPUTLANGCHANGE);
|
||||
CASE (WM_TCARD);
|
||||
CASE (WM_HELP);
|
||||
CASE (WM_USERCHANGED);
|
||||
CASE (WM_NOTIFYFORMAT);
|
||||
CASE (WM_CONTEXTMENU);
|
||||
CASE (WM_STYLECHANGING);
|
||||
CASE (WM_STYLECHANGED);
|
||||
CASE (WM_DISPLAYCHANGE);
|
||||
CASE (WM_GETICON);
|
||||
CASE (WM_SETICON);
|
||||
CASE (WM_NCCREATE);
|
||||
CASE (WM_NCDESTROY);
|
||||
CASE (WM_NCCALCSIZE);
|
||||
CASE (WM_NCHITTEST);
|
||||
CASE (WM_NCPAINT);
|
||||
CASE (WM_NCACTIVATE);
|
||||
CASE (WM_GETDLGCODE);
|
||||
CASE (WM_SYNCPAINT);
|
||||
CASE (WM_NCMOUSEMOVE);
|
||||
CASE (WM_NCLBUTTONDOWN);
|
||||
CASE (WM_NCLBUTTONUP);
|
||||
CASE (WM_NCLBUTTONDBLCLK);
|
||||
CASE (WM_NCRBUTTONDOWN);
|
||||
CASE (WM_NCRBUTTONUP);
|
||||
CASE (WM_NCRBUTTONDBLCLK);
|
||||
CASE (WM_NCMBUTTONDOWN);
|
||||
CASE (WM_NCMBUTTONUP);
|
||||
CASE (WM_NCMBUTTONDBLCLK);
|
||||
CASE (WM_NCXBUTTONDOWN);
|
||||
CASE (WM_NCXBUTTONUP);
|
||||
CASE (WM_NCXBUTTONDBLCLK);
|
||||
CASE (WM_KEYDOWN);
|
||||
CASE (WM_KEYUP);
|
||||
CASE (WM_CHAR);
|
||||
CASE (WM_DEADCHAR);
|
||||
CASE (WM_SYSKEYDOWN);
|
||||
CASE (WM_SYSKEYUP);
|
||||
CASE (WM_SYSCHAR);
|
||||
CASE (WM_SYSDEADCHAR);
|
||||
CASE (WM_KEYLAST);
|
||||
CASE (WM_IME_STARTCOMPOSITION);
|
||||
CASE (WM_IME_ENDCOMPOSITION);
|
||||
CASE (WM_IME_COMPOSITION);
|
||||
CASE (WM_INITDIALOG);
|
||||
CASE (WM_COMMAND);
|
||||
CASE (WM_SYSCOMMAND);
|
||||
CASE (WM_TIMER);
|
||||
CASE (WM_HSCROLL);
|
||||
CASE (WM_VSCROLL);
|
||||
CASE (WM_INITMENU);
|
||||
CASE (WM_INITMENUPOPUP);
|
||||
CASE (WM_MENUSELECT);
|
||||
CASE (WM_MENUCHAR);
|
||||
CASE (WM_ENTERIDLE);
|
||||
CASE (WM_MENURBUTTONUP);
|
||||
CASE (WM_MENUDRAG);
|
||||
CASE (WM_MENUGETOBJECT);
|
||||
CASE (WM_UNINITMENUPOPUP);
|
||||
CASE (WM_MENUCOMMAND);
|
||||
CASE (WM_CHANGEUISTATE);
|
||||
CASE (WM_UPDATEUISTATE);
|
||||
CASE (WM_QUERYUISTATE);
|
||||
CASE (WM_CTLCOLORMSGBOX);
|
||||
CASE (WM_CTLCOLOREDIT);
|
||||
CASE (WM_CTLCOLORLISTBOX);
|
||||
CASE (WM_CTLCOLORBTN);
|
||||
CASE (WM_CTLCOLORDLG);
|
||||
CASE (WM_CTLCOLORSCROLLBAR);
|
||||
CASE (WM_CTLCOLORSTATIC);
|
||||
CASE (WM_MOUSEMOVE);
|
||||
CASE (WM_LBUTTONDOWN);
|
||||
CASE (WM_LBUTTONUP);
|
||||
CASE (WM_LBUTTONDBLCLK);
|
||||
CASE (WM_RBUTTONDOWN);
|
||||
CASE (WM_RBUTTONUP);
|
||||
CASE (WM_RBUTTONDBLCLK);
|
||||
CASE (WM_MBUTTONDOWN);
|
||||
CASE (WM_MBUTTONUP);
|
||||
CASE (WM_MBUTTONDBLCLK);
|
||||
CASE (WM_MOUSEWHEEL);
|
||||
CASE (WM_XBUTTONDOWN);
|
||||
CASE (WM_XBUTTONUP);
|
||||
CASE (WM_XBUTTONDBLCLK);
|
||||
CASE (WM_PARENTNOTIFY);
|
||||
CASE (WM_ENTERMENULOOP);
|
||||
CASE (WM_EXITMENULOOP);
|
||||
CASE (WM_NEXTMENU);
|
||||
CASE (WM_SIZING);
|
||||
CASE (WM_CAPTURECHANGED);
|
||||
CASE (WM_MOVING);
|
||||
CASE (WM_POWERBROADCAST);
|
||||
CASE (WM_DEVICECHANGE);
|
||||
CASE (WM_MDICREATE);
|
||||
CASE (WM_MDIDESTROY);
|
||||
CASE (WM_MDIACTIVATE);
|
||||
CASE (WM_MDIRESTORE);
|
||||
CASE (WM_MDINEXT);
|
||||
CASE (WM_MDIMAXIMIZE);
|
||||
CASE (WM_MDITILE);
|
||||
CASE (WM_MDICASCADE);
|
||||
CASE (WM_MDIICONARRANGE);
|
||||
CASE (WM_MDIGETACTIVE);
|
||||
CASE (WM_MDISETMENU);
|
||||
CASE (WM_ENTERSIZEMOVE);
|
||||
CASE (WM_EXITSIZEMOVE);
|
||||
CASE (WM_DROPFILES);
|
||||
CASE (WM_MDIREFRESHMENU);
|
||||
CASE (WM_IME_SETCONTEXT);
|
||||
CASE (WM_IME_NOTIFY);
|
||||
CASE (WM_IME_CONTROL);
|
||||
CASE (WM_IME_COMPOSITIONFULL);
|
||||
CASE (WM_IME_SELECT);
|
||||
CASE (WM_IME_CHAR);
|
||||
CASE (WM_IME_REQUEST);
|
||||
CASE (WM_IME_KEYDOWN);
|
||||
CASE (WM_IME_KEYUP);
|
||||
CASE (WM_MOUSEHOVER);
|
||||
CASE (WM_MOUSELEAVE);
|
||||
CASE (WM_NCMOUSEHOVER);
|
||||
CASE (WM_NCMOUSELEAVE);
|
||||
CASE (WM_CUT);
|
||||
CASE (WM_COPY);
|
||||
CASE (WM_PASTE);
|
||||
CASE (WM_CLEAR);
|
||||
CASE (WM_UNDO);
|
||||
CASE (WM_RENDERFORMAT);
|
||||
CASE (WM_RENDERALLFORMATS);
|
||||
CASE (WM_DESTROYCLIPBOARD);
|
||||
CASE (WM_DRAWCLIPBOARD);
|
||||
CASE (WM_PAINTCLIPBOARD);
|
||||
CASE (WM_VSCROLLCLIPBOARD);
|
||||
CASE (WM_SIZECLIPBOARD);
|
||||
CASE (WM_ASKCBFORMATNAME);
|
||||
CASE (WM_CHANGECBCHAIN);
|
||||
CASE (WM_HSCROLLCLIPBOARD);
|
||||
CASE (WM_QUERYNEWPALETTE);
|
||||
CASE (WM_PALETTEISCHANGING);
|
||||
CASE (WM_PALETTECHANGED);
|
||||
CASE (WM_HOTKEY);
|
||||
CASE (WM_PRINT);
|
||||
CASE (WM_PRINTCLIENT);
|
||||
CASE (WM_APPCOMMAND);
|
||||
CASE (WM_HANDHELDFIRST);
|
||||
CASE (WM_HANDHELDLAST);
|
||||
CASE (WM_AFXFIRST);
|
||||
CASE (WM_AFXLAST);
|
||||
CASE (WM_PENWINFIRST);
|
||||
CASE (WM_PENWINLAST);
|
||||
CASE (WM_APP);
|
||||
#undef CASE
|
||||
default:
|
||||
if (msg >= WM_HANDHELDFIRST && msg <= WM_HANDHELDLAST)
|
||||
return static_printf ("WM_HANDHELDFIRST+%d", msg - WM_HANDHELDFIRST);
|
||||
else if (msg >= WM_AFXFIRST && msg <= WM_AFXLAST)
|
||||
return static_printf ("WM_AFXFIRST+%d", msg - WM_AFXFIRST);
|
||||
else if (msg >= WM_PENWINFIRST && msg <= WM_PENWINLAST)
|
||||
return static_printf ("WM_PENWINFIRST+%d", msg - WM_PENWINFIRST);
|
||||
else if (msg >= WM_USER && msg <= 0x7FFF)
|
||||
return static_printf ("WM_USER+%d", msg - WM_USER);
|
||||
else if (msg >= 0xC000 && msg <= 0xFFFF)
|
||||
return static_printf ("reg-%#x", msg);
|
||||
else
|
||||
return static_printf ("unk-%#x", msg);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_rect_to_string (const RECT *rect)
|
||||
{
|
||||
return static_printf ("%ldx%ld@+%ld+%ld",
|
||||
(rect->right - rect->left), (rect->bottom - rect->top),
|
||||
rect->left, rect->top);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect)
|
||||
{
|
||||
return static_printf ("%dx%d@+%d+%d",
|
||||
rect->width, rect->height,
|
||||
rect->x, rect->y);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_gdkregion_to_string (const GdkRegion *rgn)
|
||||
{
|
||||
return static_printf ("%dx%d@+%d+%d",
|
||||
(rgn->extents.x2 - rgn->extents.x1),
|
||||
(rgn->extents.y2 - rgn->extents.y1),
|
||||
rgn->extents.x1, rgn->extents.y1);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_win32_drawable_description (GdkDrawable *d)
|
||||
{
|
||||
GdkVisual *v;
|
||||
gint width, height;
|
||||
|
||||
gdk_drawable_get_size (d, &width, &height);
|
||||
|
||||
return static_printf
|
||||
("%s:%p:%dx%dx%d",
|
||||
G_OBJECT_TYPE_NAME (d),
|
||||
GDK_DRAWABLE_HANDLE (d),
|
||||
width, height,
|
||||
(GDK_IS_PIXMAP (d) ? GDK_PIXMAP_IMPL_WIN32 (GDK_PIXMAP_OBJECT (d)->impl)->image->depth
|
||||
: ((v = gdk_drawable_get_visual (d)) ? v->depth : gdk_visual_get_system ()->depth)));
|
||||
}
|
||||
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
+34
-44
@@ -101,6 +101,7 @@ gdk_pixmap_impl_win32_finalize (GObject *object)
|
||||
{
|
||||
GdkPixmapImplWin32 *impl = GDK_PIXMAP_IMPL_WIN32 (object);
|
||||
GdkPixmap *wrapper = GDK_PIXMAP (GDK_DRAWABLE_IMPL_WIN32 (impl)->wrapper);
|
||||
GdkImage *image = impl->image;
|
||||
|
||||
GDK_NOTE (PIXMAP, g_print ("gdk_pixmap_impl_win32_finalize: %p\n",
|
||||
GDK_PIXMAP_HBITMAP (wrapper)));
|
||||
@@ -110,6 +111,9 @@ gdk_pixmap_impl_win32_finalize (GObject *object)
|
||||
|
||||
gdk_win32_handle_table_remove (GDK_PIXMAP_HBITMAP (wrapper));
|
||||
|
||||
image->windowing_data = NULL;
|
||||
g_object_unref (image);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -125,11 +129,10 @@ gdk_pixmap_impl_win32_get_size (GdkDrawable *drawable,
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
_gdk_win32_pixmap_new (GdkWindow *window,
|
||||
GdkVisual *visual,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth)
|
||||
gdk_pixmap_new (GdkWindow *window,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth)
|
||||
{
|
||||
struct {
|
||||
BITMAPINFOHEADER bmiHeader;
|
||||
@@ -141,38 +144,33 @@ _gdk_win32_pixmap_new (GdkWindow *window,
|
||||
} bmi;
|
||||
UINT iUsage;
|
||||
HDC hdc;
|
||||
HWND hwnd;
|
||||
HPALETTE holdpal = NULL;
|
||||
HBITMAP hbitmap;
|
||||
GdkPixmap *pixmap;
|
||||
GdkDrawableImplWin32 *drawable_impl;
|
||||
GdkPixmapImplWin32 *pixmap_impl;
|
||||
GdkColormap *cmap;
|
||||
guchar *bits;
|
||||
gint i;
|
||||
gint window_depth;
|
||||
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_DRAWABLE (window), NULL);
|
||||
g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
|
||||
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
|
||||
|
||||
if (!window)
|
||||
window = _gdk_parent_root;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
if (GDK_IS_WINDOW (window) && GDK_WINDOW_DESTROYED (window))
|
||||
return NULL;
|
||||
|
||||
if (!visual)
|
||||
{
|
||||
if (window)
|
||||
visual = gdk_drawable_get_visual (window);
|
||||
else
|
||||
visual = gdk_visual_get_system ();
|
||||
}
|
||||
|
||||
window_depth = gdk_drawable_get_depth (GDK_DRAWABLE (window));
|
||||
if (depth == -1)
|
||||
depth = visual->depth;
|
||||
depth = window_depth;
|
||||
|
||||
GDK_NOTE (PIXMAP, g_print ("_gdk_win32_pixmap_new: %dx%dx%d "
|
||||
"window=%p visual=%p\n",
|
||||
width, height, depth, window, visual));
|
||||
GDK_NOTE (PIXMAP, g_print ("_gdk_win32_pixmap_new: %dx%dx%d window=%p\n",
|
||||
width, height, depth, window));
|
||||
|
||||
pixmap = g_object_new (gdk_pixmap_get_type (), NULL);
|
||||
drawable_impl = GDK_DRAWABLE_IMPL_WIN32 (GDK_PIXMAP_OBJECT (pixmap)->impl);
|
||||
@@ -184,7 +182,18 @@ _gdk_win32_pixmap_new (GdkWindow *window,
|
||||
pixmap_impl->height = height;
|
||||
GDK_PIXMAP_OBJECT (pixmap)->depth = depth;
|
||||
|
||||
if ((hdc = GetDC (GDK_WINDOW_HWND (window))) == NULL)
|
||||
if (depth == window_depth)
|
||||
{
|
||||
cmap = gdk_drawable_get_colormap (window);
|
||||
if (cmap)
|
||||
gdk_drawable_set_colormap (pixmap, cmap);
|
||||
}
|
||||
|
||||
if (GDK_IS_WINDOW (window))
|
||||
hwnd = GDK_WINDOW_HWND (window);
|
||||
else
|
||||
hwnd = GDK_WINDOW_HWND (_gdk_parent_root);
|
||||
if ((hdc = GetDC (hwnd)) == NULL)
|
||||
{
|
||||
WIN32_GDI_FAILED ("GetDC");
|
||||
g_object_unref ((GObject *) pixmap);
|
||||
@@ -247,21 +256,10 @@ _gdk_win32_pixmap_new (GdkWindow *window,
|
||||
bmi.u.bmiColors[1].rgbGreen =
|
||||
bmi.u.bmiColors[1].rgbRed = 0xFF;
|
||||
bmi.u.bmiColors[1].rgbReserved = 0x00;
|
||||
drawable_impl->colormap = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (depth > 8 && depth != visual->depth)
|
||||
g_warning ("_gdk_win32_pixmap_new: depth %d doesn't match display depth %d",
|
||||
depth, visual->depth);
|
||||
|
||||
drawable_impl->colormap = GDK_DRAWABLE_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl)->colormap;
|
||||
|
||||
if (drawable_impl->colormap == NULL)
|
||||
drawable_impl->colormap = gdk_colormap_get_system ();
|
||||
gdk_colormap_ref (drawable_impl->colormap);
|
||||
|
||||
if (depth <= 8)
|
||||
if (depth <= 8 && drawable_impl->colormap != NULL)
|
||||
{
|
||||
GdkColormapPrivateWin32 *cmapp =
|
||||
GDK_WIN32_COLORMAP_DATA (drawable_impl->colormap);
|
||||
@@ -281,6 +279,8 @@ _gdk_win32_pixmap_new (GdkWindow *window,
|
||||
}
|
||||
else if (bmi.bmiHeader.biBitCount == 16)
|
||||
{
|
||||
GdkVisual *visual = gdk_visual_get_system ();
|
||||
|
||||
bmi.u.bmiMasks[0] = visual->red_mask;
|
||||
bmi.u.bmiMasks[1] = visual->green_mask;
|
||||
bmi.u.bmiMasks[2] = visual->blue_mask;
|
||||
@@ -292,15 +292,14 @@ _gdk_win32_pixmap_new (GdkWindow *window,
|
||||
if (holdpal != NULL)
|
||||
SelectPalette (hdc, holdpal, FALSE);
|
||||
|
||||
if (!ReleaseDC (GDK_WINDOW_HWND (window), hdc))
|
||||
if (!ReleaseDC (hwnd, hdc))
|
||||
WIN32_GDI_FAILED ("ReleaseDC");
|
||||
|
||||
GDK_NOTE (PIXMAP, g_print ("...=%p bits=%p\n", hbitmap, bits));
|
||||
GDK_NOTE (PIXMAP, g_print ("...=%p bits=%p pixmap=%p\n", hbitmap, bits, pixmap));
|
||||
|
||||
if (hbitmap == NULL)
|
||||
{
|
||||
WIN32_GDI_FAILED ("CreateDIBSection");
|
||||
ReleaseDC (GDK_WINDOW_HWND (window), hdc);
|
||||
g_object_unref ((GObject *) pixmap);
|
||||
return NULL;
|
||||
}
|
||||
@@ -315,15 +314,6 @@ _gdk_win32_pixmap_new (GdkWindow *window,
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_new (GdkWindow *window,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth)
|
||||
{
|
||||
return _gdk_win32_pixmap_new (window, NULL, width, height, depth);
|
||||
}
|
||||
|
||||
static unsigned char mirror[256] = {
|
||||
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
|
||||
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
|
||||
|
||||
@@ -263,11 +263,7 @@ struct _GdkGCWin32
|
||||
* window or pixmap. We thus keep all the necessary values in the
|
||||
* GdkGCWin32 object.
|
||||
*/
|
||||
HDC hdc;
|
||||
|
||||
int saved_dc;
|
||||
|
||||
GdkRegion *clip_region;
|
||||
HRGN hcliprgn;
|
||||
|
||||
GdkGCValuesMask values_mask;
|
||||
@@ -286,8 +282,13 @@ struct _GdkGCWin32
|
||||
DWORD pen_style;
|
||||
DWORD *pen_dashes; /* use for PS_USERSTYLE or step-by-step rendering */
|
||||
gint pen_num_dashes;
|
||||
HANDLE hwnd; /* If a HDC is allocated, for which window,
|
||||
* or what bitmap is selected into it
|
||||
|
||||
/* Following fields are valid while the GC exists as a Windows DC */
|
||||
HDC hdc;
|
||||
int saved_dc;
|
||||
|
||||
HANDLE hwnd; /* For which window, or what bitmap is
|
||||
* selected into it
|
||||
*/
|
||||
HPALETTE holdpal;
|
||||
};
|
||||
@@ -297,27 +298,18 @@ struct _GdkGCWin32Class
|
||||
GdkGCClass parent_class;
|
||||
};
|
||||
|
||||
gulong _gdk_win32_get_next_tick (gulong suggested_tick);
|
||||
|
||||
GType _gdk_gc_win32_get_type (void);
|
||||
|
||||
/* Routines from gdkgeometry-win32.c */
|
||||
void _gdk_window_init_position (GdkWindow *window);
|
||||
void _gdk_window_move_resize_child (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void _gdk_window_process_expose (GdkWindow *window,
|
||||
gulong serial,
|
||||
GdkRectangle *area);
|
||||
|
||||
/* gdkdrawable-win32.c, background draw helper */
|
||||
void _gdk_win32_draw_tiles (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPixmap *tile,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void _gdk_window_process_expose (GdkWindow *window,
|
||||
GdkRegion *invalidate_region);
|
||||
|
||||
void _gdk_win32_selection_init (void);
|
||||
void _gdk_win32_dnd_exit (void);
|
||||
@@ -345,12 +337,6 @@ GdkImage *_gdk_win32_copy_to_image (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
GdkPixmap *_gdk_win32_pixmap_new (GdkWindow *window,
|
||||
GdkVisual *visual,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth);
|
||||
|
||||
GdkImage *_gdk_win32_setup_pixmap_image (GdkPixmap *pixmap,
|
||||
GdkWindow *window,
|
||||
gint width,
|
||||
@@ -372,9 +358,11 @@ void _gdk_win32_blit (gboolean use_fg_bg,
|
||||
COLORREF _gdk_win32_colormap_color (GdkColormap *colormap,
|
||||
gulong pixel);
|
||||
|
||||
HRGN _gdk_win32_bitmap_to_region (GdkPixmap *bitmap);
|
||||
HRGN _gdk_win32_bitmap_to_hrgn (GdkPixmap *bitmap);
|
||||
|
||||
gchar *gdk_font_full_name_get (GdkFont *font);
|
||||
HRGN _gdk_win32_gdkregion_to_hrgn (GdkRegion *region,
|
||||
gint x_origin,
|
||||
gint y_origin);
|
||||
|
||||
void _gdk_selection_property_store (GdkWindow *owner,
|
||||
GdkAtom type,
|
||||
@@ -404,17 +392,33 @@ void _gdk_wchar_text_handle (GdkFont *font,
|
||||
void *arg);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
gchar *gdk_win32_color_to_string (const GdkColor *color);
|
||||
gchar *gdk_win32_color_to_string (const GdkColor *color);
|
||||
void gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
|
||||
const int nentries);
|
||||
void gdk_win32_print_system_palette (void);
|
||||
void gdk_win32_print_hpalette (HPALETTE hpal);
|
||||
void gdk_win32_print_dc (HDC hdc);
|
||||
|
||||
gchar *gdk_win32_cap_style_to_string (GdkCapStyle cap_style);
|
||||
gchar *gdk_win32_fill_style_to_string (GdkFill fill);
|
||||
gchar *gdk_win32_function_to_string (GdkFunction function);
|
||||
gchar *gdk_win32_join_style_to_string (GdkJoinStyle join_style);
|
||||
gchar *gdk_win32_line_style_to_string (GdkLineStyle line_style);
|
||||
gchar *gdk_win32_message_name (UINT msg);
|
||||
gchar *gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask);
|
||||
gchar *gdk_win32_drawable_description (GdkDrawable *d);
|
||||
|
||||
gchar *gdk_win32_rop2_to_string (int rop2);
|
||||
gchar *gdk_win32_lbstyle_to_string (UINT brush_style);
|
||||
gchar *gdk_win32_pstype_to_string (DWORD pen_style);
|
||||
gchar *gdk_win32_psstyle_to_string (DWORD pen_style);
|
||||
gchar *gdk_win32_psendcap_to_string (DWORD pen_style);
|
||||
gchar *gdk_win32_psjoin_to_string (DWORD pen_style);
|
||||
gchar *gdk_win32_message_to_string (UINT msg);
|
||||
gchar *gdk_win32_rect_to_string (const RECT *rect);
|
||||
|
||||
gchar *gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect);
|
||||
gchar *gdk_win32_gdkregion_to_string (const GdkRegion *box);
|
||||
|
||||
#define PING() printf(G_STRLOC),fflush(stdout)
|
||||
#else
|
||||
#define PING()
|
||||
#endif
|
||||
|
||||
gchar *gdk_win32_last_error_string (void);
|
||||
@@ -428,6 +432,8 @@ void gdk_win32_gdi_failed (const gchar *where,
|
||||
gint line,
|
||||
const gchar *api);
|
||||
|
||||
/* Macros that print an warning message about failed GDI and other Win32 API calls */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define WIN32_API_FAILED(api) gdk_win32_api_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
|
||||
#define WIN32_GDI_FAILED(api) gdk_win32_gdi_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
|
||||
@@ -437,6 +443,15 @@ void gdk_win32_gdi_failed (const gchar *where,
|
||||
#define WIN32_GDI_FAILED(api) gdk_win32_gdi_failed (__FILE__, __LINE__, api)
|
||||
#define OTHER_API_FAILED(api) gdk_other_api_failed (__FILE__, __LINE__, api)
|
||||
#endif
|
||||
|
||||
/* These two macros call a GDI or other Win32 API and if the return
|
||||
* value is zero or NULL, print a warning message. The majority of GDI
|
||||
* calls return zero or NULL on failure. The value of the macros is nonzero
|
||||
* if the call succeeded, zero otherwise.
|
||||
*/
|
||||
|
||||
#define GDI_CALL(api, arglist) (api arglist ? 1 : (WIN32_GDI_FAILED (#api), 0))
|
||||
#define API_CALL(api, arglist) (api arglist ? 1 : (WIN32_API_FAILED (#api), 0))
|
||||
|
||||
extern LRESULT CALLBACK _gdk_win32_window_procedure (HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
@@ -475,9 +490,9 @@ extern DWORD windows_version;
|
||||
|
||||
/* Options */
|
||||
extern gboolean gdk_input_ignore_wintab;
|
||||
extern gboolean gdk_event_func_from_window_proc;
|
||||
extern gint gdk_max_colors;
|
||||
|
||||
|
||||
#define GDK_WIN32_COLORMAP_DATA(cmap) ((GdkColormapPrivateWin32 *) GDK_COLORMAP (cmap)->windowing_data)
|
||||
|
||||
#endif /* __GDK_PRIVATE_WIN32_H__ */
|
||||
|
||||
@@ -390,7 +390,7 @@ gdk_property_change (GdkWindow *window,
|
||||
cf = CF_TEXT;
|
||||
for (i = 0; i < nelements; i++)
|
||||
{
|
||||
if (*data == '\n')
|
||||
if (data[i] == '\n')
|
||||
*ucptr++ = '\r';
|
||||
*ucptr++ = data[i];
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
}
|
||||
|
||||
wcs = g_new (wchar_t, length + 1);
|
||||
wclen = MultiByteToWideChar (cp, 0, ptr, length,
|
||||
wclen = MultiByteToWideChar (cp, 0, ptr, -1,
|
||||
wcs, length + 1);
|
||||
|
||||
/* Strip out \r */
|
||||
@@ -782,7 +782,7 @@ gdk_text_property_to_utf8_list (GdkAtom encoding,
|
||||
* 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, \r\n, and \n\r to \n
|
||||
* from the input string and also canonicalizes \r, and \r\n to \n
|
||||
*/
|
||||
static gchar *
|
||||
sanitize_utf8 (const gchar *src)
|
||||
@@ -793,10 +793,10 @@ sanitize_utf8 (const gchar *src)
|
||||
|
||||
while (*p)
|
||||
{
|
||||
if (*p == '\r' || *p == '\n')
|
||||
if (*p == '\r')
|
||||
{
|
||||
p++;
|
||||
if (*p == '\r' || *p == '\n')
|
||||
if (*p == '\n')
|
||||
p++;
|
||||
|
||||
g_string_append_c (result, '\n');
|
||||
@@ -807,7 +807,7 @@ sanitize_utf8 (const gchar *src)
|
||||
char buf[7];
|
||||
gint buflen;
|
||||
|
||||
if (!((ch < 0x20 && ch != '\t') || (ch >= 0x7f && ch < 0xa0)))
|
||||
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);
|
||||
|
||||
+109
-142
@@ -34,17 +34,13 @@
|
||||
#include "gdkprivate-win32.h"
|
||||
#include "gdkinput-win32.h"
|
||||
|
||||
static gboolean gdk_window_gravity_works (void);
|
||||
static void gdk_window_set_static_win_gravity (GdkWindow *window,
|
||||
gboolean on);
|
||||
|
||||
static GdkColormap* gdk_window_impl_win32_get_colormap (GdkDrawable *drawable);
|
||||
static void gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
|
||||
GdkColormap *cmap);
|
||||
static void gdk_window_impl_win32_get_size (GdkDrawable *drawable,
|
||||
gint *width,
|
||||
gint *height);
|
||||
static GdkRegion* gdk_window_impl_win32_get_visible_region (GdkDrawable *drawable);
|
||||
static GdkRegion* gdk_window_impl_win32_get_visible_region (GdkDrawable *drawable);
|
||||
static void gdk_window_impl_win32_init (GdkWindowImplWin32 *window);
|
||||
static void gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass);
|
||||
static void gdk_window_impl_win32_finalize (GObject *object);
|
||||
@@ -247,6 +243,8 @@ _gdk_windowing_window_init (void)
|
||||
impl->width = width;
|
||||
impl->height = height;
|
||||
|
||||
_gdk_window_init_position (GDK_WINDOW (private));
|
||||
|
||||
gdk_win32_handle_table_insert (&gdk_root_window, _gdk_parent_root);
|
||||
}
|
||||
|
||||
@@ -307,14 +305,14 @@ RegisterGdkClass (GdkWindowType wtype)
|
||||
/* initialize once! */
|
||||
if (0 == hAppIcon)
|
||||
{
|
||||
gchar sLoc [_MAX_PATH+1];
|
||||
gchar sLoc [MAX_PATH+1];
|
||||
|
||||
if (0 != GetModuleFileName (gdk_app_hmodule, sLoc, _MAX_PATH))
|
||||
if (0 != GetModuleFileName (gdk_app_hmodule, sLoc, MAX_PATH))
|
||||
{
|
||||
hAppIcon = ExtractIcon (gdk_app_hmodule, sLoc, 0);
|
||||
if (0 == hAppIcon)
|
||||
{
|
||||
if (0 != GetModuleFileName (gdk_dll_hinstance, sLoc, _MAX_PATH))
|
||||
if (0 != GetModuleFileName (gdk_dll_hinstance, sLoc, MAX_PATH))
|
||||
hAppIcon = ExtractIcon (gdk_dll_hinstance, sLoc, 0);
|
||||
}
|
||||
}
|
||||
@@ -512,7 +510,7 @@ gdk_window_new (GdkWindow *parent,
|
||||
else
|
||||
{
|
||||
dwExStyle = WS_EX_TRANSPARENT;
|
||||
private->depth = 0;
|
||||
private->depth = visual->depth;
|
||||
private->input_only = TRUE;
|
||||
draw_impl->colormap = gdk_colormap_get_system ();
|
||||
gdk_colormap_ref (draw_impl->colormap);
|
||||
@@ -712,6 +710,8 @@ gdk_window_foreign_new (GdkNativeWindow anid)
|
||||
private->state |= GDK_WINDOW_STATE_WITHDRAWN;
|
||||
private->depth = gdk_visual_get_system ()->depth;
|
||||
|
||||
_gdk_window_init_position (GDK_WINDOW (private));
|
||||
|
||||
gdk_drawable_ref (window);
|
||||
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
|
||||
|
||||
@@ -946,9 +946,7 @@ gdk_window_resize (GdkWindow *window,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject*) window;
|
||||
GdkWindowImplWin32 *impl;
|
||||
int x, y;
|
||||
GdkWindowObject *private;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -958,7 +956,7 @@ gdk_window_resize (GdkWindow *window,
|
||||
if (height < 1)
|
||||
height = 1;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
||||
private = (GdkWindowObject*) window;
|
||||
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
{
|
||||
@@ -967,10 +965,15 @@ gdk_window_resize (GdkWindow *window,
|
||||
width, height);
|
||||
else
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
||||
POINT pt;
|
||||
RECT rect;
|
||||
DWORD dwStyle;
|
||||
DWORD dwExStyle;
|
||||
int x, y;
|
||||
|
||||
if (width != impl->width || height != impl->height)
|
||||
private->resize_count += 1;
|
||||
|
||||
pt.x = 0;
|
||||
pt.y = 0;
|
||||
@@ -994,7 +997,6 @@ gdk_window_resize (GdkWindow *window,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER))
|
||||
WIN32_API_FAILED ("SetWindowPos");
|
||||
}
|
||||
private->resize_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1005,8 +1007,7 @@ gdk_window_move_resize (GdkWindow *window,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject*) window;
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkWindowObject *private;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -1016,14 +1017,10 @@ gdk_window_move_resize (GdkWindow *window,
|
||||
if (height < 1)
|
||||
height = 1;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
||||
private = (GdkWindowObject*) window;
|
||||
|
||||
if (!private->destroyed)
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
{
|
||||
RECT rect;
|
||||
DWORD dwStyle;
|
||||
DWORD dwExStyle;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_move_resize: %p %dx%d@+%d+%d\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
width, height, x, y));
|
||||
@@ -1032,6 +1029,14 @@ gdk_window_move_resize (GdkWindow *window,
|
||||
_gdk_window_move_resize_child (window, x, y, width, height);
|
||||
else
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
||||
RECT rect;
|
||||
DWORD dwStyle;
|
||||
DWORD dwExStyle;
|
||||
|
||||
if (width != impl->width || height != impl->height)
|
||||
private->resize_count += 1;
|
||||
|
||||
rect.left = x;
|
||||
rect.top = y;
|
||||
rect.right = x + width;
|
||||
@@ -1105,11 +1110,13 @@ gdk_window_reparent (GdkWindow *window,
|
||||
old_parent_private->children =
|
||||
g_list_remove (old_parent_private->children, window);
|
||||
|
||||
#if 0
|
||||
if ((old_parent_private &&
|
||||
(!old_parent_private->guffaw_gravity != !parent_private->guffaw_gravity)) ||
|
||||
(!old_parent_private && parent_private->guffaw_gravity))
|
||||
gdk_window_set_static_win_gravity (window, parent_private->guffaw_gravity);
|
||||
|
||||
#endif
|
||||
|
||||
parent_private->children = g_list_prepend (parent_private->children, window);
|
||||
_gdk_window_init_position (GDK_WINDOW (window_private));
|
||||
}
|
||||
@@ -1519,7 +1526,7 @@ gdk_window_set_transient_for (GdkWindow *window,
|
||||
if (!SetParent (window_id, parent_id))
|
||||
WIN32_API_FAILED ("SetParent");
|
||||
#else /* make the modal window topmost instead */
|
||||
if (!SetWindowPos (window_id, HWND_TOPMOST, 0, 0, 0, 0,
|
||||
if (!SetWindowPos (window_id, HWND_NOTOPMOST, 0, 0, 0, 0,
|
||||
SWP_NOMOVE | SWP_NOSIZE))
|
||||
WIN32_API_FAILED ("SetWindowPos");
|
||||
#endif
|
||||
@@ -1594,6 +1601,7 @@ gdk_window_set_cursor (GdkWindow *window,
|
||||
{
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkCursorPrivate *cursor_private;
|
||||
GdkWindowObject *parent_window;
|
||||
HCURSOR hcursor;
|
||||
HCURSOR hprevcursor;
|
||||
|
||||
@@ -1637,9 +1645,10 @@ gdk_window_set_cursor (GdkWindow *window,
|
||||
hcursor, impl->hcursor));
|
||||
}
|
||||
|
||||
/* Set new cursor in all cases if we're over our window */
|
||||
/* If the pointer is over our window, set new cursor if given */
|
||||
if (gdk_window_get_pointer(window, NULL, NULL, NULL) == window)
|
||||
SetCursor (impl->hcursor);
|
||||
if (impl->hcursor != NULL)
|
||||
SetCursor (impl->hcursor);
|
||||
|
||||
/* Destroy the previous cursor: Need to make sure it's no longer in
|
||||
* use before we destroy it, in case we're not over our window but
|
||||
@@ -1648,7 +1657,25 @@ gdk_window_set_cursor (GdkWindow *window,
|
||||
if (hprevcursor != NULL)
|
||||
{
|
||||
if (GetCursor() == hprevcursor)
|
||||
SetCursor (NULL);
|
||||
{
|
||||
/* Look for a suitable cursor to use instead */
|
||||
hcursor = NULL;
|
||||
parent_window = GDK_WINDOW_OBJECT (window)->parent;
|
||||
while (hcursor == NULL)
|
||||
{
|
||||
if (parent_window)
|
||||
{
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl);
|
||||
hcursor = impl->hcursor;
|
||||
parent_window = parent_window->parent;
|
||||
}
|
||||
else
|
||||
{
|
||||
hcursor = LoadCursor (NULL, IDC_ARROW);
|
||||
}
|
||||
}
|
||||
SetCursor (hcursor);
|
||||
}
|
||||
|
||||
GDK_NOTE (MISC, g_print ("...DestroyCursor (%p)\n",
|
||||
hprevcursor));
|
||||
@@ -1678,6 +1705,26 @@ gdk_window_get_geometry (GdkWindow *window,
|
||||
if (!GetClientRect (GDK_WINDOW_HWND (window), &rect))
|
||||
WIN32_API_FAILED ("GetClientRect");
|
||||
|
||||
if (window != _gdk_parent_root)
|
||||
{
|
||||
POINT pt;
|
||||
GdkWindow *parent = gdk_window_get_parent (window);
|
||||
|
||||
pt.x = rect.left;
|
||||
pt.y = rect.top;
|
||||
ClientToScreen (GDK_WINDOW_HWND (window), &pt);
|
||||
ScreenToClient (GDK_WINDOW_HWND (parent), &pt);
|
||||
rect.left = pt.x;
|
||||
rect.top = pt.y;
|
||||
|
||||
pt.x = rect.right;
|
||||
pt.y = rect.bottom;
|
||||
ClientToScreen (GDK_WINDOW_HWND (window), &pt);
|
||||
ScreenToClient (GDK_WINDOW_HWND (parent), &pt);
|
||||
rect.right = pt.x;
|
||||
rect.bottom = pt.y;
|
||||
}
|
||||
|
||||
if (x)
|
||||
*x = rect.left;
|
||||
if (y)
|
||||
@@ -1790,7 +1837,7 @@ gdk_window_get_frame_extents (GdkWindow *window,
|
||||
WIN32_API_FAILED ("GetWindowRect");
|
||||
|
||||
rect->x = r.left;
|
||||
rect->y = r.right;
|
||||
rect->y = r.top;
|
||||
rect->width = r.right - r.left;
|
||||
rect->height = r.bottom - r.top;
|
||||
}
|
||||
@@ -1970,7 +2017,7 @@ gdk_window_shape_combine_mask (GdkWindow *window,
|
||||
RECT rect;
|
||||
|
||||
/* Convert mask bitmap to region */
|
||||
hrgn = _gdk_win32_bitmap_to_region (mask);
|
||||
hrgn = _gdk_win32_bitmap_to_hrgn (mask);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %p %p\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
@@ -2074,19 +2121,26 @@ void
|
||||
gdk_window_set_decorations (GdkWindow *window,
|
||||
GdkWMDecoration decorations)
|
||||
{
|
||||
LONG style, exstyle;
|
||||
LONG style;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_set_decorations: %p %s%s%s%s%s%s%s\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
(decorations & GDK_DECOR_ALL ? "ALL " : ""),
|
||||
(decorations & GDK_DECOR_BORDER ? "BORDER " : ""),
|
||||
(decorations & GDK_DECOR_RESIZEH ? "RESIZEH " : ""),
|
||||
(decorations & GDK_DECOR_TITLE ? "TITLE " : ""),
|
||||
(decorations & GDK_DECOR_MENU ? "MENU " : ""),
|
||||
(decorations & GDK_DECOR_MINIMIZE ? "MINIMIZE " : ""),
|
||||
(decorations & GDK_DECOR_MAXIMIZE ? "MAXIMIZE " : "")));
|
||||
|
||||
style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
||||
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
||||
|
||||
style &= (WS_OVERLAPPED|WS_POPUP|WS_CHILD|WS_MINIMIZE|WS_VISIBLE|WS_DISABLED
|
||||
|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZE);
|
||||
|
||||
exstyle &= (WS_EX_TOPMOST|WS_EX_TRANSPARENT);
|
||||
|
||||
if (decorations & GDK_DECOR_ALL)
|
||||
style |= (WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
|
||||
if (decorations & GDK_DECOR_BORDER)
|
||||
@@ -2103,26 +2157,35 @@ gdk_window_set_decorations (GdkWindow *window,
|
||||
style |= (WS_MAXIMIZEBOX);
|
||||
|
||||
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, style);
|
||||
SetWindowPos (GDK_WINDOW_HWND (window), NULL, 0, 0, 0, 0,
|
||||
SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE |
|
||||
SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_set_functions (GdkWindow *window,
|
||||
GdkWMFunction functions)
|
||||
{
|
||||
LONG style, exstyle;
|
||||
LONG style;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_set_functions: %p %s%s%s%s%s%s\n",
|
||||
GDK_WINDOW_HWND (window),
|
||||
(functions & GDK_FUNC_ALL ? "ALL " : ""),
|
||||
(functions & GDK_FUNC_RESIZE ? "RESIZE " : ""),
|
||||
(functions & GDK_FUNC_MOVE ? "MOVE " : ""),
|
||||
(functions & GDK_FUNC_MINIMIZE ? "MINIMIZE " : ""),
|
||||
(functions & GDK_FUNC_MAXIMIZE ? "MAXIMIZE " : ""),
|
||||
(functions & GDK_FUNC_CLOSE ? "CLOSE " : "")));
|
||||
|
||||
style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
||||
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
||||
|
||||
style &= (WS_OVERLAPPED|WS_POPUP|WS_CHILD|WS_MINIMIZE|WS_VISIBLE|WS_DISABLED
|
||||
|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZE|WS_CAPTION|WS_BORDER
|
||||
|WS_SYSMENU);
|
||||
|
||||
exstyle &= (WS_EX_TOPMOST|WS_EX_TRANSPARENT);
|
||||
|
||||
if (functions & GDK_FUNC_ALL)
|
||||
style |= (WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
|
||||
if (functions & GDK_FUNC_RESIZE)
|
||||
@@ -2135,19 +2198,15 @@ gdk_window_set_functions (GdkWindow *window,
|
||||
style |= (WS_MAXIMIZEBOX);
|
||||
|
||||
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, style);
|
||||
SetWindowPos (GDK_WINDOW_HWND (window), NULL, 0, 0, 0, 0,
|
||||
SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE |
|
||||
SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
/*
|
||||
* propagate the shapes from all child windows of a GDK window to the parent
|
||||
* window. Shamelessly ripped from Enlightenment's code
|
||||
*
|
||||
* - Raster
|
||||
*/
|
||||
|
||||
static void
|
||||
QueryTree (HWND hwnd,
|
||||
QueryTree (HWND hwnd,
|
||||
HWND **children,
|
||||
gint *nchildren)
|
||||
gint *nchildren)
|
||||
{
|
||||
guint i, n;
|
||||
HWND child;
|
||||
@@ -2209,6 +2268,7 @@ gdk_propagate_shapes (HANDLE win,
|
||||
}
|
||||
}
|
||||
SetWindowRgn (win, region, TRUE);
|
||||
g_free (list);
|
||||
}
|
||||
else
|
||||
DeleteObject (region);
|
||||
@@ -2238,91 +2298,11 @@ gdk_window_merge_child_shapes (GdkWindow *window)
|
||||
gdk_propagate_shapes (GDK_WINDOW_HWND (window), TRUE);
|
||||
}
|
||||
|
||||
/* Support for windows that can be guffaw-scrolled
|
||||
* (See http://www.gtk.org/~otaylor/whitepapers/guffaw-scrolling.txt)
|
||||
*/
|
||||
|
||||
static gboolean
|
||||
gdk_window_gravity_works (void)
|
||||
{
|
||||
enum { UNKNOWN, NO, YES };
|
||||
static gint gravity_works = UNKNOWN;
|
||||
|
||||
if (gravity_works == UNKNOWN)
|
||||
{
|
||||
GdkWindowAttr attr;
|
||||
GdkWindow *parent;
|
||||
GdkWindow *child;
|
||||
gint y;
|
||||
|
||||
attr.window_type = GDK_WINDOW_TEMP;
|
||||
attr.wclass = GDK_INPUT_OUTPUT;
|
||||
attr.x = 0;
|
||||
attr.y = 0;
|
||||
attr.width = 100;
|
||||
attr.height = 100;
|
||||
attr.event_mask = 0;
|
||||
|
||||
parent = gdk_window_new (NULL, &attr, GDK_WA_X | GDK_WA_Y);
|
||||
|
||||
attr.window_type = GDK_WINDOW_CHILD;
|
||||
child = gdk_window_new (parent, &attr, GDK_WA_X | GDK_WA_Y);
|
||||
|
||||
gdk_window_set_static_win_gravity (child, TRUE);
|
||||
|
||||
gdk_window_resize (parent, 100, 110);
|
||||
gdk_window_move (parent, 0, -10);
|
||||
gdk_window_move_resize (parent, 0, 0, 100, 100);
|
||||
|
||||
gdk_window_resize (parent, 100, 110);
|
||||
gdk_window_move (parent, 0, -10);
|
||||
gdk_window_move_resize (parent, 0, 0, 100, 100);
|
||||
|
||||
gdk_window_get_geometry (child, NULL, &y, NULL, NULL, NULL);
|
||||
|
||||
gdk_window_destroy (parent);
|
||||
gdk_window_destroy (child);
|
||||
|
||||
gravity_works = ((y == -20) ? YES : NO);
|
||||
}
|
||||
|
||||
return (gravity_works == YES);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_set_static_bit_gravity (GdkWindow *window, gboolean on)
|
||||
{
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_set_static_bit_gravity: Not implemented\n"));
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_set_static_win_gravity (GdkWindow *window, gboolean on)
|
||||
{
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_set_static_win_gravity: Not implemented\n"));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* gdk_window_set_static_gravities:
|
||||
* Set the bit gravity of the given window to static,
|
||||
* and flag it so all children get static subwindow
|
||||
* gravity.
|
||||
* arguments:
|
||||
* window: window for which to set static gravity
|
||||
* use_static: Whether to turn static gravity on or off.
|
||||
* results:
|
||||
* Does the XServer support static gravity?
|
||||
*************************************************************/
|
||||
|
||||
gboolean
|
||||
gdk_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static)
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GList *tmp_list;
|
||||
|
||||
g_return_val_if_fail (window != NULL, FALSE);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
||||
@@ -2330,24 +2310,11 @@ gdk_window_set_static_gravities (GdkWindow *window,
|
||||
if (!use_static == !private->guffaw_gravity)
|
||||
return TRUE;
|
||||
|
||||
if (use_static && !gdk_window_gravity_works ())
|
||||
if (use_static)
|
||||
return FALSE;
|
||||
|
||||
private->guffaw_gravity = use_static;
|
||||
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
{
|
||||
gdk_window_set_static_bit_gravity (window, use_static);
|
||||
|
||||
tmp_list = private->children;
|
||||
while (tmp_list)
|
||||
{
|
||||
gdk_window_set_static_win_gravity (window, use_static);
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -2508,7 +2475,7 @@ gdk_window_set_modal_hint (GdkWindow *window,
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
if (!SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOPMOST,
|
||||
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
|
||||
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
|
||||
WIN32_API_FAILED ("SetWindowPos");
|
||||
}
|
||||
|
||||
@@ -2539,7 +2506,7 @@ gdk_window_set_type_hint (GdkWindow *window,
|
||||
/*
|
||||
* XXX ???
|
||||
*/
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_set_type_hint (%p)\n",
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_set_type_hint: %p\n",
|
||||
GDK_WINDOW_HWND (window)));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ VS_VERSION_INFO VERSIONINFO
|
||||
VALUE "FileDescription", "GIMP Drawing Kit"
|
||||
VALUE "FileVersion", "@GTK_VERSION@.BUILDNUMBER"
|
||||
VALUE "InternalName", "libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@"
|
||||
VALUE "LegalCopyright", "Copyright © 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2001."
|
||||
VALUE "LegalCopyright", "Copyright © 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2002."
|
||||
VALUE "OriginalFilename", "libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll"
|
||||
VALUE "ProductName", "GTK+"
|
||||
VALUE "ProductVersion", "@GTK_VERSION@"
|
||||
|
||||
+4
-1
@@ -88,4 +88,7 @@ EXTRA_DIST = \
|
||||
gdkinput-x11.c \
|
||||
gdkinput-xfree.c \
|
||||
gdkinput-gxi.c \
|
||||
gdkinput-none.c
|
||||
gdkinput-none.c \
|
||||
gxid_lib.c \
|
||||
gxid_lib.h \
|
||||
gxid_proto.h
|
||||
|
||||
+56
-14
@@ -248,25 +248,13 @@ gdk_colormap_new (GdkVisual *visual,
|
||||
return colormap;
|
||||
}
|
||||
|
||||
#define MIN_SYNC_TIME 2
|
||||
|
||||
static void
|
||||
gdk_colormap_sync (GdkColormap *colormap,
|
||||
gboolean force)
|
||||
gdk_colormap_sync_palette (GdkColormap *colormap)
|
||||
{
|
||||
time_t current_time;
|
||||
GdkColormapPrivateX11 *private = GDK_COLORMAP_PRIVATE_DATA (colormap);
|
||||
XColor *xpalette;
|
||||
gint nlookup;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (GDK_IS_COLORMAP (colormap));
|
||||
|
||||
current_time = time (NULL);
|
||||
if (!force && ((current_time - private->last_sync_time) < MIN_SYNC_TIME))
|
||||
return;
|
||||
|
||||
private->last_sync_time = current_time;
|
||||
|
||||
nlookup = 0;
|
||||
xpalette = g_new (XColor, colormap->size);
|
||||
@@ -296,6 +284,60 @@ gdk_colormap_sync (GdkColormap *colormap,
|
||||
|
||||
g_free (xpalette);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_colormap_sync_direct_color (GdkColormap *colormap)
|
||||
{
|
||||
GdkColormapPrivateX11 *private = GDK_COLORMAP_PRIVATE_DATA (colormap);
|
||||
GdkVisual *visual = colormap->visual;
|
||||
XColor *xpalette;
|
||||
gint i;
|
||||
|
||||
xpalette = g_new (XColor, colormap->size);
|
||||
|
||||
for (i = 0; i < colormap->size; i++)
|
||||
{
|
||||
xpalette[i].pixel =
|
||||
(((i << visual->red_shift) & visual->red_mask) |
|
||||
((i << visual->green_shift) & visual->green_mask) |
|
||||
((i << visual->blue_shift) & visual->blue_mask));
|
||||
}
|
||||
|
||||
XQueryColors (gdk_display, private->xcolormap, xpalette, colormap->size);
|
||||
|
||||
for (i = 0; i < colormap->size; i++)
|
||||
{
|
||||
colormap->colors[i].pixel = xpalette[i].pixel;
|
||||
colormap->colors[i].red = xpalette[i].red;
|
||||
colormap->colors[i].green = xpalette[i].green;
|
||||
colormap->colors[i].blue = xpalette[i].blue;
|
||||
}
|
||||
|
||||
g_free (xpalette);
|
||||
}
|
||||
|
||||
#define MIN_SYNC_TIME 2
|
||||
|
||||
static void
|
||||
gdk_colormap_sync (GdkColormap *colormap,
|
||||
gboolean force)
|
||||
{
|
||||
time_t current_time;
|
||||
GdkColormapPrivateX11 *private = GDK_COLORMAP_PRIVATE_DATA (colormap);
|
||||
|
||||
g_return_if_fail (GDK_IS_COLORMAP (colormap));
|
||||
|
||||
current_time = time (NULL);
|
||||
if (!force && ((current_time - private->last_sync_time) < MIN_SYNC_TIME))
|
||||
return;
|
||||
|
||||
private->last_sync_time = current_time;
|
||||
|
||||
if (colormap->visual->type == GDK_VISUAL_DIRECT_COLOR)
|
||||
gdk_colormap_sync_direct_color (colormap);
|
||||
else
|
||||
gdk_colormap_sync_palette (colormap);
|
||||
}
|
||||
|
||||
|
||||
GdkColormap*
|
||||
@@ -331,10 +373,10 @@ gdk_colormap_get_system (void)
|
||||
/* Fall through */
|
||||
case GDK_VISUAL_STATIC_GRAY:
|
||||
case GDK_VISUAL_STATIC_COLOR:
|
||||
case GDK_VISUAL_DIRECT_COLOR:
|
||||
colormap->colors = g_new (GdkColor, colormap->size);
|
||||
gdk_colormap_sync (colormap, TRUE);
|
||||
|
||||
case GDK_VISUAL_DIRECT_COLOR:
|
||||
case GDK_VISUAL_TRUE_COLOR:
|
||||
break;
|
||||
}
|
||||
|
||||
+37
-3
@@ -335,6 +335,8 @@ gdk_window_cache_filter (GdkXEvent *xev,
|
||||
node->prev = above_node->prev;
|
||||
if (node->prev)
|
||||
node->prev->next = node;
|
||||
else
|
||||
cache->children = node;
|
||||
node->next = above_node;
|
||||
above_node->prev = node;
|
||||
}
|
||||
@@ -1740,6 +1742,10 @@ motif_dnd_filter (GdkXEvent *xev,
|
||||
Atom atom;
|
||||
gint16 x_root, y_root;
|
||||
gboolean is_reply;
|
||||
|
||||
if (!event->any.window ||
|
||||
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
|
||||
return GDK_FILTER_CONTINUE; /* Not for us */
|
||||
|
||||
/* First read some fields common to all Motif DND messages */
|
||||
|
||||
@@ -1878,6 +1884,10 @@ xdnd_status_filter (GdkXEvent *xev,
|
||||
guint32 flags = xevent->xclient.data.l[1];
|
||||
Atom action = xevent->xclient.data.l[4];
|
||||
GdkDragContext *context;
|
||||
|
||||
if (!event->any.window ||
|
||||
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
|
||||
return GDK_FILTER_CONTINUE; /* Not for us */
|
||||
|
||||
GDK_NOTE (DND,
|
||||
g_message ("XdndStatus: dest_window: %#x action: %ld",
|
||||
@@ -1920,6 +1930,10 @@ xdnd_finished_filter (GdkXEvent *xev,
|
||||
XEvent *xevent = (XEvent *)xev;
|
||||
guint32 dest_window = xevent->xclient.data.l[0];
|
||||
GdkDragContext *context;
|
||||
|
||||
if (!event->any.window ||
|
||||
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
|
||||
return GDK_FILTER_CONTINUE; /* Not for us */
|
||||
|
||||
GDK_NOTE (DND,
|
||||
g_message ("XdndFinished: dest_window: %#x", dest_window));
|
||||
@@ -2371,9 +2385,17 @@ xdnd_enter_filter (GdkXEvent *xev,
|
||||
gulong nitems, after;
|
||||
Atom *data;
|
||||
|
||||
guint32 source_window = xevent->xclient.data.l[0];
|
||||
gboolean get_types = ((xevent->xclient.data.l[1] & 1) != 0);
|
||||
gint version = (xevent->xclient.data.l[1] & 0xff000000) >> 24;
|
||||
guint32 source_window;
|
||||
gboolean get_types;
|
||||
gint version;
|
||||
|
||||
if (!event->any.window ||
|
||||
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
|
||||
return GDK_FILTER_CONTINUE; /* Not for us */
|
||||
|
||||
source_window = xevent->xclient.data.l[0];
|
||||
get_types = ((xevent->xclient.data.l[1] & 1) != 0);
|
||||
version = (xevent->xclient.data.l[1] & 0xff000000) >> 24;
|
||||
|
||||
GDK_NOTE (DND,
|
||||
g_message ("XdndEnter: source_window: %#x, version: %#x",
|
||||
@@ -2472,6 +2494,10 @@ xdnd_leave_filter (GdkXEvent *xev,
|
||||
g_message ("XdndLeave: source_window: %#x",
|
||||
source_window));
|
||||
|
||||
if (!event->any.window ||
|
||||
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
|
||||
return GDK_FILTER_CONTINUE; /* Not for us */
|
||||
|
||||
if ((current_dest_drag != NULL) &&
|
||||
(current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
|
||||
(GDK_DRAWABLE_XID (current_dest_drag->source_window) == source_window))
|
||||
@@ -2499,6 +2525,10 @@ xdnd_position_filter (GdkXEvent *xev,
|
||||
gint16 y_root = xevent->xclient.data.l[2] & 0xffff;
|
||||
guint32 time = xevent->xclient.data.l[3];
|
||||
Atom action = xevent->xclient.data.l[4];
|
||||
|
||||
if (!event->any.window ||
|
||||
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
|
||||
return GDK_FILTER_CONTINUE; /* Not for us */
|
||||
|
||||
GDK_NOTE (DND,
|
||||
g_message ("XdndPosition: source_window: %#x position: (%d, %d) time: %d action: %ld",
|
||||
@@ -2539,6 +2569,10 @@ xdnd_drop_filter (GdkXEvent *xev,
|
||||
XEvent *xevent = (XEvent *)xev;
|
||||
guint32 source_window = xevent->xclient.data.l[0];
|
||||
guint32 time = xevent->xclient.data.l[2];
|
||||
|
||||
if (!event->any.window ||
|
||||
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
|
||||
return GDK_FILTER_CONTINUE; /* Not for us */
|
||||
|
||||
GDK_NOTE (DND,
|
||||
g_message ("XdndDrop: source_window: %#x time: %d",
|
||||
|
||||
@@ -1285,7 +1285,8 @@ gdk_x11_draw_pixbuf (GdkDrawable *drawable,
|
||||
|
||||
if (format_type == FORMAT_NONE ||
|
||||
!gdk_pixbuf_get_has_alpha (pixbuf) ||
|
||||
(dither == GDK_RGB_DITHER_MAX && gdk_drawable_get_depth (drawable) != 24))
|
||||
(dither == GDK_RGB_DITHER_MAX && gdk_drawable_get_depth (drawable) != 24) ||
|
||||
gdk_x11_drawable_get_picture (drawable) == None)
|
||||
{
|
||||
GdkDrawable *wrapper = GDK_DRAWABLE_IMPL_X11 (drawable)->wrapper;
|
||||
GDK_DRAWABLE_CLASS (parent_class)->_draw_pixbuf (wrapper, gc, pixbuf,
|
||||
|
||||
+37
-14
@@ -304,7 +304,8 @@ gdk_check_wm_state_changed (GdkWindow *window)
|
||||
gboolean found_sticky, found_maxvert, found_maxhorz;
|
||||
GdkWindowState old_state;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL)
|
||||
return;
|
||||
|
||||
if (wm_state_atom == 0)
|
||||
@@ -665,6 +666,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
charcount = XLookupString (&xevent->xkey, buf, 16,
|
||||
&keysym, &compose);
|
||||
event->key.keyval = keysym;
|
||||
event->key.hardware_keycode = xevent->xkey.keycode;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("key release:\t\twindow: %ld key: %12s %d",
|
||||
@@ -1010,10 +1012,20 @@ gdk_event_translate (GdkEvent *event,
|
||||
case NotifyNonlinear:
|
||||
case NotifyVirtual:
|
||||
case NotifyNonlinearVirtual:
|
||||
window_impl->has_focus = TRUE;
|
||||
/* We pretend that the focus moves to the grab
|
||||
* window, so we pay attention to NotifyGrab
|
||||
* NotifyUngrab, and ignore NotifyWhileGrabbed
|
||||
*/
|
||||
if (xevent->xfocus.mode != NotifyWhileGrabbed)
|
||||
window_impl->has_focus = TRUE;
|
||||
break;
|
||||
case NotifyPointer:
|
||||
window_impl->has_pointer_focus = TRUE;
|
||||
/* The X server sends NotifyPointer/NotifyGrab,
|
||||
* but the pointer focus is ignored while a
|
||||
* grab is in effect
|
||||
*/
|
||||
if (xevent->xfocus.mode != NotifyGrab)
|
||||
window_impl->has_pointer_focus = TRUE;
|
||||
break;
|
||||
case NotifyInferior:
|
||||
case NotifyPointerRoot:
|
||||
@@ -1039,10 +1051,12 @@ gdk_event_translate (GdkEvent *event,
|
||||
case NotifyNonlinear:
|
||||
case NotifyVirtual:
|
||||
case NotifyNonlinearVirtual:
|
||||
window_impl->has_focus = FALSE;
|
||||
if (xevent->xfocus.mode != NotifyWhileGrabbed)
|
||||
window_impl->has_focus = FALSE;
|
||||
break;
|
||||
case NotifyPointer:
|
||||
window_impl->has_pointer_focus = FALSE;
|
||||
if (xevent->xfocus.mode != NotifyUngrab)
|
||||
window_impl->has_pointer_focus = FALSE;
|
||||
break;
|
||||
case NotifyInferior:
|
||||
case NotifyPointerRoot:
|
||||
@@ -1311,13 +1325,17 @@ gdk_event_translate (GdkEvent *event,
|
||||
? " (discarding)"
|
||||
: GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD
|
||||
? " (discarding child)"
|
||||
: xevent->xconfigure.event != xevent->xconfigure.window
|
||||
? " (discarding substructure)"
|
||||
: ""));
|
||||
if (window &&
|
||||
xevent->xconfigure.event == xevent->xconfigure.window &&
|
||||
!GDK_WINDOW_DESTROYED (window) &&
|
||||
(window_private->extension_events != 0))
|
||||
_gdk_input_configure_event (&xevent->xconfigure, window);
|
||||
|
||||
if (!window ||
|
||||
xevent->xconfigure.event != xevent->xconfigure.window ||
|
||||
GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD ||
|
||||
GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT)
|
||||
return_val = FALSE;
|
||||
@@ -1387,12 +1405,6 @@ gdk_event_translate (GdkEvent *event,
|
||||
break;
|
||||
}
|
||||
|
||||
event->property.type = GDK_PROPERTY_NOTIFY;
|
||||
event->property.window = window;
|
||||
event->property.atom = gdk_x11_xatom_to_atom (xevent->xproperty.atom);
|
||||
event->property.time = xevent->xproperty.time;
|
||||
event->property.state = xevent->xproperty.state;
|
||||
|
||||
if (wm_state_atom == 0)
|
||||
wm_state_atom = gdk_x11_get_xatom_by_name ("_NET_WM_STATE");
|
||||
|
||||
@@ -1403,9 +1415,20 @@ gdk_event_translate (GdkEvent *event,
|
||||
xevent->xproperty.atom == wm_desktop_atom)
|
||||
{
|
||||
/* If window state changed, then synthesize those events. */
|
||||
gdk_check_wm_state_changed (event->property.window);
|
||||
gdk_check_wm_state_changed (window);
|
||||
}
|
||||
|
||||
|
||||
if (window_private->event_mask & GDK_PROPERTY_CHANGE_MASK)
|
||||
{
|
||||
event->property.type = GDK_PROPERTY_NOTIFY;
|
||||
event->property.window = window;
|
||||
event->property.atom = gdk_x11_xatom_to_atom (xevent->xproperty.atom);
|
||||
event->property.time = xevent->xproperty.time;
|
||||
event->property.state = xevent->xproperty.state;
|
||||
}
|
||||
else
|
||||
return_val = FALSE;
|
||||
|
||||
break;
|
||||
|
||||
case SelectionClear:
|
||||
@@ -2076,7 +2099,7 @@ gdk_xsettings_notify_cb (const char *name,
|
||||
for (i = 0; i < G_N_ELEMENTS (settings_map) ; i++)
|
||||
if (strcmp (settings_map[i].xsettings_name, name) == 0)
|
||||
{
|
||||
new_event.setting.name = g_strdup (settings_map[i].gdk_name);
|
||||
new_event.setting.name = settings_map[i].gdk_name;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+28
-5
@@ -54,6 +54,13 @@ update_keyrange (void)
|
||||
#ifdef HAVE_XKB
|
||||
#include <X11/XKBlib.h>
|
||||
|
||||
/* OSF-4.0 is apparently missing this macro
|
||||
*/
|
||||
#ifndef XkbKeySymEntry
|
||||
#define XkbKeySymEntry(d,k,sl,g) \
|
||||
(XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))))
|
||||
#endif
|
||||
|
||||
gboolean _gdk_use_xkb = FALSE;
|
||||
gint _gdk_xkb_event_type;
|
||||
static XkbDescPtr xkb_desc = NULL;
|
||||
@@ -147,7 +154,7 @@ update_keymaps (void)
|
||||
XFreeModifiermap (mod_keymap);
|
||||
|
||||
keymap = XGetKeyboardMapping (gdk_display, min_keycode,
|
||||
max_keycode - min_keycode,
|
||||
max_keycode - min_keycode + 1,
|
||||
&keysyms_per_keycode);
|
||||
|
||||
|
||||
@@ -157,7 +164,7 @@ update_keymaps (void)
|
||||
* we we fudge the map here.
|
||||
*/
|
||||
keycode = min_keycode;
|
||||
while (keycode < max_keycode)
|
||||
while (keycode <= max_keycode)
|
||||
{
|
||||
KeySym *syms = keymap + (keycode - min_keycode) * keysyms_per_keycode;
|
||||
/* Check both groups */
|
||||
@@ -211,6 +218,21 @@ update_keymaps (void)
|
||||
{
|
||||
gint j = 0;
|
||||
KeySym *syms = keymap + (keycode - min_keycode) * keysyms_per_keycode;
|
||||
|
||||
/* GDK_MOD1_MASK is 1 << 3 for example, i.e. the
|
||||
* fourth modifier, i / keyspermod is the modifier
|
||||
* index
|
||||
*/
|
||||
guint mask = 1 << ( i / mod_keymap->max_keypermod);
|
||||
|
||||
/* Some keyboard maps are known to map Mode_Switch as an extra
|
||||
* Mod1 key. In circumstances like that, it won't be used to
|
||||
* switch groups.
|
||||
*/
|
||||
if (mask == GDK_CONTROL_MASK || mask == GDK_SHIFT_MASK ||
|
||||
mask == GDK_LOCK_MASK || mask == GDK_MOD1_MASK)
|
||||
goto next;
|
||||
|
||||
while (j < keysyms_per_keycode)
|
||||
{
|
||||
if (syms[j] == GDK_Mode_switch)
|
||||
@@ -222,14 +244,15 @@ update_keymaps (void)
|
||||
* index
|
||||
*/
|
||||
|
||||
group_switch_mask |= (1 << ( i / mod_keymap->max_keypermod));
|
||||
group_switch_mask |= mask;
|
||||
break;
|
||||
}
|
||||
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
next:
|
||||
++i;
|
||||
}
|
||||
}
|
||||
@@ -407,7 +430,7 @@ gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
|
||||
gint keycode;
|
||||
|
||||
keycode = min_keycode;
|
||||
while (keycode < max_keycode)
|
||||
while (keycode <= max_keycode)
|
||||
{
|
||||
const KeySym *syms = map + (keycode - min_keycode) * keysyms_per_keycode;
|
||||
gint i = 0;
|
||||
|
||||
@@ -112,6 +112,78 @@ GdkArgDesc _gdk_windowing_args[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/*
|
||||
* XLib internal connection handling
|
||||
*/
|
||||
typedef struct _GdkInternalConnection GdkInternalConnection;
|
||||
|
||||
struct _GdkInternalConnection
|
||||
{
|
||||
gint fd;
|
||||
GSource *source;
|
||||
Display *display;
|
||||
};
|
||||
|
||||
static gboolean
|
||||
process_internal_connection (GIOChannel *gioc,
|
||||
GIOCondition cond,
|
||||
gpointer data)
|
||||
{
|
||||
GdkInternalConnection *connection = (GdkInternalConnection *)data;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
XProcessInternalConnection ((Display*)connection->display, connection->fd);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GdkInternalConnection *
|
||||
gdk_add_connection_handler (Display *display,
|
||||
guint fd)
|
||||
{
|
||||
GIOChannel *io_channel;
|
||||
GdkInternalConnection *connection;
|
||||
|
||||
connection = g_new (GdkInternalConnection, 1);
|
||||
|
||||
connection->fd = fd;
|
||||
connection->display = display;
|
||||
|
||||
io_channel = g_io_channel_unix_new (fd);
|
||||
|
||||
connection->source = g_io_create_watch (io_channel, G_IO_IN);
|
||||
g_source_set_callback (connection->source,
|
||||
(GSourceFunc)process_internal_connection, connection, NULL);
|
||||
g_source_attach (connection->source, NULL);
|
||||
|
||||
g_io_channel_unref (io_channel);
|
||||
|
||||
return connection;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_remove_connection_handler (GdkInternalConnection *connection)
|
||||
{
|
||||
g_source_destroy (connection->source);
|
||||
g_free (connection);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_internal_connection_watch (Display *display,
|
||||
XPointer arg,
|
||||
gint fd,
|
||||
gboolean opening,
|
||||
XPointer *watch_data)
|
||||
{
|
||||
if (opening)
|
||||
*watch_data = (XPointer)gdk_add_connection_handler (display, fd);
|
||||
else
|
||||
gdk_remove_connection_handler ((GdkInternalConnection *)*watch_data);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_windowing_init_check (int argc, char **argv)
|
||||
{
|
||||
@@ -127,6 +199,8 @@ _gdk_windowing_init_check (int argc, char **argv)
|
||||
gdk_display = XOpenDisplay (_gdk_display_name);
|
||||
if (!gdk_display)
|
||||
return FALSE;
|
||||
|
||||
XAddConnectionWatch (gdk_display, gdk_internal_connection_watch, NULL);
|
||||
|
||||
if (gdk_synchronize)
|
||||
XSynchronize (gdk_display, True);
|
||||
|
||||
@@ -162,14 +162,14 @@ gdk_pixmap_new (GdkWindow *window,
|
||||
GdkColormap *cmap;
|
||||
gint window_depth;
|
||||
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_DRAWABLE (window), NULL);
|
||||
g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
|
||||
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
|
||||
|
||||
if (!window)
|
||||
window = _gdk_parent_root;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
if (GDK_IS_WINDOW (window) && GDK_WINDOW_DESTROYED (window))
|
||||
return NULL;
|
||||
|
||||
window_depth = gdk_drawable_get_depth (GDK_DRAWABLE (window));
|
||||
@@ -215,12 +215,12 @@ gdk_bitmap_create_from_data (GdkWindow *window,
|
||||
|
||||
g_return_val_if_fail (data != NULL, NULL);
|
||||
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_DRAWABLE (window), NULL);
|
||||
|
||||
if (!window)
|
||||
window = _gdk_parent_root;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
if (GDK_IS_WINDOW (window) && GDK_WINDOW_DESTROYED (window))
|
||||
return NULL;
|
||||
|
||||
pixmap = g_object_new (gdk_pixmap_get_type (), NULL);
|
||||
@@ -256,7 +256,7 @@ gdk_pixmap_create_from_data (GdkWindow *window,
|
||||
GdkDrawableImplX11 *draw_impl;
|
||||
GdkPixmapImplX11 *pix_impl;
|
||||
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_DRAWABLE (window), NULL);
|
||||
g_return_val_if_fail (data != NULL, NULL);
|
||||
g_return_val_if_fail (fg != NULL, NULL);
|
||||
g_return_val_if_fail (bg != NULL, NULL);
|
||||
@@ -266,7 +266,7 @@ gdk_pixmap_create_from_data (GdkWindow *window,
|
||||
if (!window)
|
||||
window = _gdk_parent_root;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
if (GDK_IS_WINDOW (window) && GDK_WINDOW_DESTROYED (window))
|
||||
return NULL;
|
||||
|
||||
if (depth == -1)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user