Compare commits
332 Commits
cancelatio
...
GTK_2_2_2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b4349a1bf | ||
|
|
fc2068e314 | ||
|
|
4867aedf79 | ||
|
|
5c0c274d81 | ||
|
|
02c32756ef | ||
|
|
7ac4f264a7 | ||
|
|
378a7488fb | ||
|
|
500bca8af3 | ||
|
|
f1bcb52ccb | ||
|
|
6a422f88bc | ||
|
|
995098e65e | ||
|
|
afa7fb3730 | ||
|
|
9ec02189ad | ||
|
|
58877f347b | ||
|
|
f1ac2debf5 | ||
|
|
108ab31b50 | ||
|
|
cd47f2bcef | ||
|
|
8af31223af | ||
|
|
81cde9d6cb | ||
|
|
5213be07e0 | ||
|
|
7db52619ba | ||
|
|
69881e62ca | ||
|
|
ee4333f91e | ||
|
|
5ee5ee3f6a | ||
|
|
03d2e8be66 | ||
|
|
3bb07953e6 | ||
|
|
b07b60261c | ||
|
|
2866fc45f4 | ||
|
|
ba6e0c4c63 | ||
|
|
83202df4d2 | ||
|
|
90b8285dda | ||
|
|
7f93523dd5 | ||
|
|
f5397b4d79 | ||
|
|
d55fe6c466 | ||
|
|
4e93f24b89 | ||
|
|
f856e7a5a2 | ||
|
|
03baed131e | ||
|
|
62f6e1b8c0 | ||
|
|
c5f5550f3c | ||
|
|
c42aa348c1 | ||
|
|
0fb6bcbf96 | ||
|
|
6520b9b607 | ||
|
|
c311d5092e | ||
|
|
541c59df2b | ||
|
|
f79c3a2434 | ||
|
|
6e260ca284 | ||
|
|
16e1a7e5f0 | ||
|
|
8cbf4cec97 | ||
|
|
8bc79c100d | ||
|
|
ce3fc77ad8 | ||
|
|
7e1a54df8b | ||
|
|
edf71ecbfe | ||
|
|
9108c09a0c | ||
|
|
d87e3afe12 | ||
|
|
892034a7c0 | ||
|
|
5087bb771a | ||
|
|
ff585a1bbe | ||
|
|
5614108365 | ||
|
|
52cf94a376 | ||
|
|
d8be69ef4c | ||
|
|
00dfe44873 | ||
|
|
39fc17f19a | ||
|
|
3932f96618 | ||
|
|
1eb3a99535 | ||
|
|
e9598560eb | ||
|
|
ba3dec7e39 | ||
|
|
60bada5f3a | ||
|
|
e6a5873929 | ||
|
|
ca973340c0 | ||
|
|
b4046f7c40 | ||
|
|
a0c3fd29df | ||
|
|
d4a787f2e1 | ||
|
|
2ab81b8093 | ||
|
|
4dfc635844 | ||
|
|
6a60f3a6b8 | ||
|
|
8d97bc30c9 | ||
|
|
0ed62104fe | ||
|
|
1a866a56a4 | ||
|
|
bec6497cca | ||
|
|
321c717741 | ||
|
|
8169f009fe | ||
|
|
9579817d6d | ||
|
|
539579842d | ||
|
|
0df1bbcddf | ||
|
|
cc02e55884 | ||
|
|
3d5517fe1d | ||
|
|
8770b66c61 | ||
|
|
9c8be35b4d | ||
|
|
019bac19a9 | ||
|
|
f3af493c21 | ||
|
|
b0ed6224db | ||
|
|
f576f5c347 | ||
|
|
5f3ce6afb8 | ||
|
|
2775064ab9 | ||
|
|
43bb83247c | ||
|
|
6fcc8afa85 | ||
|
|
26c2ef7525 | ||
|
|
e2fd1e2e12 | ||
|
|
02c952be3b | ||
|
|
726ab80ef8 | ||
|
|
2bd2eb857a | ||
|
|
7c1ea2572d | ||
|
|
a0c6c59e99 | ||
|
|
4482f32ba3 | ||
|
|
29dd4ce719 | ||
|
|
5ff77be3b8 | ||
|
|
69c9e13238 | ||
|
|
a5a4baf9f2 | ||
|
|
1b5ca9a190 | ||
|
|
1d2bf8a0c2 | ||
|
|
b86a2d2081 | ||
|
|
a2581917fe | ||
|
|
efddc90261 | ||
|
|
c71076d867 | ||
|
|
03410cd372 | ||
|
|
11a1a8a9fa | ||
|
|
de7ab66507 | ||
|
|
980dfbd7f7 | ||
|
|
1c8652ca31 | ||
|
|
b607f4bfc2 | ||
|
|
fdade41dc6 | ||
|
|
a6e7fe0e89 | ||
|
|
b398a85b23 | ||
|
|
4542e6540b | ||
|
|
3f4dbc8e4e | ||
|
|
784ce6172a | ||
|
|
ceb0100826 | ||
|
|
88fab9d287 | ||
|
|
99746d0055 | ||
|
|
bb527c2735 | ||
|
|
2bd7e4fc18 | ||
|
|
a5e86bd040 | ||
|
|
93436df139 | ||
|
|
ace5e01e0b | ||
|
|
51d83aa47a | ||
|
|
3958a82a34 | ||
|
|
42b4c8eb25 | ||
|
|
5c3af4861b | ||
|
|
93ccf6b68d | ||
|
|
dc7b32f61d | ||
|
|
9ad8ce84a8 | ||
|
|
2ad38a256d | ||
|
|
c3f1c61dbe | ||
|
|
227089828d | ||
|
|
ae9279670d | ||
|
|
d2e38059ae | ||
|
|
674abdaffc | ||
|
|
b200136fcc | ||
|
|
d17502a3e6 | ||
|
|
c5a4f595a3 | ||
|
|
6b92fe3b91 | ||
|
|
ff0cfb41aa | ||
|
|
04e870ec3e | ||
|
|
8dbab57eea | ||
|
|
fb6020965e | ||
|
|
6e75060586 | ||
|
|
3799561d29 | ||
|
|
bdf8146460 | ||
|
|
ad2398fdb1 | ||
|
|
1ca748d939 | ||
|
|
6cdff52aea | ||
|
|
abf0c05b30 | ||
|
|
4e3be2565d | ||
|
|
336912e2d4 | ||
|
|
2ce2e1ae81 | ||
|
|
a44b4fc401 | ||
|
|
1ac718dc29 | ||
|
|
49ec780bf6 | ||
|
|
1dfc733639 | ||
|
|
2470cdfb9e | ||
|
|
b28585cdc3 | ||
|
|
298f6d6b26 | ||
|
|
04f4e45e3e | ||
|
|
b4ee5eb756 | ||
|
|
abb203785f | ||
|
|
1c874acf8e | ||
|
|
22d5e6810a | ||
|
|
0f05a797f7 | ||
|
|
c16d0688db | ||
|
|
fe57bdd25b | ||
|
|
0b4b76ccef | ||
|
|
6308577b27 | ||
|
|
e4639db608 | ||
|
|
9a03f0a699 | ||
|
|
3c0467684a | ||
|
|
bac86f2f41 | ||
|
|
1a887b84e1 | ||
|
|
1a3e754aee | ||
|
|
8193e914cd | ||
|
|
101169bbba | ||
|
|
1f6aa5cea0 | ||
|
|
e4ca8e5c7c | ||
|
|
2c15776323 | ||
|
|
c6b0234335 | ||
|
|
dce4d33e87 | ||
|
|
f939818579 | ||
|
|
07a15aa307 | ||
|
|
77e7300a4e | ||
|
|
a4a82906b9 | ||
|
|
8b0a09438f | ||
|
|
26dfa43f87 | ||
|
|
5fbdd480c0 | ||
|
|
2f44686915 | ||
|
|
01059ca925 | ||
|
|
1de5e09f78 | ||
|
|
c6ba891676 | ||
|
|
62fbfc2f50 | ||
|
|
6a02a78342 | ||
|
|
c43bf5f692 | ||
|
|
79d52607b2 | ||
|
|
18fb6bc786 | ||
|
|
4be242e03c | ||
|
|
629b9c3241 | ||
|
|
cc82e4fb09 | ||
|
|
85953f9bf9 | ||
|
|
45b99c1223 | ||
|
|
af76072dbd | ||
|
|
3b7ca9fdba | ||
|
|
2e58f2eb4b | ||
|
|
ea243d2ea9 | ||
|
|
4cd9b035c7 | ||
|
|
a9773cd5f6 | ||
|
|
bb0a15ea85 | ||
|
|
a5fce9f76b | ||
|
|
09d376434e | ||
|
|
6351823847 | ||
|
|
d76994c16c | ||
|
|
693d39cf9c | ||
|
|
52e625e6a8 | ||
|
|
6ddca5edab | ||
|
|
0babe29777 | ||
|
|
fcf6f344bb | ||
|
|
f71d4457e0 | ||
|
|
3698534cb6 | ||
|
|
6ee90b280f | ||
|
|
d71067c57a | ||
|
|
f2955b204a | ||
|
|
0eca9ef242 | ||
|
|
f15893e1bd | ||
|
|
ba55a05b73 | ||
|
|
c687d2c7a4 | ||
|
|
f117e39e0d | ||
|
|
e4e126ce70 | ||
|
|
5054c1cab4 | ||
|
|
bb27defe19 | ||
|
|
ad891783f2 | ||
|
|
bd8e4ec9c7 | ||
|
|
56bf242952 | ||
|
|
b05973ad54 | ||
|
|
eb6822c2ca | ||
|
|
69e5d23af7 | ||
|
|
94d641664a | ||
|
|
b11de91341 | ||
|
|
f1a895f5cf | ||
|
|
d7fc46eb8a | ||
|
|
b5ebedc782 | ||
|
|
c012d1fe9e | ||
|
|
b92af6e16b | ||
|
|
43de9ea350 | ||
|
|
9bc1460bca | ||
|
|
acd43b3ee6 | ||
|
|
0745fd5c6c | ||
|
|
592df75970 | ||
|
|
545ef43527 | ||
|
|
fee332c6dc | ||
|
|
6ab8762032 | ||
|
|
704fd74f2b | ||
|
|
d23d7f9916 | ||
|
|
f1f9bf8a38 | ||
|
|
b0e495309d | ||
|
|
1e11759ffd | ||
|
|
30a9e56179 | ||
|
|
a3883873ce | ||
|
|
9c99f64bda | ||
|
|
d87fb4cab8 | ||
|
|
1f1e466e88 | ||
|
|
715f735051 | ||
|
|
4184031fab | ||
|
|
9ef77ef39c | ||
|
|
7e12070078 | ||
|
|
a5c0d28e10 | ||
|
|
e0c849739d | ||
|
|
a0f421f6eb | ||
|
|
d703d86055 | ||
|
|
58ee037434 | ||
|
|
6d006849aa | ||
|
|
8fcedda777 | ||
|
|
45e801df00 | ||
|
|
02dbda7fac | ||
|
|
15f799d645 | ||
|
|
365bd26d3c | ||
|
|
e344b9e864 | ||
|
|
a4f1d8e6ea | ||
|
|
1657870198 | ||
|
|
d90f3e1479 | ||
|
|
32caaf841d | ||
|
|
c84b10e5bb | ||
|
|
f4504ac5a2 | ||
|
|
e578482657 | ||
|
|
d941e11496 | ||
|
|
2db9f4acbe | ||
|
|
4a9a6598f0 | ||
|
|
2ec3761ee7 | ||
|
|
ad7a7fac4b | ||
|
|
2b09353851 | ||
|
|
7710e3111d | ||
|
|
0a35750777 | ||
|
|
6b6dfd7fe6 | ||
|
|
2a5cb4e974 | ||
|
|
2159b143c4 | ||
|
|
df954de178 | ||
|
|
cbf87cfed9 | ||
|
|
c50b328eb9 | ||
|
|
2183d21b12 | ||
|
|
ca8a6763ea | ||
|
|
c2d9c765ab | ||
|
|
95c4b5228d | ||
|
|
b60c0b2967 | ||
|
|
6ea8fe462a | ||
|
|
a329c83c0a | ||
|
|
41210aa925 | ||
|
|
c1b968cf65 | ||
|
|
9efbd84d74 | ||
|
|
261cd8ea9b | ||
|
|
5261ce807f | ||
|
|
c1bc2621fa | ||
|
|
9e291b8477 | ||
|
|
ff619c2925 | ||
|
|
1f99d840af | ||
|
|
e8c775e330 | ||
|
|
631b0ab956 | ||
|
|
f3779ad3bd |
1579
ChangeLog.pre-2-10
1579
ChangeLog.pre-2-10
File diff suppressed because it is too large
Load Diff
1579
ChangeLog.pre-2-4
1579
ChangeLog.pre-2-4
File diff suppressed because it is too large
Load Diff
1579
ChangeLog.pre-2-6
1579
ChangeLog.pre-2-6
File diff suppressed because it is too large
Load Diff
1579
ChangeLog.pre-2-8
1579
ChangeLog.pre-2-8
File diff suppressed because it is too large
Load Diff
4
INSTALL
4
INSTALL
@@ -22,8 +22,8 @@ GTK+ requires the following packages:
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-2.2.0.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.2.0 # change to the toplevel directory
|
||||
% gzip -cd gtk+-2.2.2.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.2.2 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
|
||||
@@ -8,7 +8,6 @@ AUTOMAKE_OPTIONS = 1.4
|
||||
|
||||
EXTRA_DIST = \
|
||||
HACKING \
|
||||
gtk+.spec.in \
|
||||
makecopyright \
|
||||
NEWS.pre-1-0 \
|
||||
ChangeLog.pre-1-0 \
|
||||
@@ -17,7 +16,7 @@ EXTRA_DIST = \
|
||||
README.cvs-commits \
|
||||
README.win32 \
|
||||
config.h.win32 \
|
||||
gtk-zip.sh \
|
||||
gtk-zip.sh.in \
|
||||
sanitize-la.sh \
|
||||
po/README.translators \
|
||||
po/makefile.mingw \
|
||||
@@ -149,14 +148,13 @@ install-data-hook:
|
||||
rm -f gdk-2.0.pc && cp -f gdk-$(GDKTARGET)-2.0.pc gdk-2.0.pc && \
|
||||
rm -f gtk+-2.0.pc && cp -f gtk+-$(GDKTARGET)-2.0.pc gtk+-2.0.pc)
|
||||
|
||||
dist-hook: gtk+.spec
|
||||
dist-hook:
|
||||
if test -f $(srcdir)/INSTALL.in && test -f $(srcdir)/README.in ; then \
|
||||
CONFIG_FILES="INSTALL:$(srcdir)/INSTALL.in README:$(srcdir)/README.in" \
|
||||
CONFIG_HEADERS= \
|
||||
$(SHELL) config.status \
|
||||
&& cp INSTALL README $(distdir) ; \
|
||||
fi \
|
||||
&& cp gtk+.spec $(distdir)
|
||||
fi
|
||||
|
||||
.PHONY: files release sanity snapshot
|
||||
|
||||
|
||||
101
NEWS
101
NEWS
@@ -1,3 +1,104 @@
|
||||
Overview of Changes in GTK+ 2.2.2
|
||||
=================================
|
||||
|
||||
* GdkPixbuf [Matthias Clasen]
|
||||
- Fix animation of slow-loading progressive GIFS
|
||||
- Fix long-standing animated GIF display bug with transparency
|
||||
- Misc bug and portability fixes [Rick Jones, Tim Mooney, Marijn Ross]
|
||||
* GDK [Owen Taylor]
|
||||
- Draw continuous underlines between Pango layout runs when
|
||||
possible [Kang Jeong-Hee]
|
||||
- Fix gdk_pixbuf_from_drawable() for big endian [Christian Petig]
|
||||
Major rewrite of 16-bit handling for pixbuf_from_drawable()
|
||||
* X11 backend [Owen]
|
||||
- Fix build on X11R5 [Albert Chin]
|
||||
- Fix switching keyboard layouts while running [Egmont Koblinger]
|
||||
- Work around RENDER extension bugs on certain Sun X servers [Morten Welinder]
|
||||
- Zero unused fields in client messages we send Lubos Lunak]
|
||||
- Fix occasional segfault when drawing pixbufs [Hans Petter Jansson]
|
||||
- Fix wrong initializaiton that was keeping XShm from being used.
|
||||
* Win32 backend [Tor Lillqvist]
|
||||
- Tweak line drawing
|
||||
- Mouse/cursor fixes [Allin Cottrell]
|
||||
- Better handling of floppy drives in GtkFileSelection
|
||||
- Misc fixes [Arnaud Charlet, Cedric Gustin, Martyn Russell]
|
||||
* Input methods [Hidetoshi Tajima]
|
||||
- Add rules for Greek accents to GtkIMContextSimple [Vasilis Vasaitis]
|
||||
- Fix sorting of rules in GtkIMContextSimple [Vasilis]
|
||||
- Miscellaneous GtkIMContextXIM fixes
|
||||
- Fix translation of input context names
|
||||
* Fix keyboard accelerators/bindings on Numeric Keypad [Owen, Olivier Ripoll]
|
||||
* Add Delete to GtkEntry context menu, Delete/Select All
|
||||
to GtkTextView context menu [Matthias]
|
||||
* Keynav tweaks in GtkFileSelection, GtkColorSel [Matthias]
|
||||
* Add C-A-PgUp/Down as alternative notebook page switching keys [Matthias]
|
||||
* GtkTextView
|
||||
- Fix redrawing on color-only changes [Owen, Gustavo Giráldez]
|
||||
- Don't scroll to cursor on focus in [Paolo Maggi]
|
||||
- Fix spot location reported to input method [Owen, TOKUNAGA Hiroyuki,
|
||||
Yao Zhang]
|
||||
- Miscellaneous bug fixes [Torbjörn Andersson, Matthias, Manual Clos,
|
||||
Padraig O'Briain, Owen]
|
||||
* GtkTreeView [Kristian Rietveld]
|
||||
- Fix prelighting [Sven Neumann]
|
||||
- Set drag cursor earlier to allow apps to override [Daniel Elstner]
|
||||
- Speed up insertions into GtkTreeModelSort [Owen, Jonathan Blandford]
|
||||
- Get background/cell area handling right in GtkTreeViewColumn [Vasco
|
||||
Alexandre da Silva Costa]
|
||||
- Bug fixes [Benjamin Bayart, Jonathan Blandford, Peter Bloomfield,
|
||||
Dave Cook, Felipe Heidrich, Richard Hult, Markus Lausser, Michael Natterer,
|
||||
Mariano Suarez-Alvarez, Owen]
|
||||
* Fix handling of border width for GtkToolbar [Rodney Dawes]
|
||||
* Rewrite adjustment handling of GtkViewport, fixing many bugs
|
||||
[Owen, Thomas Leonard, Michael]
|
||||
* Misc bug fixes [Dennis Björklund, Jonathan, Dave Bordoley, Rich Burridge,
|
||||
Anders Carlsson, Arnaud, Matthias, Vasco Alexandre da Silva Costa,
|
||||
Tim Evans, Larry Ewing, John Finlay, Jeff Franks, Jody Goldberg,
|
||||
Jason D. Hildebrand, Charles Kerr, Alex Larsson, Noah Levitt, Xan Lopez,
|
||||
Loban Rahman, Richard Reich, Soeren Sandmann, Charles Schmidt,
|
||||
Rajkumar Siva, Owen, Sergey V. Udaltsov, Morten Welinder, Michael Zucchi]
|
||||
* Code cleanups [Matthias, Glynn Foster, Britton Kerin, Sven Neumann,
|
||||
Doug Quale, Manish Singh, Morten Welinder]
|
||||
* Switch to using libtool-1.5
|
||||
* Build fixes [Matthias, J. Ali Harlowe, Rich Kinder, Jon Nall, Sven,
|
||||
Christian Rose]
|
||||
* Documentation improvements [Matthias, Noah Levitt, Sven Neumann]
|
||||
* New and updated translations (am,az,be,ca,cs,cy,da,de,el,es,fa,fi,fr,id,
|
||||
it,ko,li,ml,mn,ms,nl,no,pl,pt,sr,sr@Latn,sv,ta,uk,yi,zh_TW)
|
||||
|
||||
Overview of Changes in GTK+ 2.2.1
|
||||
=================================
|
||||
* Win32 [Tor Lillqvist]
|
||||
- Improve setting of window position / decorations
|
||||
- Implement gdk_pixmap_foreign_new() [Naofumi Yasufuku]
|
||||
- Fix various file selection bugs
|
||||
- Improve scheme for locating pixbuf loader modules
|
||||
- Miscellaneous fixes [Alex Shaduri, Kenichi SUTO, Ed Woods]
|
||||
* GtkTreeView [Kristian Rietveld]
|
||||
- made GtkTreeSortable work as the documentation advertises [Jarek Dukat]
|
||||
- fixed gtk_tree_view_set_sort_column_id so you can disable sorting [Soeren
|
||||
Sandmann, Jarek Dukat]
|
||||
- TreeView search now works on all values transformable by GValue and not
|
||||
just strings [Muktha Narayan]
|
||||
- _move/_swap fixage in the Stores [Matthew Tuck, Paolo Maggi]
|
||||
- a lot of misc bug fixes [Alex Duggan, Carlos Garnacho Parro, Hans Petter
|
||||
Jansson, Kjartan Maraas, Soeren, Dave Camp, Murray Cumming, Dave Cook,
|
||||
Gaël Le Mignot, Vasco Alexandre da Silva Costa]
|
||||
* GtkTextView [Matthias Clasen]
|
||||
- Fix keynav with invisible cursor
|
||||
- Fix misdrawing of cursor [Owen Taylor] and selection
|
||||
- Many miscellaneous fixes [Narayana Pattipati, Daniel Elstner]
|
||||
* Fix problem with accidental inclusion of a main() [Matthias]
|
||||
* Documentation improvements [Matthias, Havoc Pennington]
|
||||
* Fix problem with GtkColorsel and pixmap themes [Daniel]
|
||||
* Fix race condition with GdkRGB in PseudoColor [Shivaram Upadhyayula]
|
||||
* Warning fixes [Manish Singh]
|
||||
* configure fixes [Akira Tagoh]
|
||||
* New and updated translations (ca,de,es,et,ko,mn,pl,pt,vi,zh_CN)
|
||||
* Miscellaneous bug fixes [Matthias, Daniel, Martin Gansser, Louis Garcia,
|
||||
Tommi Komulainen, Thomas Leonard, Ian Peters, Arvind Samptur,
|
||||
Soeren Sandmann, Hidetoshi Tajima, Owen]
|
||||
|
||||
Overview of Changes in GTK+ 2.2.0
|
||||
=================================
|
||||
* Fix problem with the DND code and event filters [Bolian Yin, Owen Taylor]
|
||||
|
||||
2
README
2
README
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 2.2.0. GTK+ is a multi-platform toolkit for
|
||||
This is GTK+ version 2.2.2. 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.
|
||||
|
||||
11
README.win32
11
README.win32
@@ -33,16 +33,11 @@ Alternative 1 also generates Microsoft import libraries (.lib), if you
|
||||
have lib.exe available. It might also work for cross-compilation from
|
||||
Unix.
|
||||
|
||||
There are hand-written makefiles for mingw (look for makefile.mingw in
|
||||
various directories), but those haven't been kept up-to-date, and
|
||||
probably won't work without editing. Sorry. If you make them work
|
||||
again, by all means do submit patches.
|
||||
|
||||
Note that I use method 1 myself. Hans Breuer has been taking care of
|
||||
the MSVC makefiles. At times, we disagree a bit about various issues,
|
||||
and the makefile.msc files might not produce identically named DLLs
|
||||
and import libraries as the "autoconfiscated" makefiles and libtool
|
||||
do.
|
||||
and for instance the makefile.msc files will not produce identically
|
||||
named DLLs and import libraries as the "autoconfiscated" makefiles and
|
||||
libtool do. If this bothers you, you will have to fix the makefiles.
|
||||
|
||||
Using GTK+ on Win32
|
||||
===================
|
||||
|
||||
12
autogen.sh
12
autogen.sh
@@ -13,10 +13,10 @@ FILE=gdk
|
||||
DIE=0
|
||||
|
||||
have_libtool=false
|
||||
if libtool --version < /dev/null > /dev/null 2>&1 ; then
|
||||
libtool_version=`libtoolize --version | libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
|
||||
if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
|
||||
libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
|
||||
case $libtool_version in
|
||||
1.4*)
|
||||
1.4*|1.5*)
|
||||
have_libtool=true
|
||||
;;
|
||||
esac
|
||||
@@ -50,8 +50,8 @@ if automake-1.4 --version < /dev/null > /dev/null 2>&1 ; then
|
||||
fi
|
||||
if $have_automake ; then : ; else
|
||||
echo
|
||||
echo "You must have automake 1.4-p1 installed to compile $PROJECT."
|
||||
echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.4-p1.tar.gz"
|
||||
echo "You must have automake 1.4-p6 installed to compile $PROJECT."
|
||||
echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.4-p6.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
fi
|
||||
@@ -109,4 +109,4 @@ if test -z "$AUTOGEN_SUBDIR_MODE"; then
|
||||
|
||||
echo
|
||||
echo "Now type 'make' to compile $PROJECT."
|
||||
fi
|
||||
fi
|
||||
|
||||
91
configure.in
91
configure.in
@@ -20,7 +20,6 @@ cflags_set=${CFLAGS+set}
|
||||
|
||||
dnl we to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
|
||||
dnl are available for $ac_help expansion (don't we all *love* autoconf?)
|
||||
GLIB_AC_DIVERT_BEFORE_HELP([
|
||||
#
|
||||
# Making releases:
|
||||
# GTK_MICRO_VERSION += 1;
|
||||
@@ -30,15 +29,29 @@ GLIB_AC_DIVERT_BEFORE_HELP([
|
||||
# if backwards compatibility has been broken,
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
#
|
||||
GTK_MAJOR_VERSION=2
|
||||
GTK_MINOR_VERSION=2
|
||||
GTK_MICRO_VERSION=0
|
||||
GTK_INTERFACE_AGE=0
|
||||
GTK_BINARY_AGE=200
|
||||
m4_define([gtk_major_version], [2])
|
||||
m4_define([gtk_minor_version], [2])
|
||||
m4_define([gtk_micro_version], [2])
|
||||
m4_define([gtk_interface_age], [2])
|
||||
|
||||
# if the minor version number is odd, then we want debugging. Otherwise
|
||||
# we only want minimal debugging support.
|
||||
m4_define([gtk_debug_default],
|
||||
[m4_if(m4_eval(gtk_minor_version % 2), [1], [yes], [minimum])])dnl
|
||||
|
||||
GTK_MAJOR_VERSION=gtk_major_version
|
||||
GTK_MINOR_VERSION=gtk_minor_version
|
||||
GTK_MICRO_VERSION=gtk_micro_version
|
||||
GTK_INTERFACE_AGE=gtk_interface_age
|
||||
GTK_BINARY_AGE=`expr 100 '*' $GTK_MINOR_VERSION + $GTK_MICRO_VERSION`
|
||||
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
|
||||
])dnl
|
||||
|
||||
# if the minor version number is odd, then we want debugging. Otherwise
|
||||
# we only want minimal debugging support.
|
||||
m4_define([glib_debug_default],
|
||||
[m4_if(m4_eval(glib_minor_version % 2), [1], [yes], [minimum])])dnl
|
||||
|
||||
AC_SUBST(GTK_MAJOR_VERSION)
|
||||
AC_SUBST(GTK_MINOR_VERSION)
|
||||
@@ -162,24 +175,12 @@ if test "$os_win32" = "yes"; then
|
||||
fi
|
||||
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
|
||||
|
||||
dnl figure debugging default, prior to $ac_help setup
|
||||
dnl
|
||||
GLIB_AC_DIVERT_BEFORE_HELP([
|
||||
if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
|
||||
debug_default=yes
|
||||
else
|
||||
debug_default=minimum
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl declare --enable-* args and collect ac_help strings
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging @<:@default=gtk_debug_default@:>@],,enable_debug=gtk_debug_default)
|
||||
AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available [default=yes]],
|
||||
echo $enable_shm, enable_shm="yes")
|
||||
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(xkb, [ --enable-xkb support XKB [default=maybe]],
|
||||
, enable_xkb="maybe")
|
||||
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
|
||||
@@ -389,7 +390,7 @@ AC_SUBST(STRIP_BEGIN)
|
||||
AC_SUBST(STRIP_END)
|
||||
|
||||
# i18n stuff
|
||||
ALL_LINGUAS="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"
|
||||
ALL_LINGUAS="am az be bg ca cs cy da de el en_GB es et eu fa fi fr ga gl he hi hr hu ia id it ja ko lt lv mk ml mn ms nl nn no pl pt pt_BR ro ru sk sl sr sr@Latn sv ta tr uk vi wa yi zh_TW zh_CN"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
|
||||
@@ -470,13 +471,15 @@ if test "${with_ie55+set}" = set && test $with_ie55 != no; then
|
||||
AC_MSG_CHECKING([for dimm.h])
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -idirafter $with_ie55/Include"
|
||||
AC_TRY_COMPILE([#include <windows.h>
|
||||
#include <objbase.h>
|
||||
AC_TRY_COMPILE([/* The w32api imm.h clashes a bit with the IE5.5 dimm.h */
|
||||
#ifdef __GNUC__
|
||||
/* The w32api imm.h clashes a bit with the IE5.5 dimm.h */
|
||||
#define IMEMENUITEMINFOA hidden_IMEMENUITEMINFOA
|
||||
#define IMEMENUITEMINFOW hidden_IMEMENUITEMINFOW
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <objbase.h>
|
||||
#include <imm.h>
|
||||
#ifdef __GNUC__
|
||||
#undef IMEMENUITEMINFOA
|
||||
#undef IMEMENUITEMINFOW
|
||||
#endif
|
||||
@@ -632,17 +635,11 @@ fi
|
||||
|
||||
AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
|
||||
|
||||
AC_ARG_ENABLE(modules, [ --disable-modules disable dynamic module loading],[
|
||||
if test x$withval = xyes; then
|
||||
with_modules=yes
|
||||
else
|
||||
with_modules=no
|
||||
fi
|
||||
])
|
||||
AC_ARG_ENABLE(modules, [ --disable-modules disable dynamic module loading])
|
||||
|
||||
dynworks=false
|
||||
deps=
|
||||
if test x$with_modules = xno; then
|
||||
if test x$enable_modules = xno; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -997,8 +994,10 @@ if test "x$gdktarget" = "xx11"; then
|
||||
|
||||
AM_CONDITIONAL(HAVE_XFT, $have_xft)
|
||||
|
||||
if $PKG_CONFIG --exists xft ; then
|
||||
AC_DEFINE(HAVE_XFT2, 1, [Define if we have Xft, version 2])
|
||||
if $have_xft; then
|
||||
if $PKG_CONFIG --exists xft ; then
|
||||
AC_DEFINE(HAVE_XFT2, 1, [Define if we have Xft, version 2])
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -1155,11 +1154,20 @@ if test "x$gdktarget" = "xx11"; then
|
||||
,
|
||||
$x_libs_for_checks)
|
||||
|
||||
# Check for XIM support.
|
||||
# Generic X11R6 check needed for XIM support; we could
|
||||
# probably use this to replace the above, but we'll
|
||||
# leave the separate XConvertCase check for clarity
|
||||
|
||||
if test "x$enable_xim" = "xyes"; then
|
||||
GTK_XIM_FLAGS="-DUSE_XIM"
|
||||
have_x11r6=false
|
||||
AC_CHECK_LIB(X11, XAddConnectionWatch,
|
||||
have_x11r6=true,
|
||||
,
|
||||
$x_libs_for_checks)
|
||||
|
||||
if $have_x11r6; then
|
||||
AC_DEFINE(HAVE_X11R6,1,[Define if we have X11R6])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_X11R6, $have_x11r6)
|
||||
|
||||
# Check for XKB support.
|
||||
|
||||
@@ -1187,7 +1195,7 @@ if test "x$gdktarget" = "xx11"; then
|
||||
AC_DEFINE(XINPUT_NONE)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
|
||||
AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree || test x$with_xinput = xyes)
|
||||
|
||||
# Check for the RANDR extension
|
||||
|
||||
@@ -1246,6 +1254,7 @@ else
|
||||
AM_CONDITIONAL(HAVE_XFT, false)
|
||||
AM_CONDITIONAL(XINPUT_XFREE, false)
|
||||
AM_CONDITIONAL(USE_X11, false)
|
||||
AM_CONDITIONAL(HAVE_X11R6, false)
|
||||
fi
|
||||
|
||||
if test "x$gdktarget" = "xwin32"; then
|
||||
@@ -1581,7 +1590,6 @@ AM_CONDITIONAL(HAVE_SGML2HTML, test x$SGML2HTML != xno)
|
||||
AC_OUTPUT([
|
||||
config.h.win32
|
||||
gtk-zip.sh
|
||||
gtk+.spec
|
||||
Makefile
|
||||
gdk-pixbuf-2.0.pc
|
||||
gdk-2.0.pc
|
||||
@@ -1609,21 +1617,16 @@ docs/reference/gtk/version.xml
|
||||
docs/faq/Makefile
|
||||
docs/tutorial/Makefile
|
||||
gdk-pixbuf/Makefile
|
||||
gdk-pixbuf/makefile.mingw
|
||||
gdk-pixbuf/gdk_pixbuf.rc
|
||||
gdk-pixbuf/gdk-pixbuf-features.h
|
||||
gdk-pixbuf/pixops/Makefile
|
||||
gdk-pixbuf/pixops/makefile.mingw
|
||||
gdk/Makefile
|
||||
gdk/makefile.mingw
|
||||
gdk/x11/Makefile
|
||||
gdk/win32/Makefile
|
||||
gdk/win32/makefile.mingw
|
||||
gdk/win32/rc/Makefile
|
||||
gdk/win32/rc/gdk.rc
|
||||
gdk/linux-fb/Makefile
|
||||
gtk/Makefile
|
||||
gtk/makefile.mingw
|
||||
gtk/makefile.msc
|
||||
gtk/gtkversion.h
|
||||
gtk/gtk-win32.rc
|
||||
|
||||
@@ -34,11 +34,13 @@ noinst_PROGRAMS = \
|
||||
|
||||
if CROSS_COMPILING
|
||||
pixbuf_csource=$(GDK_PIXBUF_CSOURCE)
|
||||
pixbuf_csource_deps=
|
||||
else
|
||||
pixbuf_csource=GDK_PIXBUF_MODULE_FILE=$$topdir/gdk-pixbuf/gdk-pixbuf.loaders $$topdir/gdk-pixbuf/gdk-pixbuf-csource
|
||||
pixbuf_csource_deps=$(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource $(top_builddir)/gdk-pixbuf/gdk-pixbuf.loaders
|
||||
endif
|
||||
|
||||
test-inline-pixbufs.h: $(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource $(top_builddir)/gdk-pixbuf/gdk-pixbuf.loaders apple-red.png gnome-foot.png
|
||||
test-inline-pixbufs.h: $(pixbuf_csource_deps) apple-red.png gnome-foot.png
|
||||
(topdir=`cd $(top_builddir) && pwd` ; curdir=`pwd` ; \
|
||||
cd $(srcdir) && \
|
||||
$(pixbuf_csource) --build-list \
|
||||
|
||||
@@ -52,11 +52,10 @@ bin_PROGRAMS = gtk-demo
|
||||
BUILT_SOURCES = demos.h
|
||||
|
||||
EXTRA_DIST = \
|
||||
geninclude.pl \
|
||||
$(IMAGEFILES)
|
||||
|
||||
demos.h: $(demos) geninclude.pl
|
||||
(cd $(srcdir) && $(PERL) ./geninclude.pl $(demos) > demos.h)
|
||||
(cwd=`pwd` && cd $(srcdir) && $(PERL) $$cwd/geninclude.pl $(demos) > demos.h)
|
||||
|
||||
gtk_demo_SOURCES = \
|
||||
$(demos) \
|
||||
|
||||
@@ -12,6 +12,27 @@ static GtkWidget *da;
|
||||
static GdkColor color;
|
||||
static GtkWidget *frame;
|
||||
|
||||
/* Expose callback for the drawing area
|
||||
*/
|
||||
static gboolean
|
||||
expose_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
{
|
||||
if (widget->window)
|
||||
{
|
||||
GtkStyle *style;
|
||||
|
||||
style = gtk_widget_get_style (widget);
|
||||
|
||||
gdk_draw_rectangle (widget->window,
|
||||
style->bg_gc[GTK_STATE_NORMAL],
|
||||
TRUE,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
change_color_callback (GtkWidget *button,
|
||||
gpointer data)
|
||||
@@ -76,8 +97,12 @@ do_colorsel (void)
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
|
||||
g_signal_connect (da, "expose_event",
|
||||
G_CALLBACK (expose_event_callback), NULL);
|
||||
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 200, 200);
|
||||
/* set the color */
|
||||
|
||||
@@ -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;
|
||||
@@ -43,9 +43,10 @@ gchar *
|
||||
demo_find_file (const char *base,
|
||||
GError **err)
|
||||
{
|
||||
g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
|
||||
g_return_val_if_fail (err == NULL || *err == NULL, NULL);
|
||||
|
||||
if (g_file_test (base, G_FILE_TEST_EXISTS))
|
||||
if (g_file_test ("gtk-logo-rgb.gif", G_FILE_TEST_EXISTS) &&
|
||||
g_file_test (base, G_FILE_TEST_EXISTS))
|
||||
return g_strdup (base);
|
||||
else
|
||||
{
|
||||
@@ -722,7 +723,7 @@ create_tree (void)
|
||||
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
|
||||
g_object_set (G_OBJECT (cell),
|
||||
g_object_set (cell,
|
||||
"style", PANGO_STYLE_ITALIC,
|
||||
NULL);
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ do_pixbufs (void)
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), da);
|
||||
|
||||
timeout_id = gtk_timeout_add (FRAME_DELAY, timeout, NULL);
|
||||
timeout_id = g_timeout_add (FRAME_DELAY, timeout, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* column for holiday names */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
|
||||
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
||||
-1, "Holiday",
|
||||
@@ -273,7 +273,7 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* alex column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)ALEX_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
@@ -296,7 +296,7 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* havoc column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)HAVOC_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
@@ -318,7 +318,7 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* tim column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)TIM_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
@@ -341,7 +341,7 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* owen column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)OWEN_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
@@ -363,7 +363,7 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* dave column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)DAVE_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
|
||||
@@ -187,7 +187,7 @@ static guint timeout_id;
|
||||
static void
|
||||
destroy_cb (GtkObject *object, gpointer data)
|
||||
{
|
||||
gtk_timeout_remove (timeout_id);
|
||||
g_source_remove (timeout_id);
|
||||
timeout_id = 0;
|
||||
|
||||
gtk_main_quit ();
|
||||
@@ -225,7 +225,7 @@ main (int argc, char **argv)
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), da);
|
||||
|
||||
timeout_id = gtk_timeout_add (FRAME_DELAY, timeout, NULL);
|
||||
timeout_id = g_timeout_add (FRAME_DELAY, timeout, NULL);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
gtk_main ();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -626,7 +626,7 @@ main (int argc, char **argv)
|
||||
|
||||
status.readlen = readlen;
|
||||
|
||||
status.timeout = gtk_timeout_add (100, update_timeout, &status);
|
||||
status.timeout = g_timeout_add (100, update_timeout, &status);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,3 +1,77 @@
|
||||
2003-06-05 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/question_index.sgml: Add a couple of questions.
|
||||
|
||||
2003-06-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf/tmpl/gdk-pixbuf.sgml:
|
||||
* gdk-pixbuf/tmpl/animation.sgml: Remove manually inserted
|
||||
anchors, gtk-doc emits anchors for all objects since Dec 2002.
|
||||
|
||||
2003-05-27 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkadjustment.sgml: Document allowed values for
|
||||
adjustments which are used in scrollbars. (#108448, Ernst Lippe)
|
||||
|
||||
* gtk/tmpl/gtkradiomenuitem.sgml: Fix example. (#113604,
|
||||
Julien Moutte)
|
||||
|
||||
2003-05-19 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf-sections.txt:
|
||||
* gdk/gdk-sections.txt: Add some unused symbols to private sections.
|
||||
|
||||
2003-05-17 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtk-sections.txt: Add gtk_tree_row_reference_get_type.
|
||||
|
||||
2003-05-05 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtk-docs.sgml:
|
||||
* gtk/tmpl/gtksocket.sgml: Improve the docs about cross-process
|
||||
embedding a bit. (#112101, #112006)
|
||||
|
||||
2003-04-13 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtk-sections.txt: Add gtk_tree_view_column_cell_get_position().
|
||||
|
||||
2003-04-07 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkenums.sgml, gtk/tmpl/gtkmain.sgml,
|
||||
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
|
||||
gtk/tmpl/gtkspinbutton.sgml, gtk/tmpl/gtkstatusbar.sgml,
|
||||
gtk/tmpl/gtktext.sgml, gtk/tmpl/gtktogglebuttons.sgml,
|
||||
gtk/tmpl/gtktreeviewcolumn.sgml, gtk/tmpl/gtktypeutils.sgml: Fix
|
||||
numerous misspellings of possessive "its". (#110027, Doug Quale)
|
||||
|
||||
2003-04-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkmessagedialog.sgml: Fix formatting of examples.
|
||||
|
||||
* gtk/tmpl/gtkfilesel.sgml: Fix the example. (#109563)
|
||||
|
||||
2003-03-22 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* gtk/Makefile.am: copy stock_color_picker_25.png, don't copy
|
||||
stock_save_24.png twice.
|
||||
|
||||
* gtk/tmpl/gtkstock.sgml: use it for GTK_STOCK_COLOR_PICKER
|
||||
instead of stock_colorselector_24.png.
|
||||
|
||||
2003-02-24 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtktreemodel.sgml: Fix self-referential documenation of
|
||||
gtk_tree_model_get_iter_root(). (#106720, Keith Sharp)
|
||||
|
||||
2003-02-11 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkrc.sgml: Document that font and fontset declarations
|
||||
are ignored.
|
||||
|
||||
2003-01-30 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/running.sgml: s/overwrite/override/g (#104627, Brian Cameron)
|
||||
|
||||
Fri Dec 20 13:10:06 2002 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/building.sgml: Update directories in download
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
html
|
||||
sgml
|
||||
gdk-pixbuf.args
|
||||
gdk-pixbuf.hierarchy
|
||||
gdk-pixbuf.signals
|
||||
gdk-pixbuf-decl.txt
|
||||
gdk-pixbuf-decl-list.txt
|
||||
gdk-pixbuf-decl.txt
|
||||
gdk-pixbuf-undocumented.txt
|
||||
gdk-pixbuf-unused.txt
|
||||
gdk-pixbuf.args
|
||||
gdk-pixbuf.hierarchy
|
||||
gdk-pixbuf.interfaces
|
||||
gdk-pixbuf.prerequisites
|
||||
gdk-pixbuf.signals
|
||||
html
|
||||
xml
|
||||
*.stamp
|
||||
*.lo
|
||||
.libs
|
||||
|
||||
@@ -5,7 +5,7 @@ Animations
|
||||
Animated images.
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para><anchor id="GdkPixbufAnimation"/>
|
||||
<para>
|
||||
The &gdk-pixbuf; library provides a simple mechanism to load and represent
|
||||
animations. An animation is conceptually a series of frames to be displayed
|
||||
over time. Each frame is the same size. The animation may not be represented
|
||||
|
||||
@@ -6,7 +6,7 @@ Information that describes an image.
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
|
||||
<para><anchor id="GdkPixbuf"/>
|
||||
<para>
|
||||
The <structname>GdkPixbuf</structname> structure contains
|
||||
information that describes an image in memory.
|
||||
</para>
|
||||
|
||||
@@ -284,6 +284,7 @@ Modules supporting animations must derive a type from
|
||||
virtual functions.
|
||||
</para>
|
||||
|
||||
@parent_class:
|
||||
@is_static_image: returns whether the given animation is just a static image.
|
||||
@get_static_image: returns a static image representing the given animation.
|
||||
@get_size: fills @width and @height with the frame size of the animation.
|
||||
@@ -296,6 +297,7 @@ Modules supporting animations must derive a type from
|
||||
virtual functions.
|
||||
</para>
|
||||
|
||||
@parent_class:
|
||||
@get_delay_time: returns the time in milliseconds that the current frame
|
||||
should be shown.
|
||||
@get_pixbuf: returns the current frame.
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
sgml
|
||||
html
|
||||
gdk.args
|
||||
gdk.signals
|
||||
gdk.hierarchy
|
||||
gdk-decl.txt
|
||||
gdk-decl-list.txt
|
||||
gdk-decl.txt
|
||||
gdk-undocumented.txt
|
||||
gdk-unused.txt
|
||||
gdk.args
|
||||
gdk.hierarchy
|
||||
gdk.interfaces
|
||||
gdk.prerequisites
|
||||
gdk.signals
|
||||
html
|
||||
xml
|
||||
*.stamp
|
||||
*.lo
|
||||
.libs
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
sgml
|
||||
html
|
||||
.libs
|
||||
gtk.args
|
||||
gtk.hierarchy
|
||||
gtk.signals
|
||||
gtk-decl.txt
|
||||
gtk-decl-list.txt
|
||||
gtk-decl.txt
|
||||
gtk-scan.lo
|
||||
gtk-undocumented.txt
|
||||
gtk-unused.txt
|
||||
gtk-scan.lo
|
||||
gtk.args
|
||||
gtk.hierarchy
|
||||
gtk.interfaces
|
||||
gtk.prerequisites
|
||||
gtk.signals
|
||||
html
|
||||
xml
|
||||
*.stamp
|
||||
*.lo
|
||||
.libs
|
||||
|
||||
@@ -73,7 +73,6 @@ HTML_IMAGES = \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_exec_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_search_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_search_replace_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_save_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_bottom_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_first_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_last_24.png \
|
||||
@@ -109,6 +108,7 @@ HTML_IMAGES = \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_save_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_save_as_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_colorselector_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_color_picker_25.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_font_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_sort_ascending_24.png \
|
||||
$(top_srcdir)/gtk/stock-icons/stock_sort_descending_24.png \
|
||||
@@ -296,12 +296,3 @@ dist-hook: dist-check-gtkdoc dist-hook-local
|
||||
-cp $(srcdir)/html/* $(distdir)/html
|
||||
|
||||
.PHONY : dist-hook-local
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -294,7 +294,6 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
&GtkDialog;
|
||||
&GtkInvisible;
|
||||
&GtkMessageDialog;
|
||||
&GtkPlug;
|
||||
&GtkWindow;
|
||||
&GtkWindowGroup;
|
||||
</chapter>
|
||||
@@ -447,6 +446,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
|
||||
<chapter id="PlugSocket">
|
||||
<title>Cross-process Embedding</title>
|
||||
&GtkPlug;
|
||||
&GtkSocket;
|
||||
</chapter>
|
||||
|
||||
|
||||
@@ -2896,6 +2896,7 @@ GTK_TYPE_TREE_ROW_REFERENCE
|
||||
gtk_tree_model_get_type
|
||||
gtk_tree_iter_get_type
|
||||
gtk_tree_path_get_type
|
||||
gtk_tree_row_reference_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -3093,6 +3094,7 @@ gtk_tree_view_column_set_sort_order
|
||||
gtk_tree_view_column_get_sort_order
|
||||
gtk_tree_view_column_cell_set_cell_data
|
||||
gtk_tree_view_column_cell_get_size
|
||||
gtk_tree_view_column_cell_get_position
|
||||
gtk_tree_view_column_cell_is_visible
|
||||
gtk_tree_view_column_focus_cell
|
||||
<SUBSECTION Standard>
|
||||
|
||||
@@ -197,6 +197,114 @@ can be defined as:
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
How do I use non-ASCII characters in GTK+ programs ?
|
||||
</para>
|
||||
</question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
|
||||
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a
|
||||
sequence of one to six bytes and has a number of nice
|
||||
properties which make it a good choice for working with Unicode
|
||||
text in C programs:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
ASCII characters are encoded by their familiar ASCII codepoints.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
ASCII characters never appear as part of any other character.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
The zero byte doesn't occur as part of a character, so that UTF-8 strings can
|
||||
be manipulated with the usual C library functions for
|
||||
handling zero-terminated strings.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
More information about Unicode and UTF-8 can be found in the
|
||||
<ulink url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ for Unix/Linux</ulink>.
|
||||
GLib provides functions for converting strings between UTF-8 and other
|
||||
encodings, see
|
||||
<link linkend="g-locale-to-utf8">g_locale_to_utf8()</link> and <link
|
||||
linkend="g-convert">g_convert()</link>.
|
||||
</para>
|
||||
<para>
|
||||
Text coming from external sources (e.g. files or user input), has to be
|
||||
converted to UTF-8 before being handed over to GTK+. The
|
||||
following example writes the content of a IS0-8859-1 encoded text
|
||||
file to <literal>stdout</literal>:
|
||||
<informalexample><programlisting>
|
||||
gchar *text, *utf8_text;
|
||||
gsize length;
|
||||
GError *error = NULL;
|
||||
|
||||
if (g_file_get_contents (filename, &text, &length, NULL))
|
||||
{
|
||||
utf8_text = g_convert (text, length, "UTF-8", "ISO-8859-1",
|
||||
NULL, NULL, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
fprintf ("Couldn't convert file %s to UTF-8\n", filename);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
g_print (utf8_text);
|
||||
}
|
||||
else
|
||||
fprintf (stderr, "Unable to read file %s\n", filename);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
For string literals in the source code, there are several alternatives for
|
||||
handling non-ASCII content:
|
||||
<variablelist>
|
||||
<varlistentry><term>direct UTF-8</term>
|
||||
<listitem><para>
|
||||
If your editor and compiler are capable of handling UTF-8 encoded sources,
|
||||
it is very convenient to simply use UTF-8 for string literals, since it allows
|
||||
you to edit the strings in "wysiwyg". Note that choosing this option may
|
||||
reduce the portability of your code.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term>escaped UTF-8</term>
|
||||
<listitem><para>
|
||||
Even if your toolchain can't handle UTF-8 directly, you can still encode string
|
||||
literals in UTF-8 by using octal or hexadecimal escapes like
|
||||
<literal>\212</literal> or <literal>\xa8</literal> to
|
||||
encode each byte. This is portable, but modifying the escaped strings is not
|
||||
very convenient. Be careful when mixing hexadecimal escapes with ordinary text;
|
||||
<literal>"\xa8abcd"</literal> is a string of length 1 !
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term>runtime conversion</term>
|
||||
<listitem><para>
|
||||
If the string literals can be represented in an encoding which your toolchain
|
||||
can handle (e.g. IS0-8859-1), you can write your source files in that encoding
|
||||
and use <link linkend="g-convert">g_convert()</link> to convert the strings to
|
||||
UTF-8 at runtime. Note that this has some runtime overhead, so you may want to
|
||||
move the conversion out of inner loops.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
Here is an example showing the three approaches using the copyright sign
|
||||
© which has Unicode and ISO-8859-1 codepoint 169 and is represented in
|
||||
UTF-8 by the two bytes 194, 169:
|
||||
<informalexample><programlisting>
|
||||
g_print ("direct UTF-8: ©");
|
||||
g_print ("escaped UTF-8: \302\251");
|
||||
text = g_convert ("runtime conversion: ©", -1, "ISO-8859-1", "UTF-8", NULL, NULL, NULL);
|
||||
g_print(text);
|
||||
g_free (text);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I use GTK+ with C++?
|
||||
@@ -290,7 +398,100 @@ To load an image or animation file asynchronously (without blocking), use
|
||||
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I draw text ?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
To draw a piece of text, use a Pango layout and
|
||||
<link linkend="gdk-draw-layout">gdk_draw_layout()</link>,
|
||||
using code like the following:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
gdk_draw_layout (..., layout);
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
Do not use the deprecated <link linkend="GdkFont">GdkFont</link> and <link linkend="gdk-draw-text">gdk_draw_text()</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also the "Text Handling in GTK 2" section of
|
||||
<ulink url="http://developer.gnome.org/dotplan/porting/">Porting applications
|
||||
to the GNOME 2.0 platform</ulink>.
|
||||
</para>
|
||||
</answer>
|
||||
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
How do I measure the size of a piece of text ?
|
||||
</para>
|
||||
</question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
To obtain the size of a piece of text, use a Pango layout and
|
||||
<link
|
||||
linkend="pango-layout-get-pixel-size">pango_layout_get_pixel_size()</link>,
|
||||
using code like the following:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
pango_layout_get_pixel_size (layout, &width, &height);
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
Do not use the deprecated function <link linkend="gdk-text-width">gdk_text_width()</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also the "Text Handling in GTK 2" section of
|
||||
<ulink url="http://developer.gnome.org/dotplan/porting/">Porting applications
|
||||
to the GNOME 2.0 platform</ulink>.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
How do I make a text view scroll to the end of the buffer automatically ?
|
||||
</para>
|
||||
</question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
The "insert" <link linkend="GtkTextMark">mark</link> marks the insertion point
|
||||
where <link linkend="gtk-text-buffer-insert">gtk_text_buffer_insert()</link>
|
||||
inserts new text into the buffer. The text is inserted
|
||||
<emphasis>before</emphasis> the "insert" mark, so that it generally stays
|
||||
at the end of the buffer. If it gets explicitly moved to some other position,
|
||||
e.g. when the user selects some text,
|
||||
use <link linkend="gtk-text-buffer-move-mark">gtk_text_buffer_move_mark()</link>
|
||||
to set it to the desired location before inserting more text.
|
||||
The "insert" mark of a buffer can be obtained with <link
|
||||
linkend="gtk-text-buffer-get-insert">gtk_text_buffer_get_insert()</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To ensure that the end of the buffer remains visible, use
|
||||
<link
|
||||
linkend="gtk-text-view-scroll-to-mark">gtk_text_view_scroll_to_mark()</link> to scroll to the "insert" mark after inserting new text.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
</qandadiv>
|
||||
|
||||
<qandadiv><title>Which widget should I use...</title>
|
||||
@@ -330,8 +531,7 @@ number of problems that are best avoided.
|
||||
<para>
|
||||
If you only have a small amount of text, <link
|
||||
linkend="GtkLabel">GtkLabel</link> may also be appropriate of course.
|
||||
It can be made selectable with <link
|
||||
linkend="gtk-label-set-selectable">
|
||||
It can be made selectable with <link linkend="gtk-label-set-selectable">
|
||||
gtk_label_set_selectable()</link>. For a single-line text entry,
|
||||
see <link linkend="GtkEntry">GtkEntry</link>.
|
||||
</para>
|
||||
@@ -460,6 +660,20 @@ or <link
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I make a text widget display its complete contents in a specific font?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
If you use <link
|
||||
linkend="gtk-text-buffer-insert-with-tags">gtk_text_buffer_insert_with_tags()</link> with appropriate tags to select the font, the inserted text will have the desired appearance, but text typed in by the user before or after the tagged block will appear in the default style.
|
||||
</para>
|
||||
<para>
|
||||
To ensure that all text has the desired appearance, use <link
|
||||
linkend="gtk-widget-modify-font">gtk_widget_modify_font()</link> to change the default font for the widget.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
</qandadiv>
|
||||
|
||||
|
||||
@@ -485,15 +699,16 @@ See the <link linkend="TreeWidget">tree widget overview</link>.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
What's the #GtkTreeView equivalent of gtk_clist_find_row_from_data()?
|
||||
What's the <link linkend="GtkTreeView">GtkTreeView</link> equivalent of
|
||||
<link linkend="gtk-clist-find-row-from-data">gtk_clist_find_row_from_data()</link>?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
As there is no separate data column in the #GtkTreeModel, there's no
|
||||
As there is no separate data column in the <link linkend="GtkTreeModel">GtkTreeModel</link>, there's no
|
||||
built in function to find the iter from data. You can write a custom
|
||||
searching function to walk the tree and find the data, or use
|
||||
gtk_tree_model_foreach().
|
||||
<link linkend="gtk-tree-model-foreach">gtk_tree_model_foreach()</link>.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -543,6 +758,88 @@ linkend="gtk-tree-model-get">gtk_tree_model_get()</link>.
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I change the way that numbers are formatted by <link linkend="GtkTreeView">GtkTreeView</link>?
|
||||
</para></question>
|
||||
<answer><para>
|
||||
Use <link linkend="gtk-tree-view-insert-column-with-data-func">gtk_tree_view_insert_column_with_data_func()</link>
|
||||
or <link linkend="gtk-tree-view-column-set-cell-data-func">gtk_tree_view_column_set_cell_data_func()</link>
|
||||
and do the conversion from number to string yourself (with, say,
|
||||
<link linkend="g-strdup-printf">g_strdup_printf()</link>).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following example demonstrates this:
|
||||
<informalexample><programlisting>
|
||||
enum
|
||||
{
|
||||
DOUBLE_COLUMN,
|
||||
N_COLUMNS
|
||||
};
|
||||
|
||||
GtkListStore *mycolumns;
|
||||
GtkTreeView *treeview;
|
||||
|
||||
void
|
||||
my_cell_double_to_text (GtkTreeViewColumn *tree_column,
|
||||
GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
GtkCellRendererText *cell_text = (GtkCellRendererText *)cell;
|
||||
gdouble d;
|
||||
gchar *text;
|
||||
|
||||
/* Get the double value from the model. */
|
||||
gtk_tree_model_get (tree_model, iter, (gint)data, &d, -1);
|
||||
/* Now we can format the value ourselves. */
|
||||
text = g_strdup_printf ("%.2f", d);
|
||||
g_object_set (cell, "text", text, NULL);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
void
|
||||
set_up_new_columns (GtkTreeView *myview)
|
||||
{
|
||||
GtkCellRendererText *renderer;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkListStore *mycolumns;
|
||||
|
||||
/* Create the data model and associate it with the given TreeView */
|
||||
mycolumns = gtk_list_store_new (N_COLUMNS, G_TYPE_DOUBLE);
|
||||
gtk_tree_view_set_model (myview, GTK_TREE_MODEL (mycolumns));
|
||||
|
||||
/* Create a GtkCellRendererText */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
|
||||
/* Create a new column that has a title ("Example column"),
|
||||
* uses the above created renderer that will render the double
|
||||
* value into text from the associated model's rows.
|
||||
*/
|
||||
column = gtk_tree_view_column_new ();
|
||||
gtk_tree_view_column_set_title (column, "Example column");
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
gtk_tree_view_column_pack_start (column, renderer, TRUE);
|
||||
|
||||
/* Append the new column after the GtkTreeView's previous columns. */
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (myview), column);
|
||||
/* Since we created the column by hand, we can set it up for our
|
||||
* needs, e.g. set its minimum and maximum width, etc.
|
||||
*/
|
||||
/* Set up a custom function that will be called when the column content
|
||||
* is rendered. We use the func_data pointer as an index into our
|
||||
* model. This is convenient when using multi column lists.
|
||||
*/
|
||||
gtk_tree_view_column_set_cell_data_func (column, renderer,
|
||||
my_cell_double_to_text,
|
||||
(gpointer)DOUBLE_COLUMN, NULL);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
</qandadiv>
|
||||
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ This option is only available if GTK+ has been configured with
|
||||
<title><systemitem>--gxid-host <replaceable>host</replaceable></systemitem></title>
|
||||
|
||||
<para>
|
||||
The host to contact the <application>gxid</application> daemon on; overwrites
|
||||
The host to contact the <application>gxid</application> daemon on; overrides
|
||||
the <link linkend="GXID"><envar>GXID_HOST</envar></link> environment variable.
|
||||
This option is only available if GTK+ has been configured with
|
||||
<option>--gdk-target=x11</option>.
|
||||
@@ -167,7 +167,7 @@ This option is only available if GTK+ has been configured with
|
||||
<title><systemitem>--gxid-port <replaceable>port</replaceable></systemitem></title>
|
||||
|
||||
<para>
|
||||
The port for the connection to <application>gxid</application>; overwrites
|
||||
The port for the connection to <application>gxid</application>; overrides
|
||||
the <link linkend="GXID"><envar>GXID_PORT</envar></link> environment variable.
|
||||
This option is only available if GTK+ has been configured with
|
||||
<option>--gdk-target=x11</option>.
|
||||
@@ -276,8 +276,8 @@ or <envar>DISPLAY</envar>; mostly to determine paths to look for certain files.
|
||||
|
||||
<para>
|
||||
Specifies the file listing the IM modules to load. This environment
|
||||
variable overwrites the <literal>im_module_file</literal> specified in
|
||||
the RC files, which in turn overwrites the default value
|
||||
variable overrides the <literal>im_module_file</literal> specified in
|
||||
the RC files, which in turn overrides the default value
|
||||
<filename><replaceable>sysconfdir</replaceable>/gtk-2.0/gtk.immodules</filename>
|
||||
(<replaceable>sysconfdir</replaceable> is the sysconfdir specified when GTK+ was configured,
|
||||
usually <filename>/usr/local/etc</filename>.)
|
||||
@@ -322,7 +322,7 @@ nevertheless.
|
||||
|
||||
<para>
|
||||
Specifies the file listing the GdkPixbuf loader modules to load.
|
||||
This environment variable overwrites the default value
|
||||
This environment variable overrides the default value
|
||||
<filename><replaceable>sysconfdir</replaceable>/gtk-2.0/gdk-pixbuf.loaders</filename>
|
||||
(<replaceable>sysconfdir</replaceable> is the sysconfdir specified when
|
||||
GTK+ was configured, usually <filename>/usr/local/etc</filename>.)
|
||||
|
||||
@@ -104,7 +104,14 @@ Creates a new #GtkAdjustment.
|
||||
|
||||
<!-- ##### FUNCTION gtk_adjustment_set_value ##### -->
|
||||
<para>
|
||||
Sets the #GtkAdjustment value.
|
||||
Sets the #GtkAdjustment value. The value is clamped to lie between
|
||||
<literal>adjustment->lower</literal> and
|
||||
<literal>adjustment->upper</literal>.
|
||||
</para>
|
||||
<para>
|
||||
Note that for adjustments which are used in a #GtkScrollbar, the effective
|
||||
range of allowed values goes from <literal>adjustment->lower</literal> to
|
||||
<literal>adjustment->upper - adjustment->page_size</literal>.
|
||||
</para>
|
||||
|
||||
@adjustment: a #GtkAdjustment.
|
||||
|
||||
@@ -58,7 +58,7 @@ Used to indicate the direction in which a #GtkArrow should point.
|
||||
|
||||
<!-- ##### ENUM GtkAttachOptions ##### -->
|
||||
<para>
|
||||
Denotes the expansion properties that a widget will have when it (or it's
|
||||
Denotes the expansion properties that a widget will have when it (or its
|
||||
parent) is resized.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ Simple file operations; create directory, delete file, and rename file, are avai
|
||||
|
||||
/* The file selection widget and the string to store the chosen filename */
|
||||
|
||||
void store_filename (GtkFileSelection *file_selector, gpointer user_data) {
|
||||
void store_filename (GtkWidget *file_selector, gpointer user_data) {
|
||||
const gchar *selected_filename;
|
||||
|
||||
selected_filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_selector));
|
||||
g_print ("Selected filename: %s\n", selected_filename);
|
||||
g_print ("Selected filename: %s\n", selected_filename);
|
||||
}
|
||||
|
||||
void create_file_selection (void) {
|
||||
@@ -118,6 +118,26 @@ The #GtkFileSelection struct contains the following #GtkWidget fields:
|
||||
|
||||
</para>
|
||||
|
||||
@dir_list:
|
||||
@file_list:
|
||||
@selection_entry:
|
||||
@selection_text:
|
||||
@main_vbox:
|
||||
@ok_button:
|
||||
@cancel_button:
|
||||
@help_button:
|
||||
@history_pulldown:
|
||||
@history_menu:
|
||||
@history_list:
|
||||
@fileop_dialog:
|
||||
@fileop_entry:
|
||||
@fileop_file:
|
||||
@cmpl_state:
|
||||
@fileop_c_dir:
|
||||
@fileop_del_file:
|
||||
@fileop_ren_file:
|
||||
@button_area:
|
||||
@action_area:
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_new ##### -->
|
||||
<para>
|
||||
|
||||
@@ -428,7 +428,7 @@ used by GTK+ wrappers for languages other than C.
|
||||
|
||||
<!-- ##### FUNCTION gtk_quit_remove ##### -->
|
||||
<para>
|
||||
Removes a quit handler by it's identifier.
|
||||
Removes a quit handler by its identifier.
|
||||
</para>
|
||||
|
||||
@quit_handler_id: Identifier for the handler returned when installing it.
|
||||
@@ -436,7 +436,7 @@ Removes a quit handler by it's identifier.
|
||||
|
||||
<!-- ##### FUNCTION gtk_quit_remove_by_data ##### -->
|
||||
<para>
|
||||
Removes a quit handler identified by it's @data field.
|
||||
Removes a quit handler identified by its @data field.
|
||||
</para>
|
||||
|
||||
@data: The pointer passed as @data to gtk_quit_add() or gtk_quit_add_full().
|
||||
|
||||
@@ -25,7 +25,7 @@ returns when any dialog button is clicked.
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Error loading file '%s': %s",
|
||||
"Error loading file '%s': %s",
|
||||
filename, g_strerror (errno));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
@@ -42,7 +42,7 @@ You might do a non-modal #GtkMessageDialog as follows:
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Error loading file '%s': %s",
|
||||
"Error loading file '%s': %s",
|
||||
filename, g_strerror (errno));
|
||||
|
||||
/* Destroy the dialog when the user responds to it (e.g. clicks a button) */
|
||||
|
||||
@@ -32,7 +32,7 @@ Each child has two options that can be set,
|
||||
#GtkPaned is resized, that child will expand
|
||||
or shrink along with the paned widget. If @shrink
|
||||
is true, then when that child can be made smaller
|
||||
than it's requisition by the user. Setting @shrink
|
||||
than its requisition by the user. Setting @shrink
|
||||
to %FALSE allows the application to set a minimum
|
||||
size. If @resize is false for both children, then
|
||||
this is treated as if @resize is true for both
|
||||
|
||||
@@ -7,7 +7,7 @@ A choice from multiple check buttons.
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A single radio button performs the same basic function as a #GtkCheckButton,
|
||||
as it's position in the object hierarchy reflects. It is only when multiple
|
||||
as its position in the object hierarchy reflects. It is only when multiple
|
||||
radio buttons are grouped together that they become a different user
|
||||
interface component in their own right.</para>
|
||||
<para>
|
||||
|
||||
@@ -20,7 +20,7 @@ this:
|
||||
<example>
|
||||
<title>How to create a group of radio menu items.</title>
|
||||
<programlisting>
|
||||
GList *group = NULL;
|
||||
GSList *group = NULL;
|
||||
GtkWidget *item;
|
||||
gint i;
|
||||
|
||||
|
||||
@@ -258,9 +258,8 @@ elements are:
|
||||
<term><literal>font = <replaceable>font</replaceable></literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Sets the font for a widget. <replaceable>font</replaceable> must be
|
||||
a XLFD font description, e.g.
|
||||
<literal>"-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*"</literal>.
|
||||
Starting with GTK+ 2.0, the "font" and "fontset"
|
||||
declarations are ignored; use "font_name" declarations instead.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -268,13 +267,8 @@ elements are:
|
||||
<term><literal>fontset = <replaceable>font</replaceable></literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Sets the fontset for a widget. Overrides any
|
||||
<literal>font</literal> declarations. <replaceable>font</replaceable>
|
||||
must be a comma-separated list of XLFD font descriptions, e.g.
|
||||
<literal>"-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240,
|
||||
-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120,
|
||||
-GB-Fixed-Medium-R-Normal--26-180-100-100-C-240,
|
||||
-Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150"</literal>.
|
||||
Starting with GTK+ 2.0, the "font" and "fontset"
|
||||
declarations are ignored; use "font_name" declarations instead.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -282,10 +276,10 @@ elements are:
|
||||
<term><literal>font_name = <replaceable>font</replaceable></literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Sets the font for a widget. Overrides any
|
||||
<literal>font</literal> or <literal>fontset</literal> declarations.
|
||||
<replaceable>font</replaceable> must be a Pango font name, e.g.
|
||||
<literal>"Sans Italic 10"</literal>.
|
||||
Sets the font for a widget. <replaceable>font</replaceable> must be
|
||||
a Pango font name, e.g. <literal>"Sans Italic 10"</literal>.
|
||||
For details about Pango font names, see
|
||||
pango_font_description_from_string().
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -137,7 +137,8 @@ never be set by an application.)
|
||||
|
||||
<!-- ##### SIGNAL GtkSocket::plug-added ##### -->
|
||||
<para>
|
||||
|
||||
This signal is emitted when a client is successfully
|
||||
added to the socket.
|
||||
</para>
|
||||
|
||||
@socket: the object which received the signal.
|
||||
@@ -146,7 +147,9 @@ never be set by an application.)
|
||||
|
||||
<!-- ##### SIGNAL GtkSocket::plug-removed ##### -->
|
||||
<para>
|
||||
|
||||
This signal is emitted when a client is removed from the socket. The
|
||||
default action is to destroy the #GtkSocket widget, so if you want to
|
||||
reuse it you must add a signal handler that returns %TRUE.
|
||||
</para>
|
||||
|
||||
@socket: the object which received the signal.
|
||||
|
||||
@@ -140,7 +140,7 @@ GTK_SPIN_PAGE_BACKWARD</entry>
|
||||
<row>
|
||||
<entry>GTK_SPIN_HOME,
|
||||
GTK_SPIN_END</entry>
|
||||
<entry>These set the spin button's value to the minimum or maxmimum possible values, (set by it's #GtkAdjustment), respectively.</entry>
|
||||
<entry>These set the spin button's value to the minimum or maxmimum possible values, (set by its #GtkAdjustment), respectively.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>GTK_SPIN_USER_DEFINED</entry>
|
||||
|
||||
@@ -33,7 +33,7 @@ Status bars are created using gtk_statusbar_new().
|
||||
Messages are added to the bar's stack with gtk_statusbar_push().
|
||||
</para>
|
||||
<para>
|
||||
The message at the top of the stack can be removed using gtk_statusbar_pop(). A message can be removed from anywhere in the stack if it's message_id was recorded at the time it was added. This is done using gtk_statusbar_remove().
|
||||
The message at the top of the stack can be removed using gtk_statusbar_pop(). A message can be removed from anywhere in the stack if its message_id was recorded at the time it was added. This is done using gtk_statusbar_remove().
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
|
||||
@@ -154,7 +154,7 @@ The "Close" item.
|
||||
<!-- ##### MACRO GTK_STOCK_COLOR_PICKER ##### -->
|
||||
<para>
|
||||
The "Color Picker" item.
|
||||
<inlinegraphic fileref="stock_colorselector_24.png" format="PNG"></inlinegraphic>
|
||||
<inlinegraphic fileref="stock_color_picker_25.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
@Since: 2.2
|
||||
|
||||
@@ -52,7 +52,7 @@ Internal #GtkText data type. Should not be accessed directly.
|
||||
Creates a new #GtkText widget, initialized with the given pointers to
|
||||
#GtkAdjustments. These pointers can be used to track the viewing position
|
||||
of the #GtkText widget. Passing %NULL to either or both of them will make
|
||||
the #GtkText create it's own. You can set these later with the function
|
||||
the #GtkText create its own. You can set these later with the function
|
||||
gtk_text_set_adjustment().
|
||||
</para>
|
||||
|
||||
@@ -213,7 +213,7 @@ Returns the character at the given index within the #GtkText widget.
|
||||
|
||||
<!-- ##### ARG GtkText:hadjustment ##### -->
|
||||
<para>
|
||||
Used by the #GtkText widget to keep track of the size of it's horizontal
|
||||
Used by the #GtkText widget to keep track of the size of its horizontal
|
||||
text.
|
||||
</para>
|
||||
|
||||
@@ -224,7 +224,7 @@ Boolean value indicating whether line wrap is enabled or not.
|
||||
|
||||
<!-- ##### ARG GtkText:vadjustment ##### -->
|
||||
<para>
|
||||
Used by the #GtkText widget to keep track of the size of it's vertical
|
||||
Used by the #GtkText widget to keep track of the size of its vertical
|
||||
text.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -669,6 +669,14 @@ in an idle job in the background.
|
||||
@textview: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkTextView::select-all ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@textview: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkTextView::set-anchor ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ create buttons which retain their state.
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkToggleButton is a #GtkButton which will remain 'pressed-in' when
|
||||
clicked. Clicking again will cause the toggle button to return to it's
|
||||
clicked. Clicking again will cause the toggle button to return to its
|
||||
normal state.
|
||||
</para>
|
||||
<para>
|
||||
@@ -141,7 +141,7 @@ application ever to call this function.
|
||||
|
||||
<!-- ##### FUNCTION gtk_toggle_button_get_active ##### -->
|
||||
<para>
|
||||
Queries a #GtkToggleButton and returns it's current state. Returns %TRUE if
|
||||
Queries a #GtkToggleButton and returns its current state. Returns %TRUE if
|
||||
the toggle button is pressed in and %FALSE if it is raised.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -609,7 +609,7 @@ versions of GTK+.
|
||||
|
||||
<!-- ##### MACRO gtk_tree_model_get_iter_root ##### -->
|
||||
<para>
|
||||
A alternate name for gtk_tree_model_get_iter_root() provided for
|
||||
A alternate name for gtk_tree_model_get_iter_first() provided for
|
||||
compatibility reasons; this macro will be deprecated in future
|
||||
versions of GTK+.
|
||||
</para>
|
||||
|
||||
@@ -18,7 +18,7 @@ widget. It determines the geometry, type
|
||||
|
||||
<!-- ##### ENUM GtkTreeViewColumnSizing ##### -->
|
||||
<para>
|
||||
The sizing method the column uses to determine it's width. Please note
|
||||
The sizing method the column uses to determine its width. Please note
|
||||
that @GTK_TREE_VIEW_COLUMN_AUTOSIZE are inefficient for large views, and
|
||||
can make columns appear choppy.
|
||||
</para>
|
||||
@@ -462,6 +462,18 @@ calling gtk_tree_view_column_set_cell_data_func()
|
||||
@height:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_view_column_cell_get_position ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_column:
|
||||
@cell_renderer:
|
||||
@start_pos:
|
||||
@width:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_view_column_cell_is_visible ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -496,7 +496,7 @@ The base structure for a GTK+ type. Every type inherits this as a base structure
|
||||
|
||||
<!-- ##### TYPEDEF GtkEnumValue ##### -->
|
||||
<para>
|
||||
A structure which contains a single enum value, and its name, and it's
|
||||
A structure which contains a single enum value, and its name, and its
|
||||
nickname.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ handles the emission.
|
||||
Implementation of this signal is optional.
|
||||
</para>
|
||||
|
||||
@parent_class:
|
||||
@activate_signal:
|
||||
@set_scroll_adjustments_signal:
|
||||
|
||||
|
||||
@@ -8930,7 +8930,6 @@ section.</para>
|
||||
<!-- example-start menu itemfactory.c -->
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <strings.h>
|
||||
|
||||
/* Obligatory basic callback */
|
||||
static void print_hello( GtkWidget *w,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <strings.h>
|
||||
|
||||
/* Obligatory basic callback */
|
||||
static void print_hello( GtkWidget *w,
|
||||
|
||||
@@ -1,3 +1,136 @@
|
||||
2003-06-03 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixdata.c (gdk_pixbuf_new_from_inline): Document
|
||||
data_length == -1, add an example. (#97290)
|
||||
|
||||
2003-06-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixdata.h (struct _GdkPixdata): Fix misleading documentation
|
||||
of rowstride. (#113924, Noah Levitt)
|
||||
|
||||
2003-05-27 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-wbmp.c: Remove dubious bitfields of
|
||||
unspecified signedness. (#112919, Morten Welinder)
|
||||
|
||||
* gdk-pixdata.c (gdk_pixdata_to_csource): Replace all occurances
|
||||
of g_string_new ("") by g_string_new (NULL). (#106975, Morten Welinder)
|
||||
|
||||
2003-05-19 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Improve progressive loading from slow sources: (#107368)
|
||||
|
||||
* io-gif-animation.c (gdk_pixbuf_gif_anim_get_iter): Initialize
|
||||
first_loop_slowness.
|
||||
(gdk_pixbuf_gif_anim_iter_advance): Don't wrap during loading if
|
||||
the datasource falls behind the speed of the display.
|
||||
|
||||
* io-gif-animation.h: Add a loading flag to GdkPixbufGifAnim and
|
||||
first_loop_slowness to GdkPixbufGifAnimIter.
|
||||
|
||||
Wed May 14 18:24:50 2003 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk-pixdata.c (gdk_pixdata_deserialize): Add a
|
||||
(gint32 *) => (guint32 *) cast. (#108615, Rick Jones)
|
||||
|
||||
2003-04-24 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_write):
|
||||
(gdk_pixbuf_loader_new_with_type):
|
||||
(gdk_pixbuf_loader_close):
|
||||
* gdk-pixbuf-io.c (gdk_pixbuf_new_from_file):
|
||||
(gdk_pixbuf_save):
|
||||
(gdk_pixbuf_savev):
|
||||
* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file):
|
||||
Add sanity checks for GError handling. (#108345)
|
||||
|
||||
2003-03-21 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-animation.c (gdk_pixbuf_non_anim_get_type): Add
|
||||
missing static. (#108614)
|
||||
|
||||
* io-jpeg.c (gdk_pixbuf__jpeg_image_begin_load):
|
||||
* io-ico.c (gdk_pixbuf__ico_image_stop_load): Add missing static
|
||||
qualifiers apparently causing problems on some platforms. (#108617)
|
||||
|
||||
2003-03-12 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-ico.c (DecodeHeader): Calculate LineWidth for 16bpp from
|
||||
width, like for the other depths. (noticed by Marijn Ros)
|
||||
|
||||
2003-03-08 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
Bug #107664 continued:
|
||||
|
||||
* io-xpm.c (find_color): Fix 0/FALSE confusion
|
||||
* gdk-pixbuf.c (gdk_pixbuf_get_has_alpha): Fix -1/gboolean confusion.
|
||||
|
||||
2003-03-06 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-gif.c (gif_read): Fix 0/FALSE confusion (#107664, Morten Welinder)
|
||||
|
||||
2003-02-20 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-gif-animation.c (gdk_pixbuf_gif_anim_frame_composite):
|
||||
Always clear the initial frame and "disposed" areas with
|
||||
transparent pixels, no matter whether the frame has transparency
|
||||
or not. (#55502)
|
||||
|
||||
2003-02-14 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* io-tga.c (try_preload):
|
||||
(gdk_pixbuf__tga_load): Actually reject images with origin
|
||||
not in the upper-left corner. (#105912)
|
||||
|
||||
2003-02-06 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* queryloaders.c (query_module): Better error message if
|
||||
module_open() fails. (#105349, Tim Mooney)
|
||||
|
||||
Mon Jan 27 17:10:30 2003 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* Makefile.am (gdk-pixbuf.loaders): Rewrite to run
|
||||
on the .la files rather than looking for .so files.
|
||||
(#102142, Martin Gansser)
|
||||
|
||||
* Makefile.am: Don't build gdk-pixbuf.loaders when
|
||||
cross-compiling.
|
||||
|
||||
2003-01-12 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk_pixbuf.def: Add some missing entries. Thanks to Kenichi SUTO.
|
||||
|
||||
2003-01-09 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
Changes for run-time lookup of installation location on Win32:
|
||||
|
||||
* Makefile.am (INCLUDES): Define PREFIX as $(prefix).
|
||||
|
||||
* gdk-pixbuf-io.c (get_sysconfdir): New function, look up
|
||||
installation location at runtime and deduce GTK_SYSCONFDIR
|
||||
from it.
|
||||
(get_toplevel): Similar, for the top-level installation directory.
|
||||
(correct_prefix): Replace compile-time prefix with run-time
|
||||
prefix.
|
||||
(get_libdir): Remove, not used any longer.
|
||||
(gdk_pixbuf_io_init): Call correct_prefix().
|
||||
|
||||
2003-01-05 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* queryloaders.c (query_module): [Win32] Change backslahses into
|
||||
slashes in path.
|
||||
|
||||
2003-01-04 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* Makefile.am (gdk-pixbuf.loaders): Use @SOEXT@ in the find command.
|
||||
|
||||
* gdk_pixbuf.def: Add gdk_pixbuf_loader_set_size.
|
||||
|
||||
2003-01-03 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-io.c (gdk_pixbuf_new_from_xpm_data): Don't crash if
|
||||
gdk-pixbuf.loaders file is missing. (#102222)
|
||||
|
||||
2002-12-08 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gdk-pixbuf-animation.h:
|
||||
|
||||
@@ -248,6 +248,7 @@ INCLUDES = @STRIP_BEGIN@ \
|
||||
-DGTK_BINARY_VERSION=\"@GTK_BINARY_VERSION@\" \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_PIXBUF_DISABLE_DEPRECATED \
|
||||
-DPREFIX=\"$(prefix)\" \
|
||||
@INCLUDED_LOADER_DEFINE@ \
|
||||
@GTK_DEBUG_FLAGS@ \
|
||||
@GDK_PIXBUF_DEP_CFLAGS@ \
|
||||
@@ -393,8 +394,6 @@ CLEANFILES += xgen-gmc
|
||||
|
||||
EXTRA_DIST = \
|
||||
gdk-pixbuf-csource.1 \
|
||||
makefile.mingw \
|
||||
makefile.mingw.in \
|
||||
makefile.msc \
|
||||
gdk_pixbuf.def \
|
||||
gdk_pixbuf.rc \
|
||||
@@ -435,12 +434,16 @@ install-data-local: install-ms-lib install-libtool-import-lib
|
||||
echo "***" ; \
|
||||
fi
|
||||
|
||||
if CROSS_COMPILING
|
||||
else
|
||||
all-local: gdk-pixbuf.loaders
|
||||
endif
|
||||
|
||||
gdk-pixbuf.loaders: $(loader_LTLIBRARIES) gdk-pixbuf-query-loaders
|
||||
if find . -name 'libpixbufloader-*.so' | grep 'so' > /dev/null ; then \
|
||||
LOADERS=`echo libpixbufloader-*.la` ; \
|
||||
if test "x$$LOADERS" != 'xlibpixbufloader-*.la' ; then \
|
||||
echo "Writing a gdk-pixbuf.loader file to use when running examples before installing gdk-pixbuf."; \
|
||||
GDK_PIXBUF_MODULEDIR=.libs $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders > ./gdk-pixbuf.loaders ;\
|
||||
$(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders $$LOADERS > ./gdk-pixbuf.loaders ;\
|
||||
else \
|
||||
echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
|
||||
touch gdk-pixbuf.loaders; \
|
||||
|
||||
@@ -137,6 +137,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
|
||||
GdkPixbufModule *image_module;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (!f) {
|
||||
@@ -563,7 +564,7 @@ static GdkPixbufAnimationIter* gdk_pixbuf_non_anim_get_iter (GdkPixbufAn
|
||||
|
||||
static gpointer non_parent_class;
|
||||
|
||||
GType
|
||||
static GType
|
||||
gdk_pixbuf_non_anim_get_type (void)
|
||||
{
|
||||
static GType object_type = 0;
|
||||
|
||||
@@ -165,6 +165,59 @@ skip_space (const char **pos)
|
||||
return !(*p == '\0');
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
/* DllMain function needed to tuck away the gdk-pixbuf DLL name */
|
||||
G_WIN32_DLLMAIN_FOR_DLL_NAME (static, dll_name)
|
||||
|
||||
static char *
|
||||
get_toplevel (void)
|
||||
{
|
||||
static char *toplevel = NULL;
|
||||
|
||||
if (toplevel == NULL)
|
||||
toplevel = g_win32_get_package_installation_subdirectory
|
||||
(GETTEXT_PACKAGE, dll_name, "");
|
||||
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
static char *
|
||||
get_sysconfdir (void)
|
||||
{
|
||||
static char *sysconfdir = NULL;
|
||||
|
||||
if (sysconfdir == NULL)
|
||||
sysconfdir = g_win32_get_package_installation_subdirectory
|
||||
(GETTEXT_PACKAGE, dll_name, "etc");
|
||||
|
||||
return sysconfdir;
|
||||
}
|
||||
|
||||
#undef GTK_SYSCONFDIR
|
||||
#define GTK_SYSCONFDIR get_sysconfdir()
|
||||
|
||||
static void
|
||||
correct_prefix (gchar **path)
|
||||
{
|
||||
if (strncmp (*path, PREFIX "/", strlen (PREFIX "/")) == 0 ||
|
||||
strncmp (*path, PREFIX "\\", strlen (PREFIX "\\")) == 0)
|
||||
{
|
||||
/* This is an entry put there by gdk-pixbuf-query-loaders on the
|
||||
* packager's system. On Windows a prebuilt GTK+ package can be
|
||||
* installed in a random location. The gdk-pixbuf.loaders file
|
||||
* distributed in such a package contains paths from the package
|
||||
* builder's machine. Replace the build-time prefix with the
|
||||
* installation prefix on this machine.
|
||||
*/
|
||||
gchar *tem = *path;
|
||||
*path = g_strconcat (get_toplevel (), tem + strlen (PREFIX), NULL);
|
||||
g_free (tem);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static gchar *
|
||||
gdk_pixbuf_get_module_file (void)
|
||||
{
|
||||
@@ -209,6 +262,9 @@ gdk_pixbuf_io_init ()
|
||||
/* Blank line marking the end of a module
|
||||
*/
|
||||
if (module && *p != '#') {
|
||||
#ifdef G_OS_WIN32
|
||||
correct_prefix (&module->module_path);
|
||||
#endif
|
||||
file_formats = g_slist_prepend (file_formats, module);
|
||||
module = NULL;
|
||||
}
|
||||
@@ -331,29 +387,6 @@ gdk_pixbuf_io_init ()
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
/* DllMain function needed to tuck away the gdk-pixbuf DLL name */
|
||||
|
||||
G_WIN32_DLLMAIN_FOR_DLL_NAME (static, dll_name)
|
||||
|
||||
static char *
|
||||
get_libdir (void)
|
||||
{
|
||||
static char *libdir = NULL;
|
||||
|
||||
if (libdir == NULL)
|
||||
libdir = g_win32_get_package_installation_subdirectory
|
||||
(GETTEXT_PACKAGE, dll_name, "lib\\gtk-2.0\\" GTK_BINARY_VERSION "\\loaders");
|
||||
|
||||
return libdir;
|
||||
}
|
||||
|
||||
#undef PIXBUF_LIBDIR
|
||||
#define PIXBUF_LIBDIR get_libdir ()
|
||||
|
||||
#endif
|
||||
|
||||
/* actually load the image handler - gdk_pixbuf_get_module only get a */
|
||||
/* reference to the module to load, it doesn't actually load it */
|
||||
/* perhaps these actions should be combined in one function */
|
||||
@@ -694,6 +727,7 @@ gdk_pixbuf_new_from_file (const char *filename,
|
||||
GdkPixbufModule *image_module;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (!f) {
|
||||
@@ -779,20 +813,22 @@ gdk_pixbuf_new_from_xpm_data (const char **data)
|
||||
GdkPixbuf *(* load_xpm_data) (const char **data);
|
||||
GdkPixbuf *pixbuf;
|
||||
GError *error = NULL;
|
||||
GdkPixbufModule *xpm_module = _gdk_pixbuf_get_named_module ("xpm", NULL);
|
||||
GdkPixbufModule *xpm_module = _gdk_pixbuf_get_named_module ("xpm", &error);
|
||||
if (xpm_module == NULL) {
|
||||
g_warning ("Error loading XPM image loader: %s", error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (xpm_module->module == NULL) {
|
||||
if (!_gdk_pixbuf_load_module (xpm_module, &error)) {
|
||||
g_warning ("Error loading XPM image loader: %s", error->message);
|
||||
g_error_free (error);
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (xpm_module->module == NULL) {
|
||||
g_warning ("Can't find gdk-pixbuf module for parsing inline XPM data");
|
||||
return NULL;
|
||||
} else if (xpm_module->load_xpm_data == NULL) {
|
||||
if (xpm_module->load_xpm_data == NULL) {
|
||||
g_warning ("gdk-pixbuf XPM module lacks XPM data capability");
|
||||
return NULL;
|
||||
} else
|
||||
@@ -913,6 +949,8 @@ gdk_pixbuf_save (GdkPixbuf *pixbuf,
|
||||
va_list args;
|
||||
gboolean result;
|
||||
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
va_start (args, error);
|
||||
|
||||
collect_save_options (args, &keys, &values);
|
||||
@@ -959,6 +997,7 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf,
|
||||
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
g_return_val_if_fail (type != NULL, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
f = fopen (filename, "wb");
|
||||
|
||||
|
||||
@@ -423,6 +423,7 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
|
||||
|
||||
g_return_val_if_fail (buf != NULL, FALSE);
|
||||
g_return_val_if_fail (count >= 0, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
priv = loader->priv;
|
||||
|
||||
@@ -499,11 +500,12 @@ gdk_pixbuf_loader_new_with_type (const char *image_type,
|
||||
{
|
||||
GdkPixbufLoader *retval;
|
||||
GError *tmp;
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
retval = g_object_new (GDK_TYPE_PIXBUF_LOADER, NULL);
|
||||
|
||||
tmp = NULL;
|
||||
gdk_pixbuf_loader_load_module(retval, image_type, &tmp);
|
||||
gdk_pixbuf_loader_load_module (retval, image_type, &tmp);
|
||||
if (tmp != NULL)
|
||||
{
|
||||
g_propagate_error (error, tmp);
|
||||
@@ -602,6 +604,7 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
|
||||
|
||||
g_return_val_if_fail (loader != NULL, TRUE);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), TRUE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, TRUE);
|
||||
|
||||
priv = loader->priv;
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ gdk_pixbuf_get_n_channels (const GdkPixbuf *pixbuf)
|
||||
gboolean
|
||||
gdk_pixbuf_get_has_alpha (const GdkPixbuf *pixbuf)
|
||||
{
|
||||
g_return_val_if_fail (pixbuf != NULL, -1);
|
||||
g_return_val_if_fail (pixbuf != NULL, FALSE);
|
||||
|
||||
return pixbuf->has_alpha ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ gdk_pixdata_deserialize (GdkPixdata *pixdata,
|
||||
|
||||
/* deserialize header */
|
||||
stream = get_uint32 (stream, &pixdata->magic);
|
||||
stream = get_uint32 (stream, &pixdata->length);
|
||||
stream = get_uint32 (stream, (guint32 *)&pixdata->length);
|
||||
if (pixdata->magic != GDK_PIXBUF_MAGIC_NUMBER || pixdata->length < GDK_PIXDATA_HEADER_LENGTH)
|
||||
return_header_corrupt (error);
|
||||
stream = get_uint32 (stream, &pixdata->pixdata_type);
|
||||
@@ -635,7 +635,7 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
||||
cdata.dump_rle_decoder = (dump_type & GDK_PIXDATA_DUMP_RLE_DECODER) > 0;
|
||||
cdata.static_prefix = (dump_type & GDK_PIXDATA_DUMP_STATIC) ? "static " : "";
|
||||
cdata.const_prefix = (dump_type & GDK_PIXDATA_DUMP_CONST) ? "const " : "";
|
||||
gstring = g_string_new ("");
|
||||
gstring = g_string_new (NULL);
|
||||
cdata.gstring = gstring;
|
||||
|
||||
if (!cdata.dump_macros && cdata.dump_gtypes)
|
||||
@@ -819,7 +819,8 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
||||
|
||||
/**
|
||||
* gdk_pixbuf_new_from_inline:
|
||||
* @data_length: Length in bytes of the @data argument
|
||||
* @data_length: Length in bytes of the @data argument or -1 to
|
||||
* disable length checks
|
||||
* @data: Byte data containing a serialized #GdkPixdata structure
|
||||
* @copy_pixels: Whether to copy the pixel data, or use direct pointers
|
||||
* @data for the resulting pixbuf
|
||||
@@ -847,13 +848,18 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
||||
* generally a bad idea.)
|
||||
*
|
||||
* If you create a pixbuf from const inline data compiled into your
|
||||
* program, it's probably safe to ignore errors, since things will
|
||||
* always succeed. For non-const inline data, you could get out of
|
||||
* memory. For untrusted inline data located at runtime, you could
|
||||
* have corrupt inline data in addition.
|
||||
* program, it's probably safe to ignore errors and disable length checks,
|
||||
* since things will always succeed:
|
||||
* <informalexample><programlisting>
|
||||
* pixbuf = gdk_pixbuf_new_from_inline (-1, myimage_inline, NULL);
|
||||
* </programlisting></informalexample>
|
||||
*
|
||||
* For non-const inline data, you could get out of memory. For untrusted
|
||||
* inline data located at runtime, you could have corrupt inline data in
|
||||
* addition.
|
||||
*
|
||||
* Return value: A newly-created #GdkPixbuf structure with a reference,
|
||||
* count of 1, or %NULL if error is set.
|
||||
* count of 1, or %NULL if an error occurred.
|
||||
**/
|
||||
GdkPixbuf*
|
||||
gdk_pixbuf_new_from_inline (gint data_length,
|
||||
|
||||
@@ -73,9 +73,9 @@ typedef enum
|
||||
* #GDK_PIXDATA_HEADER_LENGTH + length of @pixel_data.
|
||||
* @pixdata_type: information about colorspace, sample width and
|
||||
* encoding, in a #GdkPixdataType.
|
||||
* @rowstride: padding used in @pixel_data or 0 to indicate no padding.
|
||||
* @width: the width.
|
||||
* @height: the height.
|
||||
* @rowstride: Distance in bytes between rows.
|
||||
* @width: Width of the image in pixels.
|
||||
* @height: Height of the image in pixels.
|
||||
* @pixel_data: @width x @height pixels, encoded according to @pixdata_type
|
||||
* and @rowstride.
|
||||
*
|
||||
@@ -90,7 +90,7 @@ struct _GdkPixdata
|
||||
* GDK_PIXDATA_HEADER_LENGTH + pixel_data length
|
||||
*/
|
||||
guint32 pixdata_type; /* GdkPixdataType */
|
||||
guint32 rowstride; /* maybe 0 to indicate non-padded data */
|
||||
guint32 rowstride;
|
||||
guint32 width;
|
||||
guint32 height;
|
||||
guint8 *pixel_data;
|
||||
|
||||
@@ -25,9 +25,15 @@ EXPORTS
|
||||
gdk_pixbuf_error_get_type
|
||||
gdk_pixbuf_error_quark
|
||||
gdk_pixbuf_fill
|
||||
gdk_pixbuf_format_get_description
|
||||
gdk_pixbuf_format_get_extensions
|
||||
gdk_pixbuf_format_get_mime_types
|
||||
gdk_pixbuf_format_get_name
|
||||
gdk_pixbuf_format_is_writable
|
||||
gdk_pixbuf_from_pixdata
|
||||
gdk_pixbuf_get_bits_per_sample
|
||||
gdk_pixbuf_get_colorspace
|
||||
gdk_pixbuf_get_formats
|
||||
gdk_pixbuf_get_has_alpha
|
||||
gdk_pixbuf_get_height
|
||||
gdk_pixbuf_get_n_channels
|
||||
@@ -38,10 +44,12 @@ EXPORTS
|
||||
gdk_pixbuf_get_width
|
||||
gdk_pixbuf_loader_close
|
||||
gdk_pixbuf_loader_get_animation
|
||||
gdk_pixbuf_loader_get_format
|
||||
gdk_pixbuf_loader_get_pixbuf
|
||||
gdk_pixbuf_loader_get_type
|
||||
gdk_pixbuf_loader_new
|
||||
gdk_pixbuf_loader_new_with_type
|
||||
gdk_pixbuf_loader_set_size
|
||||
gdk_pixbuf_loader_write
|
||||
gdk_pixbuf_new
|
||||
gdk_pixbuf_new_from_data
|
||||
|
||||
@@ -180,6 +180,7 @@ gdk_pixbuf_gif_anim_get_iter (GdkPixbufAnimation *anim,
|
||||
|
||||
iter->start_time = *start_time;
|
||||
iter->current_time = *start_time;
|
||||
iter->first_loop_slowness = 0;
|
||||
|
||||
return GDK_PIXBUF_ANIMATION_ITER (iter);
|
||||
}
|
||||
@@ -287,8 +288,21 @@ gdk_pixbuf_gif_anim_iter_advance (GdkPixbufAnimationIter *anim_iter,
|
||||
* and subtract time for that.
|
||||
*/
|
||||
|
||||
loop = elapsed / iter->gif_anim->total_time;
|
||||
elapsed = elapsed % iter->gif_anim->total_time;
|
||||
if (iter->gif_anim->loading)
|
||||
loop = 0;
|
||||
else {
|
||||
/* If current_frame is NULL at this point, we have loaded the
|
||||
* animation from a source which fell behind the speed of the
|
||||
* display. We remember how much slower the first loop was due
|
||||
* to this and correct the position calculation in order to not
|
||||
* jump in the middle of the second loop.
|
||||
*/
|
||||
if (iter->current_frame == NULL)
|
||||
iter->first_loop_slowness = MAX(0, elapsed - iter->gif_anim->total_time);
|
||||
|
||||
loop = (elapsed - iter->first_loop_slowness) / iter->gif_anim->total_time;
|
||||
elapsed = (elapsed - iter->first_loop_slowness) % iter->gif_anim->total_time;
|
||||
}
|
||||
|
||||
iter->position = elapsed;
|
||||
|
||||
@@ -334,9 +348,8 @@ gdk_pixbuf_gif_anim_iter_get_delay_time (GdkPixbufAnimationIter *anim_iter)
|
||||
#endif
|
||||
|
||||
return frame->delay_time - (iter->position - frame->elapsed);
|
||||
} else {
|
||||
} else
|
||||
return -1; /* show last frame forever */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -404,8 +417,7 @@ gdk_pixbuf_gif_anim_frame_composite (GdkPixbufGifAnim *gif_anim,
|
||||
gdk_pixbuf_fill (f->composited,
|
||||
(gif_anim->bg_red << 24) |
|
||||
(gif_anim->bg_green << 16) |
|
||||
(gif_anim->bg_blue << 8) |
|
||||
(f->bg_transparent ? 0 : 255));
|
||||
(gif_anim->bg_blue << 8));
|
||||
|
||||
gdk_pixbuf_composite (f->pixbuf,
|
||||
f->composited,
|
||||
@@ -459,8 +471,7 @@ gdk_pixbuf_gif_anim_frame_composite (GdkPixbufGifAnim *gif_anim,
|
||||
gdk_pixbuf_fill (area,
|
||||
(gif_anim->bg_red << 24) |
|
||||
(gif_anim->bg_green << 16) |
|
||||
(gif_anim->bg_blue << 8) |
|
||||
prev_frame->bg_transparent ? 0 : 255);
|
||||
(gif_anim->bg_blue << 8));
|
||||
|
||||
g_object_unref (area);
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ struct _GdkPixbufGifAnim {
|
||||
guchar bg_blue;
|
||||
|
||||
int loop;
|
||||
gboolean loading;
|
||||
};
|
||||
|
||||
struct _GdkPixbufGifAnimClass {
|
||||
@@ -113,6 +114,8 @@ struct _GdkPixbufGifAnimIter {
|
||||
gint position;
|
||||
|
||||
GList *current_frame;
|
||||
|
||||
gint first_loop_slowness;
|
||||
};
|
||||
|
||||
struct _GdkPixbufGifAnimIterClass {
|
||||
|
||||
@@ -250,7 +250,7 @@ gif_read (GifContext *context, guchar *buffer, size_t len)
|
||||
}
|
||||
context->amount_needed = len - (context->size - context->ptr);
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Changes the stage to be GIF_GET_COLORMAP */
|
||||
|
||||
@@ -370,7 +370,7 @@ static void DecodeHeader(guchar *Data, gint Bytes,
|
||||
else if (State->Type == 24)
|
||||
State->LineWidth = State->Header.width * 3;
|
||||
else if (State->Type == 16)
|
||||
State->LineWidth = State->Header.height * 2;
|
||||
State->LineWidth = State->Header.width * 2;
|
||||
else if (State->Type == 8)
|
||||
State->LineWidth = State->Header.width * 1;
|
||||
else if (State->Type == 4)
|
||||
@@ -491,8 +491,9 @@ gdk_pixbuf__ico_image_begin_load(GdkPixbufModuleSizeFunc size_func,
|
||||
*
|
||||
* free context, unref gdk_pixbuf
|
||||
*/
|
||||
gboolean gdk_pixbuf__ico_image_stop_load(gpointer data,
|
||||
GError **error)
|
||||
static gboolean
|
||||
gdk_pixbuf__ico_image_stop_load (gpointer data,
|
||||
GError **error)
|
||||
{
|
||||
struct ico_progressive_state *context =
|
||||
(struct ico_progressive_state *) data;
|
||||
|
||||
@@ -449,7 +449,7 @@ skip_input_data (j_decompress_ptr cinfo, long num_bytes)
|
||||
* return context (opaque to user)
|
||||
*/
|
||||
|
||||
gpointer
|
||||
static gpointer
|
||||
gdk_pixbuf__jpeg_image_begin_load (GdkPixbufModuleSizeFunc size_func,
|
||||
GdkPixbufModulePreparedFunc prepared_func,
|
||||
GdkPixbufModuleUpdatedFunc updated_func,
|
||||
|
||||
@@ -50,9 +50,7 @@
|
||||
#define TGA_INTERLEAVE_4WAY 0x80
|
||||
|
||||
#define TGA_ORIGIN_MASK 0x30
|
||||
#define TGA_ORIGIN_LEFT 0x00
|
||||
#define TGA_ORIGIN_RIGHT 0x10
|
||||
#define TGA_ORIGIN_LOWER 0x00
|
||||
#define TGA_ORIGIN_UPPER 0x20
|
||||
|
||||
enum {
|
||||
@@ -727,8 +725,8 @@ static gboolean try_preload(TGAContext *ctx, GError **err)
|
||||
}
|
||||
if ((ctx->hdr->flags & TGA_INTERLEAVE_MASK) !=
|
||||
TGA_INTERLEAVE_NONE ||
|
||||
ctx->hdr->flags & TGA_ORIGIN_RIGHT ||
|
||||
ctx->hdr->flags & TGA_ORIGIN_LOWER) {
|
||||
(ctx->hdr->flags & TGA_ORIGIN_RIGHT) ||
|
||||
!(ctx->hdr->flags & TGA_ORIGIN_UPPER)) {
|
||||
g_set_error(err, GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("TGA image type not supported"));
|
||||
@@ -1289,7 +1287,7 @@ static GdkPixbuf *gdk_pixbuf__tga_load(FILE *f, GError **err)
|
||||
if (!hdr)
|
||||
return NULL;
|
||||
if ((hdr->flags & TGA_INTERLEAVE_MASK) != TGA_INTERLEAVE_NONE ||
|
||||
hdr->flags & TGA_ORIGIN_RIGHT || hdr->flags & TGA_ORIGIN_LOWER) {
|
||||
(hdr->flags & TGA_ORIGIN_RIGHT) || !(hdr->flags & TGA_ORIGIN_UPPER)) {
|
||||
g_set_error(err, GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Unsupported TGA image type"));
|
||||
|
||||
@@ -47,12 +47,12 @@ struct wbmp_progressive_state {
|
||||
GdkPixbufModuleUpdatedFunc updated_func;
|
||||
gpointer user_data;
|
||||
|
||||
gboolean need_type : 1;
|
||||
gboolean need_header : 1;
|
||||
gboolean need_width : 1;
|
||||
gboolean need_height : 1;
|
||||
gboolean needmore : 1;
|
||||
gboolean call_progressive_updates : 1;
|
||||
guint need_type : 1;
|
||||
guint need_header : 1;
|
||||
guint need_width : 1;
|
||||
guint need_height : 1;
|
||||
guint needmore : 1;
|
||||
guint call_progressive_updates : 1;
|
||||
|
||||
guchar last_buf[16]; /* Just needs to be big enough to hold the largest datum requestable via 'getin' */
|
||||
guint last_len;
|
||||
|
||||
@@ -911,7 +911,7 @@ find_color(const char *name,
|
||||
found = bsearch (name, xColors, numXColors, sizeof (XPMColorEntry),
|
||||
compare_xcolor_entries);
|
||||
if (found == NULL)
|
||||
return 0;
|
||||
return FALSE;
|
||||
|
||||
colorPtr->red = (found->red * 65535) / 255;
|
||||
colorPtr->green = (found->green * 65535) / 255;
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
####
|
||||
#### Out of order! Use autoconfiscation.
|
||||
####
|
||||
|
||||
## Makefile for building the gdk_pixbuf DLL with gcc on Win32
|
||||
## Use: make -f makefile.mingw
|
||||
|
||||
TOP = ../..
|
||||
|
||||
include ../build/win32/make.mingw
|
||||
|
||||
# Possibly override GTK+ version from build/win32/module.defs
|
||||
GDK_PIXBUF_VER = @GDK_PIXBUF_MAJOR@.@GDK_PIXBUF_MINOR@
|
||||
|
||||
OPTIMIZE = -g
|
||||
|
||||
INCLUDES = -I . -I ..
|
||||
DEPCFLAGS = $(GLIB_CFLAGS) $(INTL_CFLAGS)
|
||||
|
||||
all : \
|
||||
../config.h \
|
||||
gdk_pixbuf-$(GDK_PIXBUF_VER).dll \
|
||||
pixbufloader-bmp.dll \
|
||||
pixbufloader-gif.dll \
|
||||
pixbufloader-ico.dll \
|
||||
pixbufloader-jpeg.dll \
|
||||
pixbufloader-png.dll \
|
||||
pixbufloader-pnm.dll \
|
||||
pixbufloader-ras.dll \
|
||||
pixbufloader-tiff.dll \
|
||||
pixbufloader-wbmp.dll \
|
||||
pixbufloader-xpm.dll \
|
||||
make-inline-pixbuf.exe \
|
||||
test-gdk-pixbuf.exe
|
||||
|
||||
gdk_pixbuf_OBJECTS = \
|
||||
gdk-pixbuf.o \
|
||||
gdk-pixbuf-animation.o \
|
||||
gdk-pixbuf-data.o \
|
||||
gdk-pixbuf-io.o \
|
||||
gdk-pixbuf-scale.o \
|
||||
gdk-pixbuf-util.o \
|
||||
pixops/libpixops.a
|
||||
|
||||
../config.h : ../config.h.win32
|
||||
cp $< $@
|
||||
|
||||
gdk_pixbuf-$(GDK_PIXBUF_VER).dll : $(gdk_pixbuf_OBJECTS) gdk_pixbuf.def
|
||||
$(GLIB)/build-dll gdk_pixbuf $(GDK_PIXBUF_VER) gdk_pixbuf.def $(gdk_pixbuf_OBJECTS) -L ../gdk -lgdk-$(GTK_VER) $(GLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
gdk-pixbuf.o:: gdk-pixbuf-marshal.c
|
||||
|
||||
gdk-pixbuf-marshal.c :
|
||||
$(GLIB_GENMARSHAL) --prefix=gdk_pixbuf_marshal gdk-pixbuf-marshal.list --header >$@
|
||||
|
||||
pixops/libpixops.a :
|
||||
cd pixops && $(MAKE) -f makefile.mingw libpixops.a
|
||||
|
||||
pixbufloader_bmp_OBJECTS = io-bmp.o
|
||||
|
||||
pixbufloader-bmp.dll : $(pixbufloader_bmp_OBJECTS) pixbufloader_bmp.def
|
||||
$(GLIB)/build-dll pixbufloader-bmp - pixbufloader_bmp.def $(pixbufloader_bmp_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
pixbufloader_gif_OBJECTS = io-gif.o
|
||||
|
||||
pixbufloader-gif.dll : $(pixbufloader_gif_OBJECTS) pixbufloader_gif.def
|
||||
$(GLIB)/build-dll pixbufloader-gif - pixbufloader_gif.def $(pixbufloader_gif_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
pixbufloader_ico_OBJECTS = io-ico.o
|
||||
|
||||
pixbufloader-ico.dll : $(pixbufloader_ico_OBJECTS) pixbufloader_ico.def
|
||||
$(GLIB)/build-dll pixbufloader-ico - pixbufloader_ico.def $(pixbufloader_ico_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
pixbufloader_jpeg_OBJECTS = io-jpeg.o
|
||||
|
||||
io-jpeg.o : io-jpeg.c
|
||||
$(CC) $(CFLAGS) $(JPEG_CFLAGS) -c $<
|
||||
|
||||
pixbufloader-jpeg.dll : $(pixbufloader_jpeg_OBJECTS) pixbufloader_jpeg.def
|
||||
$(GLIB)/build-dll pixbufloader-jpeg - pixbufloader_jpeg.def $(pixbufloader_jpeg_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(JPEG_LIBS) $(INTL_LIBS)
|
||||
|
||||
pixbufloader_png_OBJECTS = io-png.o
|
||||
|
||||
io-png.o : io-png.c
|
||||
$(CC) $(CFLAGS) $(PNG_CFLAGS) -c $<
|
||||
|
||||
pixbufloader-png.dll : $(pixbufloader_png_OBJECTS) pixbufloader_png.def
|
||||
$(GLIB)/build-dll pixbufloader-png - pixbufloader_png.def $(pixbufloader_png_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(PNG_LIBS) $(INTL_LIBS)
|
||||
|
||||
pixbufloader_pnm_OBJECTS = io-pnm.o
|
||||
|
||||
pixbufloader-pnm.dll : $(pixbufloader_pnm_OBJECTS) pixbufloader_pnm.def
|
||||
$(GLIB)/build-dll pixbufloader-pnm - pixbufloader_pnm.def $(pixbufloader_pnm_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
pixbufloader_ras_OBJECTS = io-ras.o
|
||||
|
||||
pixbufloader-ras.dll : $(pixbufloader_ras_OBJECTS) pixbufloader_ras.def
|
||||
$(GLIB)/build-dll pixbufloader-ras - pixbufloader_ras.def $(pixbufloader_ras_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
pixbufloader_tiff_OBJECTS = io-tiff.o
|
||||
|
||||
pixbufloader-tiff.dll : $(pixbufloader_tiff_OBJECTS) pixbufloader_tiff.def
|
||||
$(GLIB)/build-dll pixbufloader-tiff - pixbufloader_tiff.def $(pixbufloader_tiff_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(ZLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
io-tiff.o : io-tiff.c
|
||||
$(CC) $(CFLAGS) $(TIFF_CFLAGS) -c $<
|
||||
|
||||
pixbufloader_wbmp_OBJECTS = io-wbmp.o
|
||||
|
||||
pixbufloader-wbmp.dll : $(pixbufloader_wbmp_OBJECTS) pixbufloader_wbmp.def
|
||||
$(GLIB)/build-dll pixbufloader-wbmp - pixbufloader_wbmp.def $(pixbufloader_wbmp_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
pixbufloader_xpm_OBJECTS = io-xpm.o
|
||||
|
||||
pixbufloader-xpm.dll : $(pixbufloader_xpm_OBJECTS) pixbufloader_xpm.def
|
||||
$(GLIB)/build-dll pixbufloader-xpm - pixbufloader_xpm.def $(pixbufloader_xpm_OBJECTS) -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS) $(INTL_LIBS)
|
||||
|
||||
make-inline-pixbuf.exe : make-inline-pixbuf.o gdk_pixbuf-$(GDK_PIXBUF_VER).dll
|
||||
$(CC) $(CFLAGS) -o $@ make-inline-pixbuf.o -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GLIB_LIBS)
|
||||
|
||||
test-gdk-pixbuf.exe : test-gdk-pixbuf.o gdk_pixbuf-$(GDK_PIXBUF_VER).dll
|
||||
$(CC) $(CFLAGS) -o $@ test-gdk-pixbuf.o -L . -lgdk_pixbuf-$(GDK_PIXBUF_VER) $(GTK_LIBS) $(GLIB_LIBS)
|
||||
|
||||
ifeq ($(wildcard makefile.mingw.in),makefile.mingw.in)
|
||||
# Hack to get an updated makefile.mingw automatically after updating
|
||||
# makefile.mingw.in. Only for developer use.
|
||||
makefile.mingw: makefile.mingw.in
|
||||
sed -e 's,@GDK_PIXBUF[_]MAJOR@,@GDK_PIXBUF_MAJOR@,' \
|
||||
-e 's,@GDK_PIXBUF[_]MINOR@,@GDK_PIXBUF_MINOR@,' <$< >$@
|
||||
endif
|
||||
@@ -29,6 +29,4 @@ libpixops_la_SOURCES = \
|
||||
|
||||
EXTRA_DIST = \
|
||||
DETAILS \
|
||||
makefile.mingw \
|
||||
makefile.mingw.in \
|
||||
makefile.msc
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
## Makefile for building libpixops.a with gcc on Win32
|
||||
## Use: make -f makefile.mingw
|
||||
|
||||
TOP = ../../..
|
||||
|
||||
include $(TOP)/build/win32/make.mingw
|
||||
|
||||
# Possibly override GTK+ version from build/win32/module.defs
|
||||
GTK_VER = @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@
|
||||
|
||||
OPTIMIZE = -g
|
||||
|
||||
INCLUDES = -I .. -I ../..
|
||||
DEPCFLAGS = $(GLIB_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS) $(JPEG_CLFAGS) $(TIFF_CFLAGS)
|
||||
|
||||
all : \
|
||||
../../config.h \
|
||||
libpixops.a \
|
||||
timescale.exe
|
||||
|
||||
libpixops_OBJECTS = \
|
||||
pixops.o \
|
||||
have_mmx.o \
|
||||
scale_line_22_33_mmx.o \
|
||||
composite_line_22_4a4_mmx.o \
|
||||
composite_line_color_22_4a4_mmx.o
|
||||
|
||||
../../config.h : ../../config.h.win32
|
||||
cp $< $@
|
||||
|
||||
libpixops.a : $(libpixops_OBJECTS)
|
||||
ar rv $@ $?
|
||||
|
||||
timescale.exe : timescale.o libpixops.a
|
||||
$(CC) $(CFLAGS) -o $@ timescale.o libpixops.a $(GLIB_LIBS)
|
||||
|
||||
makefile.mingw: makefile.mingw.in
|
||||
sed -e 's,@GTK_MAJOR[_]VERSION@,@GTK_MAJOR_VERSION@,' \
|
||||
-e 's,@GTK_MINOR[_]VERSION@,@GTK_MINOR_VERSION@,' <$< >$@
|
||||
|
||||
@@ -78,6 +78,19 @@ query_module (const char *dir, const char *file)
|
||||
g_module_symbol (module, "fill_info", (gpointer *) &fill_info) &&
|
||||
g_module_symbol (module, "fill_vtable", (gpointer *) &fill_vtable)) {
|
||||
GdkPixbufFormat *info;
|
||||
#ifdef G_OS_WIN32
|
||||
/* Replace backslashes in path with forward slashes, so that
|
||||
* it reads in without problems.
|
||||
*/
|
||||
{
|
||||
char *p = path;
|
||||
while (*p) {
|
||||
if (*p == '\\')
|
||||
*p = '/';
|
||||
p++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
g_printf("\"%s\"\n", path);
|
||||
info = g_new0 (GdkPixbufFormat, 1);
|
||||
(*fill_info) (info);
|
||||
@@ -101,7 +114,11 @@ query_module (const char *dir, const char *file)
|
||||
g_free (info);
|
||||
}
|
||||
else {
|
||||
g_fprintf (stderr, "Cannot load loader %s\n", path);
|
||||
if (module == NULL)
|
||||
g_fprintf (stderr, "g_module_open() failed for %s: %s\n", path,
|
||||
g_module_error());
|
||||
else
|
||||
g_fprintf (stderr, "Cannot load loader %s\n", path);
|
||||
}
|
||||
if (module)
|
||||
g_module_close (module);
|
||||
|
||||
@@ -7,8 +7,6 @@ EXTRA_DIST = \
|
||||
gdkconfig.h.win32 \
|
||||
gdk.def \
|
||||
gdkmarshalers.list \
|
||||
makefile.mingw \
|
||||
makefile.mingw.in \
|
||||
makeenums.pl \
|
||||
makefile.msc
|
||||
|
||||
@@ -181,6 +179,7 @@ libgdk_linux_fb_2_0_la_LIBADD = linux-fb/libgdk-linux-fb.la @GDK_DEP_LIBS@
|
||||
libgdk_win32_2_0_la_LIBADD = \
|
||||
win32/libgdk-win32.la $(wintab_lib) $(ie55uuid_lib) \
|
||||
@GDK_DEP_LIBS@
|
||||
libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la gdk.def
|
||||
|
||||
lib_LTLIBRARIES = $(gdktargetlib)
|
||||
|
||||
|
||||
24
gdk/gdk.def
24
gdk/gdk.def
@@ -59,11 +59,13 @@ EXPORTS
|
||||
gdk_devices_list
|
||||
gdk_display_add_client_message_filter
|
||||
gdk_display_beep
|
||||
gdk_display_close
|
||||
gdk_display_get_core_pointer
|
||||
gdk_display_get_default
|
||||
gdk_display_get_default_screen
|
||||
gdk_display_get_name
|
||||
gdk_display_get_event
|
||||
gdk_display_get_n_screens
|
||||
gdk_display_get_name
|
||||
gdk_display_get_pointer
|
||||
gdk_display_get_screen
|
||||
gdk_display_get_type
|
||||
@@ -71,11 +73,18 @@ EXPORTS
|
||||
gdk_display_keyboard_ungrab
|
||||
gdk_display_list_devices
|
||||
gdk_display_manager_get
|
||||
gdk_display_manager_get_type
|
||||
gdk_display_manager_get_default_display
|
||||
gdk_display_manager_list_displays
|
||||
gdk_display_manager_set_default_display
|
||||
gdk_display_open
|
||||
gdk_display_open_default_libgtk_only
|
||||
gdk_display_peek_event
|
||||
gdk_display_pointer_is_grabbed
|
||||
gdk_display_pointer_ungrab
|
||||
gdk_display_put_event
|
||||
gdk_display_set_double_click_time
|
||||
gdk_display_set_pointer_hooks
|
||||
gdk_display_sync
|
||||
gdk_drag_abort
|
||||
gdk_drag_action_get_type
|
||||
@@ -88,6 +97,7 @@ EXPORTS
|
||||
gdk_drag_find_window
|
||||
gdk_drag_find_window_for_screen
|
||||
gdk_drag_get_protocol
|
||||
gdk_drag_get_protocol_for_display
|
||||
gdk_drag_get_selection
|
||||
gdk_drag_motion
|
||||
gdk_drag_protocol_get_type
|
||||
@@ -156,6 +166,7 @@ EXPORTS
|
||||
gdk_event_send_client_message
|
||||
gdk_event_send_client_message_for_display
|
||||
gdk_event_send_clientmessage_toall
|
||||
gdk_event_set_screen
|
||||
gdk_event_type_get_type
|
||||
gdk_events_pending
|
||||
gdk_exit
|
||||
@@ -287,6 +298,9 @@ EXPORTS
|
||||
gdk_pixmap_create_from_xpm_d
|
||||
gdk_pixmap_foreign_new
|
||||
gdk_pixmap_get_type
|
||||
gdk_pixmap_foreign_new_for_display
|
||||
gdk_pixmap_lookup
|
||||
gdk_pixmap_lookup_for_display
|
||||
gdk_pixmap_new
|
||||
gdk_pointer_grab
|
||||
gdk_pointer_grab_info_libgtk_only
|
||||
@@ -336,10 +350,12 @@ EXPORTS
|
||||
gdk_rgb_set_min_colors
|
||||
gdk_rgb_set_verbose
|
||||
gdk_rgb_xpixel_from_rgb
|
||||
gdk_screen_broadcast_client_message
|
||||
gdk_screen_get_default
|
||||
gdk_screen_get_default_colormap
|
||||
gdk_screen_get_display
|
||||
gdk_screen_get_height
|
||||
gdk_screen_get_height_mm
|
||||
gdk_screen_get_monitor_at_point
|
||||
gdk_screen_get_monitor_at_window
|
||||
gdk_screen_get_monitor_geometry
|
||||
@@ -350,10 +366,15 @@ EXPORTS
|
||||
gdk_screen_get_root_window
|
||||
gdk_screen_get_setting
|
||||
gdk_screen_get_system_colormap
|
||||
gdk_screen_get_system_visual
|
||||
gdk_screen_get_toplevel_windows
|
||||
gdk_screen_get_type
|
||||
gdk_screen_get_width
|
||||
gdk_screen_get_width_mm
|
||||
gdk_screen_height
|
||||
gdk_screen_height_mm
|
||||
gdk_screen_list_visuals
|
||||
gdk_screen_make_display_name
|
||||
gdk_screen_set_default_colormap
|
||||
gdk_screen_width
|
||||
gdk_screen_width_mm
|
||||
@@ -521,4 +542,3 @@ EXPORTS
|
||||
gdk_window_withdraw
|
||||
gdk_wm_decoration_get_type
|
||||
gdk_wm_function_get_type
|
||||
|
||||
|
||||
@@ -363,7 +363,6 @@ gdk_event_is_allocated (GdkEvent *event)
|
||||
GdkEvent*
|
||||
gdk_event_copy (GdkEvent *event)
|
||||
{
|
||||
GdkEventPrivate *private;
|
||||
GdkEventPrivate *new_private;
|
||||
GdkEvent *new_event;
|
||||
|
||||
@@ -372,13 +371,16 @@ gdk_event_copy (GdkEvent *event)
|
||||
new_event = gdk_event_new (GDK_NOTHING);
|
||||
new_private = (GdkEventPrivate *)new_event;
|
||||
|
||||
private = (GdkEventPrivate *)event;
|
||||
|
||||
*new_event = *event;
|
||||
if (new_event->any.window)
|
||||
g_object_ref (new_event->any.window);
|
||||
|
||||
new_private->screen = private->screen;
|
||||
if (gdk_event_is_allocated (event))
|
||||
{
|
||||
GdkEventPrivate *private = (GdkEventPrivate *)event;
|
||||
|
||||
new_private->screen = private->screen;
|
||||
}
|
||||
|
||||
switch (event->any.type)
|
||||
{
|
||||
@@ -410,6 +412,20 @@ gdk_event_copy (GdkEvent *event)
|
||||
case GDK_SETTING:
|
||||
new_event->setting.name = g_strdup (new_event->setting.name);
|
||||
break;
|
||||
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
if (event->button.axes)
|
||||
new_event->button.axes = g_memdup (event->button.axes,
|
||||
sizeof (gdouble) * event->button.device->num_axes);
|
||||
break;
|
||||
|
||||
case GDK_MOTION_NOTIFY:
|
||||
if (event->motion.axes)
|
||||
new_event->motion.axes = g_memdup (event->motion.axes,
|
||||
sizeof (gdouble) * event->motion.device->num_axes);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <glib/gprintf.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gdkkeysyms.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
@@ -85,7 +85,7 @@ gdk_keymap_class_init (GdkKeymapClass *klass)
|
||||
g_signal_new ("keys_changed",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkKeymapClass, direction_changed),
|
||||
G_STRUCT_OFFSET (GdkKeymapClass, keys_changed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE,
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include <locale.h>
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
/* Thanks to Markus G. Kuhn <mkuhn@acm.org> for the ksysym<->Unicode
|
||||
* mapping functions, from the xterm sources.
|
||||
@@ -823,6 +826,25 @@ static struct {
|
||||
/* End numeric keypad */
|
||||
};
|
||||
|
||||
static gunichar
|
||||
get_decimal_char (void)
|
||||
{
|
||||
struct lconv *locale_data;
|
||||
gunichar result = '.';
|
||||
gchar *utf8;
|
||||
|
||||
locale_data = localeconv ();
|
||||
utf8 = g_locale_to_utf8 (locale_data->decimal_point, -1, NULL, NULL, NULL);
|
||||
if (utf8)
|
||||
{
|
||||
if (g_utf8_strlen (utf8, -1) == 1)
|
||||
result = g_utf8_get_char (utf8);
|
||||
g_free (utf8);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_keyval_to_unicode:
|
||||
* @keyval: a GDK key symbol
|
||||
@@ -850,6 +872,11 @@ gdk_keyval_to_unicode (guint keyval)
|
||||
if ((keyval & 0xff000000) == 0x01000000)
|
||||
return keyval & 0x00ffffff;
|
||||
|
||||
/* Translation of KP_Decimal depends on locale.
|
||||
*/
|
||||
if (keyval == GDK_KP_Decimal)
|
||||
return get_decimal_char ();
|
||||
|
||||
/* binary search in table */
|
||||
while (max >= min) {
|
||||
mid = (min + max) / 2;
|
||||
|
||||
146
gdk/gdkpango.c
146
gdk/gdkpango.c
@@ -163,6 +163,37 @@ gdk_pango_context_set_colormap (PangoContext *context,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
draw_underline (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
PangoUnderline uline,
|
||||
int baseline_y,
|
||||
int low_y,
|
||||
int start_x,
|
||||
int end_x)
|
||||
{
|
||||
switch (uline)
|
||||
{
|
||||
case PANGO_UNDERLINE_NONE:
|
||||
break;
|
||||
case PANGO_UNDERLINE_DOUBLE:
|
||||
gdk_draw_line (drawable, gc,
|
||||
start_x, baseline_y + 3,
|
||||
end_x, baseline_y + 3);
|
||||
/* Fall through */
|
||||
case PANGO_UNDERLINE_SINGLE:
|
||||
gdk_draw_line (drawable, gc,
|
||||
start_x, baseline_y + 1,
|
||||
end_x, baseline_y + 1);
|
||||
break;
|
||||
case PANGO_UNDERLINE_LOW:
|
||||
gdk_draw_line (drawable, gc,
|
||||
start_x, low_y + 1,
|
||||
end_x, low_y + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_draw_layout_line_with_colors:
|
||||
* @drawable: the drawable on which to draw the line
|
||||
@@ -195,6 +226,15 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
|
||||
gint rise = 0;
|
||||
gboolean embossed;
|
||||
GdkBitmap *stipple;
|
||||
PangoUnderline last_uline = PANGO_UNDERLINE_NONE;
|
||||
gint uline_start_x = 0;
|
||||
gint uline_end_x = 0;
|
||||
gint uline_end_x_extended = 0;
|
||||
gint last_risen_y = 0;
|
||||
gint low_y = G_MININT;
|
||||
GdkGC *last_fg_gc = NULL;
|
||||
gboolean last_fg_set = FALSE;
|
||||
PangoColor last_fg_color;
|
||||
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
@@ -206,7 +246,7 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
PangoUnderline uline = PANGO_UNDERLINE_NONE;
|
||||
PangoUnderline this_uline = PANGO_UNDERLINE_NONE;
|
||||
PangoLayoutRun *run = tmp_list->data;
|
||||
PangoColor fg_color, bg_color;
|
||||
gboolean strike, fg_set, bg_set, shape_set;
|
||||
@@ -215,7 +255,7 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
|
||||
gdk_pango_get_item_properties (run->item, &uline,
|
||||
gdk_pango_get_item_properties (run->item, &this_uline,
|
||||
&strike,
|
||||
&rise,
|
||||
&fg_color, &fg_set,
|
||||
@@ -231,7 +271,7 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
|
||||
|
||||
if (!shape_set)
|
||||
{
|
||||
if (uline == PANGO_UNDERLINE_NONE)
|
||||
if (this_uline == PANGO_UNDERLINE_NONE)
|
||||
pango_glyph_string_extents (run->glyphs, run->item->analysis.font,
|
||||
NULL, &logical_rect);
|
||||
else
|
||||
@@ -281,7 +321,7 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
|
||||
}
|
||||
else
|
||||
fg_gc = gc;
|
||||
|
||||
|
||||
if (!shape_set)
|
||||
{
|
||||
gint gx, gy;
|
||||
@@ -304,36 +344,58 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
|
||||
gx, gy,
|
||||
run->glyphs);
|
||||
}
|
||||
|
||||
switch (uline)
|
||||
|
||||
if (this_uline != last_uline ||
|
||||
risen_y != last_risen_y ||
|
||||
fg_set != last_fg_set ||
|
||||
(fg_set && (last_fg_color.red != fg_color.red ||
|
||||
last_fg_color.green != fg_color.green ||
|
||||
last_fg_color.blue != fg_color.blue)))
|
||||
{
|
||||
case PANGO_UNDERLINE_NONE:
|
||||
break;
|
||||
case PANGO_UNDERLINE_DOUBLE:
|
||||
gdk_draw_line (drawable, fg_gc,
|
||||
x + (x_off + ink_rect.x) / PANGO_SCALE - 1,
|
||||
risen_y + 3,
|
||||
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE,
|
||||
risen_y + 3);
|
||||
/* Fall through */
|
||||
case PANGO_UNDERLINE_SINGLE:
|
||||
gdk_draw_line (drawable, fg_gc,
|
||||
x + (x_off + ink_rect.x) / PANGO_SCALE - 1,
|
||||
risen_y + 1,
|
||||
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE,
|
||||
risen_y + 1);
|
||||
break;
|
||||
case PANGO_UNDERLINE_LOW:
|
||||
gdk_draw_line (drawable, fg_gc,
|
||||
x + (x_off + ink_rect.x) / PANGO_SCALE - 1,
|
||||
risen_y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 1,
|
||||
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE,
|
||||
risen_y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 1);
|
||||
break;
|
||||
/* If only color changes, the underlines extend to the edge
|
||||
* of the logical rectangle so they join up; otherwise they
|
||||
* go 1 pixel beyond the ink rectangle. This doesn't work
|
||||
* for low underlines (they will be at a different y anyways),
|
||||
* so they follow the normal path.
|
||||
*/
|
||||
gboolean extend_uline = (this_uline == last_uline &&
|
||||
this_uline != PANGO_UNDERLINE_LOW &&
|
||||
risen_y == last_risen_y);
|
||||
|
||||
/* Starting a new underline run
|
||||
*/
|
||||
if (last_uline != PANGO_UNDERLINE_NONE)
|
||||
{
|
||||
draw_underline (drawable, last_fg_gc, last_uline,
|
||||
last_risen_y, low_y,
|
||||
uline_start_x,
|
||||
extend_uline ? uline_end_x_extended : uline_end_x);
|
||||
}
|
||||
|
||||
if (this_uline != PANGO_UNDERLINE_NONE)
|
||||
{
|
||||
if (extend_uline)
|
||||
uline_start_x = x + x_off / PANGO_SCALE;
|
||||
else
|
||||
uline_start_x = x + (x_off + ink_rect.x) / PANGO_SCALE - 1;
|
||||
|
||||
low_y = G_MININT;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update current underline segment information
|
||||
*/
|
||||
if (this_uline != PANGO_UNDERLINE_NONE)
|
||||
{
|
||||
uline_end_x = x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE;
|
||||
uline_end_x_extended = x + (x_off + logical_rect.x + logical_rect.width) / PANGO_SCALE - 1;
|
||||
}
|
||||
|
||||
if (this_uline == PANGO_UNDERLINE_LOW)
|
||||
low_y = MAX (low_y, risen_y + (ink_rect.y + ink_rect.height) / PANGO_SCALE);
|
||||
|
||||
if (strike)
|
||||
{
|
||||
{
|
||||
int centerline = logical_rect.y + logical_rect.height / 2;
|
||||
|
||||
gdk_draw_line (drawable, fg_gc,
|
||||
@@ -341,13 +403,29 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
|
||||
risen_y + centerline / PANGO_SCALE,
|
||||
x + (x_off + logical_rect.x + logical_rect.width) / PANGO_SCALE + 1,
|
||||
risen_y + centerline / PANGO_SCALE);
|
||||
}
|
||||
|
||||
if (fg_gc != gc)
|
||||
gdk_pango_free_gc (context, fg_gc);
|
||||
}
|
||||
|
||||
if (last_fg_gc != gc && last_fg_gc)
|
||||
gdk_pango_free_gc (context, last_fg_gc);
|
||||
|
||||
last_risen_y = risen_y;
|
||||
last_uline = this_uline;
|
||||
last_fg_gc = fg_gc;
|
||||
last_fg_set = fg_set;
|
||||
if (fg_set)
|
||||
last_fg_color = fg_color;
|
||||
|
||||
x_off += logical_rect.width;
|
||||
}
|
||||
|
||||
/* Finish off any remaining underlines
|
||||
*/
|
||||
if (last_uline != PANGO_UNDERLINE_NONE)
|
||||
draw_underline (drawable, last_fg_gc, last_uline, last_risen_y, low_y,
|
||||
uline_start_x, uline_end_x);
|
||||
|
||||
if (last_fg_gc != gc && last_fg_gc)
|
||||
gdk_pango_free_gc (context, last_fg_gc);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,11 +34,19 @@
|
||||
#include "gdk-pixbuf-private.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
/* Some convenient names
|
||||
*/
|
||||
#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
|
||||
#define LITTLE
|
||||
#undef BIG
|
||||
#else
|
||||
#define BIG
|
||||
#undef LITTLE
|
||||
#endif
|
||||
#define d(x)
|
||||
|
||||
#define SWAP16(d) GUINT16_SWAP_LE_BE(d)
|
||||
|
||||
|
||||
|
||||
static guint32 mask_table[] = {
|
||||
@@ -363,6 +371,39 @@ rgb8a (GdkImage *image,
|
||||
}
|
||||
}
|
||||
|
||||
/* Bit shifting for 565 and 555 conversion routines
|
||||
*
|
||||
* RGB565 == rrrr rggg gggb bbbb, 16 bit native endian
|
||||
* RGB555 == xrrr rrgg gggb bbbb
|
||||
* ABGR8888: ARGB, 32-bit native endian
|
||||
* RGBA8888: RGBA, 32-bit native endian
|
||||
*/
|
||||
#define R8fromRGB565(d) ((((d) >> 8) & 0xf8) | (((d) >> 13) & 0x7))
|
||||
#define G8fromRGB565(d) ((((d) >> 3) & 0xfc) | (((d) >> 9) & 0x3))
|
||||
#define B8fromRGB565(d) ((((d) << 3) & 0xf8) | (((d) >> 2) & 0x7))
|
||||
|
||||
#define ABGR8888fromRGB565(d) ( ((d) & 0xf800) >> 8 | ((d) & 0xe000) >> 13 \
|
||||
| ((d) & 0x07e0) << 5 | ((d) & 0x0600) >> 1 \
|
||||
| ((d) & 0x001f) << 19 | ((d) & 0x001c) << 14 \
|
||||
| 0xff000000)
|
||||
#define RGBA8888fromRGB565(d) ( ((d) & 0xf800) << 16 | ((d) & 0xe000) << 11 \
|
||||
| ((d) & 0x07e0) << 13 | ((d) & 0x0600) << 7 \
|
||||
| ((d) & 0x001f) << 11 | ((d) & 0x001c) << 6 \
|
||||
| 0xff)
|
||||
|
||||
#define R8fromRGB555(d) (((d) & 0x7c00) >> 7 | ((d) & 0x7000) >> 12)
|
||||
#define G8fromRGB555(d) (((d) & 0x03e0) >> 2 | ((d) & 0x0380) >> 7)
|
||||
#define B8fromRGB555(d) (((d) & 0x001f) << 3 | ((d) & 0x001c) >> 2)
|
||||
|
||||
#define ABGR8888fromRGB555(d) ( ((d) & 0x7c00) >> 7 | ((d) & 0x7000) >> 12 \
|
||||
| ((d) & 0x03e0) << 6 | ((d) & 0x0380) << 1 \
|
||||
| ((d) & 0x001f) << 19 | ((d) & 0x001c) << 14 \
|
||||
| 0xff000000)
|
||||
#define RGBA8888fromRGB555(d) ( ((d) & 0x7c00) << 17 | ((d) & 0x7000) << 12 \
|
||||
| ((d) & 0x03e0) << 14 | ((d) & 0x0380) << 9 \
|
||||
| ((d) & 0x001f) << 11 | ((d) & 0x001c) << 6 \
|
||||
| 0xff)
|
||||
|
||||
/*
|
||||
* convert 16 bits/pixel data
|
||||
* no alpha
|
||||
@@ -372,95 +413,35 @@ static void
|
||||
rgb565lsb (GdkImage *image,
|
||||
guchar *pixels,
|
||||
int rowstride,
|
||||
int x1,
|
||||
int y1,
|
||||
int x2,
|
||||
int y2,
|
||||
int x1,
|
||||
int y1,
|
||||
int x2,
|
||||
int y2,
|
||||
GdkColormap *colormap)
|
||||
{
|
||||
int xx, yy;
|
||||
int bpl;
|
||||
|
||||
#ifdef LITTLE
|
||||
register guint32 *s; /* read 2 pixels at once */
|
||||
#else
|
||||
register guint8 *s; /* read 2 pixels at once */
|
||||
#endif
|
||||
register guint16 *o;
|
||||
register guint16 *s;
|
||||
register guint8 *o;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
|
||||
|
||||
bpl = image->bpl;
|
||||
|
||||
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
#ifdef LITTLE
|
||||
s = (guint32 *) srow;
|
||||
#else
|
||||
s = srow;
|
||||
#endif
|
||||
o = (guint16 *) orow;
|
||||
|
||||
/* check for first pixel odd */
|
||||
xx = x1;
|
||||
if (xx & 1)
|
||||
s = (guint16 *) srow;
|
||||
o = (guint8 *) orow;
|
||||
for (xx = x1; xx < x2; xx ++)
|
||||
{
|
||||
register guint16 data;
|
||||
#ifdef LITTLE
|
||||
data = *((short *) s);
|
||||
#else
|
||||
data = *((short *) s);
|
||||
data = ((data >> 8) & 0xff) | ((data & 0xff) << 8);
|
||||
#endif
|
||||
((char *) o)[0] = ((data >> 8) & 0xf8) | ((data >> 13) & 0x7);
|
||||
((char *) o)[1] = ((data >> 3) & 0xfc) | ((data >> 9) & 0x3);
|
||||
((char *) o)[2] = ((data << 3) & 0xf8) | ((data >> 2) & 0x7);
|
||||
o = (guint16 *) (((char *) o) + 3);
|
||||
++xx;
|
||||
}
|
||||
|
||||
g_assert (!(xx & 1));
|
||||
|
||||
/* if x2 is even, then the -1 does nothing to number of
|
||||
* loop iterations, if x2 is odd then the -1 reduces
|
||||
* iterations by one
|
||||
*/
|
||||
for (; xx < (x2 - 1); xx += 2)
|
||||
{
|
||||
register guint32 data;
|
||||
#ifdef LITTLE
|
||||
data = *s++;
|
||||
*o++ = (data & 0xf800) >> 8 | (data & 0xe000) >> 13
|
||||
| (data & 0x7e0) << 5 | (data & 0x600) >> 1;
|
||||
*o++ = (data & 0x1f) << 3 | (data & 0x1c) >> 2
|
||||
| (data & 0xf8000000) >> 16 | (data & 0xe0000000) >> 21;
|
||||
*o++ = (data & 0x7e00000) >> 19 | (data & 0x6000000) >> 25
|
||||
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
|
||||
#else
|
||||
/* swap endianness first */
|
||||
data = s[1] << 24 | s[0] << 16 | s[3] << 8 | s[2];
|
||||
s += 4;
|
||||
|
||||
*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 */
|
||||
if (x2 & 1)
|
||||
{
|
||||
register guint16 data;
|
||||
#ifdef LITTLE
|
||||
data = *((short *) s);
|
||||
#else
|
||||
data = *((short *) s);
|
||||
data = ((data >> 8) & 0xff) | ((data & 0xff) << 8);
|
||||
#endif
|
||||
((char *) o)[0] = ((data >> 8) & 0xf8) | ((data >> 13) & 0x7);
|
||||
((char *) o)[1] = ((data >> 3) & 0xfc) | ((data >> 9) & 0x3);
|
||||
((char *) o)[2] = ((data << 3) & 0xf8) | ((data >> 2) & 0x7);
|
||||
register guint32 data = *s++;
|
||||
#ifdef BIG
|
||||
data = SWAP16 (data);
|
||||
#endif
|
||||
*o++ = R8fromRGB565 (data);
|
||||
*o++ = G8fromRGB565 (data);
|
||||
*o++ = B8fromRGB565 (data);
|
||||
}
|
||||
srow += bpl;
|
||||
orow += rowstride;
|
||||
@@ -485,87 +466,26 @@ rgb565msb (GdkImage *image,
|
||||
int xx, yy;
|
||||
int bpl;
|
||||
|
||||
#ifdef LITTLE
|
||||
register guint8 *s; /* need to swap data order */
|
||||
#else
|
||||
register guint32 *s; /* read 2 pixels at once */
|
||||
#endif
|
||||
register guint16 *o;
|
||||
register guint16 *s;
|
||||
register guint8 *o;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
|
||||
bpl = image->bpl;
|
||||
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
#ifdef LITTLE
|
||||
s = srow;
|
||||
#else
|
||||
s = (guint32 *) srow;
|
||||
#endif
|
||||
o = (guint16 *) orow;
|
||||
|
||||
xx = x1;
|
||||
|
||||
/* check for first pixel odd */
|
||||
if (xx & 1)
|
||||
s = (guint16 *) srow;
|
||||
o = (guint8 *) orow;
|
||||
for (xx = x1; xx < x2; xx ++)
|
||||
{
|
||||
register guint16 data;
|
||||
register guint32 data = *s++;
|
||||
#ifdef LITTLE
|
||||
data = *((short *) s);
|
||||
data = ((data >> 8) & 0xff) | ((data & 0xff) << 8);
|
||||
#else
|
||||
data = *((short *) s);
|
||||
#endif
|
||||
((char *) o)[0] = ((data >> 8) & 0xf8) | ((data >> 13) & 0x7);
|
||||
((char *) o)[1] = ((data >> 3) & 0xfc) | ((data >> 9) & 0x3);
|
||||
((char *) o)[2] = ((data << 3) & 0xf8) | ((data >> 2) & 0x7);
|
||||
|
||||
o = (guint16 *) (((char *) o) + 3);
|
||||
++xx;
|
||||
}
|
||||
|
||||
g_assert (!(xx & 1));
|
||||
|
||||
/* if x2 is even, then the -1 does nothing to number of
|
||||
* loop iterations, if x2 is odd then the -1 reduces
|
||||
* iterations by one
|
||||
*/
|
||||
for (; xx < (x2 - 1); xx += 2)
|
||||
{
|
||||
register guint32 data;
|
||||
#ifdef LITTLE
|
||||
/* swap endianness first */
|
||||
data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
|
||||
s += 4;
|
||||
*o++ = (data & 0xf800) >> 8 | (data & 0xe000) >> 13
|
||||
| (data & 0x7e0) << 5 | (data & 0x600) >> 1;
|
||||
*o++ = (data & 0x1f) << 3 | (data & 0x1c) >> 2
|
||||
| (data & 0xf8000000) >> 16 | (data & 0xe0000000) >> 21;
|
||||
*o++ = (data & 0x7e00000) >> 19 | (data & 0x6000000) >> 25
|
||||
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
|
||||
#else
|
||||
data = *s++;
|
||||
*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 */
|
||||
if (x2 & 1)
|
||||
{
|
||||
register guint16 data;
|
||||
#ifdef LITTLE
|
||||
data = *((short *) s);
|
||||
data = ((data >> 8) & 0xff) | ((data & 0xff) << 8);
|
||||
#else
|
||||
data = *((short *) s);
|
||||
#endif
|
||||
((char *) o)[0] = ((data >> 8) & 0xf8) | ((data >> 13) & 0x7);
|
||||
((char *) o)[1] = ((data >> 3) & 0xfc) | ((data >> 9) & 0x3);
|
||||
((char *) o)[2] = ((data << 3) & 0xf8) | ((data >> 2) & 0x7);
|
||||
data = SWAP16 (data);
|
||||
#endif
|
||||
*o++ = R8fromRGB565 (data);
|
||||
*o++ = G8fromRGB565 (data);
|
||||
*o++ = B8fromRGB565 (data);
|
||||
}
|
||||
srow += bpl;
|
||||
orow += rowstride;
|
||||
@@ -590,11 +510,7 @@ rgb565alsb (GdkImage *image,
|
||||
int xx, yy;
|
||||
int bpl;
|
||||
|
||||
#ifdef LITTLE
|
||||
register guint16 *s; /* read 1 pixels at once */
|
||||
#else
|
||||
register guint8 *s;
|
||||
#endif
|
||||
register guint16 *s;
|
||||
register guint32 *o;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
@@ -603,31 +519,16 @@ rgb565alsb (GdkImage *image,
|
||||
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
#ifdef LITTLE
|
||||
s = (guint16 *) srow;
|
||||
#else
|
||||
s = (guint8 *) srow;
|
||||
#endif
|
||||
o = (guint32 *) orow;
|
||||
for (xx = x1; xx < x2; xx ++)
|
||||
{
|
||||
register guint32 data;
|
||||
/* rrrrrggg gggbbbbb -> rrrrrRRR ggggggGG bbbbbBBB aaaaaaaa */
|
||||
/* little endian: aaaaaaaa bbbbbBBB ggggggGG rrrrrRRR */
|
||||
register guint32 data = *s++;
|
||||
#ifdef LITTLE
|
||||
data = *s++;
|
||||
*o++ = (data & 0xf800) >> 8 | (data & 0xe000) >> 13
|
||||
| (data & 0x7e0) << 5 | (data & 0x600) >> 1
|
||||
| (data & 0x1f) << 19 | (data & 0x1c) << 14
|
||||
| 0xff000000;
|
||||
*o++ = ABGR8888fromRGB565 (data);
|
||||
#else
|
||||
/* swap endianness first */
|
||||
data = s[0] | s[1] << 8;
|
||||
s += 2;
|
||||
*o++ = (data & 0xf800) << 16 | (data & 0xe000) << 11
|
||||
| (data & 0x7e0) << 13 | (data & 0x600) << 7
|
||||
| (data & 0x1f) << 11 | (data & 0x1c) << 6
|
||||
| 0xff;
|
||||
data = SWAP16 (data);
|
||||
*o++ = RGBA8888fromRGB565 (data);
|
||||
#endif
|
||||
}
|
||||
srow += bpl;
|
||||
@@ -653,11 +554,7 @@ rgb565amsb (GdkImage *image,
|
||||
int xx, yy;
|
||||
int bpl;
|
||||
|
||||
#ifdef LITTLE
|
||||
register guint8 *s;
|
||||
#else
|
||||
register guint16 *s; /* read 1 pixels at once */
|
||||
#endif
|
||||
register guint16 *s;
|
||||
register guint32 *o;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
@@ -666,27 +563,16 @@ rgb565amsb (GdkImage *image,
|
||||
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
s = srow;
|
||||
s = (guint16 *) srow;
|
||||
o = (guint32 *) orow;
|
||||
for (xx = x1; xx < x2; xx ++)
|
||||
{
|
||||
register guint32 data;
|
||||
/* rrrrrggg gggbbbbb -> rrrrrRRR gggggg00 bbbbbBBB aaaaaaaa */
|
||||
/* little endian: aaaaaaaa bbbbbBBB gggggg00 rrrrrRRR */
|
||||
register guint32 data = *s++;
|
||||
#ifdef LITTLE
|
||||
/* swap endianness first */
|
||||
data = s[0] | s[1] << 8;
|
||||
s += 2;
|
||||
*o++ = (data & 0xf800) >> 8 | (data & 0xe000) >> 13
|
||||
| (data & 0x7e0) << 5 | (data & 0x600) >> 1
|
||||
| (data & 0x1f) << 19 | (data & 0x1c) << 14
|
||||
| 0xff000000;
|
||||
data = SWAP16 (data);
|
||||
*o++ = ABGR8888fromRGB565 (data);
|
||||
#else
|
||||
data = *s++;
|
||||
*o++ = (data & 0xf800) << 16 | (data & 0xe000) << 11
|
||||
| (data & 0x7e0) << 13 | (data & 0x600) << 7
|
||||
| (data & 0x1f) << 11 | (data & 0x1c) << 6
|
||||
| 0xff;
|
||||
*o++ = RGBA8888fromRGB565 (data);
|
||||
#endif
|
||||
}
|
||||
srow += bpl;
|
||||
@@ -712,86 +598,26 @@ rgb555lsb (GdkImage *image,
|
||||
int xx, yy;
|
||||
int bpl;
|
||||
|
||||
#ifdef LITTLE
|
||||
register guint32 *s; /* read 2 pixels at once */
|
||||
#else
|
||||
register guint8 *s; /* read 2 pixels at once */
|
||||
#endif
|
||||
register guint16 *o;
|
||||
register guint16 *s;
|
||||
register guint8 *o;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
|
||||
bpl = image->bpl;
|
||||
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
#ifdef LITTLE
|
||||
s = (guint32 *) srow;
|
||||
#else
|
||||
s = srow;
|
||||
#endif
|
||||
o = (guint16 *) orow;
|
||||
|
||||
xx = x1;
|
||||
|
||||
/* check for first odd pixel */
|
||||
if (xx & 1)
|
||||
s = (guint16 *) srow;
|
||||
o = (guint8 *) orow;
|
||||
for (xx = x1; xx < x2; xx ++)
|
||||
{
|
||||
register guint16 data;
|
||||
#ifdef LITTLE
|
||||
data = *((short *) s);
|
||||
#else
|
||||
data = *((short *) s);
|
||||
data = ((data >> 8) & 0xff) | ((data & 0xff) << 8);
|
||||
#endif
|
||||
((char *) o)[0] = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12;
|
||||
((char *) o)[1] = (data & 0x3e0) >> 2 | (data & 0x380) >> 7;
|
||||
((char *) o)[2] = (data & 0x1f) << 3 | (data & 0x1c) >> 2;
|
||||
o = (guint16 *) (((char *) o) + 3);
|
||||
++xx;
|
||||
}
|
||||
|
||||
g_assert (!(xx & 1));
|
||||
|
||||
/* if x2 is even, then the -1 does nothing to number of
|
||||
* loop iterations, if x2 is odd then the -1 reduces
|
||||
* iterations by one
|
||||
*/
|
||||
for (; xx < (x2 - 1); xx += 2)
|
||||
{
|
||||
register guint32 data;
|
||||
#ifdef LITTLE
|
||||
data = *s++;
|
||||
*o++ = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12
|
||||
| (data & 0x3e0) << 6 | (data & 0x380) << 1;
|
||||
*o++ = (data & 0x1f) << 3 | (data & 0x1c) >> 2
|
||||
| (data & 0x7c000000) >> 15 | (data & 0x70000000) >> 20;
|
||||
*o++ = (data & 0x3e00000) >> 18 | (data & 0x3800000) >> 23
|
||||
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
|
||||
#else
|
||||
/* swap endianness first */
|
||||
data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
|
||||
s += 4;
|
||||
*o++ = (data & 0x7c00) << 1 | (data & 0x7000) >> 4
|
||||
| (data & 0x3e0) >> 2 | (data & 0x380) >> 7;
|
||||
*o++ = (data & 0x1f) << 11 | (data & 0x1c) << 6
|
||||
| (data & 0x7c000000) >> 23 | (data & 0x70000000) >> 28;
|
||||
*o++ = (data & 0x3e00000) >> 10 | (data & 0x3800000) >> 15
|
||||
| (data & 0x1f0000) >> 13 | (data & 0x1c0000) >> 18;
|
||||
#endif
|
||||
}
|
||||
/* check for last remaining pixel */
|
||||
if (x2 & 1)
|
||||
{
|
||||
register guint16 data;
|
||||
#ifdef LITTLE
|
||||
data = *((short *) s);
|
||||
#else
|
||||
data = *((short *) s);
|
||||
data = ((data >> 8) & 0xff) | ((data & 0xff) << 8);
|
||||
#endif
|
||||
((char *) o)[0] = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12;
|
||||
((char *) o)[1] = (data & 0x3e0) >> 2 | (data & 0x380) >> 7;
|
||||
((char *) o)[2] = (data & 0x1f) << 3 | (data & 0x1c) >> 2;
|
||||
register guint32 data = *s++;
|
||||
#ifdef BIG
|
||||
data = SWAP16 (data);
|
||||
#endif
|
||||
*o++ = R8fromRGB555 (data);
|
||||
*o++ = G8fromRGB555 (data);
|
||||
*o++ = B8fromRGB555 (data);
|
||||
}
|
||||
srow += bpl;
|
||||
orow += rowstride;
|
||||
@@ -816,82 +642,26 @@ rgb555msb (GdkImage *image,
|
||||
int xx, yy;
|
||||
int bpl;
|
||||
|
||||
#ifdef LITTLE
|
||||
register guint8 *s; /* read 2 pixels at once */
|
||||
#else
|
||||
register guint32 *s; /* read 2 pixels at once */
|
||||
#endif
|
||||
register guint16 *o;
|
||||
register guint16 *s;
|
||||
register guint8 *o;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
|
||||
bpl = image->bpl;
|
||||
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
s = srow;
|
||||
o = (guint16 *) orow;
|
||||
|
||||
xx = x1;
|
||||
/* See if first pixel is odd */
|
||||
if (xx & 1)
|
||||
s = (guint16 *) srow;
|
||||
o = (guint8 *) orow;
|
||||
for (xx = x1; xx < x2; xx ++)
|
||||
{
|
||||
register guint16 data;
|
||||
register guint32 data = *s++;
|
||||
#ifdef LITTLE
|
||||
data = *((short *) s);
|
||||
data = ((data >> 8) & 0xff) | ((data & 0xff) << 8);
|
||||
#else
|
||||
data = *((short *) s);
|
||||
#endif
|
||||
((char *) o)[0] = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12;
|
||||
((char *) o)[1] = (data & 0x3e0) >> 2 | (data & 0x380) >> 7;
|
||||
((char *) o)[2] = (data & 0x1f) << 3 | (data & 0x1c) >> 2;
|
||||
|
||||
o = (guint16 *) (((char *) o) + 3);
|
||||
++xx;
|
||||
}
|
||||
|
||||
g_assert (!(xx & 1));
|
||||
|
||||
/* if x2 is even, then the -1 does nothing to number of
|
||||
* loop iterations, if x2 is odd then the -1 reduces
|
||||
* iterations by one
|
||||
*/
|
||||
for (; xx < (x2 - 1); xx += 2)
|
||||
{
|
||||
register guint32 data;
|
||||
#ifdef LITTLE
|
||||
/* swap endianness first */
|
||||
data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
|
||||
s += 4;
|
||||
*o++ = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12
|
||||
| (data & 0x3e0) << 6 | (data & 0x380) << 1;
|
||||
*o++ = (data & 0x1f) << 3 | (data & 0x1c) >> 2
|
||||
| (data & 0x7c000000) >> 15 | (data & 0x70000000) >> 20;
|
||||
*o++ = (data & 0x3e00000) >> 18 | (data & 0x3800000) >> 23
|
||||
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
|
||||
#else
|
||||
data = *s++;
|
||||
*o++ = (data & 0x7c00) << 1 | (data & 0x7000) >> 4
|
||||
| (data & 0x3e0) >> 2 | (data & 0x380) >> 7;
|
||||
*o++ = (data & 0x1f) << 11 | (data & 0x1c) << 6
|
||||
| (data & 0x7c000000) >> 23 | (data & 0x70000000) >> 28;
|
||||
*o++ = (data & 0x3e00000) >> 10 | (data & 0x3800000) >> 15
|
||||
| (data & 0x1f0000) >> 13 | (data & 0x1c0000) >> 18;
|
||||
#endif
|
||||
}
|
||||
/* check for last remaining pixel */
|
||||
if (x2 & 1)
|
||||
{
|
||||
register guint16 data;
|
||||
#ifdef LITTLE
|
||||
data = *((short *) s);
|
||||
data = ((data >> 8) & 0xff) | ((data & 0xff) << 8);
|
||||
#else
|
||||
data = *((short *) s);
|
||||
#endif
|
||||
((char *) o)[0] = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12;
|
||||
((char *) o)[1] = (data & 0x3e0) >> 2 | (data & 0x380) >> 7;
|
||||
((char *) o)[2] = (data & 0x1f) << 3 | (data & 0x1c) >> 2;
|
||||
data = SWAP16 (data);
|
||||
#endif
|
||||
*o++ = R8fromRGB555 (data);
|
||||
*o++ = G8fromRGB555 (data);
|
||||
*o++ = B8fromRGB555 (data);
|
||||
}
|
||||
srow += bpl;
|
||||
orow += rowstride;
|
||||
@@ -916,11 +686,7 @@ rgb555alsb (GdkImage *image,
|
||||
int xx, yy;
|
||||
int bpl;
|
||||
|
||||
#ifdef LITTLE
|
||||
register guint16 *s; /* read 1 pixels at once */
|
||||
#else
|
||||
register guint8 *s;
|
||||
#endif
|
||||
register guint32 *o;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
@@ -929,31 +695,16 @@ rgb555alsb (GdkImage *image,
|
||||
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
#ifdef LITTLE
|
||||
s = (guint16 *) srow;
|
||||
#else
|
||||
s = srow;
|
||||
#endif
|
||||
o = (guint32 *) orow;
|
||||
for (xx = x1; xx < x2; xx++)
|
||||
{
|
||||
register guint32 data;
|
||||
/* rrrrrggg gggbbbbb -> rrrrrRRR gggggGGG bbbbbBBB aaaaaaaa */
|
||||
/* little endian: aaaaaaaa bbbbbBBB gggggGGG rrrrrRRR */
|
||||
register guint32 data = *s++;
|
||||
#ifdef LITTLE
|
||||
data = *s++;
|
||||
*o++ = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12
|
||||
| (data & 0x3e0) << 6 | (data & 0x380) << 1
|
||||
| (data & 0x1f) << 19 | (data & 0x1c) << 14
|
||||
| 0xff000000;
|
||||
*o++ = ABGR8888fromRGB555 (data);
|
||||
#else
|
||||
/* swap endianness first */
|
||||
data = s[0] | s[1] << 8;
|
||||
s += 2;
|
||||
*o++ = (data & 0x7c00) << 17 | (data & 0x7000) << 12
|
||||
| (data & 0x3e0) << 14 | (data & 0x380) << 9
|
||||
| (data & 0x1f) << 11 | (data & 0x1c) << 6
|
||||
| 0xff;
|
||||
data = SWAP16 (data);
|
||||
*o++ = RGBA8888fromRGB555 (data);
|
||||
#endif
|
||||
}
|
||||
srow += bpl;
|
||||
@@ -979,11 +730,7 @@ rgb555amsb (GdkImage *image,
|
||||
int xx, yy;
|
||||
int bpl;
|
||||
|
||||
#ifdef LITTLE
|
||||
register guint16 *s; /* read 1 pixels at once */
|
||||
#else
|
||||
register guint8 *s;
|
||||
#endif
|
||||
register guint16 *s;
|
||||
register guint32 *o;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
@@ -992,31 +739,16 @@ rgb555amsb (GdkImage *image,
|
||||
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
#ifdef LITTLE
|
||||
s = (guint16 *) srow;
|
||||
#else
|
||||
s = srow;
|
||||
#endif
|
||||
o = (guint32 *) orow;
|
||||
for (xx = x1; xx < x2; xx++)
|
||||
{
|
||||
register guint32 data;
|
||||
/* rrrrrggg gggbbbbb -> rrrrrRRR gggggGGG bbbbbBBB aaaaaaaa */
|
||||
/* little endian: aaaaaaaa bbbbbBBB gggggGGG rrrrrRRR */
|
||||
register guint32 data = *s++;
|
||||
#ifdef LITTLE
|
||||
/* swap endianness first */
|
||||
data = s[0] | s[1] << 8;
|
||||
s += 2;
|
||||
*o++ = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12
|
||||
| (data & 0x3e0) << 6 | (data & 0x380) << 1
|
||||
| (data & 0x1f) << 19 | (data & 0x1c) << 14
|
||||
| 0xff000000;
|
||||
data = SWAP16 (data);
|
||||
*o++ = ABGR8888fromRGB555 (data);
|
||||
#else
|
||||
data = *s++;
|
||||
*o++ = (data & 0x7c00) << 17 | (data & 0x7000) << 12
|
||||
| (data & 0x3e0) << 14 | (data & 0x380) << 9
|
||||
| (data & 0x1f) << 11 | (data & 0x1c) << 6
|
||||
| 0xff;
|
||||
*o++ = RGBA8888fromRGB555 (data);
|
||||
#endif
|
||||
}
|
||||
srow += bpl;
|
||||
@@ -1114,13 +846,8 @@ rgb888amsb (GdkImage *image,
|
||||
int bpl;
|
||||
|
||||
guint8 *srow = (guint8*)image->mem + y1 * image->bpl + x1 * image->bpp, *orow = pixels;
|
||||
#ifdef LITTLE
|
||||
guint32 *o;
|
||||
guint32 *s;
|
||||
#else
|
||||
guint8 *s; /* for byte order swapping */
|
||||
guint8 *o;
|
||||
#endif
|
||||
|
||||
d (printf ("32 bit, msb, with alpha\n"));
|
||||
|
||||
@@ -1129,24 +856,14 @@ rgb888amsb (GdkImage *image,
|
||||
/* msb data */
|
||||
for (yy = y1; yy < y2; yy++)
|
||||
{
|
||||
#ifdef LITTLE
|
||||
s = (guint32 *) srow;
|
||||
o = (guint32 *) orow;
|
||||
#else
|
||||
s = srow;
|
||||
o = orow;
|
||||
#endif
|
||||
for (xx = x1; xx < x2; xx++)
|
||||
{
|
||||
#ifdef LITTLE
|
||||
*o++ = s[1];
|
||||
*o++ = s[2];
|
||||
*o++ = s[3];
|
||||
*o++ = 0xff;
|
||||
s += 4;
|
||||
*o++ = (*s++ >> 8) | 0xff000000;
|
||||
#else
|
||||
*o++ = (*s << 8) | 0xff; /* untested */
|
||||
s++;
|
||||
*o++ = (*s++ << 8) | 0xff;
|
||||
#endif
|
||||
}
|
||||
srow += bpl;
|
||||
|
||||
19
gdk/gdkrgb.c
19
gdk/gdkrgb.c
@@ -207,7 +207,7 @@ gdk_rgb_make_colorcube_d (GdkRgbInfo *image_info, gulong *pixels,
|
||||
|
||||
/* Try installing a color cube of the specified size.
|
||||
Make the colorcube and return TRUE on success */
|
||||
static gint
|
||||
static gboolean
|
||||
gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
|
||||
gint nr, gint ng, gint nb)
|
||||
{
|
||||
@@ -217,7 +217,6 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
|
||||
GdkColormap *cmap;
|
||||
GdkColor color;
|
||||
gulong pixels[256];
|
||||
gulong junk[256];
|
||||
gint i;
|
||||
gint d2;
|
||||
gint colors_needed;
|
||||
@@ -277,22 +276,6 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (colors_needed &&
|
||||
image_info->visual->type != GDK_VISUAL_STATIC_COLOR)
|
||||
{
|
||||
if (!gdk_colors_alloc (cmap, 0, NULL, 0, junk, colors_needed))
|
||||
{
|
||||
char tmp_str[80];
|
||||
|
||||
g_snprintf (tmp_str, 80,
|
||||
"%d %d %d colormap failed (in gdk_colors_alloc)\n",
|
||||
nr, ng, nb);
|
||||
return gdk_rgb_cmap_fail (tmp_str, cmap, pixels);
|
||||
}
|
||||
|
||||
gdk_colors_free (cmap, junk, colors_needed, 0);
|
||||
}
|
||||
|
||||
for (r = 0, i = 0; r < nr; r++)
|
||||
for (g = 0; g < ng; g++)
|
||||
for (b = 0; b < nb; b++, i++)
|
||||
|
||||
@@ -354,6 +354,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
|
||||
}
|
||||
|
||||
_gdk_windowing_window_destroy (window, recursing, foreign_destroy);
|
||||
private->parent = NULL;
|
||||
private->destroyed = TRUE;
|
||||
|
||||
if (private->filters)
|
||||
@@ -780,17 +781,20 @@ gboolean
|
||||
gdk_window_is_viewable (GdkWindow *window)
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkScreen *screen = gdk_drawable_get_screen (window);
|
||||
GdkWindow *root_window = gdk_screen_get_root_window (screen);
|
||||
GdkScreen *screen;
|
||||
GdkWindow *root_window;
|
||||
|
||||
g_return_val_if_fail (window != NULL, FALSE);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
||||
|
||||
screen = gdk_drawable_get_screen (window);
|
||||
root_window = gdk_screen_get_root_window (screen);
|
||||
|
||||
while (private &&
|
||||
(private != (GdkWindowObject *)root_window) &&
|
||||
(GDK_WINDOW_TYPE (private) != GDK_WINDOW_FOREIGN))
|
||||
{
|
||||
if (!GDK_WINDOW_IS_MAPPED (window))
|
||||
if (GDK_WINDOW_DESTROYED (window) || !GDK_WINDOW_IS_MAPPED (window))
|
||||
return FALSE;
|
||||
|
||||
private = (GdkWindowObject *)private->parent;
|
||||
@@ -2661,7 +2665,7 @@ gdk_window_constrain_size (GdkGeometry *geometry,
|
||||
|
||||
if (geometry->min_aspect * height > width)
|
||||
{
|
||||
delta = FLOOR (height - width * geometry->min_aspect, yinc);
|
||||
delta = FLOOR (height - width / geometry->min_aspect, yinc);
|
||||
if (height - delta >= min_height)
|
||||
height -= delta;
|
||||
else
|
||||
|
||||
@@ -40,7 +40,7 @@ struct _GdkFBKeyboard {
|
||||
gint io_tag;
|
||||
|
||||
guint modifier_state;
|
||||
gboolean caps_lock : 1;
|
||||
guint caps_lock : 1;
|
||||
|
||||
gint group;
|
||||
gint level;
|
||||
|
||||
@@ -119,7 +119,7 @@ struct _GdkWindowFBData
|
||||
|
||||
GdkRegion *shape; /* Can also be GDK_FB_USE_CHILD_SHAPE */
|
||||
|
||||
gboolean realized : 1;
|
||||
guint realized : 1;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -338,9 +338,9 @@ struct _GdkFBDrawingContext {
|
||||
guint rowstride, clip_rowstride;
|
||||
int clipxoff, clipyoff;
|
||||
|
||||
gboolean draw_bg : 1;
|
||||
gboolean copy_region : 1;
|
||||
gboolean handle_cursor : 1;
|
||||
guint draw_bg : 1;
|
||||
guint copy_region : 1;
|
||||
guint handle_cursor : 1;
|
||||
};
|
||||
|
||||
void gdk_fb_drawing_context_init (GdkFBDrawingContext *dc,
|
||||
|
||||
@@ -1551,7 +1551,7 @@ gdk_window_get_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
g_return_val_if_fail (window != NULL, 0);
|
||||
g_return_val_if_fail (window != NULL, FALSE);
|
||||
|
||||
if (x)
|
||||
*x = GDK_DRAWABLE_IMPL_FBDATA (window)->abs_x;
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
####
|
||||
#### Out of order! Use autoconfiscation.
|
||||
####
|
||||
|
||||
## Makefile for building the GDK DLL with gcc on Win32
|
||||
## Use: make -f makefile.mingw
|
||||
|
||||
## There is no install target, you have to decide where and
|
||||
## how to install for yourself.
|
||||
|
||||
TOP = ../..
|
||||
|
||||
include ../build/win32/make.mingw
|
||||
|
||||
# Possibly override versions from build/win32/module.defs
|
||||
GTK_VER = @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@
|
||||
GDK_PIXBUF_VER = @GDK_PIXBUF_MAJOR@.@GDK_PIXBUF_MINOR@
|
||||
|
||||
GDK_PIXBUF_LIBS = -L ../gdk-pixbuf -lgdk_pixbuf-$(GDK_PIXBUF_VER)
|
||||
|
||||
OPTIMIZE = -g
|
||||
|
||||
INCLUDES = -I . -I .. -I ../gdk-pixbuf
|
||||
DEPCFLAGS = $(GLIB_CFLAGS) $(PANGO_CFLAGS)
|
||||
DEFINES = -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" -DGDK_COMPILATION
|
||||
|
||||
all: \
|
||||
../config.h \
|
||||
gdkconfig.h \
|
||||
win32/libgdk-win32.a \
|
||||
win32/gdk-win32res.o \
|
||||
gdk-win32-$(GTK_VER).dll
|
||||
|
||||
gdk_OBJECTS = \
|
||||
gdk.o \
|
||||
gdkcolor.o \
|
||||
gdkcursor.o \
|
||||
gdkdraw.o \
|
||||
gdkevents.o \
|
||||
gdkfont.o \
|
||||
gdkgc.o \
|
||||
gdkglobals.o \
|
||||
gdkimage.o \
|
||||
gdkkeys.o \
|
||||
gdkkeyuni.o \
|
||||
gdkpango.o \
|
||||
gdkpixbuf-drawable.o \
|
||||
gdkpixbuf-render.o \
|
||||
gdkpixmap.o \
|
||||
gdkpolyreg-generic.o \
|
||||
gdkrgb.o \
|
||||
gdkrectangle.o \
|
||||
gdkregion-generic.o \
|
||||
gdkwindow.o
|
||||
|
||||
../config.h : ../config.h.win32
|
||||
cp $< $@
|
||||
|
||||
gdkconfig.h : gdkconfig.h.win32
|
||||
cp $< $@
|
||||
|
||||
win32/libgdk-win32.a : FRC
|
||||
cd win32 && $(MAKE) -f makefile.mingw libgdk-win32.a
|
||||
|
||||
win32/gdk-win32res.o : FRC
|
||||
cd win32 && $(MAKE) -f makefile.mingw gdk-win32res.o
|
||||
|
||||
gdk-win32-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def win32/libgdk-win32.a win32/gdk-win32res.o win32/libwntab32x.a
|
||||
$(GLIB)/build-dll gdk-win32 $(GTK_VER) gdk.def $(gdk_OBJECTS) win32/libgdk-win32.a win32/libwntab32x.a $(GDK_PIXBUF_LIBS) $(GLIB_LIBS) $(PANGOWIN32_LIBS) -lgdi32 -luser32 -limm32 -lshell32 -lole32 -luuid $(LDFLAGS) win32/gdk-win32res.o
|
||||
|
||||
win32/libwntab32x.a : FRC
|
||||
cd win32 && $(MAKE) -f makefile.mingw libwntab32x.a
|
||||
|
||||
# Hack to get an updated makefile.mingw automatically after updating
|
||||
# makefile.mingw.in. Only for developer use.
|
||||
makefile.mingw: makefile.mingw.in
|
||||
sed -e 's,@GTK_MAJOR[_]VERSION@,@GTK_MAJOR_VERSION@,' \
|
||||
-e 's,@GTK_MINOR[_]VERSION@,@GTK_MINOR_VERSION@,' \
|
||||
-e 's,@GDK_PIXBUF[_]MAJOR@,@GDK_PIXBUF_MAJOR@,' \
|
||||
-e 's,@GDK_PIXBUF[_]MINOR@,@GDK_PIXBUF_MINOR@,' <$< >$@
|
||||
|
||||
.PHONY: FRC
|
||||
@@ -40,7 +40,6 @@ SUBDIRS=rc
|
||||
|
||||
EXTRA_DIST = \
|
||||
bdfcursor.c \
|
||||
makefile.mingw \
|
||||
makefile.msc \
|
||||
libie55uuid.la \
|
||||
libwntab32x.la
|
||||
|
||||
@@ -96,10 +96,10 @@ gdk_cursor_new_for_display (GdkDisplay *display,
|
||||
hcursor = _gdk_win32_data_to_wcursor (cursor_type);
|
||||
|
||||
if (hcursor == NULL)
|
||||
g_warning ("gdk_cursor_new: no cursor %d found", cursor_type);
|
||||
g_warning ("gdk_cursor_new_for_display: no cursor %d found", cursor_type);
|
||||
else
|
||||
GDK_NOTE (MISC, g_print ("gdk_cursor_new: %d: %#x\n",
|
||||
cursor_type, (guint) hcursor));
|
||||
GDK_NOTE (MISC, g_print ("gdk_cursor_new_for_display: %d: %p\n",
|
||||
cursor_type, hcursor));
|
||||
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->hcursor = hcursor;
|
||||
@@ -268,12 +268,12 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
||||
and_mask, xor_mask);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_cursor_new_from_pixmap: "
|
||||
"%#x (%dx%d) %#x (%dx%d) = %#x (%dx%d)\n",
|
||||
(guint) GDK_PIXMAP_HBITMAP (source),
|
||||
"%p (%dx%d) %p (%dx%d) = %p (%dx%d)\n",
|
||||
GDK_PIXMAP_HBITMAP (source),
|
||||
source_impl->width, source_impl->height,
|
||||
(guint) GDK_PIXMAP_HBITMAP (mask),
|
||||
GDK_PIXMAP_HBITMAP (mask),
|
||||
mask_impl->width, mask_impl->height,
|
||||
(guint) hcursor, cursor_width, cursor_height));
|
||||
hcursor, cursor_width, cursor_height));
|
||||
|
||||
g_free (xor_mask);
|
||||
g_free (and_mask);
|
||||
@@ -295,11 +295,11 @@ _gdk_cursor_destroy (GdkCursor *cursor)
|
||||
g_return_if_fail (cursor != NULL);
|
||||
private = (GdkCursorPrivate *) cursor;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("_gdk_cursor_destroy: %#x\n",
|
||||
(cursor->type == GDK_CURSOR_IS_PIXMAP) ? (guint) private->hcursor : 0));
|
||||
GDK_NOTE (MISC, g_print ("_gdk_cursor_destroy: %p\n",
|
||||
(cursor->type == GDK_CURSOR_IS_PIXMAP) ? private->hcursor : 0));
|
||||
|
||||
if (GetCursor() == private->hcursor)
|
||||
SetCursor(NULL);
|
||||
if (GetCursor () == private->hcursor)
|
||||
SetCursor (NULL);
|
||||
|
||||
if (!DestroyCursor (private->hcursor))
|
||||
WIN32_API_FAILED ("DestroyCursor");
|
||||
|
||||
@@ -1214,18 +1214,14 @@ draw_segments (GdkGCWin32 *gcwin32,
|
||||
}
|
||||
else
|
||||
GDI_CALL (MoveToEx, (hdc, segs[i].x1, segs[i].y1, NULL)) &&
|
||||
GDI_CALL (LineTo, (hdc, segs[i].x2, segs[i].y2)) &&
|
||||
(gcwin32->pen_width <= 1 &&
|
||||
GDI_CALL (LineTo, (hdc, segs[i].x2 + 1, segs[i].y2 + 1)));
|
||||
GDI_CALL (LineTo, (hdc, segs[i].x2, segs[i].y2));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < nsegs; i++)
|
||||
GDI_CALL (MoveToEx, (hdc, segs[i].x1, segs[i].y1, NULL)) &&
|
||||
GDI_CALL (LineTo, (hdc, segs[i].x2, segs[i].y2)) &&
|
||||
(gcwin32->pen_width <= 1 &&
|
||||
GDI_CALL (LineTo, (hdc, segs[i].x2 + 1, segs[i].y2 + 1)));
|
||||
GDI_CALL (LineTo, (hdc, segs[i].x2, segs[i].y2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,13 +36,23 @@
|
||||
/* Do use SetCapture, it works now. Thanks to jpe@archaeopteryx.com */
|
||||
#define USE_SETCAPTURE 1
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib/gprintf.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 "gdk.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
#include "gdkinput-win32.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
#include <windowsx.h>
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
@@ -50,12 +60,6 @@
|
||||
|
||||
#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>
|
||||
|
||||
#if defined (__GNUC__) && defined (HAVE_DIMM_H)
|
||||
@@ -169,8 +173,8 @@ real_window_procedure (HWND hwnd,
|
||||
msg.lParam = lparam;
|
||||
msg.time = _gdk_win32_get_next_tick (0);
|
||||
pos = GetMessagePos ();
|
||||
msg.pt.x = LOWORD (pos);
|
||||
msg.pt.y = HIWORD (pos);
|
||||
msg.pt.x = GET_X_LPARAM (pos);
|
||||
msg.pt.y = GET_Y_LPARAM (pos);
|
||||
|
||||
event = gdk_event_new (GDK_NOTHING);
|
||||
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
|
||||
@@ -199,6 +203,7 @@ real_window_procedure (HWND hwnd,
|
||||
return ret_val;
|
||||
else
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print("calling DefWindowProc\n"));
|
||||
#ifndef HAVE_DIMM_H
|
||||
return DefWindowProc (hwnd, message, wparam, lparam);
|
||||
#else
|
||||
@@ -527,8 +532,8 @@ gdk_pointer_grab (GdkWindow *window,
|
||||
|
||||
if (!cursor)
|
||||
hcursor = NULL;
|
||||
else
|
||||
hcursor = cursor_private->hcursor;
|
||||
else if ((hcursor = CopyCursor (cursor_private->hcursor)) == NULL)
|
||||
WIN32_API_FAILED ("CopyCursor");
|
||||
#if 0
|
||||
return_val = _gdk_input_grab_pointer (window,
|
||||
owner_events,
|
||||
@@ -562,6 +567,9 @@ gdk_pointer_grab (GdkWindow *window,
|
||||
{
|
||||
p_grab_window = window;
|
||||
p_grab_cursor = hcursor;
|
||||
|
||||
if (p_grab_cursor != NULL)
|
||||
SetCursor (p_grab_cursor);
|
||||
}
|
||||
|
||||
return return_val;
|
||||
@@ -584,6 +592,13 @@ gdk_display_pointer_ungrab (GdkDisplay *display,
|
||||
#endif
|
||||
|
||||
p_grab_window = NULL;
|
||||
if (p_grab_cursor != NULL)
|
||||
{
|
||||
if (GetCursor () == p_grab_cursor)
|
||||
SetCursor (NULL);
|
||||
DestroyCursor (p_grab_cursor);
|
||||
p_grab_cursor = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -879,6 +894,8 @@ build_keypress_event (GdkEvent *event,
|
||||
event->key.group = 0; /* ??? */
|
||||
event->key.keyval = GDK_VoidSymbol;
|
||||
|
||||
build_key_event_state (event);
|
||||
|
||||
if (msg->message == WM_IME_COMPOSITION)
|
||||
{
|
||||
himc = ImmGetContext (msg->hwnd);
|
||||
@@ -902,7 +919,11 @@ build_keypress_event (GdkEvent *event,
|
||||
/* For ASCII control chars, the keyval should be the
|
||||
* corresponding ASCII character.
|
||||
*/
|
||||
event->key.keyval = msg->wParam + '@';
|
||||
if ((event->key.state & GDK_SHIFT_MASK) == 0)
|
||||
event->key.keyval = msg->wParam + '`';
|
||||
else
|
||||
event->key.keyval = msg->wParam + '@';
|
||||
|
||||
/* This is needed in case of Alt+nnn or Alt+0nnn (on the numpad)
|
||||
* where nnn<32
|
||||
*/
|
||||
@@ -936,8 +957,6 @@ build_keypress_event (GdkEvent *event,
|
||||
wbuf, G_N_ELEMENTS (wbuf));
|
||||
}
|
||||
|
||||
build_key_event_state (event);
|
||||
|
||||
/* Build UTF-8 string */
|
||||
if (ucount > 0)
|
||||
{
|
||||
@@ -970,12 +989,18 @@ build_keyrelease_event (GdkEvent *event,
|
||||
event->key.state = 0;
|
||||
event->key.group = 0; /* ??? */
|
||||
|
||||
build_key_event_state (event);
|
||||
|
||||
if (msg->message == WM_CHAR || msg->message == WM_SYSCHAR)
|
||||
{
|
||||
event->key.hardware_keycode = vk_from_char (msg->wParam);
|
||||
if (msg->wParam < ' ')
|
||||
{
|
||||
event->key.keyval = msg->wParam + '@';
|
||||
if ((event->key.state & GDK_SHIFT_MASK) == 0)
|
||||
event->key.keyval = msg->wParam + '`';
|
||||
else
|
||||
event->key.keyval = msg->wParam + '@';
|
||||
|
||||
event->key.state |= GDK_CONTROL_MASK;
|
||||
}
|
||||
else
|
||||
@@ -992,7 +1017,7 @@ build_keyrelease_event (GdkEvent *event,
|
||||
event->key.keyval = GDK_VoidSymbol;
|
||||
event->key.hardware_keycode = 0; /* ??? */
|
||||
}
|
||||
build_key_event_state (event);
|
||||
|
||||
event->key.string = NULL;
|
||||
event->key.length = 0;
|
||||
}
|
||||
@@ -1218,11 +1243,11 @@ synthesize_enter_event (GdkWindow *window,
|
||||
if (!(GDK_WINDOW_OBJECT (window)->event_mask & GDK_ENTER_NOTIFY_MASK))
|
||||
return;
|
||||
|
||||
/* Enter events are at LOWORD (msg->lParam), HIWORD
|
||||
/* Enter events are at GET_X_LPARAM (msg->lParam), GET_Y_LPARAM
|
||||
* (msg->lParam) in msg->hwnd */
|
||||
|
||||
pt.x = LOWORD (msg->lParam);
|
||||
pt.y = HIWORD (msg->lParam);
|
||||
pt.x = GET_X_LPARAM (msg->lParam);
|
||||
pt.y = GET_Y_LPARAM (msg->lParam);
|
||||
if (msg->hwnd != GDK_WINDOW_HWND (window))
|
||||
{
|
||||
ClientToScreen (msg->hwnd, &pt);
|
||||
@@ -1462,11 +1487,12 @@ translate_mouse_coords (GdkWindow *window1,
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
pt.x = LOWORD (msg->lParam);
|
||||
pt.y = HIWORD (msg->lParam);
|
||||
pt.x = GET_X_LPARAM (msg->lParam);
|
||||
pt.y = GET_Y_LPARAM (msg->lParam);
|
||||
ClientToScreen (GDK_WINDOW_HWND (window1), &pt);
|
||||
ScreenToClient (GDK_WINDOW_HWND (window2), &pt);
|
||||
msg->lParam = MAKELPARAM (pt.x, pt.y);
|
||||
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are (%ld,%ld)\n", pt.x, pt.y));
|
||||
}
|
||||
|
||||
@@ -1875,6 +1901,23 @@ gdk_event_translate (GdkDisplay *display,
|
||||
if (ret_val_flagp)
|
||||
*ret_val_flagp = FALSE;
|
||||
|
||||
/* init these, since the done: block uses them */
|
||||
ASSIGN_WINDOW (NULL);
|
||||
event->any.window = NULL;
|
||||
|
||||
if (_gdk_default_filters)
|
||||
{
|
||||
/* Apply global filters */
|
||||
GdkFilterReturn result;
|
||||
result = gdk_event_apply_filters (msg, event, _gdk_default_filters);
|
||||
|
||||
if (result != GDK_FILTER_CONTINUE)
|
||||
{
|
||||
return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
ASSIGN_WINDOW (gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd));
|
||||
orig_window = window;
|
||||
|
||||
@@ -1969,8 +2012,8 @@ gdk_event_translate (GdkDisplay *display,
|
||||
* around that. Also, the position is in screen coordinates, not
|
||||
* client coordinates as with the button messages.
|
||||
*/
|
||||
pt.x = LOWORD (msg->lParam);
|
||||
pt.y = HIWORD (msg->lParam);
|
||||
pt.x = GET_X_LPARAM (msg->lParam);
|
||||
pt.y = GET_Y_LPARAM (msg->lParam);
|
||||
if ((hwnd = WindowFromPoint (pt)) == NULL)
|
||||
goto done;
|
||||
|
||||
@@ -2008,8 +2051,8 @@ gdk_event_translate (GdkDisplay *display,
|
||||
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
|
||||
event->scroll.x = (gint16) pt.x + xoffset;
|
||||
event->scroll.y = (gint16) pt.y + yoffset;
|
||||
event->scroll.x_root = (gint16) LOWORD (msg->lParam);
|
||||
event->scroll.y_root = (gint16) HIWORD (msg->lParam);
|
||||
event->scroll.x_root = (gint16) GET_X_LPARAM (msg->lParam);
|
||||
event->scroll.y_root = (gint16) GET_Y_LPARAM (msg->lParam);
|
||||
event->scroll.state = 0; /* No state information with MSH_MOUSEWHEEL */
|
||||
event->scroll.device = display->core_pointer;
|
||||
return_val = !GDK_WINDOW_DESTROYED (window);
|
||||
@@ -2361,7 +2404,20 @@ gdk_event_translate (GdkDisplay *display,
|
||||
break;
|
||||
default:
|
||||
if (msg->message == WM_SYSKEYDOWN || msg->message == WM_SYSKEYUP)
|
||||
event->key.keyval = msg->wParam;
|
||||
{
|
||||
if (msg->wParam >= 'A' && msg->wParam <= 'Z')
|
||||
{
|
||||
/* If Alt-unshifted ASCII letter, lowercase */
|
||||
if (GetKeyState (VK_SHIFT) < 0)
|
||||
event->key.keyval = msg->wParam;
|
||||
else
|
||||
event->key.keyval = msg->wParam + 0x20;
|
||||
}
|
||||
else
|
||||
{
|
||||
event->key.keyval = msg->wParam;
|
||||
}
|
||||
}
|
||||
else
|
||||
ignore_wm_char = FALSE;
|
||||
break;
|
||||
@@ -2382,14 +2438,10 @@ gdk_event_translate (GdkDisplay *display,
|
||||
GDK_KEY_PRESS : GDK_KEY_RELEASE);
|
||||
event->key.time = _gdk_win32_get_next_tick (msg->time);
|
||||
event->key.state = 0;
|
||||
if (GetKeyState (VK_SHIFT) < 0)
|
||||
event->key.state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
event->key.state |= GDK_LOCK_MASK;
|
||||
if (GetKeyState (VK_CONTROL) < 0)
|
||||
event->key.state |= GDK_CONTROL_MASK;
|
||||
if (msg->wParam != VK_MENU && GetKeyState (VK_MENU) < 0)
|
||||
event->key.state |= GDK_MOD1_MASK;
|
||||
build_key_event_state (event);
|
||||
/* Reset MOD1_MASK if it is the Alt key itself */
|
||||
if (msg->wParam == VK_MENU)
|
||||
event->key.state &= ~GDK_MOD1_MASK;
|
||||
event->key.hardware_keycode = msg->wParam;
|
||||
event->key.group = 0;
|
||||
event->key.string = NULL;
|
||||
@@ -2425,6 +2477,13 @@ gdk_event_translate (GdkDisplay *display,
|
||||
if (ignore_wm_char)
|
||||
{
|
||||
ignore_wm_char = FALSE;
|
||||
|
||||
if (msg->wParam != VK_SPACE && ret_val_flagp)
|
||||
{
|
||||
*ret_val_flagp = TRUE;
|
||||
*ret_valp = FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2488,7 +2547,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
g_print ("WM_%cBUTTONDOWN: %p (%d,%d)\n",
|
||||
" LMR"[button],
|
||||
msg->hwnd,
|
||||
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
||||
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
|
||||
|
||||
if (GDK_WINDOW_OBJECT (window)->extension_events != 0
|
||||
&& _gdk_input_ignore_core)
|
||||
@@ -2528,10 +2587,10 @@ gdk_event_translate (GdkDisplay *display,
|
||||
event->button.time = _gdk_win32_get_next_tick (msg->time);
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, msg);
|
||||
event->button.x = current_x = (gint16) LOWORD (msg->lParam);
|
||||
event->button.y = current_y = (gint16) HIWORD (msg->lParam);
|
||||
event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
|
||||
event->button.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
|
||||
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
|
||||
event->button.x += xoffset; /* XXX translate current_x, y too? */
|
||||
event->button.x += xoffset;
|
||||
event->button.y += yoffset;
|
||||
event->button.x_root = current_x_root = msg->pt.x;
|
||||
event->button.y_root = current_y_root = msg->pt.y;
|
||||
@@ -2557,7 +2616,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
g_print ("WM_%cBUTTONUP: %p (%d,%d)\n",
|
||||
" LMR"[button],
|
||||
msg->hwnd,
|
||||
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
||||
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
|
||||
|
||||
ASSIGN_WINDOW (find_window_for_pointer_event (window, msg));
|
||||
|
||||
@@ -2585,9 +2644,11 @@ gdk_event_translate (GdkDisplay *display,
|
||||
event->button.time = _gdk_win32_get_next_tick (msg->time);
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, msg);
|
||||
event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
|
||||
event->button.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
|
||||
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
|
||||
event->button.x = (gint16) LOWORD (msg->lParam) + xoffset;
|
||||
event->button.y = (gint16) HIWORD (msg->lParam) + yoffset;
|
||||
event->button.x += xoffset;
|
||||
event->button.y += yoffset;
|
||||
event->button.x_root = current_x_root = msg->pt.x;
|
||||
event->button.y_root = current_y_root = msg->pt.y;
|
||||
event->button.axes = NULL;
|
||||
@@ -2608,19 +2669,10 @@ gdk_event_translate (GdkDisplay *display,
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("WM_MOUSEMOVE: %p %#x (%d,%d)\n",
|
||||
msg->hwnd, msg->wParam,
|
||||
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
||||
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
|
||||
|
||||
ASSIGN_WINDOW (find_window_for_pointer_event (window, msg));
|
||||
|
||||
/* If we haven't moved, don't create any event.
|
||||
* Windows sends WM_MOUSEMOVE messages after button presses
|
||||
* even if the mouse doesn't move. This disturbs gtk.
|
||||
*/
|
||||
if (window == current_window
|
||||
&& LOWORD (msg->lParam) == current_x
|
||||
&& HIWORD (msg->lParam) == current_y)
|
||||
break;
|
||||
|
||||
/* HB: only process mouse move messages if we own the active window. */
|
||||
GetWindowThreadProcessId (GetActiveWindow (), &pidActWin);
|
||||
GetWindowThreadProcessId (msg->hwnd, &pidThis);
|
||||
@@ -2648,8 +2700,18 @@ gdk_event_translate (GdkDisplay *display,
|
||||
event->motion.time = _gdk_win32_get_next_tick (msg->time);
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, msg);
|
||||
event->motion.x = current_x = (gint16) LOWORD (msg->lParam);
|
||||
event->motion.y = current_y = (gint16) HIWORD (msg->lParam);
|
||||
|
||||
/* If we haven't moved, don't create any event.
|
||||
* Windows sends WM_MOUSEMOVE messages after button presses
|
||||
* even if the mouse doesn't move. This disturbs gtk.
|
||||
*/
|
||||
if (window == current_window
|
||||
&& GET_X_LPARAM (msg->lParam) == current_x
|
||||
&& GET_Y_LPARAM (msg->lParam) == current_y)
|
||||
break;
|
||||
|
||||
event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
|
||||
event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
|
||||
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
|
||||
event->motion.x += xoffset;
|
||||
event->motion.y += yoffset;
|
||||
@@ -2665,9 +2727,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
|
||||
case WM_NCMOUSEMOVE:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("WM_NCMOUSEMOVE: %p x,y: %d %d\n",
|
||||
g_print ("WM_NCMOUSEMOVE: %p (%d,%d)\n",
|
||||
msg->hwnd,
|
||||
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
||||
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
|
||||
if (current_window != NULL
|
||||
&& (GDK_WINDOW_OBJECT (current_window)->event_mask & GDK_LEAVE_NOTIFY_MASK))
|
||||
{
|
||||
@@ -2709,8 +2771,8 @@ gdk_event_translate (GdkDisplay *display,
|
||||
* coordinates as with the button messages. I love the
|
||||
* consistency of Windows.
|
||||
*/
|
||||
pt.x = LOWORD (msg->lParam);
|
||||
pt.y = HIWORD (msg->lParam);
|
||||
pt.x = GET_X_LPARAM (msg->lParam);
|
||||
pt.y = GET_Y_LPARAM (msg->lParam);
|
||||
if ((hwnd = WindowFromPoint (pt)) == NULL)
|
||||
break;
|
||||
|
||||
@@ -2748,8 +2810,8 @@ gdk_event_translate (GdkDisplay *display,
|
||||
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
|
||||
event->scroll.x = (gint16) pt.x + xoffset;
|
||||
event->scroll.y = (gint16) pt.y + yoffset;
|
||||
event->scroll.x_root = (gint16) LOWORD (msg->lParam);
|
||||
event->scroll.y_root = (gint16) HIWORD (msg->lParam);
|
||||
event->scroll.x_root = (gint16) GET_X_LPARAM (msg->lParam);
|
||||
event->scroll.y_root = (gint16) GET_Y_LPARAM (msg->lParam);
|
||||
event->scroll.state = build_pointer_event_state (msg);
|
||||
event->scroll.device = display->core_pointer;
|
||||
return_val = !GDK_WINDOW_DESTROYED (window);
|
||||
@@ -2996,6 +3058,9 @@ gdk_event_translate (GdkDisplay *display,
|
||||
#endif
|
||||
)
|
||||
{
|
||||
GdkWindowState withdrawn_bit =
|
||||
IsWindowVisible (msg->hwnd) ? GDK_WINDOW_STATE_WITHDRAWN : 0;
|
||||
|
||||
if (!(private->event_mask & GDK_STRUCTURE_MASK))
|
||||
break;
|
||||
|
||||
@@ -3017,12 +3082,12 @@ gdk_event_translate (GdkDisplay *display,
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_ICONIFIED |
|
||||
GDK_WINDOW_STATE_MAXIMIZED |
|
||||
GDK_WINDOW_STATE_WITHDRAWN,
|
||||
withdrawn_bit,
|
||||
0);
|
||||
else if (msg->wParam == SIZE_MAXIMIZED)
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_ICONIFIED |
|
||||
GDK_WINDOW_STATE_WITHDRAWN,
|
||||
withdrawn_bit,
|
||||
GDK_WINDOW_STATE_MAXIMIZED);
|
||||
|
||||
if (private->resize_count > 1)
|
||||
@@ -3100,7 +3165,7 @@ gdk_event_translate (GdkDisplay *display,
|
||||
case WM_MOVE:
|
||||
GDK_NOTE (EVENTS, g_print ("WM_MOVE: %p (%d,%d)\n",
|
||||
msg->hwnd,
|
||||
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
||||
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
|
||||
|
||||
if (!(private->event_mask & GDK_STRUCTURE_MASK))
|
||||
break;
|
||||
@@ -3111,8 +3176,8 @@ gdk_event_translate (GdkDisplay *display,
|
||||
{
|
||||
event->configure.type = GDK_CONFIGURE;
|
||||
event->configure.window = window;
|
||||
event->configure.x = LOWORD (msg->lParam);
|
||||
event->configure.y = HIWORD (msg->lParam);
|
||||
event->configure.x = GET_X_LPARAM (msg->lParam);
|
||||
event->configure.y = GET_Y_LPARAM (msg->lParam);
|
||||
GetClientRect (msg->hwnd, &rect);
|
||||
event->configure.width = rect.right;
|
||||
event->configure.height = rect.bottom;
|
||||
|
||||
@@ -1418,17 +1418,17 @@ gdk_font_equal (const GdkFont *fonta,
|
||||
{
|
||||
if (((GdkWin32SingleFont *) lista->data)->hfont
|
||||
!= ((GdkWin32SingleFont *) listb->data)->hfont)
|
||||
return 0;
|
||||
return FALSE;
|
||||
lista = lista->next;
|
||||
listb = listb->next;
|
||||
}
|
||||
if (lista || listb)
|
||||
return 0;
|
||||
return FALSE;
|
||||
else
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Return the Unicode Subset bitfield number for a Unicode character */
|
||||
|
||||
@@ -454,8 +454,10 @@ _gdk_win32_gc_new (GdkDrawable *drawable,
|
||||
win32_gc->fill_style = GDK_SOLID;
|
||||
win32_gc->tile = NULL;
|
||||
win32_gc->stipple = NULL;
|
||||
win32_gc->pen_style = PS_GEOMETRIC|PS_ENDCAP_FLAT|PS_JOIN_MITER;
|
||||
win32_gc->subwindow_mode = GDK_CLIP_BY_CHILDREN;
|
||||
win32_gc->graphics_exposures = TRUE;
|
||||
win32_gc->pen_width = 0;
|
||||
win32_gc->pen_style = PS_GEOMETRIC|PS_ENDCAP_FLAT|PS_JOIN_MITER;
|
||||
win32_gc->pen_dashes = NULL;
|
||||
win32_gc->pen_num_dashes = 0;
|
||||
|
||||
|
||||
@@ -687,7 +687,7 @@ _gdk_input_enter_event (GdkEventCrossing *event,
|
||||
input_window->root_y = root_y;
|
||||
}
|
||||
|
||||
gint
|
||||
gboolean
|
||||
_gdk_input_other_event (GdkEvent *event,
|
||||
MSG *msg,
|
||||
GdkWindow *window)
|
||||
@@ -956,7 +956,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
return -1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -1114,13 +1114,6 @@ _gdk_input_ungrab_pointer (guint32 time)
|
||||
#endif
|
||||
}
|
||||
|
||||
gint
|
||||
_gdk_input_window_none_event (GdkEvent *event,
|
||||
MSG *msg)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_device_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
|
||||
@@ -137,13 +137,11 @@ GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
|
||||
/* The following functions are provided by each implementation
|
||||
* (just wintab for now)
|
||||
*/
|
||||
gint _gdk_input_window_none_event(GdkEvent *event,
|
||||
MSG *msg);
|
||||
void _gdk_input_configure_event (GdkEventConfigure *event,
|
||||
GdkWindow *window);
|
||||
void _gdk_input_enter_event (GdkEventCrossing *event,
|
||||
GdkWindow *window);
|
||||
gint _gdk_input_other_event (GdkEvent *event,
|
||||
gboolean _gdk_input_other_event (GdkEvent *event,
|
||||
MSG *msg,
|
||||
GdkWindow *window);
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "gdkpixmap.h"
|
||||
#include "gdkdisplay.h"
|
||||
|
||||
#include "gdkprivate-win32.h"
|
||||
|
||||
static void gdk_pixmap_impl_win32_get_size (GdkDrawable *drawable,
|
||||
@@ -440,6 +442,16 @@ gdk_pixmap_create_from_data (GdkDrawable *drawable,
|
||||
return result;
|
||||
}
|
||||
|
||||
GdkPixmap *
|
||||
gdk_pixmap_foreign_new_for_display (GdkDisplay *display,
|
||||
GdkNativeWindow anid)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
|
||||
return gdk_pixmap_foreign_new (anid);
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_foreign_new (GdkNativeWindow anid)
|
||||
{
|
||||
@@ -479,3 +491,18 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid)
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_lookup (GdkNativeWindow anid)
|
||||
{
|
||||
return (GdkPixmap*) gdk_win32_handle_table_lookup (anid);
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_lookup_for_display (GdkDisplay *display, GdkNativeWindow anid)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
|
||||
return gdk_pixmap_lookup (anid);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user