Compare commits
347 Commits
gdk-object
...
GTK_1_2_8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52223d33df | ||
|
|
3a5d4e0087 | ||
|
|
b055c28254 | ||
|
|
21d6acdd59 | ||
|
|
71112bd2ea | ||
|
|
76014e2a5f | ||
|
|
5a4b3458f9 | ||
|
|
bb255d8d68 | ||
|
|
90e47067c4 | ||
|
|
42c524897f | ||
|
|
93fe7a1353 | ||
|
|
3d46b64e3d | ||
|
|
5d1c00802e | ||
|
|
eda7c00f58 | ||
|
|
ab364d726a | ||
|
|
7d622f5328 | ||
|
|
ee76654247 | ||
|
|
cc4ef5bcdf | ||
|
|
2e34ce303a | ||
|
|
44e72c4ac1 | ||
|
|
74bd7ec0a1 | ||
|
|
4078590376 | ||
|
|
388e9cc8b1 | ||
|
|
a24c0e61f6 | ||
|
|
877738b90a | ||
|
|
fcfaafd93e | ||
|
|
30cc40d29e | ||
|
|
86171eb551 | ||
|
|
8ae8964c9f | ||
|
|
5d4a62a69b | ||
|
|
572cec3f4c | ||
|
|
a53000aa95 | ||
|
|
ac67b09410 | ||
|
|
e57721e0ba | ||
|
|
fa77e9551f | ||
|
|
01ae7f9537 | ||
|
|
60aea982b0 | ||
|
|
5c478e3754 | ||
|
|
2853369686 | ||
|
|
a326074438 | ||
|
|
778cb9ab52 | ||
|
|
3f8d44d715 | ||
|
|
c39a5a1c6f | ||
|
|
319b25908b | ||
|
|
49bc9e0606 | ||
|
|
81cb919181 | ||
|
|
1f72a1fd70 | ||
|
|
5aa2275d8b | ||
|
|
ed581c7530 | ||
|
|
84591d622b | ||
|
|
d5c5dba8de | ||
|
|
b40cc444eb | ||
|
|
c299e5d963 | ||
|
|
7de47cc94b | ||
|
|
cec440f3e4 | ||
|
|
255369aecb | ||
|
|
c59f760824 | ||
|
|
06b6a0f70a | ||
|
|
dad7ab1fd6 | ||
|
|
bd39b10fc4 | ||
|
|
3dad840ffb | ||
|
|
ef642b7799 | ||
|
|
958d74e856 | ||
|
|
39246639a1 | ||
|
|
e5b7ec7e36 | ||
|
|
b269eb0874 | ||
|
|
9770128fb9 | ||
|
|
c1f4231af6 | ||
|
|
f86f2a2944 | ||
|
|
04d6ead184 | ||
|
|
4249864c0d | ||
|
|
cc7b995f66 | ||
|
|
03fc238e46 | ||
|
|
911ced17c2 | ||
|
|
67dbd575c2 | ||
|
|
c3bf3122da | ||
|
|
1175039476 | ||
|
|
373c75d574 | ||
|
|
fcd4498506 | ||
|
|
7c1abc5f73 | ||
|
|
25b47b88cd | ||
|
|
638080f28a | ||
|
|
087eed88f3 | ||
|
|
ecc7096f83 | ||
|
|
29edc1802f | ||
|
|
bd063a8f9a | ||
|
|
bc36a3cdb0 | ||
|
|
cb0c6a6943 | ||
|
|
ddd28f9d4c | ||
|
|
4ff91a04c0 | ||
|
|
1b1ea194a5 | ||
|
|
d74b6b56e6 | ||
|
|
822fab280f | ||
|
|
7b31d00ddf | ||
|
|
f6e398fa53 | ||
|
|
6eb684bebc | ||
|
|
d8ebd2d78a | ||
|
|
0d4c279b4b | ||
|
|
6c70ce7260 | ||
|
|
828b8b8600 | ||
|
|
bcb86b752f | ||
|
|
0a4ea40510 | ||
|
|
43f31b2e7d | ||
|
|
10b03b35c0 | ||
|
|
ab3a70ee16 | ||
|
|
b0e81d06c0 | ||
|
|
6ed6b20570 | ||
|
|
9230dc1470 | ||
|
|
47e15bdf5f | ||
|
|
e9c55bc8ce | ||
|
|
703f17ec05 | ||
|
|
3b3891191e | ||
|
|
ae1f478285 | ||
|
|
1e8e510300 | ||
|
|
d7e9880433 | ||
|
|
23c00ecebe | ||
|
|
6841c77b0c | ||
|
|
abfd8215f8 | ||
|
|
e69a498bd5 | ||
|
|
ad246fcf51 | ||
|
|
e322f322e2 | ||
|
|
d76955e34b | ||
|
|
003c5dccd0 | ||
|
|
95a5e5cd09 | ||
|
|
fe725cf7d9 | ||
|
|
4a50847abd | ||
|
|
83f3b1e8e3 | ||
|
|
fd37d2bdb0 | ||
|
|
3b8ecf24f6 | ||
|
|
91307e5e87 | ||
|
|
c2aaaf16f3 | ||
|
|
5bfdcc2c3e | ||
|
|
2dc5212004 | ||
|
|
4478fefd28 | ||
|
|
91da226af7 | ||
|
|
f8ca8253f9 | ||
|
|
9b98ede875 | ||
|
|
a97747dfc7 | ||
|
|
5739ca8f3b | ||
|
|
9cc3eb8c0d | ||
|
|
6b5d56e39c | ||
|
|
7a4bc2038f | ||
|
|
6b7f4bb036 | ||
|
|
51bae3f9cd | ||
|
|
60a7c53123 | ||
|
|
ee09d2e5da | ||
|
|
4eb1338d42 | ||
|
|
8e8ac56db5 | ||
|
|
54a90a6c61 | ||
|
|
fc0117177c | ||
|
|
8a7795d2db | ||
|
|
2a0a33bc35 | ||
|
|
cd1c6de2ea | ||
|
|
44a04ee211 | ||
|
|
b107653636 | ||
|
|
90d2cae68c | ||
|
|
369ea6013d | ||
|
|
175b04c33d | ||
|
|
389f174dad | ||
|
|
c98ffe744f | ||
|
|
661d0ad067 | ||
|
|
f04d58dd29 | ||
|
|
0ab9dddc34 | ||
|
|
7347cd702f | ||
|
|
531f44bbdc | ||
|
|
d807397177 | ||
|
|
8014d7db5e | ||
|
|
8cf06479ae | ||
|
|
123914048c | ||
|
|
91645584a5 | ||
|
|
6362c20b8b | ||
|
|
a88d8fff6d | ||
|
|
61f9087af4 | ||
|
|
2b2ee64b60 | ||
|
|
4767c40249 | ||
|
|
844cbfb1ba | ||
|
|
04d23ae07e | ||
|
|
59724766af | ||
|
|
2c331c9fdf | ||
|
|
df57d883b3 | ||
|
|
c9dec55549 | ||
|
|
22a15408bb | ||
|
|
3abc634152 | ||
|
|
ad9263ec39 | ||
|
|
501c87a65d | ||
|
|
f9c868233f | ||
|
|
0285d26804 | ||
|
|
189706f619 | ||
|
|
b4def251f8 | ||
|
|
ddc6217c32 | ||
|
|
80ed2661c5 | ||
|
|
088428655b | ||
|
|
be326a5a7c | ||
|
|
108d82e785 | ||
|
|
c431108d84 | ||
|
|
bd2194afb1 | ||
|
|
39fb4797ae | ||
|
|
10f1fff6ec | ||
|
|
becd87fbd4 | ||
|
|
55c0a94c2c | ||
|
|
c64f52a36c | ||
|
|
b2a084beb4 | ||
|
|
57485d9029 | ||
|
|
92671fe1f6 | ||
|
|
5e049110f3 | ||
|
|
d008fbb84d | ||
|
|
b7fa562427 | ||
|
|
5bfd32fd64 | ||
|
|
b977baed2b | ||
|
|
39024c05ae | ||
|
|
8ec53bf61b | ||
|
|
b6d42f7eb7 | ||
|
|
7a73d7bd4d | ||
|
|
083941009f | ||
|
|
eb0859b277 | ||
|
|
bb2b76689c | ||
|
|
65725a25ff | ||
|
|
bd91541a01 | ||
|
|
2e6baef994 | ||
|
|
6469f8473e | ||
|
|
40d855bb0c | ||
|
|
fb44e1b6df | ||
|
|
0ab658cd10 | ||
|
|
f5891aa3bf | ||
|
|
5568346aa2 | ||
|
|
0f8e13ca60 | ||
|
|
8830e211f8 | ||
|
|
a6c5f95bac | ||
|
|
bae298ea0e | ||
|
|
4139d6fc64 | ||
|
|
54b231b034 | ||
|
|
0c39d9a4f3 | ||
|
|
263a095543 | ||
|
|
fe3173bd1a | ||
|
|
6eb649146c | ||
|
|
b7b01fa9d3 | ||
|
|
4f490f626a | ||
|
|
66a7a593e2 | ||
|
|
bd7c5b22be | ||
|
|
32e24f9f32 | ||
|
|
f50fed4098 | ||
|
|
13aa12ea14 | ||
|
|
ca599d6060 | ||
|
|
029baff26a | ||
|
|
79e872c851 | ||
|
|
fa80ff6c59 | ||
|
|
58102a49f0 | ||
|
|
d38f1248d1 | ||
|
|
8e401114ef | ||
|
|
46144b1be4 | ||
|
|
af5243ab71 | ||
|
|
37ad5eb7c0 | ||
|
|
d97fede574 | ||
|
|
dc624c4dd8 | ||
|
|
43e80bc87a | ||
|
|
4c09ae6026 | ||
|
|
86e47a1efa | ||
|
|
b90f0c9ee7 | ||
|
|
e0bc92268b | ||
|
|
94ba2610fe | ||
|
|
b39b03d27d | ||
|
|
611e6e20e7 | ||
|
|
852baf9bfe | ||
|
|
2d19ab20f7 | ||
|
|
f9aee08d6e | ||
|
|
c084c71294 | ||
|
|
c288d2419e | ||
|
|
8d32617d16 | ||
|
|
651a662ba5 | ||
|
|
1c2bde024e | ||
|
|
3680b735d7 | ||
|
|
9d40a0cd27 | ||
|
|
dc9569756e | ||
|
|
0ef2295c53 | ||
|
|
519fed9991 | ||
|
|
5e52b31fd7 | ||
|
|
bbe8b7ba61 | ||
|
|
f187c3bb24 | ||
|
|
6227a115be | ||
|
|
2f80acc28e | ||
|
|
30d6a30b01 | ||
|
|
7f9cb3548b | ||
|
|
17c8d9cd74 | ||
|
|
197950e184 | ||
|
|
bbf7b3a60f | ||
|
|
498b5eca13 | ||
|
|
658f736af1 | ||
|
|
edf4aa4bcd | ||
|
|
3046ab9f0f | ||
|
|
a654f96831 | ||
|
|
ff01cccfb9 | ||
|
|
0c177d15d1 | ||
|
|
be0f11a4d2 | ||
|
|
ed0db4cd4f | ||
|
|
1cc01ceb59 | ||
|
|
caf95cd161 | ||
|
|
83c4021614 | ||
|
|
fdb8efb35a | ||
|
|
9ad66ac6e8 | ||
|
|
3834ea83c0 | ||
|
|
e3b8c8ba92 | ||
|
|
e6828ec4e4 | ||
|
|
7ee4ba7781 | ||
|
|
3a03678080 | ||
|
|
badd841246 | ||
|
|
ffafb164d9 | ||
|
|
8286bd2493 | ||
|
|
ceb0f66e51 | ||
|
|
3de957405f | ||
|
|
4361369939 | ||
|
|
0d353949e2 | ||
|
|
80c5ac85d4 | ||
|
|
b44c5d0f0c | ||
|
|
7ac92e74e8 | ||
|
|
eaa98e5cfc | ||
|
|
db496116d9 | ||
|
|
d32d93cc3c | ||
|
|
da74d5d843 | ||
|
|
44dd4a430d | ||
|
|
fcc38c19d8 | ||
|
|
737580cc57 | ||
|
|
db025ebfb0 | ||
|
|
0ae73a09dd | ||
|
|
2c659472e2 | ||
|
|
0720955e17 | ||
|
|
0c90498103 | ||
|
|
bab8d95583 | ||
|
|
3f2cd052fd | ||
|
|
0362058f6e | ||
|
|
b59eefd649 | ||
|
|
287624f406 | ||
|
|
d4ecce94c8 | ||
|
|
536673ad38 | ||
|
|
8b424288ba | ||
|
|
f880eba7cd | ||
|
|
ac8d845b3d | ||
|
|
b691a88e07 | ||
|
|
af138bc287 | ||
|
|
29ce61fcf3 | ||
|
|
69d2eba366 | ||
|
|
efb837bdb6 | ||
|
|
5db63aaa6d | ||
|
|
7e8d27f327 | ||
|
|
8556b64654 | ||
|
|
12d38df79e | ||
|
|
7699e34d83 | ||
|
|
14ff63b93d |
@@ -15,6 +15,3 @@ ABOUT-NLS
|
||||
intl
|
||||
stamp-h.in
|
||||
gtk+.spec
|
||||
missing
|
||||
install-sh
|
||||
mkinstalldirs
|
||||
|
||||
9106
ChangeLog.pre-1-2
9106
ChangeLog.pre-1-2
File diff suppressed because it is too large
Load Diff
13107
ChangeLog.pre-2-0
13107
ChangeLog.pre-2-0
File diff suppressed because it is too large
Load Diff
13107
ChangeLog.pre-2-10
13107
ChangeLog.pre-2-10
File diff suppressed because it is too large
Load Diff
13107
ChangeLog.pre-2-2
13107
ChangeLog.pre-2-2
File diff suppressed because it is too large
Load Diff
13107
ChangeLog.pre-2-4
13107
ChangeLog.pre-2-4
File diff suppressed because it is too large
Load Diff
13107
ChangeLog.pre-2-6
13107
ChangeLog.pre-2-6
File diff suppressed because it is too large
Load Diff
13107
ChangeLog.pre-2-8
13107
ChangeLog.pre-2-8
File diff suppressed because it is too large
Load Diff
8
INSTALL
8
INSTALL
@@ -7,8 +7,8 @@ you got this package.
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-1.2.7.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-1.2.7 # change to the toplevel directory
|
||||
% gzip -cd gtk+-1.2.8.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-1.2.8 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
@@ -118,7 +118,7 @@ You can compile GTK+ against a copy of GLIB that you have not
|
||||
yet installed. To do this, give the --with-glib=DIR options
|
||||
to ./configure. For instance:
|
||||
|
||||
./configure --with-glib=../glib-1.2.7
|
||||
./configure --with-glib=../glib-1.2.8
|
||||
|
||||
This, however, will not work if you built GLIB with different
|
||||
source and build directories.
|
||||
@@ -169,7 +169,7 @@ C library multibyte functions. Unless your C library has support
|
||||
for Japanese locales, this is incorrect, and will cause problems
|
||||
for GTK's internationalization.
|
||||
|
||||
(In particular, this occurs with GNU libc 2.0 and 2.1, in which
|
||||
(In particular, this occurs with GNU libc 2.0 in which
|
||||
the multibyte functions always translate to and from UTF-8; but
|
||||
the problem may occur for other C libraries, and other operating
|
||||
systems as well.)
|
||||
|
||||
1
MAINTAINERS
Normal file
1
MAINTAINERS
Normal file
@@ -0,0 +1 @@
|
||||
Email: gtk-bugs@gimp.org
|
||||
@@ -17,7 +17,6 @@ EXTRA_DIST = \
|
||||
NEWS.pre-1-0 \
|
||||
ChangeLog.pre-1-0 \
|
||||
README.cvs-commits \
|
||||
README.win32 \
|
||||
intl/libgettext.h \
|
||||
intl/po2tbl.sed.in \
|
||||
examples/aspectframe/Makefile \
|
||||
|
||||
15
NEWS
15
NEWS
@@ -1,3 +1,18 @@
|
||||
Overview of Changes in GTK+ 1.2.8:
|
||||
|
||||
* GNU Make 3.79 bug workaround
|
||||
* FAQ and tutorial updates and improvements
|
||||
* Miscellaneous bug fixes: CList, Calendar, rc-files, FontSelection
|
||||
|
||||
Overview of Changes in GTK+ 1.2.7:
|
||||
|
||||
* More header cleanups.
|
||||
* Fixed activation bug for insensitive widgets.
|
||||
* Locale fixes to RC file parsing code.
|
||||
* Miscellaneous bugfixes for Item Factory, CList, CTree, X Selections,
|
||||
HScale, VScale, Pixmap, Viewport, OptionMenu, Entry and Notebook.
|
||||
* Upgrade to libtool 1.3.4.
|
||||
|
||||
Overview of Changes in GTK+ 1.2.6:
|
||||
|
||||
* container queue_resize fixes
|
||||
|
||||
8
README
8
README
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 1.2.7. GTK+, which stands for the Gimp ToolKit,
|
||||
This is GTK+ version 1.2.8. GTK+, which stands for the Gimp ToolKit,
|
||||
is a library for creating graphical user interfaces for the X Window
|
||||
System. It is designed to be small, efficient, and flexible. GTK+ is
|
||||
written in C with a very object-oriented approach.
|
||||
@@ -37,9 +37,9 @@ version number. This should be separated by a blank
|
||||
line from the actual headers.
|
||||
|
||||
Package: gtk+
|
||||
Version: 1.2.7
|
||||
Version: 1.2.8
|
||||
|
||||
[ Please substitute 1.2.7 with the version of GTK+ that
|
||||
[ Please substitute 1.2.8 with the version of GTK+ that
|
||||
you have installed ]
|
||||
|
||||
Then describe the bug. Include:
|
||||
@@ -82,7 +82,7 @@ From: yourname@your.address.org
|
||||
Subject: handlebox test in testgtk is misnamed.
|
||||
|
||||
Package: gtk+
|
||||
Version: 1.2.7
|
||||
Version: 1.2.8
|
||||
|
||||
When I run gtk/testgtk, the button "handle box"
|
||||
is misnamed. There are multiple handle boxes in
|
||||
|
||||
154
README.nanox
154
README.nanox
@@ -1,154 +0,0 @@
|
||||
Gtk port to nano-X
|
||||
|
||||
STATUS
|
||||
|
||||
Once upon a time I got a few apps working, then started merging
|
||||
the new features added by Owen (32 bit sizes for windows and buffering).
|
||||
Since then I haven't found the time to work on it:-/
|
||||
|
||||
|
||||
TODO
|
||||
|
||||
Finish internal window manager abstraction or add proper support in nano-X.
|
||||
Fix event polling.
|
||||
Implement GdkImage, GdkRgb stuff.
|
||||
Put generic region code in generic gdk and/or use the region code from nano-X.
|
||||
Fix ugly automake stuff for make dist.
|
||||
|
||||
TODO in nano-X
|
||||
|
||||
We need to be able to clip and change the background of windows at runtime
|
||||
for apps to not look so ugly!
|
||||
Fonts: wait for better nano-X font implementation.
|
||||
Properties on windows.
|
||||
|
||||
|
||||
If you want to work on this port or get additional informnation, get in
|
||||
touch with me.
|
||||
To get the beast to compile you also need to apply the patch below
|
||||
(any auto* wizard here?): the issue of having two gtk libraries in the
|
||||
system needs to be addressed too, maybe use libgtk-x11-1.4.so and
|
||||
libgtk-nanox-1.4.so ...
|
||||
|
||||
Paolo Molaro
|
||||
lupus@linuxcare.com
|
||||
|
||||
|
||||
Index: acconfig.h
|
||||
===================================================================
|
||||
RCS file: /cvs/gnome/gtk+/acconfig.h,v
|
||||
retrieving revision 1.16
|
||||
diff -u -r1.16 acconfig.h
|
||||
--- acconfig.h 1999/03/20 00:52:29 1.16
|
||||
+++ acconfig.h 2000/05/06 11:52:38
|
||||
@@ -49,6 +49,8 @@
|
||||
/* Most machines will be happy with int or void. IRIX requires '...' */
|
||||
#undef SIGNAL_ARG_TYPE
|
||||
|
||||
+#undef USE_NANOX
|
||||
+
|
||||
/* #undef PACKAGE */
|
||||
/* #undef VERSION */
|
||||
|
||||
Index: configure.in
|
||||
===================================================================
|
||||
RCS file: /cvs/gnome/gtk+/configure.in,v
|
||||
retrieving revision 1.142
|
||||
diff -u -r1.142 configure.in
|
||||
--- configure.in 2000/05/04 00:29:46 1.142
|
||||
+++ configure.in 2000/05/06 11:52:38
|
||||
@@ -99,6 +99,8 @@
|
||||
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
|
||||
|
||||
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
|
||||
+AC_ARG_ENABLE(nanox, [ --enable-nanox use nano-X instead of X11 [default=no]],
|
||||
+ , enable_nanox="no")
|
||||
|
||||
if test "x$enable_debug" = "xyes"; then
|
||||
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
|
||||
@@ -322,6 +324,8 @@
|
||||
saved_cflags="$CFLAGS"
|
||||
saved_ldflags="$LDFLAGS"
|
||||
|
||||
+if text "x$enable_nanox" = "xno"; then
|
||||
+
|
||||
CFLAGS="$CFLAGS $X_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
|
||||
|
||||
@@ -465,6 +469,13 @@
|
||||
GTK_LOCALE_FLAGS="-DX_LOCALE"
|
||||
fi
|
||||
|
||||
+else
|
||||
+AC_CHECK_LIB(nano-X, GrOpen)
|
||||
+LIBS="-lnano-X $LIBS"
|
||||
+ AC_DEFINE(USE_NANOX)
|
||||
+AM_CONDITIONAL(USE_NANOX, test x$enable_nanox = xyes)
|
||||
+fi # if enable_nanox
|
||||
+
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
@@ -602,8 +613,13 @@
|
||||
esac
|
||||
],[
|
||||
# Currently we always use X11 on those systems where we run configure...
|
||||
+if test x$enable_nanox = xno; then
|
||||
gdk_windowing='
|
||||
#define GDK_WINDOWING_X11'
|
||||
+else
|
||||
+gdk_windowing='
|
||||
+#define GDK_WINDOWING_NANOX'
|
||||
+fi
|
||||
if test x$gdk_wchar_h = xyes; then
|
||||
gdk_wc='
|
||||
#define GDK_HAVE_WCHAR_H 1'
|
||||
@@ -629,6 +645,7 @@
|
||||
docs/Makefile
|
||||
gdk/Makefile
|
||||
gdk/x11/Makefile
|
||||
+gdk/nanox/Makefile
|
||||
gdk/win32/Makefile
|
||||
gtk/Makefile
|
||||
gtk/gtkfeatures.h
|
||||
Index: gdk/Makefile.am
|
||||
===================================================================
|
||||
RCS file: /cvs/gnome/gtk+/gdk/Makefile.am,v
|
||||
retrieving revision 1.41
|
||||
diff -u -r1.41 Makefile.am
|
||||
--- gdk/Makefile.am 2000/04/05 04:11:10 1.41
|
||||
+++ gdk/Makefile.am 2000/05/06 11:52:38
|
||||
@@ -1,6 +1,10 @@
|
||||
## Makefile.am for gtk+/gdk
|
||||
|
||||
+if USE_NANOX
|
||||
+SUBDIRS=win32 nanox
|
||||
+else
|
||||
SUBDIRS=x11 win32
|
||||
+endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
gdkconfig.h.win32 \
|
||||
@@ -36,8 +40,13 @@
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
|
||||
+if USE_NANOX
|
||||
libgdk_la_LIBADD = \
|
||||
+ nanox/libgdk-nanox.la
|
||||
+else
|
||||
+libgdk_la_LIBADD = \
|
||||
x11/libgdk-x11.la
|
||||
+endif
|
||||
|
||||
#
|
||||
# setup source file variables
|
||||
@@ -138,3 +147,8 @@
|
||||
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
|
||||
echo $$p; \
|
||||
done
|
||||
+
|
||||
+noinst_PROGRAMS = simple
|
||||
+simple_DEPENDENCIES = libgdk.la simple.c
|
||||
+simple_LDADD = libgdk.la
|
||||
+
|
||||
45
README.win32
45
README.win32
@@ -1,45 +0,0 @@
|
||||
The Win32 port of GTk+ is a work in progress, and not as stable or
|
||||
correct as the Unix/X11 version. For more information about the Win32
|
||||
port, see http://www.gimp.org/tml/gimp/win32/ or
|
||||
http://www.iki.fi/tml/gimp/win32/ .
|
||||
|
||||
The current (CVS) version of the Win32 backend is *not* as stable as it
|
||||
was before the no-flicker branch was merged. A zipfile with that
|
||||
version is available from http://www.gimp.org/win32/. That should be
|
||||
use by "production" code until this CVS version is usable. (But note,
|
||||
the Win32 backend has never been claimed to be "production quality".)
|
||||
|
||||
To build GTk+ on Win32, you need either the Microsoft compiler and
|
||||
tools, or gcc-2.95 or later. The mingw setup of gcc is preferred, but
|
||||
you can run gcc also under cygwin-b20.1 or later. Compile in
|
||||
gdk\win32, gdk and gtk with `nmake -f makefile.msc` or `make -f
|
||||
makefile.cygwin`. The name makefile.cygwin is misleading, it should
|
||||
really be called makefile.mingw.
|
||||
|
||||
See the README.win32 file in the GLib distribution for instructions
|
||||
how to build with gcc.
|
||||
|
||||
To use GTk+ on Win32, you also need either of the above mentioned
|
||||
compilers. Other compilers might work, but don't count on it. The
|
||||
same instructions on how to set up a correct version of gcc should
|
||||
also be followed if you want to build applications that use GTk+ with
|
||||
gcc.
|
||||
|
||||
The tablet support uses the Wintab API. The Wintab development kit can
|
||||
be downloaded from http://www.pointing.com. If you don't care for
|
||||
that, undefine HAVE_WINTAB in config.h.win32 and remove references to
|
||||
the wntab32x library from the makefile before building.
|
||||
|
||||
GTk+ wants to be built with the GNU "intl" library for
|
||||
internationalisation (i18n). Get the version ported to Win32 (not a
|
||||
very big deal) from tml's web site mentioned above. We build the
|
||||
"intl" library as a DLL called gnu-intl.dll (the "gnu" prefix is used
|
||||
to reduce name clash risks). If you don't want any i18n stuff,
|
||||
undefine ENABLE_NLS, HAVE_GETTEXT and HAVE_LIBINTL in the
|
||||
config.h.win32 file, and remove references to the gnu-intl library
|
||||
from the makefiles.
|
||||
|
||||
Note that while the GNU gettext package is under the GPL, the "intl"
|
||||
part of it which is distributed with GNU libc is under the LGPL (like
|
||||
GTk+ or GLib). We want the LGPL one, even if they are the same, more
|
||||
or less.
|
||||
739
TODO.xml
739
TODO.xml
@@ -1,739 +0,0 @@
|
||||
<!-- This is used to generate the online TODO list for GTK+ using
|
||||
the script docs/make-todo. Whenever a change to this file is
|
||||
committed to CVS,the file is run through make-todo and the online
|
||||
version updated. If you modify this file, you should check for
|
||||
parse errors by running:
|
||||
|
||||
$ docs/make-todo TODO.xml > /dev/null
|
||||
|
||||
before committing, or you may screw up the online version -->
|
||||
<todo logourl="gtk-logo-rgb.gif">
|
||||
<title>GTK+ TODO list</title>
|
||||
<section>
|
||||
<title>GDK</title>
|
||||
|
||||
<entry size="medium" status="70%" target="1.4">
|
||||
<title>Add backing store support</title>
|
||||
<description>
|
||||
<p>
|
||||
GTK+'s drawing model involves clearing to a background, and
|
||||
then drawing widgets on top of this. Without having
|
||||
backing-store support, this results in flickering in various
|
||||
situations. Backing store cannot be added widget-by-widget,
|
||||
because the drawing in a particular window is not confined
|
||||
to a single widget. Instead it needs to be added per GDK
|
||||
window.
|
||||
</p>
|
||||
<p>
|
||||
The way this is done is by having
|
||||
<tt>gdk_window_begin_paint()</tt>
|
||||
and <tt>gdk_window_end_paint()</tt> functions that
|
||||
redirect all drawing to a particular window to an offscreen
|
||||
pixmap, and then copy that offscreen pixmap back onto the
|
||||
screen when the paint operation is done. The implementation
|
||||
of this is mostly complete in the <tt>gtk-no-flicker</tt> branch of
|
||||
GTK+.
|
||||
</p>
|
||||
</description>
|
||||
<url>http://www.gtk.org/~otaylor/gtk/1.4/gdk-drawing.html</url>
|
||||
<contact>Owen Taylor <otaylor@redhat.com></contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="70%" target="1.4">
|
||||
<title>32 Bit Coordinates</title>
|
||||
<description>
|
||||
<p>
|
||||
GTK+-1.2 and earlier share X's limitation on the
|
||||
size of coordinates and restrict all dimensions
|
||||
to 16 bit quantities. By clever use of X it is
|
||||
possible to lift this restriction and present a
|
||||
full 32-bit space to the user.
|
||||
</p>
|
||||
<p>
|
||||
There are some difficulties with performance in this
|
||||
approach - mostly because scrolling can involve mapping and
|
||||
unmapping lots of widgets, but in general, current
|
||||
trials in this area seem to work pretty well.
|
||||
</p>
|
||||
</description>
|
||||
<url>http://www.gtk.org/~otaylor/gtk/1.4/gdk-drawing.html</url>
|
||||
<contact>Owen Taylor <otaylor@redhat.com></contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Customizable double-click timeout</title>
|
||||
<description>
|
||||
<p>
|
||||
The current fixed double-click timeout in GTK+
|
||||
is too small for some users. This needs to be
|
||||
customizable
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
<bugs>#3958</bugs>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Make color handling more convenient</title>
|
||||
<description>
|
||||
<p>
|
||||
Add some color convenience functions; such as a way to get an
|
||||
allocated GdkColor from GdkRGB, and export functions from gtkstyle.c
|
||||
that lighten/darken a given color, and set a color from HSV in
|
||||
addition to RGB. Also, consider having static variables that contain
|
||||
preallocated common colors (gdk_blue, gdk_red, etc.), the problem
|
||||
being colormap issues.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Cursors</title>
|
||||
<description>
|
||||
<p>
|
||||
Two tasks: 1) move the cursors in the cursor font that people actually
|
||||
care about to the top of the gdkcursor.h header file, and put a nice
|
||||
list of the 15 cursors people actually care about in the docs 2) if
|
||||
the cursor font lacks some commonly-useful cursors (like magnifying
|
||||
glass), add these cursors to gdkcursor.h and then emulate them in
|
||||
gdk_cursor_new by transparently creating the cursor from a bitmap.
|
||||
The list of Qt cursors is worth http://doc.trolltech.com/qcursor.html
|
||||
looking at for this task.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="0%" target="1.4">
|
||||
<title>Make GdkRGB work on any visual</title>
|
||||
<description>
|
||||
<p>
|
||||
GdkRGB should be able to render to an arbitrary visual
|
||||
(i.e. the visual shouldn't be fixed at gdk_rgb_init()
|
||||
time). This will break gdk_rgb_gc_set_foreground() and
|
||||
friends, though.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
</section> <!-- GDK -->
|
||||
|
||||
<section>
|
||||
<title>Internationalization</title>
|
||||
|
||||
<entry size="big" status="70%" target="1.4">
|
||||
<title>Integrate Pango</title>
|
||||
<description>
|
||||
<p>
|
||||
The purpose of the Pango project is to provide a system for
|
||||
layout and rendering of internationalized text. It handles
|
||||
most of the issues necessary to
|
||||
</p>
|
||||
</description>
|
||||
<url>http://www.pango.org</url>
|
||||
<contact>gtk-i18n-list@redhat.com</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="80%" target="1.4">
|
||||
<title>Switch to using UTF-8</title>
|
||||
<description>
|
||||
<p>
|
||||
This is closely related to Pango integration. Pango deals
|
||||
with all strings in terms of UTF-8; by switching GTK+ over
|
||||
to UTF-8 we make it considerably simpler for developers to
|
||||
support multiple languages properly while still retaining
|
||||
a large degree of compatibility with existing programs.
|
||||
</p>
|
||||
<p>
|
||||
Some work has already been done on this as part of the Win32
|
||||
port, since the Win32 port is currently using UTF-8 for all
|
||||
strings. In general, this should be an easy job; the hardest
|
||||
parts are places like GtkFileSelection, cut and paste, and
|
||||
input method support where there is interaction between GTK+
|
||||
and the operating system.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-i18n-list@redhat.com</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="40%" target="1.4">
|
||||
<title>Rewrite Input Method Support</title>
|
||||
<description>
|
||||
<p>
|
||||
Support for Input Methods is GTK+-1.2 is done via XIM, with
|
||||
supported styles being over-the-spot and the root-window
|
||||
styles. However, the over-the-spot style is not going to
|
||||
work well with the Pango integration, since it relies on the
|
||||
text rendering in the program being done in the standard
|
||||
Xlib style, so it will be necessary to also support
|
||||
on-the-spot input. On-the-spot input is done by supplying a
|
||||
set of callbacks that are invoked by the input methods.
|
||||
</p>
|
||||
<p>
|
||||
GTK+-1.4 will have a new system with loadable input method
|
||||
modules. These modules can either be implemented using XIM,
|
||||
or written from scratch.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-i18n-list@redhat.com</contact>
|
||||
</entry>
|
||||
</section> <!-- i18n -->
|
||||
|
||||
<section>
|
||||
<title>GTK+ Core</title>
|
||||
|
||||
<entry size="big" status="5%" target="1.4">
|
||||
<title>GLib based object and type system</title>
|
||||
<description>
|
||||
<p>
|
||||
The GTK+ object system is already in use in quite a few different
|
||||
non-GUI applications; it would be desirable for these uses
|
||||
to have the object and type systems separated from the GUI portions
|
||||
of GTK+ and be generalized for non-GUI usage.
|
||||
</p>
|
||||
</description>
|
||||
<contact>Tim Janik <timj@gtk.org></contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="1%" target="1.4">
|
||||
<title>Overall callback improvements</title>
|
||||
<description>
|
||||
<p>
|
||||
The GTK+ type and signal systems need significant improvements to
|
||||
allow signal creation with default handlers from language bindings
|
||||
and to aid language bindings in deriving new objects.
|
||||
One aspect of this is the Closure support, recently suggested by
|
||||
Karl Nelson <kenelson@ece.ucdavis.edu>, but this also
|
||||
requires a GLib based type and parameter system (ties in with
|
||||
"GLib based object and type system").
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="0%" target="1.4">
|
||||
<title>State change notification</title>
|
||||
<description>
|
||||
<p>
|
||||
GTK+ objects emit various types of signals, some to perform
|
||||
arbitrary actions, some to allow customization from user code,
|
||||
and some signals are emitted to notify of certain changes
|
||||
of an object. For the latter, what really is required is a
|
||||
gneneric signal that can be used to monitor *any* kind of object
|
||||
changes. For that, all object changes need to be routed through
|
||||
a central point (otherwise the signal emissions are spread all
|
||||
over the object implementation), i.e. an object argument setter.
|
||||
The state change notification signal doesn't need to be emitted
|
||||
syncronously, in fact, it's probably most effective to always
|
||||
emit this asynchronously, so subsequent changes are accumulated.
|
||||
</p>
|
||||
</description>
|
||||
<contact>Tim Janik <timj@gtk.org></contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="5%" target="1.4">
|
||||
<title>Widget as sensitivity/grab state machine</title>
|
||||
<description>
|
||||
<p>
|
||||
Maintenance of pointer and keybnoard grabs is currently very
|
||||
tedious and error-prone, most widget's cook up their own stuff
|
||||
in this regard.
|
||||
By moving the general concept of "Grabs" to the GTK+ level as
|
||||
a widget state, and providing a new signal for alterations of
|
||||
a widget's state ("visible", "visible+insensitive",
|
||||
"visible+grab", "hidden", "hidden+insensitive", etc.), things
|
||||
can be unified and more stabelize. A couple of bugs, such as
|
||||
insensitive widgets still holding a grab, or buttons that
|
||||
still think they are depressed when hidden, will be squeezed
|
||||
automatically with that.
|
||||
</p>
|
||||
</description>
|
||||
<contact>Tim Janik <timj@gtk.org></contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="0%" target="1.4">
|
||||
<title>Allow argument customization</title>
|
||||
<description>
|
||||
<p>
|
||||
Many types of object arguments (expander style in the CList,
|
||||
default padding in button boxes, etc), conceptually go with
|
||||
the theme, or as user preferences; they should not be set by
|
||||
a particular program.
|
||||
</p>
|
||||
<p>
|
||||
There needs to be a mechanism for themes to be able to
|
||||
control these arguments from the RC file.
|
||||
</p>
|
||||
</description>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="0%" target="1.4">
|
||||
<title>Allow global customization</title>
|
||||
<description>
|
||||
<p>
|
||||
There are a number of global parameters in GTK+ and GDK that should be
|
||||
customizable by the user, such as the double-click timeout,
|
||||
or whether widgets should be backing-stored by default.
|
||||
</p>
|
||||
<p>
|
||||
If we had argument customization from an RC file, it might
|
||||
be possible to do this simply with a global object with
|
||||
arguments for the various global parameters that was
|
||||
customized in the same fashion as object arguments.
|
||||
</p>
|
||||
</description>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Gtk+ Modules installation directory</title>
|
||||
<description>
|
||||
<p>
|
||||
Gtk+ needs to support an extra lib/ directory, to search
|
||||
for dynamically loadable modules, it also needs to support
|
||||
an environment variable to specify module search paths.
|
||||
This has quite some cross-platform issues with the GModule
|
||||
code (especially on AIX).
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Convenient widget setup</title>
|
||||
<description>
|
||||
<p>
|
||||
Make it simpler to set all the basic attributes of a widget. Might
|
||||
want set_tooltip(), set_accel(), set_color(FOREGROUND, color),
|
||||
set_min_size() (usize does this, but needs a rename), set_whatsthis(),
|
||||
etc. set_accel() may not work for all widgets, may need a convenience
|
||||
API for button and label accelerators specifically.
|
||||
</p>
|
||||
<p>
|
||||
The idea is that it should be easy, out of the box, to set up a widget
|
||||
with all the nice touches and features the widget really should
|
||||
have. Users shouldn't need to do their own convenience functions for
|
||||
this.
|
||||
</p>
|
||||
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="0%" target="> 1.4">
|
||||
<title>Make selections/clipboard more convenient</title>
|
||||
<description>
|
||||
<p>
|
||||
Make GtkSelectionData more like the MIME blobs in Swing and Qt.
|
||||
Consider a GtkClipboard object to simplify cut-and-paste handling.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
|
||||
<entry size="small" status="50%" target="1.4">
|
||||
<title>Stock label/icon system</title>
|
||||
<description>
|
||||
<p>
|
||||
A system like GnomeStock for getting a standard labels/icons
|
||||
for menus and toolbars. Should be extensible by themes, and
|
||||
by libgnomeui. Some work already done on this.
|
||||
</p>
|
||||
</description>
|
||||
<contact>hp@redhat.com</contact>
|
||||
</entry>
|
||||
|
||||
|
||||
<entry size="big" status="0%" target="> 1.4">
|
||||
<title>Session Management</title>
|
||||
<description>
|
||||
<p>
|
||||
Look in to session management. Consider whether to use
|
||||
X11R6 SM, or some custom spec shared with KDE. Create
|
||||
GTK+ API for this.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="0%" target="> 1.4">
|
||||
<title>Online help enhancements</title>
|
||||
<description>
|
||||
<p>
|
||||
Look at a small "What's This" popup widget,
|
||||
and a What's This system in general (this part
|
||||
could maybe be done for 1.4). A more difficult, probably
|
||||
a post-1.4 task, is to integrate a very simple little
|
||||
help browser gizmo into GTK.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
|
||||
<entry size="medium" status="0%" target="1.4">
|
||||
<title>GUI-editable means of user configuration</title>
|
||||
<description>
|
||||
<p>
|
||||
Need to be able to set double click time, whether cursors
|
||||
blink, etc., from a control panel type of deal.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
</section> <!-- Core -->
|
||||
|
||||
<section>
|
||||
<title>GTK+ Widgets</title>
|
||||
|
||||
<entry size="small" status="50%" target="1.4">
|
||||
<title>Make GtkFrame use a label</title>
|
||||
<description>
|
||||
<p>
|
||||
The title of a frame should simply be another child widget
|
||||
which, by default, holds a label widget. This will important
|
||||
with Pango where proper text behavior will be more complex to
|
||||
implement, but is also useful for certain user-interface
|
||||
designs. (It can be useful, for example, to put a checkbutton
|
||||
in that slot.)
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="75%" target="1.4">
|
||||
<title>Replace GtkText Widget</title>
|
||||
<description>
|
||||
<p>
|
||||
The GtkText widget is badly in need of replacement, since it
|
||||
is buggy and insufficiently feature rich. This is being done
|
||||
using Havoc Pennington's port of the Tk Text widget.
|
||||
</p>
|
||||
<p>
|
||||
As part of this job <a href="http://www.pango.org">Pango</a>
|
||||
support is being added to the replacement. The structure of
|
||||
the Tk text widget port is suited to this as it works
|
||||
paragraph-by-paragraph, and Pango works at a sub-paragraph
|
||||
scale. The main remaining tasks here are to implement
|
||||
incremental reflow to make performance acceptable and to
|
||||
implement embedded pixmaps and widgets.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Improve Radio/Checkbutton Look</title>
|
||||
<description>
|
||||
<p>
|
||||
The default look for the radio and checkbuttons is both
|
||||
unattractive and not friendly to the user . Motif did not
|
||||
get this one right, and we should not keep on following the
|
||||
Motif look. The right thing here is probably to copy the
|
||||
Windows appearance for these controls fairly closely. This
|
||||
will fit in with well with the rest of the GTK+ look.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Improve Submenu Navigation</title>
|
||||
<description>
|
||||
<p>
|
||||
Navigating through a deep menu tree in GTK+ is currently
|
||||
quite tricky, because as soon as one leaves a menu item,
|
||||
the submenu disappears. The way that the Macintosh is
|
||||
reputed to handle this is that to pop down the current
|
||||
submenu, you have to leave the triangle defined by the
|
||||
upper left hand corner of the menu item and right
|
||||
side of the submenu.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4 ?">
|
||||
<title>Improve Spinbutton Look</title>
|
||||
<description>
|
||||
<p>
|
||||
Spinbuttons currently appear to have lumpy boundaries,
|
||||
because sides of the arrows aren't at an angle that
|
||||
meshes well with the pixel grid. However, fixing this
|
||||
would require making the spinbuttons narrower and
|
||||
harder to hit. This points out a general problem with
|
||||
the spinbutton (and the arrows on the scrollbars) - the
|
||||
target area for clicks actually the bounding box of the
|
||||
arrows, but the user thinks that they must click on the
|
||||
arrows themselves. It would probably be more friendly
|
||||
to use a square button with an arrow drawn on top instead
|
||||
of a arrow-shaped button, the approach taken by most other
|
||||
windowing systems.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="90%" target="1.4">
|
||||
<title>Supply horizontable/vertical wrapping boxes</title>
|
||||
<description>
|
||||
<p>
|
||||
An often requested feature are wrapping containers, at this
|
||||
point, gimp's development version already uses such widgets:
|
||||
horizontable/vertical wrap boxes, that need to go into 1.4
|
||||
proper at some point.
|
||||
</p>
|
||||
</description>
|
||||
<contact>Tim Janik <timj@gtk.org></contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="90%" target="1.4">
|
||||
<title>Improved generic combo support</title>
|
||||
<description>
|
||||
<p>
|
||||
Gtk+'s combo box has several drawbacks in design and
|
||||
implementation. An new attempt at providing the combo box
|
||||
functionality with improved flexibility has been made with
|
||||
the GtkClueHunter widget, sitting in the CVS module "gle".
|
||||
</p>
|
||||
</description>
|
||||
<contact>Tim Janik <timj@gtk.org></contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="0%" target="> 1.4">
|
||||
<title>Add unified set of List/Tree/Grid widgets</title>
|
||||
<description>
|
||||
<p>
|
||||
Currently, GTK+ has a large number of list and tree widgets
|
||||
(GtkList, GtkTree, GtkCList, GtkCTree), none of which are
|
||||
ideal. The GtkList and GtkTree widgets perform badly on large
|
||||
number of items. (GtkTree widget is also quite buggy.) GtkCList
|
||||
and GtkCTree mostly solve the size problem, but are quite
|
||||
complex and, despite that, not very flexible. They are limited to
|
||||
displaying pixmaps and text, and can neither support arbitrary
|
||||
widgets nor custom drawing functions.
|
||||
</p>
|
||||
<p>
|
||||
In addition to list and tree widgets, a closely related need
|
||||
is a sheet widget that displays a (possibly editable) 2-D grid.
|
||||
It would be desirable to have a complete set of widgets that
|
||||
could be presented as the one-true-solution for these needs.
|
||||
Model/View techniques could be used effectively to increase
|
||||
both the simplicity and power of the interfaces.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>GtkPixbuf</title>
|
||||
<description>
|
||||
<p>
|
||||
gdk-pixbuf is moving to become a GTK+ dependency, a new image-display
|
||||
widget is thus needed.
|
||||
</p>
|
||||
</description>
|
||||
<contact>hp@redhat.com</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Attempt to fix GtkStatusbar</title>
|
||||
<description>
|
||||
<p>
|
||||
GtkStatusbar is too inconvenient to use.
|
||||
The only non-breakage-inducing fix we could
|
||||
come up with is to permit 0 as a context ID, so you
|
||||
don't have to use gtk_statusbar_get_context_id().
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="95%" target="1.4">
|
||||
<title>Decruft GtkProgress, GtkProgressbar</title>
|
||||
<description>
|
||||
<p>UPDATE: this is done, just need to apply the patch.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This interface is just a disaster of overcomplexity;
|
||||
it should pretty much just be set_percentage(),
|
||||
pulse() (to move during activity mode), and set_text().
|
||||
There's no reason that there are two objects, should
|
||||
just be one interface. Almost all the functions
|
||||
that currently exist should be deprecated.
|
||||
</p>
|
||||
</description>
|
||||
<contact>hp@redhat.com</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Entry validation hooks</title>
|
||||
<description>
|
||||
<p>
|
||||
Simple hooks for validation in a GtkEntry. Pretty much just a
|
||||
"validate" callback which takes a string (current entry contents) and
|
||||
returns either VALID, INVALID, or COULDBEVALID. Then the
|
||||
GtkEntry calls this function if it's set, and does the appropriate
|
||||
UI things. GTK should come with validators for int and float,
|
||||
see GtkSpinButton where these are already implemented.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="0%" target="> 1.4">
|
||||
<title>pseudo-MDI Widget</title>
|
||||
<description>
|
||||
<p>
|
||||
Add a widget that lets you rearrange various views (similar to many
|
||||
IDEs, like Visual SlickEdit or JBuilder). Basically there should be a
|
||||
central slot and 4 slots around the sides; each slot holds one or more
|
||||
views. If two views are dropped in the same slot, then a notebook is
|
||||
created displaying both views. If a view is dropped outside the
|
||||
application window, it becomes a standalone window. It should be
|
||||
possible to restrict whether a view can be dropped on the sides,
|
||||
horizontal/vertical sides only, in the central content area, or in
|
||||
any of those places.
|
||||
</p>
|
||||
<p>
|
||||
(Havoc has a proposed interface for this, mail hp@redhat.com)
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="0%" target="> 1.4">
|
||||
<title>Icon List Widget</title>
|
||||
<description>
|
||||
<p>
|
||||
A simple icon list widget, suitable for creating a file selector or
|
||||
the like.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="0%" target="> 1.4">
|
||||
<title>Dock widget</title>
|
||||
<description>
|
||||
<p>
|
||||
Add a widget like GnomeDock (perhaps based on GnomeDock)
|
||||
that allows people to put rearrangeable toolbars, menubars, etc.
|
||||
around a central content area. The widget should have hooks for
|
||||
saving the current positions of the various docked bars.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="big" status="0%" target="> 1.4">
|
||||
<title>Canvas widget</title>
|
||||
<description>
|
||||
<p>
|
||||
Figure out how to get GnomeCanvas or a derived work into GTK+ itself.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="0%" target="1.4">
|
||||
<title>Menu scroll</title>
|
||||
<description>
|
||||
<p>
|
||||
When menus are bigger than the screen, allow scrolling
|
||||
as on the Mac.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="0%" target="1.4">
|
||||
<title>Toolbar/menubar wrap</title>
|
||||
<description>
|
||||
<p>
|
||||
When toolbars and menubars are too wide, do some sort of
|
||||
wrapping or drop-down deal. (See Windows/Mac apps for examples.)
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Blink cursor in GtkEntry</title>
|
||||
<description>
|
||||
<p>
|
||||
Make the cursor optionally blink in GtkEntry. Beware, the entry code
|
||||
is somewhat in flux; mail Owen and ask.
|
||||
</p>
|
||||
</description>
|
||||
<contact>otaylor@redhat.com</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="100%" target="1.4">
|
||||
<title>Don't highlight first menu item when menus come up</title>
|
||||
<description>
|
||||
<p>
|
||||
Keep GtkMenu from prelighting the first menu item.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="95%" target="1.4">
|
||||
<title>Integrate new color selector</title>
|
||||
<description>
|
||||
<p>
|
||||
There's a new color selector in CVS (module gnome-colorsel),
|
||||
it needs to be folded in to GTK and any remaining issues resolved.
|
||||
(This new selector is API-compatible with the old one, and
|
||||
still called GtkColorSelector).
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="medium" status="0%" target="1.4">
|
||||
<title>Write new font selector</title>
|
||||
<description>
|
||||
<p>
|
||||
Pango introduces a new font handling system,
|
||||
replacing the XLFD system. Need a font selector for this.
|
||||
The XLFD selector should probably remain, for apps where
|
||||
it makes sense (like gnome-terminal probably).
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Stack Widget</title>
|
||||
<description>
|
||||
<p>
|
||||
Jonathan has a widget like a tabless/frameless notebook, used for
|
||||
something like the GNOME control center where you want to toggle which
|
||||
widget is visible to the user. Needs to be cleaned up and considered
|
||||
for GTK.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org, jrb@redhat.com</contact>
|
||||
</entry>
|
||||
|
||||
<entry size="small" status="0%" target="1.4">
|
||||
<title>Clean up GtkNotebook</title>
|
||||
<description>
|
||||
<p>
|
||||
GtkNotebook currently breaks GTK invariants about
|
||||
mapping/visibility/etc., needs fixing.
|
||||
</p>
|
||||
</description>
|
||||
<contact>gtk-devel-list@gnome.org</contact>
|
||||
</entry>
|
||||
|
||||
</section> <!-- GTK+ -->
|
||||
</todo>
|
||||
|
||||
@@ -19,17 +19,14 @@
|
||||
#undef GTK_COMPILED_WITH_DEBUGGING
|
||||
|
||||
#undef HAVE_CATGETS
|
||||
#undef HAVE_DIRENT_H
|
||||
#undef HAVE_GETTEXT
|
||||
#undef HAVE_IPC_H
|
||||
#undef HAVE_LC_MESSAGES
|
||||
#undef HAVE_PWD_H
|
||||
#undef HAVE_SHM_H
|
||||
#undef HAVE_STPCPY
|
||||
#undef HAVE_XSHM_H
|
||||
#undef HAVE_SHAPE_EXT
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
#undef HAVE_SYS_TIME_H
|
||||
#undef HAVE_XCONVERTCASE
|
||||
|
||||
#undef NO_FD_SET
|
||||
|
||||
192
config.h.win32
192
config.h.win32
@@ -1,192 +0,0 @@
|
||||
/* config.h.win32. Handcrafted for Microsoft C and gcc -mno-cygwin */
|
||||
|
||||
#if ! (defined(_MSC_VER) || defined(__GNUC__))
|
||||
#error Unrecognized Win32 compiler, edit config.h.win32 by hand
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
#ifdef _MSC_VER
|
||||
#define alloca _alloca
|
||||
#elif defined (__GNUC__)
|
||||
#define alloca __builtin_alloca
|
||||
#endif
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define to empty, or __inline if that's what your compiler wants. */
|
||||
#define inline __inline
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE*/
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Other stuff */
|
||||
#define ENABLE_NLS 1
|
||||
#define GTK_COMPILED_WITH_DEBUGGING "minimum"
|
||||
|
||||
/* #undef HAVE_CATGETS */
|
||||
/* #undef HAVE_DIRENT_H */
|
||||
#define HAVE_GETTEXT 1
|
||||
/* #undef HAVE_IPC_H */
|
||||
/* #undef HAVE_LC_MESSAGES */
|
||||
/* #undef HAVE_PWD_H */
|
||||
/* #undef HAVE_SHM_H */
|
||||
/* #undef HAVE_STPCPY */
|
||||
/* #undef HAVE_XSHM_H */
|
||||
#define HAVE_SHAPE_EXT 1
|
||||
/* #undef HAVE_SYS_SELECT_H */
|
||||
/* #undef HAVE_SYS_TIME_H */
|
||||
/* #undef HAVE_XCONVERTCASE */
|
||||
|
||||
/* #undef NO_FD_SET */
|
||||
|
||||
/* #undef XINPUT_NONE */
|
||||
/* #undef XINPUT_GXI */
|
||||
/* #undef XINPUT_XFREE */
|
||||
#define XINPUT_WIN32 1
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if you have the __argz_count function. */
|
||||
/* #undef HAVE___ARGZ_COUNT */
|
||||
|
||||
/* Define if you have the __argz_next function. */
|
||||
/* #undef HAVE___ARGZ_NEXT */
|
||||
|
||||
/* Define if you have the __argz_stringify function. */
|
||||
/* #undef HAVE___ARGZ_STRINGIFY */
|
||||
|
||||
/* Define if you have the broken_wctype function. */
|
||||
/* #undef HAVE_BROKEN_WCTYPE */
|
||||
|
||||
/* Define if you have the dcgettext function. */
|
||||
/* #undef HAVE_DCGETTEXT */
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
|
||||
/* Define if you have the lstat function. */
|
||||
/* #undef HAVE_LSTAT */
|
||||
|
||||
/* Define if you have the munmap function. */
|
||||
/* #undef HAVE_MUNMAP */
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#define HAVE_PUTENV 1
|
||||
#define putenv _putenv
|
||||
|
||||
/* Define if you have the setenv function. */
|
||||
/* #undef HAVE_SETENV */
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define if you have the stpcpy function. */
|
||||
/* #undef HAVE_STPCPY */
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define strcasecmp _stricmp
|
||||
|
||||
/* Define if you have the strchr function. */
|
||||
#define HAVE_STRCHR 1
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define if you have the <argz.h> header file. */
|
||||
/* #undef HAVE_ARGZ_H */
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
/* #undef HAVE_DIRENT_H */
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#define HAVE_MALLOC_H 1
|
||||
|
||||
/* Define if you have the <nl_types.h> header file. */
|
||||
/* #undef HAVE_NL_TYPES_H */
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
/* #undef HAVE_PWD_H */
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
/* #undef HAVE_SYS_TIME_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if you have the <wchar.h> header file. */
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* Define if you have the <wctype.h> header file. */
|
||||
#ifdef _MSC_VER
|
||||
#define HAVE_WCTYPE_H 1
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Define if you have the i library (-li). */
|
||||
/* #undef HAVE_LIBI */
|
||||
|
||||
/* Define if you have the intl library (-lintl). */
|
||||
#define HAVE_LIBINTL 1
|
||||
|
||||
/* define if compiled symbols have a leading underscore */
|
||||
/* #undef WITH_SYMBOL_UNDERSCORE */
|
||||
|
||||
/* Define if you have the Wintab programmer's kit */
|
||||
#define HAVE_WINTAB 1
|
||||
|
||||
/* Define if you have the <dimm.h> header file
|
||||
* (available in the Platform SDK)
|
||||
*/
|
||||
/* #define HAVE_DIMM_H 1 */
|
||||
157
configure.in
157
configure.in
@@ -15,7 +15,7 @@ AC_INIT(gdk/gdktypes.h)
|
||||
# Save this value here, since automake will set cflags later
|
||||
cflags_set=${CFLAGS+set}
|
||||
|
||||
dnl we to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
|
||||
dnl we need 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?)
|
||||
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
|
||||
#
|
||||
@@ -28,10 +28,10 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
#
|
||||
GTK_MAJOR_VERSION=1
|
||||
GTK_MINOR_VERSION=3
|
||||
GTK_MICRO_VERSION=0
|
||||
GTK_INTERFACE_AGE=0
|
||||
GTK_BINARY_AGE=0
|
||||
GTK_MINOR_VERSION=2
|
||||
GTK_MICRO_VERSION=8
|
||||
GTK_INTERFACE_AGE=3
|
||||
GTK_BINARY_AGE=8
|
||||
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
|
||||
dnl
|
||||
AC_DIVERT_POP()dnl
|
||||
@@ -165,8 +165,6 @@ if test "x$enable_rebuilds" = "xyes" && \
|
||||
fi
|
||||
AC_SUBST(REBUILD)
|
||||
|
||||
AC_CHECK_FUNCS(lstat)
|
||||
|
||||
AC_MSG_CHECKING(whether make is GNU Make)
|
||||
STRIP_BEGIN=
|
||||
STRIP_END=
|
||||
@@ -177,13 +175,14 @@ if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
dnl some Make 3.79 $(strip ) versions are broken and require an empty arg
|
||||
STRIP_DUMMY=
|
||||
AC_SUBST(STRIP_DUMMY)
|
||||
AC_SUBST(STRIP_BEGIN)
|
||||
AC_SUBST(STRIP_END)
|
||||
|
||||
# i18n stuff
|
||||
ALL_LINGUAS="ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no pl pt pt_BR ro ru sk sl sv tr uk wa zh_TW.Big5 zh_CN.GB2312"
|
||||
ALL_LINGUAS="ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no nn pl pt pt_BR ro ru sk sl sv uk wa zh_TW.Big5"
|
||||
AM_GTK_GNU_GETTEXT
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
|
||||
@@ -216,22 +215,6 @@ AC_TRY_RUN([#include <math.h>
|
||||
)
|
||||
LIBS=$gtk_save_LIBS
|
||||
|
||||
MATH_LIB=-lm
|
||||
GTK_LIBS_EXTRA=
|
||||
AC_MSG_CHECKING(for the BeOS)
|
||||
case $host in
|
||||
*-*-beos*)
|
||||
AC_MSG_RESULT(yes)
|
||||
GTK_LIBS_EXTRA="-L\$(top_builddir_full)/gdk/.libs -lgdk"
|
||||
MATH_LIB=
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(MATH_LIB)
|
||||
AC_SUBST(GTK_LIBS_EXTRA)
|
||||
|
||||
dnl NeXTStep cc seems to need this
|
||||
AC_MSG_CHECKING([for extra flags for POSIX compliance])
|
||||
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
|
||||
@@ -252,16 +235,16 @@ fi
|
||||
if test x$with_glib = x ; then
|
||||
# Look for separately installed glib
|
||||
|
||||
AM_PATH_GLIB(1.3.1,,
|
||||
AM_PATH_GLIB(1.2.8,,
|
||||
AC_MSG_ERROR([
|
||||
*** GLIB 1.3.0 or better is required. The latest version of GLIB
|
||||
*** GLIB 1.2.8 or better is required. The latest version of GLIB
|
||||
*** is always available from ftp://ftp.gtk.org/.]),
|
||||
gobject gmodule gthread)
|
||||
gmodule gthread)
|
||||
|
||||
# we do not want to make all gtk progs to link to thread libraries.
|
||||
glib_cflags=`$GLIB_CONFIG glib gobject gmodule --cflags`
|
||||
glib_cflags=`$GLIB_CONFIG glib gmodule --cflags`
|
||||
glib_thread_cflags="$GLIB_CFLAGS"
|
||||
glib_libs=`$GLIB_CONFIG glib gobject gmodule --libs`
|
||||
glib_libs=`$GLIB_CONFIG glib gmodule --libs`
|
||||
glib_thread_libs="$GLIB_LIBS"
|
||||
GLIB_LIBS="$glib_libs"
|
||||
GLIB_DEPLIBS="$glib_libs"
|
||||
@@ -307,10 +290,6 @@ AC_SUBST(glib_thread_cflags)
|
||||
AC_SUBST(glib_thread_libs)
|
||||
AC_SUBST(GLIB_DEPLIBS)
|
||||
|
||||
AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
|
||||
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
|
||||
AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
|
||||
|
||||
# Find the X11 include and library directories
|
||||
AC_PATH_X
|
||||
AC_PATH_XTRA
|
||||
@@ -410,9 +389,6 @@ else
|
||||
AC_DEFINE(XINPUT_NONE)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
|
||||
AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
|
||||
|
||||
CFLAGS="$saved_cflags"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
@@ -492,29 +468,30 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# `widechar' tests for gdki18n.h
|
||||
# Duplicate `widechar' tests from `glib'.
|
||||
# Check for wchar.h
|
||||
AC_MSG_CHECKING(for wchar.h)
|
||||
AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
|
||||
if test $gdk_wchar_h = yes; then
|
||||
AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
|
||||
AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
|
||||
if test $gtk_ok = yes; then
|
||||
AC_DEFINE(HAVE_WCHAR_H,1,[Define if wchar.h exists])
|
||||
fi
|
||||
AC_MSG_RESULT($gdk_wchar_h)
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
|
||||
# Check for wctype.h (for iswalnum)
|
||||
AC_MSG_CHECKING(for wctype.h)
|
||||
AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
|
||||
if test $gdk_wctype_h = yes; then
|
||||
AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
|
||||
AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
|
||||
if test $gtk_ok = yes; then
|
||||
AC_DEFINE(HAVE_WCTYPE_H,1,[Define if wctype.h exists])
|
||||
fi
|
||||
AC_MSG_RESULT($gdk_wctype_h)
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
|
||||
# in Solaris 2.5, `iswalnum' is in -lw
|
||||
GDK_WLIBS=
|
||||
AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
|
||||
|
||||
# The following is necessary for Linux libc-5.4.38
|
||||
oLIBS="$LIBS"
|
||||
LIBS="$LIBS $GDK_WLIBS"
|
||||
# The following is necessary for Linux libc-5.4.38
|
||||
AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
|
||||
AC_TRY_LINK([#include <stdlib.h>],[
|
||||
#if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
|
||||
@@ -529,97 +506,20 @@ AC_TRY_LINK([#include <stdlib.h>],[
|
||||
# define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
|
||||
#endif
|
||||
iswalnum((wchar_t) 0);
|
||||
], gdk_working_wctype=yes, gdk_working_wctype=no)
|
||||
], gtk_ok=yes, gtk_ok=no)
|
||||
LIBS="$oLIBS"
|
||||
|
||||
if test $gdk_working_wctype = no; then
|
||||
AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
|
||||
if test $gtk_ok = no; then
|
||||
AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Define if the wctype function is broken])
|
||||
GDK_WLIBS=
|
||||
fi
|
||||
AC_MSG_RESULT($gdk_working_wctype)
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
AC_SUBST(GDK_WLIBS)
|
||||
|
||||
AC_SUBST(GTK_DEBUG_FLAGS)
|
||||
AC_SUBST(GTK_XIM_FLAGS)
|
||||
AC_SUBST(GTK_LOCALE_FLAGS)
|
||||
|
||||
AC_OUTPUT_COMMANDS([
|
||||
|
||||
## Generate `gdk/gdkconfig.h' in two cases
|
||||
## 1. `config.status' is run either explicitly, or via configure.
|
||||
## Esp. not when it is run in `Makefile' to generate makefiles and
|
||||
## config.h
|
||||
## 2. CONFIG_OTHER is set explicitly
|
||||
##
|
||||
## Case 1 is difficult. We know that `automake' sets one of
|
||||
## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
|
||||
## only when AM_CONFIG_HEADER is set, however.
|
||||
|
||||
if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
|
||||
# Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
|
||||
CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
|
||||
fi
|
||||
case "$CONFIG_OTHER" in
|
||||
*gdk/gdkconfig.h*)
|
||||
echo creating gdk/gdkconfig.h
|
||||
outfile=gdkconfig.h-tmp
|
||||
cat > $outfile <<\_______EOF
|
||||
/* gdkconfig.h
|
||||
*
|
||||
* This is a generated file. Please modify `configure.in'
|
||||
*/
|
||||
|
||||
#ifndef GDKCONFIG_H
|
||||
#define GDKCONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
_______EOF
|
||||
|
||||
cat >>$outfile <<_______EOF
|
||||
$gdk_windowing
|
||||
$gdk_wc
|
||||
_______EOF
|
||||
|
||||
cat >>$outfile <<_______EOF
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* GDKCONFIG_H */
|
||||
_______EOF
|
||||
|
||||
|
||||
if cmp -s $outfile gdk/gdkconfig.h; then
|
||||
echo gdk/gdkconfig.h is unchanged
|
||||
rm -f $outfile
|
||||
else
|
||||
mv $outfile gdk/gdkconfig.h
|
||||
fi ;;
|
||||
esac
|
||||
],[
|
||||
# Currently we always use X11 on those systems where we run configure...
|
||||
gdk_windowing='
|
||||
#define GDK_WINDOWING_X11'
|
||||
if test x$gdk_wchar_h = xyes; then
|
||||
gdk_wc='
|
||||
#define GDK_HAVE_WCHAR_H 1'
|
||||
fi
|
||||
if test x$gdk_wctype_h = xyes; then
|
||||
gdk_wc="\$gdk_wc
|
||||
#define GDK_HAVE_WCTYPE_H 1"
|
||||
fi
|
||||
if test x$gdk_working_wctype = xno; then
|
||||
gdk_wc="\$gdk_wc
|
||||
#define GDK_HAVE_BROKEN_WCTYPE 1"
|
||||
fi
|
||||
|
||||
|
||||
])
|
||||
|
||||
AC_OUTPUT([
|
||||
gtk+.spec
|
||||
docs/gtk-config.1
|
||||
@@ -628,9 +528,6 @@ gtk-config
|
||||
po/Makefile.in
|
||||
docs/Makefile
|
||||
gdk/Makefile
|
||||
gdk/x11/Makefile
|
||||
gdk/win32/Makefile
|
||||
gtk/Makefile
|
||||
gtk/gtkfeatures.h
|
||||
gtk/gtkcompat.h
|
||||
], [chmod +x gtk-config])
|
||||
|
||||
@@ -18,5 +18,4 @@ Makefile.in
|
||||
*.vrs
|
||||
html
|
||||
text
|
||||
texinfo.tex
|
||||
gtk-config.1
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
Incompatible Changes from GTK+-1.2 to GTK+-1.4:
|
||||
|
||||
* The gdk_time* functions have been removed. This functionality
|
||||
has been unused since the main loop was moved into GLib
|
||||
prior to 1.2.
|
||||
|
||||
* The signature for GtkPrintFunc (used for gtk_item_factory_dump_items)
|
||||
has been changed to take a 'const gchar *' instead of 'gchar *', to
|
||||
match what we do for glib, and other similar cases.
|
||||
|
||||
* The detail arguments in the GtkStyleClass structure are now 'const gchar *'.
|
||||
|
||||
* gtk_paned_set_gutter_size() has been removed, since the small handle tab
|
||||
has been changed to include the entire area previously occupied by
|
||||
the gutter.
|
||||
|
||||
* GDK no longer selects OwnerGrabButtonMask for button presses. This means
|
||||
that the automatic grab that occurs when the user presses a button
|
||||
will have owner_events = FALSE, so all events are redirected to the
|
||||
grab window, even events that would normally go to other windows of the
|
||||
window's owner.
|
||||
|
||||
* GtkColorSelectionDialog has now been moved into it's own set of files,
|
||||
gtkcolorseldialog.c and gtkcolorseldialog.h.
|
||||
|
||||
* gtk_widget_shape_combine_mask() now keeps a reference count on the
|
||||
mask pixmap that is passed in.
|
||||
|
||||
* Type system changes:
|
||||
- GTK_TYPE_OBJECT is not a fundamental type anymore. Type checks of the
|
||||
style (GTK_FUNDAMENTAL_TYPE (some_type) == GTK_TYPE_OBJECT)
|
||||
will not work anymore. As a replacement, (GTK_TYPE_IS_OBJECT (some_type))
|
||||
can be used now.
|
||||
- The following types vanished: GTK_TYPE_ARGS, GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK, GTK_TYPE_FOREIGN. The corresponding GtkArg
|
||||
fields and field access macros are also gone.
|
||||
- The following type aliases vanished: GTK_TYPE_FLAT_FIRST,
|
||||
GTK_TYPE_FLAT_LAST, GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST.
|
||||
- The type macros GTK_TYPE_MAKE() and GTK_TYPE_SEQNO() vanished, use of
|
||||
GTK_FUNDAMENTAL_TYPE() is discouraged. Instead, the corresponding GType
|
||||
API should be used: G_TYPE_FUNDAMENTAL(), G_TYPE_DERIVE_ID(),
|
||||
G_TYPE_BRANCH_SEQNO(). Note that the GLib type system doesn't build new
|
||||
type ids based on a global incremental sequential number anymore, but
|
||||
numbers new type ids sequentially per fundamental type branch.
|
||||
- The following type functions vanished/were replaced:
|
||||
Old Function Replacement
|
||||
gtk_type_query() - being investigated -
|
||||
gtk_type_set_varargs_type() -
|
||||
gtk_type_get_varargs_type() -
|
||||
gtk_type_check_object_cast() g_type_check_instance_cast()
|
||||
gtk_type_check_class_cast() g_type_check_class_cast()
|
||||
gtk_type_describe_tree() -
|
||||
gtk_type_describe_heritage() -
|
||||
gtk_type_free() -
|
||||
gtk_type_children_types() g_type_children()
|
||||
gtk_type_set_chunk_alloc() GTypeInfo.n_preallocs
|
||||
gtk_type_register_enum() g_enum_register_static()
|
||||
gtk_type_register_flags() g_flags_register_static()
|
||||
gtk_type_parent_class() g_type_parent() / g_type_class_peek_parent()
|
||||
Use of g_type_class_ref() / g_type_class_unref() and g_type_class_peek()
|
||||
is recommended over usage of gtk_type_class().
|
||||
Use of g_type_register_static() / g_type_register_dynamic() is recommended
|
||||
over usage of gtk_type_unique().
|
||||
|
||||
* Object system changes:
|
||||
GtkObject derives from GObject, so is not the basic object type anymore.
|
||||
This imposes the following source incompatible changes:
|
||||
- GtkObject has no klass field anymore, an object's class can be retrived
|
||||
with the object's coresponding GTK_<OBJECT>_GET_CLASS (object) macro.
|
||||
- GtkObjectClass has no type field anymore, a class's type can be retrived
|
||||
with the GTK_CLASS_TYPE (class) macro.
|
||||
- GtkObjectClass does not introduce the finalize() and shutdown() methods
|
||||
anymore. While shutdown() is intended for GTK+ internal use only, finalize()
|
||||
is required by a variety of object implementations. GObjectClass.finalize
|
||||
should be overriden here, e.g.:
|
||||
static void gtk_label_finalize (GObject *gobject)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (gobject);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
static void gtk_label_class_init (GtkLabelClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
|
||||
gobject_class->finalize = gtk_label_finalize;
|
||||
}
|
||||
|
||||
- the GtkObject::destroy signal can now be emitted multiple times on an object.
|
||||
::destroy implementations should check that make sure that they take this
|
||||
into account, by checking to make sure that resources are there before
|
||||
freeing them. For example:
|
||||
if (object->foo_data)
|
||||
{
|
||||
g_free (object->foo_data);
|
||||
object->foo_data = NULL;
|
||||
}
|
||||
|
||||
Also, ::destroy implementations have to release object references that
|
||||
the object holds. Code in finalize implementations such as:
|
||||
if (object->adjustment)
|
||||
{
|
||||
gtk_object_unref (object->adjustment);
|
||||
object->adjustment = NULL;
|
||||
}
|
||||
have to be moved into the ::destroy implementations. The reason for doing
|
||||
this is that all object reference cycles should be broken at destruction
|
||||
time.
|
||||
@@ -1,338 +0,0 @@
|
||||
|
||||
The overall syntax is:
|
||||
|
||||
(type-of-thing-being-defined name-used-to-refer-to-this-thing
|
||||
(attribute-name attribute-value-depending-on-the-attribute)
|
||||
(attribute-name attribute-value-depending-on-the-attribute)
|
||||
(attribute-name attribute-value-depending-on-the-attribute))
|
||||
|
||||
Some definitions can have a c-declaration field that gives the C code
|
||||
we parsed to arrive at the definition. The c-declaration is a quoted
|
||||
string because it can contain parentheses and such.
|
||||
|
||||
Defined types and their attributes:
|
||||
|
||||
===
|
||||
(module module-name
|
||||
(submodule-of module-name)) ;; submodule is optional
|
||||
|
||||
Ex: (module Gtk)
|
||||
Ex: (module Rgb
|
||||
(submodule-of Gdk))
|
||||
|
||||
modules are later referred to with a list of module names, like
|
||||
(Gdk Rgb) or (Gtk)
|
||||
|
||||
Object and boxed type definitions automatically create a submodule.
|
||||
For example, GtkCList creates the module (module CList (submodule-of
|
||||
(Gtk))) which is referred to as module (Gtk CList).
|
||||
|
||||
===
|
||||
|
||||
(type
|
||||
(alias some-unique-identifier)
|
||||
(in-module module-name) ;; optional, gchar* is not in a module
|
||||
(gtk-type-id gtk-type-system-id) ;; optional, absent if this is not
|
||||
;; in the type system
|
||||
(is-parametric boolean) ;; optional default to #f
|
||||
(in-c-name name-of-symbol-in-C)
|
||||
(out-c-name name-of-symbol-in-C)
|
||||
(inout-c-name name-of-symbol-in-C))
|
||||
|
||||
Ex: (type
|
||||
(alias string)
|
||||
(gtk-type-id GTK_TYPE_STRING)
|
||||
(in-c-name "const gchar*")
|
||||
(out-c-name "gchar**") ;; actually I'm not sure how strings work out/inout
|
||||
(inout-c-name "gchar*"))
|
||||
|
||||
(type
|
||||
(alias list)
|
||||
(gtk-type-id GTK_TYPE_POINTER)
|
||||
(is-parametric #t)
|
||||
(in-c-name "GList*")
|
||||
(out-c-name "GList**")
|
||||
(inout-c-name "GList**"))
|
||||
|
||||
|
||||
;; This one would be implied by the (object) def for GtkWidget I
|
||||
;; think - (type) is only required for types that are not implied
|
||||
;; by other definitions, such as int/boolean/etc.
|
||||
|
||||
(type
|
||||
(alias GtkWidget)
|
||||
(in-module (Gtk))
|
||||
(gtk-type-id GTK_TYPE_WIDGET)
|
||||
(in-c-name "GtkWidget*")
|
||||
(inout-c-name "GtkWidget*")
|
||||
(out-c-name "GtkWidget**"))
|
||||
|
||||
"Type" bindings are automatically assumed for objects, boxed types,
|
||||
etc. as defined below.
|
||||
|
||||
The alias field is used to refer to the type later on.
|
||||
|
||||
Whenever a type alias can be used, it is also possible to use the
|
||||
keyword "native", which implies that the type in question is too
|
||||
C-specific to represent. Then a c-declaration will typically be
|
||||
available for use.
|
||||
|
||||
C types containing [] or () are function pointers or arrays. For
|
||||
arrays that don't specify a size, we just treat them as pointers. For
|
||||
function pointers, we need special (type) syntax/attributes of some
|
||||
kind, but since there basically aren't any of these right now in the
|
||||
libs we care about we can just ignore them. For arrays that specify a
|
||||
size ditto, you would handle them by adding an (array-size) attribute
|
||||
or something or using the "native" keyword and skipping the (type)
|
||||
stuff.
|
||||
|
||||
===
|
||||
(object object-name
|
||||
(in-module module-name-list)
|
||||
(parent object-name optional-module-name-if-different)
|
||||
(abstract boolean-is-abstract-class) ;; omit for default of #f
|
||||
(c-name name-of-the-object-in-C)
|
||||
(field (type-and-name type-alias-of-struct-field name-of-struct-field)
|
||||
(access read-or-write-or-readwrite)))
|
||||
|
||||
|
||||
Ex: (object Widget
|
||||
(in-module (Gtk))
|
||||
(parent Object) ;; could say (parent Object (Gtk))
|
||||
(abstract #t)
|
||||
(c-name GtkWidget)
|
||||
(field (type-and-name GdkWindow* window) (access read)))
|
||||
|
||||
An "object" declaration automatically implies the type definition:
|
||||
|
||||
(type
|
||||
(alias concat-module-elements-and-object-name)
|
||||
(in-c-name pointer-to-c-name)
|
||||
(out-c-name pointer-to-pointer-to-c-name)
|
||||
(inout-c-name pointer-to-c-name))
|
||||
|
||||
Ex:
|
||||
(type (alias GtkWidget)
|
||||
(in-c-name GtkWidget*)
|
||||
(out-c-name GtkWidget**)
|
||||
(inout-c-name GtkWidget*))
|
||||
|
||||
It also implies a module that is the name broken into parts:
|
||||
(module CTree
|
||||
(submodule-of Gtk))
|
||||
|
||||
===
|
||||
|
||||
(function function-name
|
||||
(in-module module-name-list) ;; "static methods" go in their
|
||||
;; object's module
|
||||
(is-constructor-of object-type-alias) ;; optional, marks a constructor
|
||||
(c-name function-name)
|
||||
(return-type return-value-type) ;; defaults to void
|
||||
(caller-owns-return boolean-value) ;; defaults to #f
|
||||
(can-return-null boolean-value) ;; defaults to #t
|
||||
(parameter in-or-out-or-inout
|
||||
(type-and-name parameter-type-alias parameter-name)
|
||||
(type-parameter name-of-contained-type) ;; optional, requires parametric type
|
||||
(c-declaration "c-type-and-name")) ;; c-declaration only required
|
||||
;; if the type alias is "native"
|
||||
(varargs #t) ;; has varargs at the end
|
||||
)
|
||||
|
||||
Ex:
|
||||
(function init
|
||||
(in-module (Gdk Rgb)
|
||||
(c-name gdk_rgb_init)))
|
||||
|
||||
Ex:
|
||||
(function new
|
||||
(in-module (Gdk Rgb Cmap))
|
||||
(is-constructor-of GdkRgbCmap)
|
||||
(c-name gdk_rgb_cmap_new)
|
||||
(return-type GdkRgbCmap)
|
||||
(caller-owns-return #t) ;; perhaps this could be implied by is-constructor-of
|
||||
(parameter in (type-and-name array-of-guint32 colors))
|
||||
(parameter in (type-and-name gint n_colors)))
|
||||
|
||||
Ex:
|
||||
(function config_set_set_handler
|
||||
(in-module (Gnome))
|
||||
(c-name gnome_config_set_set_handler)
|
||||
(parameter in (type-and-name native func)
|
||||
(c-declaration "void (*func)(void*)"))
|
||||
(parameter in (type-and-name gpointer data)))
|
||||
|
||||
===
|
||||
(method method-name
|
||||
(of-object object-name module-name)
|
||||
;; retval/arg attributes as for (function), but with first parameter
|
||||
;; omitted for non-constructors
|
||||
)
|
||||
|
||||
Ex:
|
||||
(method set_text
|
||||
(of-object Label (Gtk))
|
||||
(parameter (type-and-name const-gchar* str)))
|
||||
|
||||
===
|
||||
(object-argument arg-name
|
||||
(of-object object-we-are-an-argument-of optional-objects-module)
|
||||
(type-id argument-type) ;; GTK_TYPE_OBJECT etc.
|
||||
;; flags all default to #f
|
||||
(readable bool-value)
|
||||
(writeable bool-value)
|
||||
(construct-only bool-value))
|
||||
|
||||
Ex:
|
||||
(object-argument label
|
||||
(of-object Label (Gtk))
|
||||
(type GTK_TYPE_STRING)
|
||||
(readable #t)
|
||||
(writeable #t))
|
||||
|
||||
===
|
||||
(signal signal-name
|
||||
(run-action bool-value)
|
||||
(run-first bool-value)
|
||||
(run-last bool-value)
|
||||
(of-object object-we-are-a-signal-of optional-objects-module)
|
||||
;; return value and parameters as for a function, omitting the object
|
||||
;; and user data parameters
|
||||
|
||||
;; what other properties matter for a signal?
|
||||
)
|
||||
|
||||
Ex:
|
||||
(signal select_row
|
||||
(of-object CList (Gtk))
|
||||
(run-first #t)
|
||||
;; return type defaults to void
|
||||
(parameter in (type-and-name gint row))
|
||||
(parameter in (type-and-name gint column))
|
||||
(parameter in (type-and-name GdkEvent* event)))
|
||||
|
||||
===
|
||||
(enum enum-name
|
||||
(in-module modname)
|
||||
(c-name name-in-c)
|
||||
(value (nick value-name-noprefixes-hyphen-lowercase) (c-name value-c-name)))
|
||||
|
||||
Ex:
|
||||
|
||||
(enum DirectionType
|
||||
(in-module Gtk)
|
||||
(c-name GtkDirectionType)
|
||||
(value (nick tab-forward) (c-name GTK_DIR_TAB_FORWARD))
|
||||
(value (nick tab-backward) (c-name GTK_DIR_TAB_BACKWARD))
|
||||
(value (nick up) (c-name GTK_DIR_UP))
|
||||
(value (nick down) (c-name GTK_DIR_DOWN))
|
||||
(value (nick left) (c-name GTK_DIR_LEFT))
|
||||
(value (nick right) (c-name GTK_DIR_RIGHT)))
|
||||
|
||||
(enum Pos
|
||||
(in-module (Gtk CTree))
|
||||
(c-name GtkCTreePos)
|
||||
(value (nick before) (c-name GTK_CTREE_POS_BEFORE))
|
||||
(value (nick as-child) (c-name GTK_CTREE_POS_AS_CHILD))
|
||||
(value (nick after) (c-name GTK_CTREE_POS_AFTER)))
|
||||
|
||||
===
|
||||
(flags) is just like enum, but some bindings may wrap enums and flags differently.
|
||||
|
||||
===
|
||||
|
||||
(boxed boxed-name
|
||||
(in-module modname)
|
||||
(c-name c-name)
|
||||
(ref-func func-to-increase-refcount)
|
||||
(copy-func func-to-copy)
|
||||
(release-func func-to-destroy-or-decrement-refcount)
|
||||
(field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
|
||||
|
||||
It is never OK to use memcpy() to copy a boxed type, or use
|
||||
malloc()/free() to alloc/free one.
|
||||
|
||||
Ex:
|
||||
|
||||
(boxed Pixmap
|
||||
(in-module (Gdk))
|
||||
(c-name GdkPixmap)
|
||||
(ref-func pixmap_ref)
|
||||
(release-func pixmap_unref))
|
||||
|
||||
An "object" declaration automatically implies the type definition:
|
||||
|
||||
(type
|
||||
(alias concat-module-elements-and-boxed-name)
|
||||
(in-c-name pointer-to-c-name)
|
||||
(out-c-name pointer-to-pointer-to-c-name)
|
||||
(inout-c-name pointer-to-c-name))
|
||||
|
||||
Ex:
|
||||
(type (alias GdkPixmap)
|
||||
(in-c-name GdkPixmap*)
|
||||
(out-c-name GdkPixmap**)
|
||||
(inout-c-name GdkPixmap*))
|
||||
|
||||
|
||||
===
|
||||
|
||||
(struct struct-name
|
||||
(in-module modname)
|
||||
(c-name c-name)
|
||||
(field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
|
||||
|
||||
Unlike a boxed type, a struct type can be copied with memcpy() and
|
||||
allocated on the stack or with g_malloc().
|
||||
|
||||
Ex:
|
||||
(struct Rectangle
|
||||
(in-module (Gdk))
|
||||
(c-name GdkRectangle)
|
||||
(field (type-and-name gint16 x) (access readwrite))
|
||||
(field (type-and-name gint16 y) (access readwrite))
|
||||
(field (type-and-name guint16 width) (access readwrite))
|
||||
(field (type-and-name guint16 height) (access readwrite)))
|
||||
|
||||
Implies GdkRectangle type alias:
|
||||
|
||||
(type (alias GdkRectangle)
|
||||
(in-c-name GdkRectangle*)
|
||||
(out-c-name GdkRectangle*) ;; note - not the same as boxed types
|
||||
(inout-c-name GdkRectangle*))
|
||||
|
||||
===
|
||||
|
||||
(user-function name
|
||||
(in-module module)
|
||||
(c-name c-typedef-name)
|
||||
;; return-type and parameters as for (function)
|
||||
)
|
||||
|
||||
Ex:
|
||||
|
||||
(user-function PrintFunc
|
||||
(in-module (Gtk))
|
||||
(parameter in (type-and-name gpointer func_data))
|
||||
(parameter in (type-and-name gchar* str)))
|
||||
|
||||
===
|
||||
|
||||
(typedef new-name
|
||||
(in-module module)
|
||||
(c-name c-full-name)
|
||||
(orig-type alias-of-orig-type))
|
||||
|
||||
Ex:
|
||||
|
||||
(typedef Type
|
||||
(in-module (Gtk))
|
||||
(c-name GtkType)
|
||||
(orig-type guint))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
103
docs/es/gtk.html
103
docs/es/gtk.html
@@ -1,103 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ</TITLE>
|
||||
<LINK HREF="gtkfaq-es-1.html" REL=next>
|
||||
|
||||
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<A HREF="gtkfaq-es-1.html">Next</A>
|
||||
Previous
|
||||
Contents
|
||||
<HR NOSHADE>
|
||||
<H1>GTK+ FAQ</H1>
|
||||
|
||||
|
||||
<H2>Nathan Froyd, Tony Gale, Shawn T. Amundson.</H2>Seis de Julio de 1998
|
||||
<P><HR NOSHADE>
|
||||
<EM>La intención de este documento es dar respuesta a las preguntas
|
||||
realizadas con más frecuencia por parte de los programadores que utilizan GTK+ o simplemente por personas que desean utilizar GTK+. </EM>
|
||||
<HR NOSHADE>
|
||||
<P>
|
||||
<H2><A NAME="toc1">1.</A> <A HREF="gtkfaq-es-1.html">Información General</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.1">1.1 Autores</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.2">1.2 ¿Qué es GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.3">1.3 ¿Qué es el + en GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.9">1.9 Cómo reportar errores en GTK+</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc2">2.</A> <A HREF="gtkfaq-es-2.html">Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc3">3.</A> <A HREF="gtkfaq-es-3.html">Desarrollo de GTK+</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc4">4.</A> <A HREF="gtkfaq-es-4.html">Desarrollo con GTK+</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.1">4.1 ¿Cómo empiezo?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc5">5.</A> <A HREF="gtkfaq-es-5.html">Acerca de gdk</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-5.html#ss5.1">5.1 ¿Qué es gdk?</A>
|
||||
<LI><A HREF="gtkfaq-es-5.html#ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc6">6.</A> <A HREF="gtkfaq-es-6.html">Acerca de glib</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-6.html#ss6.1">6.1 ¿Qué es glib?</A>
|
||||
<LI><A HREF="gtkfaq-es-6.html#ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc7">7.</A> <A HREF="gtkfaq-es-7.html">Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-7.html#ss7.1">7.1 Nota del Traductor</A>
|
||||
</UL>
|
||||
<HR NOSHADE>
|
||||
<A HREF="gtkfaq-es-1.html">Next</A>
|
||||
Previous
|
||||
Contents
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,192 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ: Información General</TITLE>
|
||||
<LINK HREF="gtkfaq-es-2.html" REL=next>
|
||||
|
||||
<LINK HREF="gtkfaq-es.html#toc1" REL=contents>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<A HREF="gtkfaq-es-2.html">Next</A>
|
||||
Previous
|
||||
<A HREF="gtkfaq-es.html#toc1">Contents</A>
|
||||
<HR NOSHADE>
|
||||
<H2><A NAME="s1">1. Información General</A></H2>
|
||||
|
||||
<H2><A NAME="ss1.1">1.1 Autores</A>
|
||||
</H2>
|
||||
|
||||
<P>Los autores de GTK+ son:
|
||||
<P>
|
||||
<UL>
|
||||
<LI>Peter Mattis (petm@xcf.berkeley.edu)</LI>
|
||||
<LI>Spencer Kimball (spencer@xcf.berkeley.edu)</LI>
|
||||
<LI>Josh MacDonald (jmacd@xcf.berkeley.edu)</LI>
|
||||
</UL>
|
||||
|
||||
GTK+ se ditribuye bajo la licencia de Librería Pública General de GNU
|
||||
<P>
|
||||
<H2><A NAME="ss1.2">1.2 ¿Qué es GTK+?</A>
|
||||
</H2>
|
||||
|
||||
<P>GTK+ es un pequeño y eficiente conjunto de <EM>widgets</EM>, diseñados
|
||||
con un aspecto y sentir general a Motif. Contiene <EM>widgets</EM> comúnes
|
||||
y algúnos <EM>widgets</EM> más complejos como una selección de
|
||||
archivos, y <EM>widgets</EM> de selección de colores.
|
||||
<P>GTK+ proporciona algunas características únicas. (No tengo conocimiento
|
||||
de otra librería de <EM>widge>
|
||||
<HR><H3>Transfer interrupted!</H3>
|
||||
enos).
|
||||
Por ejemplo, un botón no contiene una etiqueta, contiene un <EM>widget</EM>
|
||||
hijo, que en muchas instancias será una etiqueta. Sin embargo, el
|
||||
<EM>widget</EM> hijo también puede ser un <EM>pixmap</EM> (mapa de pixels),
|
||||
imagén o cualquier combinación posible que desee el programador. Toda la
|
||||
librería es así de flexible.
|
||||
<P>
|
||||
<H2><A NAME="ss1.3">1.3 ¿Qué es el + en GTK+?</A>
|
||||
</H2>
|
||||
|
||||
<P>Peter Mattis informó a la lista de correo gtk:
|
||||
<BLOCKQUOTE>
|
||||
"Escribí originalmente gtk el cual incluía tres librerías,
|
||||
libglib, libgdk y libgtk. Era caracterizado por una jerarquía de
|
||||
<EM>widget</EM> plana. O sea, no podías derivar un nuevo
|
||||
<EM>widget</EM> de uno ya existente. Contenía un mecanismo de
|
||||
<EM>callback</EM> (llamada) más estándar en lugar del mecanismo
|
||||
de señales ahora presente en gtk+. El + fue agregado para distinguir
|
||||
entre la versión original de gtk y la nueva versión. Pueden pensar
|
||||
en ello como una ampliación al gtk original que agrega características
|
||||
orientadas o objetos."
|
||||
</BLOCKQUOTE>
|
||||
<P>
|
||||
<H2><A NAME="ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
|
||||
</H2>
|
||||
|
||||
<P>Peter Mattis informó a la lista de correo gtk:
|
||||
<BLOCKQUOTE>
|
||||
"Pienso que la última vez que Spencer y yo hablamos al respecto nos
|
||||
decidimos por GTK = Gimp ToolKit. Pero no estoy seguro. Sin embargo,
|
||||
definitivamente no es GNU."
|
||||
</BLOCKQUOTE>
|
||||
<P>
|
||||
<H2><A NAME="ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
|
||||
</H2>
|
||||
|
||||
<P>
|
||||
En el directorio doc/ de la distribución de GTK+ encontrarás
|
||||
el material de referencia para GTK y GDK, este FAQ y el tutor de GTK.
|
||||
<P>Adicionalmente, puedes encontrar enlaces a versiones HTML de estos
|
||||
documentos al ir a
|
||||
<A HREF="http://www.gtk.org/">http://www.gtk.org/</A>.
|
||||
<P>El Tutor y el FAQ también se pueden encontrar en
|
||||
<A HREF="http://www.geocities.com/ResearchTriangle/Lab/4299/">http://www.geocities.com/ResearchTriangle/Lab/4299/</A>.
|
||||
<P>
|
||||
<H2><A NAME="ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
|
||||
</H2>
|
||||
|
||||
<P>Hay dos listas de correo:
|
||||
<UL>
|
||||
<LI>Una lista de correo para la discusión del desarrollo de aplicaciones
|
||||
basadas en GTK se hospeda en gtk-app-devel-list@redhat.com. Para suscribirse
|
||||
envíe un correo electrónico a
|
||||
<A HREF="mailto:gtk-app-devel-list-request@redhat.com">gtk-app-devel-list-request@redhat.com</A> con <EM>subscribe</EM> en el
|
||||
campo <B>subject</B>.
|
||||
<P>
|
||||
</LI>
|
||||
<LI>Una lista de correo para la discusión del desarrollo de GTK se hospeda
|
||||
en gtk-list@redhat.com. Para suscribirse envíe un correo electrónico
|
||||
a
|
||||
<A HREF="mailto:gtk-list-request@redhat.com">gtk-list-request@redhat.com</A> con <EM>subscribe</EM>
|
||||
en el campo <B>subject</B>.
|
||||
<P>Un archivo escudriñable de la lista de correo puede ser encontrado en
|
||||
<A HREF="http://archive.redhat.com/gtk-list">http://archive.redhat.com/gtk-list</A></LI>
|
||||
</UL>
|
||||
<H2><A NAME="ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
|
||||
está muerta?</H2>
|
||||
|
||||
<P>No, todos están ocupados codificando.
|
||||
<P>
|
||||
<H2><A NAME="ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
|
||||
</H2>
|
||||
|
||||
<P>Primero, asegúrate que tu pregunta no esté respondida en la
|
||||
documentación, este FAQ o el tutor. ¿Hecho? ¿Estás seguro de que
|
||||
lo has hecho, verdad? En ese caso, el mejor lugar para hacer preguntas es
|
||||
la lista de correo de GTK+.
|
||||
<P>
|
||||
<H2><A NAME="ss1.9">1.9 Cómo reportar errores en GTK+</A>
|
||||
</H2>
|
||||
|
||||
<P>Los reportes de errores se deben enviar a la lista de correo de GTK+.
|
||||
<P>
|
||||
<H2><A NAME="ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
|
||||
</H2>
|
||||
|
||||
<P>Algunas aplicaciones que utilizan GTK+ son:
|
||||
<UL>
|
||||
<LI>GIMP (
|
||||
<A HREF="http://www.XCF.Berkeley.EDU/~gimp/">http://www.XCF.Berkeley.EDU/~gimp/</A> ),
|
||||
un programa de manipulación de imágenes</LI>
|
||||
<LI>Gsumi (
|
||||
<A HREF="http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html">http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html</A>),
|
||||
un divertido programa para rayar en blanco y negro con soporte para
|
||||
XInput.</LI>
|
||||
<LI>GUBI (
|
||||
<A HREF="http://www.SoftHome.net/pub/users/timj/gubi/index.htm">http://www.SoftHome.net/pub/users/timj/gubi/index.htm</A>),
|
||||
un constructor de interface de usuario</LI>
|
||||
<LI>Gzilla (
|
||||
<A HREF="http://www.levien.com/gzilla/">http://www.levien.com/gzilla/</A>),
|
||||
un navegador del web</LI>
|
||||
<LI>SANE (
|
||||
<A HREF="http://www.azstarnet.com/~axplinux/sane/">http://www.azstarnet.com/~axplinux/sane/</A> ),
|
||||
una interface universal para <EM>scanner</EM></LI>
|
||||
<LI>XQF (
|
||||
<A HREF="http://www.botik.ru/~roma/quake/">http://www.botik.ru/~roma/quake/</A>),
|
||||
un lanzador y navegador de servidores de QuakeWorld/Quake2</LI>
|
||||
<LI>ElectricEyes (
|
||||
<A HREF="http://www.labs.redhat.com/ee.shtml">http://www.labs.redhat.com/ee.shtml</A>),
|
||||
un visor de imágenes que se dirige a ser un reemplazo libre de xv</LI>
|
||||
<LI>GPK - the General Proxy Kit (
|
||||
<A HREF="http://www.humanfactor.com/gpk/">http://www.humanfactor.com/gpk/</A>),
|
||||
una librería agregable que permite accesso seguro a GTK+
|
||||
ante múltiples hilos</LI>
|
||||
<LI>GCK - the General Convenience Kit (
|
||||
<A HREF="http://www.ii.uib.no/~tomb/gck.html">http://www.ii.uib.no/~tomb/gck.html</A>),
|
||||
funciones misceláneas cuya intención es facilitar el manejo de
|
||||
colores, construcción de IU (interfaces de usuario), operaciones
|
||||
vectoriales, y funciones matemáticas</LI>
|
||||
<LI>GDK Imlib (
|
||||
<A HREF="http://www.labs.redhat.com/imlib/">http://www.labs.redhat.com/imlib/</A>),
|
||||
una librería de manipulación y carga rápida de imágenes para
|
||||
GDK </LI>
|
||||
</UL>
|
||||
<P>Adicionalmente a lo de arriba, el proyecto GNOME
|
||||
(
|
||||
<A HREF="http://www.gnome.org">http://www.gnome.org</A>)
|
||||
utiliza GTK+ para construír un escritorio libre para Linux. Muchos más
|
||||
programas pueden ser encontrados ahí.
|
||||
<P>
|
||||
<H2><A NAME="ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
|
||||
</H2>
|
||||
|
||||
<P>
|
||||
<P>Pregunte en gtk-list para sugerencias. Actualmente hay por lo menos cuatro
|
||||
clientes IRC endesarrollo.
|
||||
<P>
|
||||
<UL>
|
||||
<LI>girc. (Incluído con GNOME)</LI>
|
||||
<LI>Bezerk (
|
||||
<A HREF="http://www.gtk.org/~trog/">http://www.gtk.org/~trog/</A>)</LI>
|
||||
<LI>gsirc. (¿Localización?)</LI>
|
||||
<LI>Gnirc. (
|
||||
<A HREF="http://www.imaginet.fr/~dramboz/gnirc">http://www.imaginet.fr/~dramboz/gnirc</A>)</LI>
|
||||
</UL>
|
||||
<P>
|
||||
<P>
|
||||
<HR NOSHADE>
|
||||
<A HREF="gtkfaq-es-2.html">Next</A>
|
||||
Previous
|
||||
<A HREF="gtkfaq-es.html#toc1">Contents</A>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,195 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ: Cómo encontrar, configurar, instalar y comprobar GTK+</TITLE>
|
||||
<LINK HREF="gtkfaq-es-3.html" REL=next>
|
||||
<LINK HREF="gtkfaq-es-1.html" REL=previous>
|
||||
<LINK HREF="gtkfaq-es.html#toc2" REL=contents>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<A HREF="gtkfaq-es-3.html">Next</A>
|
||||
<A HREF="gtkfaq-es-1.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc2">Contents</A>
|
||||
<HR NOSHADE>
|
||||
<H2><A NAME="s2">2. Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
|
||||
|
||||
<H2><A NAME="ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
|
||||
</H2>
|
||||
|
||||
<P>Para compilar GTK+, todo lo que necesita es un compilador de C (gcc) y
|
||||
el Sistema X Windows y librerías asociadas en su sistema.
|
||||
<P>
|
||||
<H2><A NAME="ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
|
||||
</H2>
|
||||
|
||||
<P>El sitio canónico es:
|
||||
<PRE>
|
||||
ftp://ftp.gtk.org/pub/gtk
|
||||
</PRE>
|
||||
|
||||
Por supuesto, cualquier espejo de ftp.gtk.org debe tener las últimas
|
||||
versiones también.
|
||||
<P>
|
||||
<H2><A NAME="ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
|
||||
</H2>
|
||||
|
||||
<P>Por lo general, todo lo que necesita es emititir los comandos:
|
||||
<PRE>
|
||||
./configure
|
||||
make
|
||||
</PRE>
|
||||
|
||||
en el directorio gtk+-version/.
|
||||
<P>
|
||||
<H2><A NAME="ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
|
||||
</H2>
|
||||
|
||||
<P>Asegúrese de que utiliza GNU make (verifique con <CODE>make -v</CODE>). Hay
|
||||
varias versiones extrañas y maravillosas de make por ahí, y no todas
|
||||
manejan los <EM>Makefiles</EM> generados automáticamente.
|
||||
<P>
|
||||
<P>
|
||||
<H2><A NAME="ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
|
||||
</H2>
|
||||
|
||||
<P>Este problema se encuentra comúnmente cuando las librerías GTK+ no pueden
|
||||
ser localizadas o tienen la versión incorrecta. Generalmente, el compilador
|
||||
se quejará de un 'unresolved symbol' (símbolo no resuelto). Hay dos cosas
|
||||
que necesita verificar:
|
||||
<P>
|
||||
<UL>
|
||||
<LI>Asegúrese de que las librerías pueden ser encontradas. Usted desea editar
|
||||
/etc/ld.so.conf para incluír los directorios que contienen las librerías
|
||||
GTK, de manera que luzca como:
|
||||
<PRE>
|
||||
/usr/X11R6/lib
|
||||
/usr/local/lib
|
||||
</PRE>
|
||||
|
||||
Luego necesita correr /sbin/ldconfig como root. Puede encontrar que directorio
|
||||
utiliza GTK al ejecutar
|
||||
<PRE>
|
||||
gtk-config --libs
|
||||
</PRE>
|
||||
|
||||
|
||||
Si su sitema no utiliza ld.so para encontrar librerías (como Solaris),
|
||||
entonces tendrá que utilizar la variable de ambiente LD_LIBRARY_PATH
|
||||
(o compilar el camino en su programa, lo cual no voy a cubrir aquí). Así
|
||||
que, con un shell tipo Bourne usted puede hacer (si sus librerías GTK
|
||||
están en /usr/local/lib):
|
||||
<PRE>
|
||||
export LD_LIBRARY_PATH=/usr/local/lib
|
||||
</PRE>
|
||||
|
||||
y en un csh, usted puede hacer:
|
||||
<PRE>
|
||||
setenv LD_LIBRARY_PATH /usr/local/lib
|
||||
</PRE>
|
||||
|
||||
</LI>
|
||||
<LI>Asegúrese de que el enlazador está ha encontrado el conjunto correcto de
|
||||
librerías. Si tiene una distribución de Linux que instala GTK+ (ej.
|
||||
RedHat 5.0) entonces esta versión anterior puede ser utilizada. Ahora
|
||||
(asumiendo que tiene un sistema RedHat), emita el comando
|
||||
<PRE>
|
||||
rpm -e gtk gtk-devel
|
||||
</PRE>
|
||||
|
||||
También puede querer remover los paquetes que dependen de gtk (rpm le
|
||||
dirá cuáles son). Si no tiene un sistema Linux RedHat, verifique
|
||||
para estar seguro que ni
|
||||
<PRE>
|
||||
/usr/lib
|
||||
</PRE>
|
||||
ni
|
||||
<PRE>
|
||||
/usr/local/lib
|
||||
</PRE>
|
||||
|
||||
contengan alguna de las librerías libgtk, libgdk, libglib, or libgck.
|
||||
Si existen, elimínelas (y cualquier archivo <EM>include</EM>, como
|
||||
/usr/include/gtk y /usr/include/gdk) y reinstale gtk+.</LI>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
|
||||
</H2>
|
||||
|
||||
<P>El archivo de encabezado "glibconfig.h" se movió al directorio
|
||||
$exec_prefix/lib/glib/include/. $exec_prefix es el directorio que fue
|
||||
especificado al dar la bandera --exec-prefix a ./configure cuando se
|
||||
compiló GTK+. Va por omisión a $prefix, (especificado con --prefix),
|
||||
que en su lugar va por omisión a /usr/local/.
|
||||
<P>Ésto se hizo asi porque "glibconfig.h" incluye información
|
||||
dependiente de la arquitectura, y el resto de los archivos <EM>include</EM>
|
||||
se colocan en $prefix/include, el cual puede ser compartido entre distintas
|
||||
arquitecturas.
|
||||
<P>GTK+ incluye un guión para el intérprete de comandos,
|
||||
<CODE>gtk-config</CODE>, el cual hace fácil
|
||||
encontrar los caminos correctos de inclusión. El tutor de GTK+ incluye
|
||||
un ejemplo de como utilizar <CODE>gtk-config</CODE> para una compilación simple
|
||||
desde la línea de comandos. Para información sobre configuraciones más
|
||||
complicadas, vea el archivo docs/gtk-config.txt en la distribución de GTK+.
|
||||
<P>Si está intentando compilar un programa viejo, puede bordear el problema
|
||||
al configurarlo con una línea de comando como:
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
CPPFLAGS="-I/usr/local/include/glib/include" ./configure
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>para intérpretes de comandos compatibles con Bourne como bash, o para
|
||||
variantes csh:
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
setenv CPPFLAGS "-I/usr/local/include/glib/include"
|
||||
./configure
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>(Sustituya el valor apropiado de $exec_prefix para /usr/local.)
|
||||
<P>
|
||||
<H2><A NAME="ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
|
||||
</H2>
|
||||
|
||||
<P>Hay varias razones comúnes para esto:
|
||||
<UL>
|
||||
<LI>Usted tiene una versión vieja de GTK instalada en algún lugar.
|
||||
RedHat 5.0, por ejemplo, instala una copia anterior de GTK que no funcinará
|
||||
con las últimas veriones de GIMP. Debe eliminar esta copia vieja, pero
|
||||
observe que en el caso de RedHat 5.0 esto dañará las aplicaciones
|
||||
<CODE>control-panel</CODE>.
|
||||
<P>
|
||||
</LI>
|
||||
<LI><CODE>gtk-config</CODE> (u otro componente de GTK) no se encuentra en el camino
|
||||
(<EM>path</EM>),
|
||||
o hay una versión vieja en su sistema. Teclee:
|
||||
<PRE>
|
||||
gtk-config --version
|
||||
</PRE>
|
||||
|
||||
para verificar ambos casos. Ésto debe devolver un valor de por lo menos
|
||||
0.99.8 para que las cosas funcionen correctamente con GIMP 0.99.23. Si
|
||||
devuelve un valor distinto a lo que usted espera, entonces tiene una versión
|
||||
vieja de GTK en su sistema.
|
||||
<P>
|
||||
</LI>
|
||||
<LI>El guión ./configure no puede encontrar las librerías GTK. Como
|
||||
./configure compila varios programas de prueba, necesita poder encontrar las
|
||||
librerías GTK. Revise la pregunta anterior para obtener más ayuda al
|
||||
respecto.</LI>
|
||||
</UL>
|
||||
<P>Si nada de lo anterior ayuda, entonces revise config.log, el cual es
|
||||
generado por ./configure cuando corre. Al final estará la última
|
||||
acción tomada antes de fallar. Si es una sección de código fuente,
|
||||
copie el código fuente a un archivo y compilelo con la línea
|
||||
jústamente arriba de él en config.log. Si la compilación tiene
|
||||
éxito, intente ejecutarlo.
|
||||
<P>
|
||||
<HR NOSHADE>
|
||||
<A HREF="gtkfaq-es-3.html">Next</A>
|
||||
<A HREF="gtkfaq-es-1.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc2">Contents</A>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,198 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ: Desarrollo de GTK+</TITLE>
|
||||
<LINK HREF="gtkfaq-es-4.html" REL=next>
|
||||
<LINK HREF="gtkfaq-es-2.html" REL=previous>
|
||||
<LINK HREF="gtkfaq-es.html#toc3" REL=contents>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<A HREF="gtkfaq-es-4.html">Next</A>
|
||||
<A HREF="gtkfaq-es-2.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc3">Contents</A>
|
||||
<HR NOSHADE>
|
||||
<H2><A NAME="s3">3. Desarrollo de GTK+</A></H2>
|
||||
|
||||
<H2><A NAME="ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
|
||||
</H2>
|
||||
|
||||
<P>CVS es el Concurrent Version System (Sistema de Versión Concurrente) y es
|
||||
un medio muy popular de control de versión para proyectos de software.
|
||||
Está diseñado para permitir que múltiples autores puedan operar de
|
||||
manera simultánea en el mismo árbol fuente. Este árbol fuente es
|
||||
mantenido centralizadamente, pero cada desarrollador tiene una réplica local
|
||||
de este repositorio en el cual hacen sus cambios.
|
||||
<P>Los desarrolladores de GTK+ utilizan un repositorio CVS para almacenar la
|
||||
copia maestra de la actual versión en desarrollo de GTK+. Como tal,
|
||||
la gente que desea contribuír con parches a GTK+ deben generarlos para la
|
||||
versión del CVS. La gente normal debe utilizar los paquetes liberados.
|
||||
<P>El conjunto de herramientas CVS está disponible como paquetes RPM en los
|
||||
sitios usuales de RedHat. La última versión está disponible en
|
||||
<A HREF="http://download.cyclic.com/pub/"><http://download.cyclic.com/pub/></A><P>Cualquiera puede bajar la última versión CVS de GTK+ utilizando
|
||||
acceso anónimo con los siguientes pasos:
|
||||
<UL>
|
||||
<LI> En un descendiente del intérprete de comandos bourne (ej. bash)
|
||||
teclee:
|
||||
<PRE>
|
||||
export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/debian/home/gnomecvs'
|
||||
</PRE>
|
||||
</LI>
|
||||
<LI>Luego, la primera vez que el árbol fuente se retira, se necesita
|
||||
un <EM>login</EM> cvs.
|
||||
<PRE>
|
||||
cvs login
|
||||
</PRE>
|
||||
|
||||
Ésto hará que se le solicite una clave de acceso. No hay clave de
|
||||
acceso para cvs.gimp.org, así que solo ingrese un retorno de carro.</LI>
|
||||
<LI>Para conseguir el árbol y colocarlo en un subdirectorio de su
|
||||
directorio de trabajo actual, emita el comando:
|
||||
<PRE>
|
||||
cvs -z3 get gtk+
|
||||
</PRE>
|
||||
|
||||
|
||||
Observe que con el árbol GTK+ 1.1, glib se ha movido a un módulo CVS
|
||||
separado, de manera que si no tiene glib instalado necesitará conseguirlo
|
||||
igualmente:
|
||||
<PRE>
|
||||
cvs -z3 get glib
|
||||
</PRE>
|
||||
|
||||
</LI>
|
||||
</UL>
|
||||
<H2><A NAME="ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
|
||||
</H2>
|
||||
|
||||
<P>Es simple. Si algo no funciona en un programa como usted piensa que debería,
|
||||
revise la documentación para asegurarse de que no ha pasado algo por alto.
|
||||
Si es un verdadero error o característica perdida, rastréelo en el
|
||||
fuente de GTK+, cámbielo, y entonces genere un parche en la forma de un
|
||||
'diff de contexto'. Esto puede hacerse utilizando un comando como
|
||||
<CODE>diff -ru <oldfile> <newfile></CODE>. Entonces envíe el archivo
|
||||
de parche a:
|
||||
<PRE>
|
||||
ftp://ftp.gtk.org/incoming
|
||||
</PRE>
|
||||
|
||||
junto a un archivo README. ¡Asegúrese de seguir las convenciones de
|
||||
asignación de nombres o su parche será borrado! Los archivos deben ser
|
||||
de esta forma:
|
||||
<PRE>
|
||||
gtk-<username>-<date yymmdd-n>.patch.gz
|
||||
gtk-<username>-<date yymmdd-n>.patch.README
|
||||
</PRE>
|
||||
|
||||
La "n" en la fecha indica un número único (empezando de 0)
|
||||
de parches que subió ese día. Debe ser 0, a menos que envíe más de
|
||||
un parche en el mismo día.
|
||||
<P>Example:
|
||||
<PRE>
|
||||
gtk-gale-982701-0.patch.gz
|
||||
gtk-gale-982701-0.patch.README
|
||||
</PRE>
|
||||
|
||||
Una vez que usted envía <EM>lo que sea</EM>, envíe el README a
|
||||
ftp-admin@gtk.org
|
||||
<P>
|
||||
<H2><A NAME="ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
|
||||
</H2>
|
||||
|
||||
<P>Los parches enviados se mandarán a
|
||||
<CODE>ftp://ftp.gtk.org/pub/gtk/patches</CODE>
|
||||
donde uno del equipo de desarrollo de GTK+ los recogerá. Si son aplicados,
|
||||
serán movidos a <CODE>/pub/gtk/patches/old</CODE>.
|
||||
<P>Los parches que no son aplicados, por cualquier razón, se mandarán a
|
||||
<CODE>/pub/gtk/patches/unapplied</CODE> o <CODE>/pub/gtk/patches/outdated</CODE>.
|
||||
En este punto puede preguntar en la lista de correo <CODE>gtk-list</CODE> el porqué
|
||||
su parche no fué aplicado. Hay muchas razones posibles por las cuales un
|
||||
parche no se aplica, pasando desde que no se puede aplicar limpiamente, hasta
|
||||
que no es correcto. No se rinda si no logró que su parche se aplicase a la
|
||||
primera.
|
||||
<P>
|
||||
<H2><A NAME="ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
|
||||
</H2>
|
||||
|
||||
<P>Esto corresponde a los autores, de manera que tendrá que preguntarles
|
||||
al terminar su <EM>widget</EM>. Como una guía general, los <EM>widgets</EM>
|
||||
que por lo general son útiles, funcionan, y no son una desgracia al conjunto
|
||||
de <EM>widgets</EM> serán incluídos con mucho gusto.
|
||||
<P>
|
||||
<H2><A NAME="ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
|
||||
</H2>
|
||||
|
||||
<P>Sí. Existe
|
||||
<UL>
|
||||
<LI>una envoltura de C++ para GTK+ llamada gtk--. Puede encontrar el su
|
||||
página hogar en:
|
||||
<A HREF="http://www.cs.tut.fi/~p150650/gtk/gtk--.html">http://www.cs.tut.fi/~p150650/gtk/gtk--.html</A>.
|
||||
El sitio FTP es
|
||||
<A HREF="ftp://ftp.gtk.org/pub/gtk/gtk--">ftp://ftp.gtk.org/pub/gtk/gtk--</A>.
|
||||
<P>
|
||||
<P>
|
||||
</LI>
|
||||
<LI>Hay dos ataduras para Objective-C en desarrollo:
|
||||
|
||||
<UL>
|
||||
<LI>El paquete elegido por el
|
||||
<A HREF="http://www.gnome.org/">proyecto GNOME</A> es obgtk. Objgtk se basa en la clase Object y es
|
||||
mantenido por
|
||||
<A HREF="mailto:sopwith@cuc.edu">Elliot Lee</A>.
|
||||
Aparentemente, objgtk se está aceptando como el atamiento `estándar'
|
||||
de Objective-C para GTK+.
|
||||
</LI>
|
||||
<LI> Si usted está más inclinado al
|
||||
<A HREF="http://www.gnustep.org/">proyecto GNUstep</A>,
|
||||
puede que quiera revisar GTKKit por
|
||||
<A HREF="mailto:helge@mdlink.de">Helge Heß</A>.
|
||||
La intención es crear un atamiento GTK+ utilizando FoundationKit.
|
||||
GTKKit incluye linduras como escribir un archivo con una plantilla tipo
|
||||
XML para construír una interface GTK+.
|
||||
</LI>
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
</LI>
|
||||
<LI>Atamientos Perl
|
||||
<A HREF="ftp://ftp.gtk.org/pub/gtk/perl">ftp://ftp.gtk.org/pub/gtk/perl</A>
|
||||
<P>
|
||||
</LI>
|
||||
<LI>Atamientos Guile. La página hogar se encuentra en
|
||||
<A HREF="http://www.ping.de/sites/zagadka/guile-gtk">http://www.ping.de/sites/zagadka/guile-gtk</A>.
|
||||
Por cierto, Guile es la implantación del Proyecto GNU de Scheme R4RS (el
|
||||
estándar). Si le gusta Scheme, querrá darle un vistazo a éste.
|
||||
<P>
|
||||
<P>
|
||||
</LI>
|
||||
<LI>David Monniaux informa:
|
||||
<BLOCKQUOTE>
|
||||
He empezado un sistema de atamiento gtk-O'Caml. Las bases del sistema,
|
||||
incluyendo <EM>callbacks</EM>, funcionan bien.
|
||||
|
||||
El desarrollo actual se encuentra en
|
||||
<A HREF="http://www.ens-lyon.fr/~dmonniau/arcs">http://www.ens-lyon.fr/~dmonniau/arcs</A></BLOCKQUOTE>
|
||||
|
||||
</LI>
|
||||
<LI>Se han hecho varios atamientos para python:
|
||||
<P>
|
||||
<UL>
|
||||
<LI>pygtk se encuentra en
|
||||
<A HREF="http://www.daa.com.au/~james/pygtk">http://www.daa.com.au/~james/pygtk</A> y
|
||||
<A HREF="ftp://ftp.gtk.org/pub/gtk/python">ftp://ftp.gtk.org/pub/gtk/python</A></LI>
|
||||
<LI>python-gtk se encuentra en
|
||||
<A HREF="http://www.ucalgary.ca/~nascheme/python-gtk">http://www.ucalgary.ca/~nascheme/python-gtk</A></LI>
|
||||
</UL>
|
||||
<P>
|
||||
</LI>
|
||||
<LI>Hay un <EM>widget</EM> disponible para GTK+. Agárrelo en
|
||||
<A HREF="http://www.sakuranet.or.jp/~aozasa/shige/doc/comp/gtk/gtkGL/files-en.html">http://www.sakuranet.or.jp/~aozasa/shige/doc/comp/gtk/gtkGL/files-en.html</A>
|
||||
</LI>
|
||||
</UL>
|
||||
<P>
|
||||
<HR NOSHADE>
|
||||
<A HREF="gtkfaq-es-4.html">Next</A>
|
||||
<A HREF="gtkfaq-es-2.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc3">Contents</A>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,435 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ: Desarrollo con GTK+</TITLE>
|
||||
<LINK HREF="gtkfaq-es-5.html" REL=next>
|
||||
<LINK HREF="gtkfaq-es-3.html" REL=previous>
|
||||
<LINK HREF="gtkfaq-es.html#toc4" REL=contents>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<A HREF="gtkfaq-es-5.html">Next</A>
|
||||
<A HREF="gtkfaq-es-3.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc4">Contents</A>
|
||||
<HR NOSHADE>
|
||||
<H2><A NAME="s4">4. Desarrollo con GTK+</A></H2>
|
||||
|
||||
<H2><A NAME="ss4.1">4.1 ¿Cómo empiezo?</A>
|
||||
</H2>
|
||||
|
||||
<P>Después de que ha instalado GTK+, hay un par de cosas que pueden
|
||||
facilitarle el desarrollo de aplicaciones con él. Está el Tutor de
|
||||
GTK+
|
||||
<A HREF="http://www.gtk.org/tutorial/"><http://www.gtk.org/tutorial/></A>, el cual está en desarrollo
|
||||
activo. Este tutorial le introducirá en la escritura de aplicaciones
|
||||
utilizando C.
|
||||
<P>El Tutor no contiene (todavía) información sobre todos los
|
||||
<EM>widgets</EM> que existen en GTK+. Para código de ejemplo sobre la
|
||||
utilización básica de todos los <EM>widgets</EM> de GTK+, debe ver
|
||||
el archivo gtk/testgtk.c (y archivos fuentes asociados) en la distribución
|
||||
GTK+. Ver estos ejemplos le dará una buena base sobre lo que pueden hacer
|
||||
los <EM>widgets</EM>.
|
||||
<P>
|
||||
<H2><A NAME="ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
|
||||
</H2>
|
||||
|
||||
<P>El Tutor de GTK+ lista los siguientes <EM>widgets</EM>:
|
||||
<PRE>
|
||||
GtkObject
|
||||
+GtkData
|
||||
| +GtkAdjustment
|
||||
| `GtkTooltips
|
||||
`GtkWidget
|
||||
+GtkContainer
|
||||
| +GtkBin
|
||||
| | +GtkAlignment
|
||||
| | +GtkEventBox
|
||||
| | +GtkFrame
|
||||
| | | `GtkAspectFrame
|
||||
| | +GtkHandleBox
|
||||
| | +GtkItem
|
||||
| | | +GtkListItem
|
||||
| | | +GtkMenuItem
|
||||
| | | | `GtkCheckMenuItem
|
||||
| | | | `GtkRadioMenuItem
|
||||
| | | `GtkTreeItem
|
||||
| | +GtkViewport
|
||||
| | `GtkWindow
|
||||
| | +GtkColorSelectionDialog
|
||||
| | +GtkDialog
|
||||
| | | `GtkInputDialog
|
||||
| | `GtkFileSelection
|
||||
| +GtkBox
|
||||
| | +GtkButtonBox
|
||||
| | | +GtkHButtonBox
|
||||
| | | `GtkVButtonBox
|
||||
| | +GtkHBox
|
||||
| | | +GtkCombo
|
||||
| | | `GtkStatusbar
|
||||
| | `GtkVBox
|
||||
| | +GtkColorSelection
|
||||
| | `GtkGammaCurve
|
||||
| +GtkButton
|
||||
| | +GtkOptionMenu
|
||||
| | `GtkToggleButton
|
||||
| | `GtkCheckButton
|
||||
| | `GtkRadioButton
|
||||
| +GtkCList
|
||||
| `GtkCTree
|
||||
| +GtkFixed
|
||||
| +GtkList
|
||||
| +GtkMenuShell
|
||||
| | +GtkMenuBar
|
||||
| | `GtkMenu
|
||||
| +GtkNotebook
|
||||
| +GtkPaned
|
||||
| | +GtkHPaned
|
||||
| | `GtkVPaned
|
||||
| +GtkScrolledWindow
|
||||
| +GtkTable
|
||||
| +GtkToolbar
|
||||
| `GtkTree
|
||||
+GtkDrawingArea
|
||||
| `GtkCurve
|
||||
+GtkEditable
|
||||
| +GtkEntry
|
||||
| | `GtkSpinButton
|
||||
| `GtkText
|
||||
+GtkMisc
|
||||
| +GtkArrow
|
||||
| +GtkImage
|
||||
| +GtkLabel
|
||||
| | `GtkTipsQuery
|
||||
| `GtkPixmap
|
||||
+GtkPreview
|
||||
+GtkProgressBar
|
||||
+GtkRange
|
||||
| +GtkScale
|
||||
| | +GtkHScale
|
||||
| | `GtkVScale
|
||||
| `GtkScrollbar
|
||||
| +GtkHScrollbar
|
||||
| `GtkVScrollbar
|
||||
+GtkRuler
|
||||
| +GtkHRuler
|
||||
| `GtkVRuler
|
||||
`GtkSeparator
|
||||
+GtkHSeparator
|
||||
`GtkVSeparator
|
||||
</PRE>
|
||||
<P>
|
||||
<H2><A NAME="ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
|
||||
</H2>
|
||||
|
||||
<P>Aunque GTK+, como la mayoría de los juegos de herramientas para X,
|
||||
no es seguro ante múltiples hilos, esto no prohibe el desarrollo de
|
||||
aplicaciones con múltiples hilos con GTK+.
|
||||
<P>Rob Browning (rlb@cs.utexas.edu) describe técnicas de hilamiento
|
||||
que pueden utilizarse con GTK+ (levemente modificado):
|
||||
<P>Básicamente existen dos enfoques principales, el primero es sencillo,
|
||||
y el segundo complicado. En el primero, simplemente hay que asegurarse
|
||||
de que todas las interacciones de GTK+ (o X) se manejan por un, y solo un,
|
||||
hilo. Cualquier otro hilo que desee dibujar algo tiene que notificarlo de
|
||||
alguna manera al hilo "GTK+", y dejarlo que maneje el trabajo real.
|
||||
<P>El segundo enfoque le permite llamar funciones de GTK+ (o X) desde cualquier
|
||||
hilo, pero requiere sincronización cuidadosa. La idea básica es crear
|
||||
una exclusión mutua de protección para X, de manera que nadie haga
|
||||
llamadas X sin primero adquirir esta exclusión mutua.
|
||||
<P>Observe que se trata de un pequeño esfuerzo, pero que le permitirá ser
|
||||
potencialmente más eficiente que un GTK+ completamente seguro ante
|
||||
múltiples hilos. Usted decide la granularidad del bloqueo de hilos.
|
||||
También debe asegurarse que el hilo que llama a gtk_main mantiene la
|
||||
cerradura cuando llama a gtk_main.
|
||||
<P>Lo siguiente por lo que hay que preocuparse ya que se tenía agarrada
|
||||
la exclusión mutua global cuando se entró a gtk_main, es que todos
|
||||
los <EM>callbacks</EM> también la tendrán. Esto significa que el
|
||||
<EM>callback</EM> debe soltarla si va a llamar a cualquier otro código
|
||||
que pueda readquirirla. De otra manera obtendrá un bloqueo mortal.
|
||||
También hay que tener agarrada la exclusión mutua cuando finalmente
|
||||
regresa del <EM>callback</EM>.
|
||||
<P>Para permitir a otros hilos, además del que llama a gtk_main, tener
|
||||
acceso a la exclusión mutua, necesitamos registrar una función de
|
||||
trabajo con GTK que nos permita liberar la exclusión mutua
|
||||
periódicamente.
|
||||
<P>¿Por qué GTK+ no puede ser seguro ante múltiples hilos de
|
||||
manera nativa?
|
||||
<P>Complejidad, sobrecarga, y mano de obra. La proporción de programas
|
||||
con hilos es todavía razonablemente pequeña, y conseguir seguridad
|
||||
ante hilos es muy difícil y le quita tiempo valioso al trabajo
|
||||
principal de obtener una buena librería gráfica terminada. Sería
|
||||
muy agradable que GTK+ fuera seguro ante hilos "al sacarlo de la caja",
|
||||
pero no es práctico ahora mismo, y haría a GTK+ sustancialmente menos
|
||||
eficiente si no se maneja cuidadosamente.
|
||||
<P>De cualquier manera, no es una prioridad esencial ya que existen remedios
|
||||
relativamente buenos.
|
||||
<P>
|
||||
<H2><A NAME="ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
|
||||
</H2>
|
||||
|
||||
<P>
|
||||
Utilize gtk_container_disable_resize y gtk_container_enable_resize alrededor
|
||||
del código donde quiere cambiar varias cosas. Esto resultará en mayor
|
||||
velocidad ya que prevendrá tener que darle el tamaño otra vez a la
|
||||
jerarquía de <EM>widget</EM> por completo.
|
||||
<P>
|
||||
<H2><A NAME="ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
|
||||
</H2>
|
||||
|
||||
<P>Tim Janik escribió a la lista gtk-list (ligeramente modificado):
|
||||
<P>Defina un manejador de señal:
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
gint
|
||||
signal_handler_event(GtkWiget *widget, GdkEvenButton *event, gpointer func_data)
|
||||
{
|
||||
if (GTK_IS_LIST_ITEM(widget) &&
|
||||
(event->type==GDK_2BUTTON_PRESS ||
|
||||
event->type==GDK_3BUTTON_PRESS) ) {
|
||||
printf("I feel %s clicked on button %d\",
|
||||
event->type==GDK_2BUTTON_PRESS ? "double" : "triple",
|
||||
event->button);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>Y conecte el manejador a su objeto:
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
{
|
||||
/* lista, asuntos de inicializacion de articulos de lista */
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(list_item),
|
||||
"button_press_event",
|
||||
GTK_SIGNAL_FUNC(signal_handler_event),
|
||||
NULL);
|
||||
|
||||
/* y/o */
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(list_item),
|
||||
"button_release_event",
|
||||
GTK_SIGNAL_FUNC(signal_handler_event),
|
||||
NULL);
|
||||
|
||||
/* algo mas */
|
||||
}
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>y, Owen Taylor escribió:
|
||||
<P>Observe que se recibirá la pulsación del botón de antemano, y
|
||||
si está haciendo esto para un botón, también obtendrá una señal
|
||||
de "tecleado" para el botón. (Esto es cierto para cualquier juego de
|
||||
herramientas, ya que las computadoras no son buenas para leer la mente de
|
||||
cada quien.)
|
||||
<P>
|
||||
<H2><A NAME="ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
|
||||
</H2>
|
||||
|
||||
<P>
|
||||
<P>Consiga la selección con algo como esto:
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
GList *sel;
|
||||
sel = GTK_LIST(list)->selection;
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>Así es como GList está definido (sacado de glist.h):
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
typedef struct _GList GList;
|
||||
|
||||
struct _GList
|
||||
{
|
||||
gpointer data;
|
||||
GList *next;
|
||||
GList *prev;
|
||||
};
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>Una estructura GList es simplemente una estructura para listas doblemente
|
||||
enlazadas. Existen varias funciones g_list_*() para modificar una lista
|
||||
enlazada en glib.h. Sin embargo, la selección GTK_LIST(MyGtkList)->selection
|
||||
es mantenida por las funciones gtk_list_*() y no deben ser modificadas.
|
||||
<P>El selection_mode del GtkList determina las facilidades de selección de un
|
||||
GtkList y por lo tanto los contenidos de GTK_LIST(AnyGtkList)->selection:
|
||||
<P>
|
||||
<PRE>
|
||||
selection_mode GTK_LIST()->selection contents
|
||||
------------------------------------------------------
|
||||
|
||||
GTK_SELECTION_SINGLE) la selección es NULL
|
||||
o contiene un puntero GList*
|
||||
para un artículo seleccionado individualmente
|
||||
|
||||
GTK_SELECTION_BROWSE) la selección es NULL si la lista
|
||||
no contiene widgets, de otra manera
|
||||
contiene un puntero GList*
|
||||
para una estructura GList.
|
||||
GTK_SELECTION_MULTIPLE) la selección es NULL si no se seleccionan
|
||||
listitems para un apuntador GList*
|
||||
para el primer artículo seleccionado. Eso en
|
||||
su lugar apunta a una estructura GList para el
|
||||
segundo artículo seleccionado y continúa
|
||||
|
||||
GTK_SELECTION_EXTENDED) la selección es NULL.
|
||||
</PRE>
|
||||
<P>El campo data de la estructura GList GTK_LIST(MyGtkList)->selection apunta
|
||||
al primer GtkListItem que es seleccionado. De manera que si quiere determinar
|
||||
cuales listitems están seleccionados debe hacer esto:
|
||||
<P>Durante la in>
|
||||
<HR><H3>Transfer interrupted!</H3>
|
||||
>
|
||||
{
|
||||
gchar *list_items[]={
|
||||
"Item0",
|
||||
"Item1",
|
||||
"foo",
|
||||
"last Item",
|
||||
};
|
||||
guint nlist_items=sizeof(list_items)/sizeof(list_items[0]);
|
||||
GtkWidget *list_item;
|
||||
guint i;
|
||||
|
||||
list=gtk_list_new();
|
||||
gtk_list_set_selection_mode(GTK_LIST(list), GTK_SELECTION_MULTIPLE);
|
||||
gtk_container_add(GTK_CONTAINER(AnyGtkContainer), list);
|
||||
gtk_widget_show (list);
|
||||
|
||||
for (i = 0; i < nlist_items; i++)
|
||||
{
|
||||
list_item=gtk_list_item_new_with_label(list_items[i]);
|
||||
gtk_object_set_user_data(GTK_OBJECT(list_item), (gpointer)i);
|
||||
gtk_container_add(GTK_CONTAINER(list), list_item);
|
||||
gtk_widget_show(list_item);
|
||||
}
|
||||
}
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>Para tener conocimiento de la inicialización:
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
{
|
||||
GList *items;
|
||||
|
||||
items=GTK_LIST(list)->selection;
|
||||
|
||||
printf("Selected Items: ");
|
||||
while (items) {
|
||||
if (GTK_IS_LIST_ITEM(items->data))
|
||||
printf("%d ", (guint)
|
||||
gtk_object_get_user_data(items->data));
|
||||
items=items->next;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<H2><A NAME="ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
|
||||
</H2>
|
||||
|
||||
<P>El comportamiento de GTK+ (sin recorte) es una consecuencia de sus intentos
|
||||
para conservar recursos de X. Los <EM>widgets</EM> etiqueta (entre otros) no
|
||||
tienen su propia ventana X - simplemente dibujan su contenido en la ventana
|
||||
de su padre. Aunque sería posible hacer que ocurran recortes al establecer
|
||||
la máscara de recorte antes de dibujar el texto, esto podría causar una
|
||||
penalización substancial en el rendimiento.
|
||||
<P>Es posible que, a largo plazo, la mejor solución a tales problemas sea
|
||||
simplemente cambiar gtk para que le de ventanas X a las etiquetas. Un remedio
|
||||
a corto plazo es poner el <EM>widget</EM> de etiqueta dentro de otro
|
||||
<EM>widget</EM> que sí obtiene su propia ventana - un candidato posible puede ser el <EM>widget</EM> <EM>viewport</EM>.
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
viewport = gtk_viewport (NULL, NULL);
|
||||
gtk_widget_set_usize (viewport, 50, 25);
|
||||
gtk_viewport_set_shadow_type (GTK_VIEWPORT(viewport), GTK_SHADOW_NONE);
|
||||
gtk_widget_show(viewport);
|
||||
|
||||
label = gtk_label ("a really long label that won't fit");
|
||||
gtk_container_add (GTK_CONTAINER(viewport), label);
|
||||
gtk_widget_show (label);
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>Si estuviera haciendo esto para un montón de <EM>widgets</EM>, querrá
|
||||
copiar gtkviewport.c y arrancar la funcionalidad de sombra y ajuste (tal vez
|
||||
quiera llamarlo GtkClipper).
|
||||
<P>
|
||||
<H2><A NAME="ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
|
||||
</H2>
|
||||
|
||||
<P>De: Peter Mattis
|
||||
<P>La razón por la cuál los botones no mueven a su hijo abajo y a la derecha
|
||||
cuando son presionados es porque no me parece que eso es lo que ocurre
|
||||
visualmente. Mi visión de los botonos es que los miras de manera recta.
|
||||
O sea, la interface de usuario tiende sobre un plano y tú estás sobre
|
||||
él observándolo de manera recta. Cuando un botón es presionado se
|
||||
mueve directamente lejos de tí. Para ser absolutamente correcto supongo
|
||||
que el hijo debería encojerse un poquito. Pero no veo por qué el hijo
|
||||
debería moverse abajo y a la izquierda. Recurda, el hijo se supone que
|
||||
está pegado a la superficie del botón. No es bueno que luzca como si
|
||||
el hijo se resbala sobre la superficie del botón.
|
||||
<P>En una nota más práctica, ya implanté esto una vez y determiné
|
||||
que no se veía bien y lo quité.
|
||||
<P>
|
||||
<H2><A NAME="ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
|
||||
</H2>
|
||||
|
||||
<P>Revise el
|
||||
<A HREF="http://www.gtk.org/tutorial/">Tutor</A> para información sobre como crear menús.
|
||||
<P>Sin embargo, para crear una línea de separación en un menú,
|
||||
simplemente inserte un artículo de menú vacío:
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
menuitem = gtk_menu_item_new();
|
||||
gtk_menu_append(GTK_MENU(menu), menuitem);
|
||||
gtk_widget_show(menuitem);
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>
|
||||
<H2><A NAME="ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
|
||||
</H2>
|
||||
|
||||
<P>Utilice algo como lo que sigue:
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
menu_path = gtk_menu_factory_find (factory, "<MyApp>/Help");
|
||||
gtk_menu_item_right_justify(menu_path->widget);
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<H2><A NAME="ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
|
||||
</H2>
|
||||
|
||||
<P>Después de haber creado su ventana, haga gtk_grab_add(my_window). Y
|
||||
después de cerrar la ventana haga gtk_grab_remove(my_window).
|
||||
<P>
|
||||
<H2><A NAME="ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
|
||||
</H2>
|
||||
|
||||
<P>
|
||||
<P>Probablemente usted está haciendo todos los cambios dentro de una función
|
||||
sin devolver el control a gtk_main. La mayoría de las actualizaciones de
|
||||
dibujo se colocan simplemente en una cola, la cual es procesada dentro de
|
||||
gtk_main. Puede forzar que se procese la cola de dibujado utilizando algo como:
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
while (gtk_events_pending())
|
||||
gtk_main_iteration();
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>dentro de la función que cambia el <EM>widget</EM>.
|
||||
<P>Lo que el fragmento anterior hace es correr todos los eventos pendientes y
|
||||
funciones ociosas de alta prioridad, luego regresa de inmediato (el dibujado
|
||||
se realiza en una función ociosa de alta prioridad).
|
||||
<P>
|
||||
<HR NOSHADE>
|
||||
<A HREF="gtkfaq-es-5.html">Next</A>
|
||||
<A HREF="gtkfaq-es-3.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc4">Contents</A>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,92 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ: Acerca de gdk</TITLE>
|
||||
<LINK HREF="gtkfaq-es-6.html" REL=next>
|
||||
<LINK HREF="gtkfaq-es-4.html" REL=previous>
|
||||
<LINK HREF="gtkfaq-es.html#toc5" REL=contents>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<A HREF="gtkfaq-es-6.html">Next</A>
|
||||
<A HREF="gtkfaq-es-4.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc5">Contents</A>
|
||||
<HR NOSHADE>
|
||||
<H2><A NAME="s5">5. Acerca de gdk</A></H2>
|
||||
|
||||
<H2><A NAME="ss5.1">5.1 ¿Qué es gdk?</A>
|
||||
</H2>
|
||||
|
||||
<P>gdk es básicamente una envoltura alrededor de las llamadas a funciones
|
||||
Xlib. Si estás familiarizado con Xlib, muchas de las funciones en gdk
|
||||
requerirán poco o ningún tiempo para acostumbrarse.
|
||||
Todas las funciones están escritas para proporcionar una manera fácil de
|
||||
acceder a las funciones Xlib en una manera un poco más intuitiva.
|
||||
Adicionalmente, ya que gdk utiliza glib (vea abajo), será más portable
|
||||
y seguro de utilizar en
|
||||
múltiples plataformas.
|
||||
<P>
|
||||
<P>
|
||||
<H2><A NAME="ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
|
||||
</H2>
|
||||
|
||||
<P>Una de las cosas agradables de GDK es que está basado sobre Xlib; esto
|
||||
también es un problema, especialmente en el área de administración
|
||||
de colores. Si usted quiere utilizar color en su programa (dibujando un
|
||||
rectángulo o algo por el estilo, su código debe lucir algo así:
|
||||
<P>
|
||||
<BLOCKQUOTE><CODE>
|
||||
<PRE>
|
||||
{
|
||||
GdkColor *color;
|
||||
int width, height;
|
||||
GtkWidget *widget;
|
||||
GdkGC *gc;
|
||||
|
||||
...
|
||||
|
||||
/* primero, cree un GC (contexto grafico) en el cual dibujar */
|
||||
gc = gdk_gc_new(widget->window);
|
||||
|
||||
/* encuentre las dimensiones correctas para el rectangulo */
|
||||
gdk_window_get_size(widget->window, &width, &height);
|
||||
|
||||
/* el color que queremos utilizar */
|
||||
color = (GdkColor *)malloc(sizeof(GdkColor));
|
||||
|
||||
/* rojo, verde y azul son valores pasados, indicando el trio RGB
|
||||
* del color que queremos dibujar. Note que los valores de los componentes
|
||||
* RGB dentro de GdkColor son tomados de 0 a 65535, no de 0 a 255.
|
||||
*/
|
||||
color->red = red * (65535/255);
|
||||
color->green = green * (65535/255);
|
||||
color->blue = blue * (65535/255);
|
||||
|
||||
/* el valor de pixel indica el indice en el mapa de colores del color.
|
||||
* simplemente es una combinacion de los valores RGB colocados anteriormente
|
||||
*/
|
||||
color->pixel = (gulong)(red*65536 + green*256 + blue);
|
||||
|
||||
/* Sin embargo, el valor de pixel es solo valido en dispositivos de 24-bit
|
||||
* (color verdadero). Por lo tanto, esta llamada es requerida para que GDK
|
||||
* y X puedan darnos el color mas cercano disponible en el mapa de colores
|
||||
*/
|
||||
gdk_color_alloc(gtk_widget_get_colormap(widget), color);
|
||||
|
||||
/* colocar la parte delantera a nuestro color */
|
||||
gdk_gc_set_foreground(gc, color);
|
||||
|
||||
/* dibujar el rectangulo*/
|
||||
gdk_draw_rectangle(widget->window, gc, 1, 0, 0, width, height);
|
||||
|
||||
...
|
||||
}
|
||||
</PRE>
|
||||
</CODE></BLOCKQUOTE>
|
||||
<P>
|
||||
<HR NOSHADE>
|
||||
<A HREF="gtkfaq-es-6.html">Next</A>
|
||||
<A HREF="gtkfaq-es-4.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc5">Contents</A>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,64 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ: Acerca de glib</TITLE>
|
||||
<LINK HREF="gtkfaq-es-7.html" REL=next>
|
||||
<LINK HREF="gtkfaq-es-5.html" REL=previous>
|
||||
<LINK HREF="gtkfaq-es.html#toc6" REL=contents>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<A HREF="gtkfaq-es-7.html">Next</A>
|
||||
<A HREF="gtkfaq-es-5.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc6">Contents</A>
|
||||
<HR NOSHADE>
|
||||
<H2><A NAME="s6">6. Acerca de glib</A></H2>
|
||||
|
||||
<H2><A NAME="ss6.1">6.1 ¿Qué es glib?</A>
|
||||
</H2>
|
||||
|
||||
<P>glib es una librería de funciones y definiciones útiles disponibles
|
||||
para ser utilizadas cuando se crean aplicaciones GDK y GTK. Proporciona
|
||||
reemplazos para algunas funciones estándar de libc, como malloc, las
|
||||
cuales tienen errores en algunos sistemas.
|
||||
<P>También proporciona rutinas para manejar:
|
||||
<UL>
|
||||
<LI>Listas Doblemente Enlazadas</LI>
|
||||
<LI>Listas con Enlace Sencillo</LI>
|
||||
<LI>Cronómetros</LI>
|
||||
<LI>Manipulación de cadenas</LI>
|
||||
<LI>Un Analizador Léxico</LI>
|
||||
<LI>Funciones de Error</LI>
|
||||
</UL>
|
||||
<P>
|
||||
<P>
|
||||
<H2><A NAME="ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
|
||||
</H2>
|
||||
|
||||
<P>Gracias a Tim Janik que escribió a gtk-list: (ligeramente modificado)
|
||||
<BLOCKQUOTE>
|
||||
Con respecto a g_malloc(), g_free() y hermanos, estas funciones son más
|
||||
seguras que sus equivalentes en libc. Por ejemplo, g_free() solo regresa si
|
||||
se llama con NULL. También, si se define USE_DMALLOC, la definición para
|
||||
estas funciones cambia (en glib.h) para utilizar MALLOC(), FREE() etc... Si
|
||||
MEM_PROFILE o MEM_CHECK se definen, hay incluso pequeñas estadísticas
|
||||
realizadas las cuales cuentan los tamaños de los bloques (mostrado por
|
||||
g_mem_profile() / g_mem_check()).
|
||||
<P>Considerando el hecho de que glib provee una interface para salvar espacio en
|
||||
pedazos de memoria si se tiene varios bloques que son siempre del mismo
|
||||
tamaño y para marcarlos ALLOC_ONLY si es necesario, es sencillo crear
|
||||
una pequeña envoltura para salvar (revisable para errores) alrededor del
|
||||
malloc/free normal asimismo - igual que gdk cubre Xlib. ;)
|
||||
<P>Utilizar g_error() y g_warning() dentro de aplicaciones como GIMP las cuales
|
||||
utilizan gtk por completo incluso da la oportunidad de hacer saltar una ventana
|
||||
que muestre los mensajes dentro de una ventana gtk con tu propio handler
|
||||
(utilizando g_set_error_handler()) con el mismo estilo que gtk_print()
|
||||
(dentro de gtkmain.c).
|
||||
</BLOCKQUOTE>
|
||||
<P>
|
||||
<HR NOSHADE>
|
||||
<A HREF="gtkfaq-es-7.html">Next</A>
|
||||
<A HREF="gtkfaq-es-5.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc6">Contents</A>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,80 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ: Contribuciones al GTK+ FAQ, Mantenedores y Copyright</TITLE>
|
||||
<LINK HREF="gtkfaq-es-6.html" REL=previous>
|
||||
<LINK HREF="gtkfaq-es.html#toc7" REL=contents>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
Next
|
||||
<A HREF="gtkfaq-es-6.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc7">Contents</A>
|
||||
<HR NOSHADE>
|
||||
<H2><A NAME="s7">7. Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
|
||||
|
||||
<P>Si desea hacer una contribución al FAQ, envíe a alguno de nosotros
|
||||
un mensaje por correo electrónico con el texto exacto que cree que
|
||||
debería ser incluído (pregunta y respuesta). ¡Con su ayuda, este
|
||||
documento puede crecer y llegar a ser más útil!
|
||||
<P>Este documento es mantenido por Nathan Froyd
|
||||
<A HREF="mailto:maestrox@geocities.com"><maestrox@geocities.com></A>
|
||||
y Tony Gale
|
||||
<A HREF="mailto:gale@gimp.org"><gale@gimp.org></A>.
|
||||
Este FAQ fue creado por Shawn T. Amundson
|
||||
<A HREF="mailto:amundson@gimp.org"><amundson@gimp.org></A> quien continúa dando soporte.
|
||||
<P>El GTK+ FAQ está registrado Copyright (C) 1997, 1998 por Shawn T. Amundson,
|
||||
Nathan Froyd y tony Gale.
|
||||
<P>Se otorga permiso para hacer y distribuír copias textuales de este manual
|
||||
siempre y cuando la información de copyright y este permiso se preserven en
|
||||
todas las copias.
|
||||
<P>Se otorga permiso para copiar y distribuir versiones modificados de este
|
||||
documento bajo las condiciones para copiado textual, siempre y cuando esta
|
||||
noticia de copyright se incluya exáctamente como en el original, y
|
||||
que el trabajo resultante en su totalidad sea distribuído bajo los
|
||||
términos de una noticia de permiso idéntica a esta.
|
||||
<P>Se otorga permiso para copiar y distribuír traducciones de este documento
|
||||
a otro lenguaje, bajo las condiciones anteriores de versiones modificadas.
|
||||
<P>Si tiene intenciones de incorporar este documento en un trabajo publicado,
|
||||
por favor contacte a uno de los mantenedores, y nos aseguraremos de que
|
||||
obtenga la información más actual posible.
|
||||
<P>No hay garantía de que este documento logre su propósito. Este documento
|
||||
se proporciona simplemente como un recurso libre. Como tal, los autores y
|
||||
mantenedores de la información proporcionada en él no pueden dar
|
||||
garantía alguna de que la información es precisa.
|
||||
<P>
|
||||
<H2><A NAME="ss7.1">7.1 Nota del Traductor</A>
|
||||
</H2>
|
||||
|
||||
<P>Esta traducción fue realizada por
|
||||
<A HREF="http://www.talisman.com.pa">Ramsés Morales</A>.
|
||||
He intentado hacer
|
||||
la mejor adaptación posible de los términos técnicos, si tiene
|
||||
alguna sugerencia o mejora a estos términos y mi español, o alguna
|
||||
duda por causa de mi traducción, no dude en comunicármelo a
|
||||
<A HREF="mailto:ramses@computer.org"><ramses@computer.org></A><P>Gracias a
|
||||
<A HREF="mailto: e98cuenc@criens.u-psud.fr">Joaquín Cuenca</A> por todas sus sugerencias para mejorar la
|
||||
traducción, fueron de gran ayuda.
|
||||
<P>--------------------------------------
|
||||
<P>The GTK+ FAQ is Copyright (C) 1997,1998 by Shawn T. Amundson, Nathan Froyd and Tony Gale.
|
||||
<P>Permission is granted to make and distribute verbatim copies of this manual provided the
|
||||
copyright notice and this permission notice are preserved on all copies.
|
||||
<P>Permission is granted to copy and distribute modified versions of this document under the conditions
|
||||
for verbatim copying, provided that this copyright notice is included exactly as in the original,
|
||||
and that the entire resulting derived work is distributed under the terms of a permission
|
||||
notice identical to this one.
|
||||
<P>Permission is granted to copy and distribute translations of this document into another language,
|
||||
under the above conditions for modified versions.
|
||||
<P>If you are intending to incorporate this document into a published work, please contact one of
|
||||
the maintainers, and we will make an effort to ensure that you have the most up to date
|
||||
information available.
|
||||
<P>There is no guarentee that this document lives up to its intended
|
||||
purpose. This is simply provided as a free resource. As such,
|
||||
the authors and maintainers of the information provided within can
|
||||
not make any guarentee that the information is even accurate.
|
||||
<HR NOSHADE>
|
||||
Next
|
||||
<A HREF="gtkfaq-es-6.html">Previous</A>
|
||||
<A HREF="gtkfaq-es.html#toc7">Contents</A>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,103 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
|
||||
<TITLE>GTK+ FAQ</TITLE>
|
||||
<LINK HREF="gtkfaq-es-1.html" REL=next>
|
||||
|
||||
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<A HREF="gtkfaq-es-1.html">Next</A>
|
||||
Previous
|
||||
Contents
|
||||
<HR NOSHADE>
|
||||
<H1>GTK+ FAQ</H1>
|
||||
|
||||
|
||||
<H2>Nathan Froyd, Tony Gale, Shawn T. Amundson.</H2>Seis de Julio de 1998
|
||||
<P><HR NOSHADE>
|
||||
<EM>La intención de este documento es dar respuesta a las preguntas
|
||||
realizadas con más frecuencia por parte de los programadores que utilizan GTK+ o simplemente por personas que desean utilizar GTK+. </EM>
|
||||
<HR NOSHADE>
|
||||
<P>
|
||||
<H2><A NAME="toc1">1.</A> <A HREF="gtkfaq-es-1.html">Información General</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.1">1.1 Autores</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.2">1.2 ¿Qué es GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.3">1.3 ¿Qué es el + en GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.9">1.9 Cómo reportar errores en GTK+</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-1.html#ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc2">2.</A> <A HREF="gtkfaq-es-2.html">Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
|
||||
<LI><A HREF="gtkfaq-es-2.html#ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc3">3.</A> <A HREF="gtkfaq-es-3.html">Desarrollo de GTK+</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
|
||||
<LI><A HREF="gtkfaq-es-3.html#ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc4">4.</A> <A HREF="gtkfaq-es-4.html">Desarrollo con GTK+</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.1">4.1 ¿Cómo empiezo?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
|
||||
<LI><A HREF="gtkfaq-es-4.html#ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc5">5.</A> <A HREF="gtkfaq-es-5.html">Acerca de gdk</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-5.html#ss5.1">5.1 ¿Qué es gdk?</A>
|
||||
<LI><A HREF="gtkfaq-es-5.html#ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc6">6.</A> <A HREF="gtkfaq-es-6.html">Acerca de glib</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-6.html#ss6.1">6.1 ¿Qué es glib?</A>
|
||||
<LI><A HREF="gtkfaq-es-6.html#ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="toc7">7.</A> <A HREF="gtkfaq-es-7.html">Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="gtkfaq-es-7.html#ss7.1">7.1 Nota del Traductor</A>
|
||||
</UL>
|
||||
<HR NOSHADE>
|
||||
<A HREF="gtkfaq-es-1.html">Next</A>
|
||||
Previous
|
||||
Contents
|
||||
</BODY>
|
||||
</HTML>
|
||||
17638
docs/gtk_tut_12.es.sgml
17638
docs/gtk_tut_12.es.sgml
File diff suppressed because it is too large
Load Diff
350
docs/make-todo
350
docs/make-todo
@@ -1,350 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import xmllib;
|
||||
import sys;
|
||||
import string
|
||||
import re
|
||||
|
||||
def html_subst(s):
|
||||
if s.group(1) != None:
|
||||
return s.group(0)
|
||||
elif s.group(2) != None:
|
||||
return '<a href="' + s.group(0) + '">' + s.group(0) + '</a>'
|
||||
elif s.group(3) != None:
|
||||
return '<a href="mailto:' + s.group(0) + '">' + s.group(0) + '</a>'
|
||||
|
||||
def htmlify(str):
|
||||
return re.sub ("(<[^>]*>)|(http://[~.:/\w-]+)|([\w._!-]+@[\w_-]+).[\w_-]+", html_subst, str)
|
||||
|
||||
def bug_subst(s):
|
||||
if s.group(1) != None:
|
||||
return s.group(0)
|
||||
else:
|
||||
n = s.group(2)
|
||||
return '<a href="http://bugs.gnome.org/db/%s/%s.html">#%s</a>' % (n[0:2], n, n)
|
||||
|
||||
def bugify(str):
|
||||
str = re.sub ("(<[^>]*>)|#(\d+)", bug_subst, str)
|
||||
return htmlify(str)
|
||||
|
||||
def make_id(str):
|
||||
return re.sub ("[^a-z]","-", string.lower(str))
|
||||
|
||||
class ParseError (Exception):
|
||||
pass
|
||||
|
||||
class Entry:
|
||||
def __init__(self):
|
||||
self.description = None
|
||||
self.title = None
|
||||
self.url = None
|
||||
self.contact = None
|
||||
self.bugs = None
|
||||
|
||||
def set_size(self, size):
|
||||
size = string.lower(size)
|
||||
if size == "small":
|
||||
self.size = "Small"
|
||||
elif size == "medium":
|
||||
self.size = "Medium"
|
||||
elif size == "big":
|
||||
self.size = "Big"
|
||||
else:
|
||||
raise ParseError, 'size must be "small", "medium", or "big"'
|
||||
|
||||
def output(self):
|
||||
if self.size == "Big":
|
||||
bgcolor = "#88bb88"
|
||||
elif self.size == "Medium":
|
||||
bgcolor = "#b4d4b4"
|
||||
else:
|
||||
bgcolor = "#d0e0d0"
|
||||
|
||||
print '''<table cellspacing="0" cellpadding="2" width="97%%" border="0" bgcolor="#000000">
|
||||
<tbody><tr><td colspan=2>
|
||||
<table cellspacing="0" cellpadding="5" width="100%%" border="0" bgcolor="#ffffff">
|
||||
<tbody>
|
||||
<tr bgcolor="%s">
|
||||
<td align="left"><font size="+1">%s</font></font></td>
|
||||
<td align="left" width="20%%"><b>Size</b>: %s</td>
|
||||
<td align="center" width="20%%"><b>Status</b>: %s</td>
|
||||
<td align="right" width="20%%"><b>Target Version</b>: %s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=4>
|
||||
%s
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>''' % (bgcolor, self.title, self.size, self.status, self.target, htmlify(self.description))
|
||||
|
||||
if self.url != None:
|
||||
print '''<tr><td width="0"><b>More Info</b>:</td>
|
||||
<td>%s</td>
|
||||
</tr>''' % htmlify (self.url)
|
||||
|
||||
if self.bugs != None:
|
||||
print '''<tr><td width="0"><b>Bug Reports</b>:</td>
|
||||
<td>%s</td>
|
||||
</tr>''' % bugify (self.bugs)
|
||||
|
||||
if self.contact != None:
|
||||
print '''<tr><td width="0"><b>Contact</b>:</td>
|
||||
<td>%s</td>
|
||||
</tr>''' % htmlify (self.contact)
|
||||
|
||||
print '''</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
'''
|
||||
|
||||
class Section:
|
||||
def __init__(self):
|
||||
self.title = None
|
||||
self.entries = []
|
||||
|
||||
def output(self):
|
||||
|
||||
print '<h2><a name="%s">%s</a></h2>' % (make_id(self.title), self.title)
|
||||
|
||||
first = 1
|
||||
for entry in self.entries:
|
||||
if not first:
|
||||
print "<br>"
|
||||
first = 0
|
||||
entry.output()
|
||||
|
||||
class TodoParser (xmllib.XMLParser):
|
||||
def __init__(self):
|
||||
xmllib.XMLParser.__init__(self)
|
||||
|
||||
self.in_todo = 0
|
||||
self.in_data = 0
|
||||
self.data = ""
|
||||
self.section = None
|
||||
self.entry = None
|
||||
self.logourl = None
|
||||
self.title = None
|
||||
self.sections = []
|
||||
|
||||
self.entitydefs = {}
|
||||
|
||||
def start_todo(self,attributes):
|
||||
if self.in_todo:
|
||||
raise ParseError, "<todo> tags may not be nested"
|
||||
if attributes.has_key ("logourl"):
|
||||
self.logourl = attributes["logourl"]
|
||||
self.in_todo = 1
|
||||
|
||||
def end_todo(self):
|
||||
self.in_todo = 0
|
||||
|
||||
def start_section(self,attributes):
|
||||
if self.section:
|
||||
raise ParseError, "<section> tags may not be nested"
|
||||
|
||||
self.section = Section()
|
||||
|
||||
def end_section(self):
|
||||
if self.section.title == None:
|
||||
raise ParseError, "<section> requires <title>"
|
||||
|
||||
self.sections.append(self.section)
|
||||
self.section = None
|
||||
|
||||
def start_title(self,attributes):
|
||||
if not self.in_todo:
|
||||
raise ParseError, "<title> tag must be in <todo>, <section> or <entry>"
|
||||
if self.in_data:
|
||||
raise ParseError, "Unexpected <title> tag in content"
|
||||
self.in_data = 1
|
||||
|
||||
def end_title(self):
|
||||
self.in_data = 0
|
||||
if self.entry:
|
||||
self.entry.title = self.data
|
||||
elif self.section:
|
||||
self.section.title = self.data
|
||||
else:
|
||||
self.title = self.data
|
||||
self.data = ""
|
||||
|
||||
def start_description(self,attributes):
|
||||
if not self.entry:
|
||||
raise ParseError, "<description> tag must be in <entry>"
|
||||
if self.in_data:
|
||||
raise ParseError, "Unexpected <description> tag in content"
|
||||
self.in_data = 1
|
||||
|
||||
def end_description(self):
|
||||
self.in_data = 0
|
||||
self.entry.description = self.data
|
||||
self.data = ""
|
||||
|
||||
def start_url(self,attributes):
|
||||
if not self.entry:
|
||||
raise ParseError, "<url> tag must be in <entry>"
|
||||
if self.in_data:
|
||||
raise ParseError, "Unexpected <url> tag in content"
|
||||
self.in_data = 1
|
||||
|
||||
def end_url(self):
|
||||
self.in_data = 0
|
||||
self.entry.url = self.data
|
||||
self.data = ""
|
||||
|
||||
def start_contact(self,attributes):
|
||||
if not self.entry:
|
||||
raise ParseError, "<contact> tag must be in <contact>"
|
||||
if self.in_data:
|
||||
raise ParseError, "Unexpected <contact> tag in content"
|
||||
self.in_data = 1
|
||||
|
||||
def end_contact(self):
|
||||
self.in_data = 0
|
||||
self.entry.contact = self.data
|
||||
self.data = ""
|
||||
|
||||
def start_bugs(self,attributes):
|
||||
if not self.entry:
|
||||
raise ParseError, "<bugs> tag must be in <bugs>"
|
||||
if self.in_data:
|
||||
raise ParseError, "Unexpected <bugs> tag in content"
|
||||
self.in_data = 1
|
||||
|
||||
def end_bugs(self):
|
||||
self.in_data = 0
|
||||
self.entry.bugs = self.data
|
||||
self.data = ""
|
||||
|
||||
def start_entry(self,attributes):
|
||||
if not self.section:
|
||||
raise ParseError, "<entry> tag must be in <section>"
|
||||
if self.entry:
|
||||
raise ParseError, "<entry> tags may not be nested"
|
||||
|
||||
self.entry = Entry()
|
||||
|
||||
if not attributes.has_key("size"):
|
||||
raise ParseError, '"size" attribute required for entry'
|
||||
self.entry.set_size(attributes["size"])
|
||||
|
||||
if not attributes.has_key("status"):
|
||||
raise ParseError, '"status" attribute (completion percentage) required for entry'
|
||||
self.entry.status=attributes["status"]
|
||||
|
||||
if not attributes.has_key("target"):
|
||||
raise ParseError, '"target" attribute (target version) required for entry'
|
||||
self.entry.target=attributes["target"]
|
||||
|
||||
def end_entry(self):
|
||||
if self.entry.title == None:
|
||||
raise ParseError, "<entry> requires <title>"
|
||||
|
||||
if self.entry.description == None:
|
||||
raise ParseError, "<entry> requires <description>"
|
||||
|
||||
self.section.entries.append(self.entry)
|
||||
self.entry = None
|
||||
|
||||
def handle_data(self,data):
|
||||
if self.in_data:
|
||||
self.data = self.data + data
|
||||
|
||||
def unknown_starttag(self,tag,attributes):
|
||||
if not self.in_data:
|
||||
raise ParseError, "Unexpected start tag: " + tag
|
||||
else:
|
||||
self.data = self.data + "<" + tag
|
||||
for (key,val) in attributes.items():
|
||||
self.data = self.data + ' %s="%s"' % (key,val)
|
||||
self.data = self.data + ">"
|
||||
|
||||
def unknown_endtag(self,tag):
|
||||
if not self.in_data:
|
||||
raise ParseError, "Unexpected end tag: " + tag
|
||||
else:
|
||||
self.data = self.data + "</%s>" % tag
|
||||
|
||||
def syntax_error(self, err):
|
||||
if re.match("reference to unknown entity", err):
|
||||
pass
|
||||
else:
|
||||
xmllib.XMLParser.syntax_error (self, err)
|
||||
|
||||
def unknown_entityref(self,ref):
|
||||
if not self.in_data:
|
||||
raise ParseError, "Unknown entity &" + ref + ";"
|
||||
else:
|
||||
self.data = self.data + "&" + ref + ";"
|
||||
|
||||
file = open(sys.argv[1])
|
||||
parser = TodoParser()
|
||||
|
||||
lineno = 1
|
||||
while 1:
|
||||
line = file.readline()
|
||||
if line == "":
|
||||
break
|
||||
|
||||
try:
|
||||
parser.feed(line)
|
||||
except ParseError, err:
|
||||
sys.stderr.write("Parse error at line " + `lineno` + ": " + err.__str__() + "\n")
|
||||
sys.exit(1)
|
||||
except RuntimeError, err:
|
||||
sys.stderr.write(err.__str__() + "\n")
|
||||
sys.exit(1)
|
||||
|
||||
lineno = lineno + 1
|
||||
|
||||
parser.close()
|
||||
if parser.title == None:
|
||||
sys.stderr.write ("<todo> Document must have a <title>\n")
|
||||
sys.exit (1)
|
||||
|
||||
print '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>%s</title>
|
||||
</head>
|
||||
<body bgcolor="#ffffff">
|
||||
<table width="100%%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<h1>%s</h1>''' % (parser.title, parser.title)
|
||||
|
||||
|
||||
for section in parser.sections:
|
||||
ntasks = len(section.entries)
|
||||
id = make_id (section.title)
|
||||
if ntasks == 1:
|
||||
print '<a href="#%s">%s</a> (1 item)<br>' % (id,section.title)
|
||||
else:
|
||||
print '<a href="#%s">%s</a> (%d items)<br>' % (id,section.title,ntasks)
|
||||
|
||||
print '''
|
||||
</td>'''
|
||||
if parser.logourl != None:
|
||||
print ''' <td align="right">
|
||||
<img src="%s" alt="Logo"></img>
|
||||
</td>''' % parser.logourl
|
||||
print '''
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
'''
|
||||
|
||||
first = 1
|
||||
for section in parser.sections:
|
||||
if not first:
|
||||
print "<br><br>"
|
||||
first = 0
|
||||
section.output()
|
||||
|
||||
print '''</body>
|
||||
</html>'''
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
CC = gcc
|
||||
|
||||
packer: pack.c
|
||||
$(CC) `gtk-config --cflags` pack.c -o packer `gtk-config --libs`
|
||||
$(CC) -g `gtk-config --cflags` pack.c -o packer `gtk-config --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o packer
|
||||
|
||||
@@ -8,5 +8,3 @@ libgdk-1.1.la
|
||||
gdkcursors.h
|
||||
gdkkeysyms.h
|
||||
libgdk.la
|
||||
gdkconfig.h
|
||||
stamp-gc-h
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
## Makefile.am for gtk+/gdk
|
||||
|
||||
SUBDIRS=x11 win32
|
||||
|
||||
EXTRA_DIST = \
|
||||
gdkconfig.h.win32 \
|
||||
gdk.def \
|
||||
makefile.cygwin \
|
||||
makefile.msc
|
||||
|
||||
INCLUDES = @STRIP_BEGIN@ \
|
||||
-DG_LOG_DOMAIN=\"Gdk\" \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir)/gdk \
|
||||
@GTK_DEBUG_FLAGS@ \
|
||||
@GTK_XIM_FLAGS@ \
|
||||
@GTK_LOCALE_FLAGS@ \
|
||||
@@ -36,59 +27,52 @@ libgdk_la_LDFLAGS = @STRIP_BEGIN@ \
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
|
||||
libgdk_la_LIBADD = \
|
||||
x11/libgdk-x11.la
|
||||
|
||||
#
|
||||
# setup source file variables
|
||||
#
|
||||
#
|
||||
# GDK header files for public installation (non-generated)
|
||||
#
|
||||
# Note: files added here may need to be be propagated to gdk_headers in gtk/Makefile.am
|
||||
#
|
||||
gdk_public_h_sources = @STRIP_BEGIN@ \
|
||||
gdk.h \
|
||||
gdkcc.h \
|
||||
gdkcolor.h \
|
||||
gdkcompat.h \
|
||||
gdkcursor.h \
|
||||
gdkcursors.h \
|
||||
gdkdnd.h \
|
||||
gdkdrawable.h \
|
||||
gdkevents.h \
|
||||
gdkfont.h \
|
||||
gdkgc.h \
|
||||
gdkkeysyms.h \
|
||||
gdki18n.h \
|
||||
gdkim.h \
|
||||
gdkimage.h \
|
||||
gdkinput.h \
|
||||
gdkpixmap.h \
|
||||
gdkprivate.h \
|
||||
gdkproperty.h \
|
||||
gdkregion.h \
|
||||
gdkrgb.h \
|
||||
gdkselection.h \
|
||||
gdki18n.h \
|
||||
gdkkeysyms.h \
|
||||
gdkprivate.h \
|
||||
gdktypes.h \
|
||||
gdkvisual.h \
|
||||
gdkwindow.h \
|
||||
gdkx.h \
|
||||
@STRIP_END@
|
||||
gdk_c_sources = @STRIP_BEGIN@ \
|
||||
gdk.c \
|
||||
gdkcc.c \
|
||||
gdkcolor.c \
|
||||
gdkcursor.c \
|
||||
gdkdnd.c \
|
||||
gdkdraw.c \
|
||||
gdkevents.c \
|
||||
gdkfont.c \
|
||||
gdkgc.c \
|
||||
gdkglobals.c \
|
||||
gdkim.c \
|
||||
gdkimage.c \
|
||||
gdkinternals.h \
|
||||
gdkinput.c \
|
||||
gdkinput.h \
|
||||
gdkinputnone.h \
|
||||
gdkinputcommon.h\
|
||||
gdkinputgxi.h \
|
||||
gdkinputxfree.h \
|
||||
gdkpixmap.c \
|
||||
gdkproperty.c \
|
||||
gdkrgb.c \
|
||||
gdkrectangle.c \
|
||||
gdkregion.c \
|
||||
gdkselection.c \
|
||||
gdkvisual.c \
|
||||
gdkwindow.c \
|
||||
gdkxid.c \
|
||||
MwmUtil.h \
|
||||
gxid_lib.h \
|
||||
gxid_proto.h \
|
||||
gxid_lib.c \
|
||||
@STRIP_END@
|
||||
|
||||
#
|
||||
@@ -115,23 +99,19 @@ X-derived-headers:
|
||||
< @x_includes@/X11/keysymdef.h > gdkkeysyms.h
|
||||
|
||||
#
|
||||
# Rule to install gdkconfig.h header file
|
||||
# extra programs
|
||||
#
|
||||
configexecincludedir = $(pkglibdir)/include
|
||||
#configexecinclude_DATA = gdkconfig.h
|
||||
install-exec-local: gdkconfig.h
|
||||
$(mkinstalldirs) $(DESTDIR)$(configexecincludedir)
|
||||
file=$(DESTDIR)$(configexecincludedir)/gdkconfig.h; \
|
||||
if test -r $$file && cmp -s gdkconfig.h $$file; then :; \
|
||||
else $(INSTALL_DATA) gdkconfig.h $$file; fi
|
||||
EXTRA_PROGRAMS = gxid
|
||||
bin_PROGRAMS = @xinput_progs@
|
||||
LDADDS = @STRIP_BEGIN@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
@GLIB_LIBS@ \
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
gxid_SOURCES = gxid.c
|
||||
gxid_LDADD = $(LDADDS)
|
||||
|
||||
BUILT_SOURCES = stamp-gc-h #note: not gdkconfig.h
|
||||
gdkconfig.h: stamp-gc-h
|
||||
@if test -f gdkconfig.h; then :; \
|
||||
else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
|
||||
stamp-gc-h: ../config.status
|
||||
cd .. && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=gdk/gdkconfig.h ./config.status
|
||||
echo timestamp > stamp-gc-h
|
||||
|
||||
.PHONY: files
|
||||
|
||||
|
||||
342
gdk/TODO
342
gdk/TODO
@@ -1,342 +0,0 @@
|
||||
General
|
||||
=======
|
||||
|
||||
- gdk_pointer_grab() and gdk_keyboard_grab() are logically member
|
||||
functions of GdkWindow.
|
||||
|
||||
X specific Functions that need to be moved out of the common header files
|
||||
=========================================================================
|
||||
|
||||
|
||||
Dir structure for ports
|
||||
=======================
|
||||
|
||||
The directory structure here is:
|
||||
|
||||
gdk/
|
||||
gdk/x11
|
||||
gdk/win32
|
||||
...
|
||||
|
||||
The gdk/ directory directly contains all public
|
||||
header files (that are not specific to one
|
||||
windowing system).
|
||||
|
||||
There, in general should be no system dependency
|
||||
|
||||
For each set of functionality, there are the following
|
||||
files:
|
||||
|
||||
gdkwindow.h: public header file
|
||||
gdkwindow.c: common implementation
|
||||
x11/gdkwindow.i: functionality specific to X11
|
||||
win32/gdkwindow.i: functionality specific to win32
|
||||
|
||||
The gdkwindow.c file looks like:
|
||||
|
||||
====
|
||||
#include "gdkwindow.h"
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
#include "x11/gdkwindow.i"
|
||||
#elif defined(GDK_WINDOW_WIN32)
|
||||
#include "win32/gdkwindow.i"
|
||||
fo#endif
|
||||
|
||||
[ generic implementation bits ]
|
||||
====
|
||||
|
||||
x11/gdkwindow.i should only assume that gdkwindow.h has been
|
||||
included and included all other dependencies explicitely.
|
||||
|
||||
The x11/ directory will contain:
|
||||
|
||||
.i files
|
||||
.c files specific to X
|
||||
.h files specific to X
|
||||
|
||||
And a Makefile.am that takes care of distributing the
|
||||
files in the directory, and also for building any
|
||||
X-specific utilities. (Such as the gxid daemon).
|
||||
|
||||
|
||||
Port Status for Files
|
||||
=====================
|
||||
|
||||
gdk
|
||||
|
||||
Much of the contents have been moved to x11/gtkmain.c.
|
||||
I've added a little argument-parsing abstraction.
|
||||
(Currently called gdk_arg_context_*) that allows
|
||||
arguments from multiple places to be combined - that
|
||||
probably needs to be either fixed up and moved into
|
||||
GLib or replaced with some existing solution like
|
||||
popt.
|
||||
|
||||
gdkcc
|
||||
|
||||
This will be removed for GTK+-1.4. Right now, it has been moved
|
||||
completely into the x11/ directory to avoid having to port it.
|
||||
|
||||
gdkcolor
|
||||
|
||||
There are a few common utility functions, and the rest
|
||||
is in the port-specific files.
|
||||
|
||||
gdkcursor
|
||||
|
||||
No shared code - completely port-specific.
|
||||
|
||||
gdkdnd
|
||||
|
||||
No shared code - completely arch-specific. It's possible that some
|
||||
common code for handling GdkDragContext could exist, but the
|
||||
GdkDragContextPrivate will be different on each port.
|
||||
|
||||
gdkdrawable
|
||||
|
||||
Pretty much done. GdkDrawable is completely virtualized.
|
||||
|
||||
gdkevents
|
||||
|
||||
There are a few common utility functions, and the rest
|
||||
is in the port-specific files.
|
||||
|
||||
gdkfont
|
||||
|
||||
Pretty much done for now - gdkfont.c contains a number of functions
|
||||
reimplemented as utility functions, and the rest is
|
||||
ports-specific. It will be obsoleted by pango before 1.4.
|
||||
|
||||
gdkgc
|
||||
|
||||
GdkGC is virtualized to go along with GdkDrawable. There are
|
||||
a couple of functions I punted on for now and moved into the
|
||||
port-specific files - the clipmask functions (because gdkregion
|
||||
is not finalized) and also gdk_gc_copy, which I'm not sure
|
||||
I like enough to put into the vtable.
|
||||
|
||||
gdkim
|
||||
|
||||
All in the port-specific directories. The abstraction here probably
|
||||
will be changed at some point to something more convenient and
|
||||
more Unicode-based.
|
||||
|
||||
gdkimage
|
||||
|
||||
GdkImage is virtualized - all of the code except for ref/unref
|
||||
is in the port-specific files.
|
||||
|
||||
gdkinput
|
||||
|
||||
Right now all the code is port-specific. It should be possible
|
||||
to share the code in gdkinputnone.c, but probably not worth it;
|
||||
I'd like to get rid of the gdk_input_vtable in X11 code -
|
||||
it doesn't make sense since you can't switch the type of input
|
||||
on the fly.
|
||||
|
||||
gdkpixmap
|
||||
|
||||
All moved into the port-specific file for now. The xpm loader
|
||||
should be changed to render with GdkRGB, and thus be
|
||||
windowing-system independent, but that requires
|
||||
first making GdkRGB able to render onto any arbitrary visual.
|
||||
|
||||
gdkproperty
|
||||
|
||||
All port-specific. Possibly should be X-specific with a higher-level
|
||||
clipboard API on top of it.
|
||||
|
||||
gdkregion
|
||||
|
||||
Right now punted to being port-specific, but that probably needs
|
||||
to change with the virtualized drawables and GC's.
|
||||
|
||||
gdkrgb
|
||||
|
||||
With a few changes to debugging code, it was already port-independent.
|
||||
|
||||
gdkselection
|
||||
|
||||
Completely port specific. (In fact, really doesn't make sense
|
||||
on anything other than X; a higher-level clipboard facility
|
||||
should be provided somewhere, though.)
|
||||
|
||||
gdkvisual
|
||||
|
||||
Completely port-specific. (The concepts are rather X-specific)
|
||||
|
||||
gdkwindow
|
||||
|
||||
The window-private data is split between windowing-system independent
|
||||
parts and windowing system dependent parts. There are a few
|
||||
functions in gdk/gdkwindow.c and the rest is moved off
|
||||
into x11/gdkwindow-x11.c
|
||||
|
||||
Virtualization
|
||||
==============
|
||||
|
||||
The concept of virtualization is that calls to draw
|
||||
on a drawable are dispatched through a function table.
|
||||
This potentially allows for:
|
||||
|
||||
Postscript drawables
|
||||
metafiles
|
||||
|
||||
It also provides a nice clean framework for multi-windowing
|
||||
support - instead of reimplementing a whole bunch of function
|
||||
calls, one provides an implementaiton for the vtables.
|
||||
|
||||
X works in this way internally - per-screen functions are
|
||||
virtualized inside a screen structure, and drawing functions
|
||||
are virtualized inside the GC structure.
|
||||
|
||||
For the virtualization of drawing, clearly GdkDrawable needs
|
||||
to be virtualized. Beyond that, one has to decide on
|
||||
a case-by-case basis whether a particular structure is
|
||||
drawing-mode independent (like GdkRectangle) or not.
|
||||
|
||||
The most important GDK structures that are involved drawing are:
|
||||
|
||||
GdkColor
|
||||
GdkGC
|
||||
GdkFont
|
||||
GdkRegion
|
||||
|
||||
The whole font aspect of Gdk is going to get heavily
|
||||
reworked with the introduction of "Pango".
|
||||
GdkRegion almost certainly needs to be virtualized,
|
||||
if you, way, want to do postscript drawables.
|
||||
|
||||
While doing so, the API of GdkRegion should be
|
||||
changed so that the region operations take 3 parameters
|
||||
instead of returning a newly created region.
|
||||
|
||||
|
||||
Drawable operations:
|
||||
destroy
|
||||
create_gc
|
||||
get_values
|
||||
set_values
|
||||
set_dashes
|
||||
copy
|
||||
|
||||
GC Operations:
|
||||
draw_point
|
||||
draw_line
|
||||
draw_rectangle
|
||||
draw_arc
|
||||
draw_polygon
|
||||
draw_string
|
||||
draw_text
|
||||
draw_text_wc
|
||||
draw_pixmap
|
||||
draw_bitmap
|
||||
draw_image
|
||||
draw_points
|
||||
draw_segments
|
||||
draw_lines
|
||||
|
||||
|
||||
Adding multi-screen, display support.
|
||||
=====================================
|
||||
|
||||
The following functions need to have per-display variants:
|
||||
|
||||
void gdk_pointer_ungrab (guint32 time);
|
||||
void gdk_keyboard_ungrab (guint32 time);
|
||||
gint gdk_pointer_is_grabbed (void);
|
||||
|
||||
gint gdk_screen_width (void);
|
||||
gint gdk_screen_height (void);
|
||||
|
||||
gint gdk_screen_width_mm (void);
|
||||
gint gdk_screen_height_mm (void);
|
||||
|
||||
void gdk_beep (void);
|
||||
|
||||
void gdk_key_repeat_disable (void);
|
||||
void gdk_key_repeat_restore (void);
|
||||
|
||||
gint gdk_visual_get_best_depth (void);
|
||||
GdkVisualType gdk_visual_get_best_type (void);
|
||||
GdkVisual* gdk_visual_get_system (void);
|
||||
GdkVisual* gdk_visual_get_best (void);
|
||||
GdkVisual* gdk_visual_get_best_with_depth (gint depth);
|
||||
GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
|
||||
GdkVisual* gdk_visual_get_best_with_both (gint depth,
|
||||
GdkVisualType visual_type);
|
||||
|
||||
void gdk_query_depths (gint **depths,
|
||||
gint *count);
|
||||
void gdk_query_visual_types (GdkVisualType **visual_types,
|
||||
gint *count);
|
||||
|
||||
GList* gdk_list_visuals (void);
|
||||
|
||||
void gdk_add_client_message_filter (GdkAtom message_type,
|
||||
GdkFilterFunc func,
|
||||
gpointer data);
|
||||
|
||||
guint32 gdk_drag_get_protocol (guint32 xid,
|
||||
GdkDragProtocol *protocol);
|
||||
|
||||
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
|
||||
GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
||||
GdkPixmap *mask,
|
||||
GdkColor *fg,
|
||||
GdkColor *bg,
|
||||
gint x,
|
||||
gint y);
|
||||
GdkColormap* gdk_colormap_get_system (void);
|
||||
gint gdk_colormap_get_system_size (void);
|
||||
|
||||
GdkFont* gdk_font_load (const gchar *font_name);
|
||||
GdkFont* gdk_fontset_load (gchar *fontset_name);
|
||||
|
||||
gint gdk_selection_owner_set (GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gint send_event);
|
||||
GdkWindow* gdk_selection_owner_get (GdkAtom selection);
|
||||
|
||||
void gdk_selection_send_notify (guint32 requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time);
|
||||
gint gdk_text_property_to_text_list (GdkAtom encoding, gint format,
|
||||
guchar *text, gint length,
|
||||
gchar ***list);
|
||||
void gdk_free_text_list (gchar **list);
|
||||
gint gdk_string_to_compound_text (gchar *str,
|
||||
GdkAtom *encoding, gint *format,
|
||||
guchar **ctext, gint *length);
|
||||
void gdk_free_compound_text (guchar *ctext);
|
||||
GdkAtom gdk_atom_intern (const gchar *atom_name,
|
||||
gint only_if_exists);
|
||||
gchar* gdk_atom_name (GdkAtom atom);
|
||||
GList *gdk_input_list_devices (void);
|
||||
void gdk_input_set_source (guint32 deviceid,
|
||||
GdkInputSource source);
|
||||
gint gdk_input_set_mode (guint32 deviceid,
|
||||
GdkInputMode mode);
|
||||
void gdk_input_set_axes (guint32 deviceid,
|
||||
GdkAxisUse *axes);
|
||||
void gdk_input_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
gint gdk_im_ready (void);
|
||||
void gdk_im_end (void);
|
||||
GdkIC* gdk_ic_new (GdkICAttr *attr,
|
||||
GdkICAttributesType mask);
|
||||
GdkRegion* gdk_region_new (void);
|
||||
void gdk_event_send_clientmessage_toall (GdkEvent *event);
|
||||
gboolean gdk_event_send_client_message (GdkEvent *event,
|
||||
guint32 xid);
|
||||
|
||||
And maybe:
|
||||
|
||||
void gdk_error_trap_push (void);
|
||||
gint gdk_error_trap_pop (void);
|
||||
347
gdk/gdk.def
347
gdk/gdk.def
@@ -1,347 +0,0 @@
|
||||
EXPORTS
|
||||
gdk_atom_intern
|
||||
gdk_atom_name
|
||||
gdk_beep
|
||||
gdk_bitmap_create_from_data
|
||||
gdk_char_height
|
||||
gdk_char_measure
|
||||
gdk_char_width
|
||||
gdk_char_width_wc
|
||||
gdk_color_alloc
|
||||
gdk_color_black
|
||||
gdk_color_change
|
||||
gdk_color_context_add_palette
|
||||
gdk_color_context_free
|
||||
gdk_color_context_free_dither
|
||||
gdk_color_context_get_index_from_palette
|
||||
gdk_color_context_get_pixel
|
||||
gdk_color_context_get_pixel_from_palette
|
||||
gdk_color_context_get_pixels
|
||||
gdk_color_context_get_pixels_incremental
|
||||
gdk_color_context_init_dither
|
||||
gdk_color_context_new
|
||||
gdk_color_context_new_mono
|
||||
gdk_color_context_query_color
|
||||
gdk_color_context_query_colors
|
||||
gdk_color_copy
|
||||
gdk_color_equal
|
||||
gdk_color_free
|
||||
gdk_color_hash
|
||||
gdk_color_parse
|
||||
gdk_color_white
|
||||
gdk_colormap_alloc_color
|
||||
gdk_colormap_alloc_colors
|
||||
gdk_colormap_change
|
||||
gdk_colormap_free_colors
|
||||
gdk_colormap_get_system
|
||||
gdk_colormap_get_system_size
|
||||
gdk_colormap_get_visual
|
||||
gdk_colormap_new
|
||||
gdk_colormap_ref
|
||||
gdk_colormap_unref
|
||||
gdk_colors_alloc
|
||||
gdk_colors_free
|
||||
gdk_colors_store
|
||||
gdk_cursor_new
|
||||
gdk_cursor_new_from_pixmap
|
||||
gdk_cursor_ref
|
||||
gdk_cursor_unref
|
||||
gdk_dnd_init
|
||||
gdk_drag_abort
|
||||
gdk_drag_begin
|
||||
gdk_drag_context_new
|
||||
gdk_drag_context_ref
|
||||
gdk_drag_context_unref
|
||||
gdk_drag_drop
|
||||
gdk_drag_find_window
|
||||
gdk_drag_get_protocol
|
||||
gdk_drag_get_selection
|
||||
gdk_drag_motion
|
||||
gdk_drag_status
|
||||
gdk_draw_arc
|
||||
gdk_draw_drawable
|
||||
gdk_draw_gray_image
|
||||
gdk_draw_image
|
||||
gdk_draw_indexed_image
|
||||
gdk_draw_line
|
||||
gdk_draw_lines
|
||||
gdk_draw_point
|
||||
gdk_draw_points
|
||||
gdk_draw_polygon
|
||||
gdk_draw_rectangle
|
||||
gdk_draw_rgb_32_image
|
||||
gdk_draw_rgb_image
|
||||
gdk_draw_rgb_image_dithalign
|
||||
gdk_draw_segments
|
||||
gdk_draw_string
|
||||
gdk_draw_text
|
||||
gdk_draw_text_wc
|
||||
gdk_drawable_alloc
|
||||
gdk_drawable_get_colormap
|
||||
gdk_drawable_get_size
|
||||
gdk_drawable_get_type
|
||||
gdk_drawable_get_visual
|
||||
gdk_drawable_ref
|
||||
gdk_drawable_set_colormap
|
||||
gdk_drawable_set_data
|
||||
gdk_drawable_unref
|
||||
gdk_drop_finish
|
||||
gdk_drop_reply
|
||||
gdk_error_code
|
||||
gdk_error_trap_pop
|
||||
gdk_error_trap_push
|
||||
gdk_error_warnings
|
||||
gdk_event_button_generate
|
||||
gdk_event_copy
|
||||
gdk_event_data
|
||||
gdk_event_free
|
||||
gdk_event_func
|
||||
gdk_event_get
|
||||
gdk_event_get_graphics_expose
|
||||
gdk_event_get_time
|
||||
gdk_event_handler_set
|
||||
gdk_event_new
|
||||
gdk_event_peek
|
||||
gdk_event_put
|
||||
gdk_event_queue_append
|
||||
gdk_event_queue_find_first
|
||||
gdk_event_queue_remove_link
|
||||
gdk_event_send_client_message
|
||||
gdk_event_send_clientmessage_toall
|
||||
gdk_event_unqueue
|
||||
gdk_events_pending
|
||||
gdk_exit
|
||||
gdk_flush
|
||||
gdk_font_equal
|
||||
gdk_font_full_name_free
|
||||
gdk_font_full_name_get
|
||||
gdk_font_id
|
||||
gdk_font_list_free
|
||||
gdk_font_list_new
|
||||
gdk_font_load
|
||||
gdk_font_ref
|
||||
gdk_font_unref
|
||||
gdk_fontset_load
|
||||
gdk_free_compound_text
|
||||
gdk_free_text_list
|
||||
gdk_gc_alloc
|
||||
gdk_gc_copy
|
||||
gdk_gc_get_values
|
||||
gdk_gc_new
|
||||
gdk_gc_new_with_values
|
||||
gdk_gc_ref
|
||||
gdk_gc_set_background
|
||||
gdk_gc_set_clip_mask
|
||||
gdk_gc_set_clip_origin
|
||||
gdk_gc_set_clip_rectangle
|
||||
gdk_gc_set_clip_region
|
||||
gdk_gc_set_dashes
|
||||
gdk_gc_set_exposures
|
||||
gdk_gc_set_fill
|
||||
gdk_gc_set_font
|
||||
gdk_gc_set_foreground
|
||||
gdk_gc_set_function
|
||||
gdk_gc_set_line_attributes
|
||||
gdk_gc_set_stipple
|
||||
gdk_gc_set_subwindow
|
||||
gdk_gc_set_tile
|
||||
gdk_gc_set_ts_origin
|
||||
gdk_gc_unref
|
||||
gdk_get_display
|
||||
gdk_get_show_events
|
||||
gdk_get_use_xshm
|
||||
gdk_ic_destroy
|
||||
gdk_ic_get_attr
|
||||
gdk_ic_get_events
|
||||
gdk_ic_get_style
|
||||
gdk_ic_get_values
|
||||
gdk_ic_new
|
||||
gdk_ic_set_attr
|
||||
gdk_ic_set_values
|
||||
gdk_im_begin
|
||||
gdk_im_decide_style
|
||||
gdk_im_end
|
||||
gdk_im_ready
|
||||
gdk_im_set_best_style
|
||||
gdk_image_bitmap_new
|
||||
gdk_image_get
|
||||
gdk_image_get_pixel
|
||||
gdk_image_new
|
||||
gdk_image_new_bitmap
|
||||
gdk_image_put_pixel
|
||||
gdk_image_ref
|
||||
gdk_image_unref
|
||||
gdk_init
|
||||
gdk_init_check
|
||||
gdk_input_add
|
||||
gdk_input_add_full
|
||||
gdk_input_exit
|
||||
gdk_input_init
|
||||
gdk_input_list_devices
|
||||
gdk_input_motion_events
|
||||
gdk_input_remove
|
||||
gdk_input_set_axes
|
||||
gdk_input_set_extension_events
|
||||
gdk_input_set_key
|
||||
gdk_input_set_mode
|
||||
gdk_input_set_source
|
||||
gdk_input_window_get_pointer
|
||||
gdk_key_repeat_disable
|
||||
gdk_key_repeat_restore
|
||||
gdk_keyboard_grab
|
||||
gdk_keyboard_ungrab
|
||||
gdk_keyval_from_name
|
||||
gdk_keyval_is_lower
|
||||
gdk_keyval_is_upper
|
||||
gdk_keyval_name
|
||||
gdk_keyval_to_lower
|
||||
gdk_keyval_to_upper
|
||||
gdk_list_visuals
|
||||
gdk_mbstowcs
|
||||
gdk_null_window_warnings
|
||||
gdk_parent_root
|
||||
gdk_pixmap_colormap_create_from_xpm
|
||||
gdk_pixmap_colormap_create_from_xpm_d
|
||||
gdk_pixmap_create_from_data
|
||||
gdk_pixmap_create_from_xpm
|
||||
gdk_pixmap_create_from_xpm_d
|
||||
gdk_pixmap_create_on_shared_image
|
||||
gdk_pixmap_foreign_new
|
||||
gdk_pixmap_new
|
||||
gdk_pointer_grab
|
||||
gdk_pointer_is_grabbed
|
||||
gdk_pointer_ungrab
|
||||
gdk_progclass
|
||||
gdk_property_change
|
||||
gdk_property_delete
|
||||
gdk_property_get
|
||||
gdk_query_depths
|
||||
gdk_query_visual_types
|
||||
gdk_rectangle_intersect
|
||||
gdk_rectangle_union
|
||||
gdk_region_destroy
|
||||
gdk_region_empty
|
||||
gdk_region_equal
|
||||
gdk_region_get_clipbox
|
||||
gdk_region_intersect
|
||||
gdk_region_new
|
||||
gdk_region_offset
|
||||
gdk_region_point_in
|
||||
gdk_region_polygon
|
||||
gdk_region_rect_in
|
||||
gdk_region_shrink
|
||||
gdk_region_subtract
|
||||
gdk_region_union
|
||||
gdk_region_union_with_rect
|
||||
gdk_region_xor
|
||||
gdk_rgb_cmap_free
|
||||
gdk_rgb_cmap_new
|
||||
gdk_rgb_ditherable
|
||||
gdk_rgb_gc_set_background
|
||||
gdk_rgb_gc_set_foreground
|
||||
gdk_rgb_get_cmap
|
||||
gdk_rgb_get_visual
|
||||
gdk_rgb_init
|
||||
gdk_rgb_set_install
|
||||
gdk_rgb_set_min_colors
|
||||
gdk_rgb_set_verbose
|
||||
gdk_rgb_xpixel_from_rgb
|
||||
gdk_screen_height
|
||||
gdk_screen_height_mm
|
||||
gdk_screen_width
|
||||
gdk_screen_width_mm
|
||||
gdk_selection_convert
|
||||
gdk_selection_owner_get
|
||||
gdk_selection_owner_set
|
||||
gdk_selection_property
|
||||
gdk_selection_property_get
|
||||
gdk_selection_send_notify
|
||||
gdk_set_locale
|
||||
gdk_set_show_events
|
||||
gdk_set_sm_client_id
|
||||
gdk_set_use_xshm
|
||||
gdk_string_extents
|
||||
gdk_string_height
|
||||
gdk_string_measure
|
||||
gdk_string_to_compound_text
|
||||
gdk_string_width
|
||||
gdk_text_extents
|
||||
gdk_text_extents_wc
|
||||
gdk_text_height
|
||||
gdk_text_measure
|
||||
gdk_text_property_to_text_list
|
||||
gdk_text_width
|
||||
gdk_text_width_wc
|
||||
gdk_threads_enter
|
||||
gdk_threads_leave
|
||||
gdk_threads_mutex
|
||||
gdk_visual_get_best
|
||||
gdk_visual_get_best_depth
|
||||
gdk_visual_get_best_type
|
||||
gdk_visual_get_best_with_both
|
||||
gdk_visual_get_best_with_depth
|
||||
gdk_visual_get_best_with_type
|
||||
gdk_visual_get_system
|
||||
gdk_visual_ref
|
||||
gdk_visual_unref
|
||||
gdk_wcstombs
|
||||
gdk_window_add_filter
|
||||
gdk_window_at_pointer
|
||||
gdk_window_begin_paint_rect
|
||||
gdk_window_clear
|
||||
gdk_window_clear_area
|
||||
gdk_window_clear_area_e
|
||||
gdk_window_destroy
|
||||
gdk_window_end_paint
|
||||
gdk_window_foreign_new
|
||||
gdk_window_get_children
|
||||
gdk_window_get_deskrelative_origin
|
||||
gdk_window_get_events
|
||||
gdk_window_get_geometry
|
||||
gdk_window_get_origin
|
||||
gdk_window_get_parent
|
||||
gdk_window_get_pointer
|
||||
gdk_window_get_position
|
||||
gdk_window_get_root_origin
|
||||
gdk_window_get_toplevel
|
||||
gdk_window_get_toplevels
|
||||
gdk_window_get_user_data
|
||||
gdk_window_hide
|
||||
gdk_window_invalidate_rect
|
||||
gdk_window_is_viewable
|
||||
gdk_window_is_visible
|
||||
gdk_window_lower
|
||||
gdk_window_merge_child_shapes
|
||||
gdk_window_move
|
||||
gdk_window_move_resize
|
||||
gdk_window_new
|
||||
gdk_window_process_all_updates
|
||||
gdk_window_process_updates
|
||||
gdk_window_raise
|
||||
gdk_window_register_dnd
|
||||
gdk_window_remove_filter
|
||||
gdk_window_reparent
|
||||
gdk_window_resize
|
||||
gdk_window_set_back_pixmap
|
||||
gdk_window_set_background
|
||||
gdk_window_set_child_shapes
|
||||
gdk_window_set_cursor
|
||||
gdk_window_set_decorations
|
||||
gdk_window_set_events
|
||||
gdk_window_set_functions
|
||||
gdk_window_set_geometry_hints
|
||||
gdk_window_set_group
|
||||
gdk_window_set_hints
|
||||
gdk_window_set_icon
|
||||
gdk_window_set_icon_name
|
||||
gdk_window_set_override_redirect
|
||||
gdk_window_set_role
|
||||
gdk_window_set_static_gravities
|
||||
gdk_window_set_title
|
||||
gdk_window_set_transient_for
|
||||
gdk_window_set_user_data
|
||||
gdk_window_shape_combine_mask
|
||||
gdk_window_show
|
||||
gdk_window_withdraw
|
||||
gdk_xid_table_insert
|
||||
gdk_xid_table_lookup
|
||||
917
gdk/gdk.h
917
gdk/gdk.h
@@ -27,27 +27,8 @@
|
||||
#ifndef __GDK_H__
|
||||
#define __GDK_H__
|
||||
|
||||
#include <gdk/gdkcc.h>
|
||||
#include <gdk/gdkcolor.h>
|
||||
#include <gdk/gdkcursor.h>
|
||||
#include <gdk/gdkdnd.h>
|
||||
#include <gdk/gdkdrawable.h>
|
||||
#include <gdk/gdkevents.h>
|
||||
#include <gdk/gdkfont.h>
|
||||
#include <gdk/gdkgc.h>
|
||||
#include <gdk/gdkim.h>
|
||||
#include <gdk/gdkimage.h>
|
||||
#include <gdk/gdkinput.h>
|
||||
#include <gdk/gdkpixmap.h>
|
||||
#include <gdk/gdkproperty.h>
|
||||
#include <gdk/gdkregion.h>
|
||||
#include <gdk/gdkrgb.h>
|
||||
#include <gdk/gdkselection.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkvisual.h>
|
||||
#include <gdk/gdkwindow.h>
|
||||
|
||||
#include <gdk/gdkcompat.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -70,11 +51,34 @@ void gdk_error_trap_push (void);
|
||||
gint gdk_error_trap_pop (void);
|
||||
|
||||
|
||||
gboolean gdk_events_pending (void);
|
||||
GdkEvent* gdk_event_get (void);
|
||||
|
||||
GdkEvent* gdk_event_peek (void);
|
||||
GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window);
|
||||
void gdk_event_put (GdkEvent *event);
|
||||
|
||||
GdkEvent* gdk_event_copy (GdkEvent *event);
|
||||
void gdk_event_free (GdkEvent *event);
|
||||
guint32 gdk_event_get_time (GdkEvent *event);
|
||||
|
||||
void gdk_event_handler_set (GdkEventFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify notify);
|
||||
|
||||
void gdk_set_show_events (gboolean show_events);
|
||||
void gdk_set_use_xshm (gboolean use_xshm);
|
||||
|
||||
gboolean gdk_get_show_events (void);
|
||||
gboolean gdk_get_use_xshm (void);
|
||||
gchar* gdk_get_display (void);
|
||||
|
||||
guint32 gdk_time_get (void);
|
||||
guint32 gdk_timer_get (void);
|
||||
void gdk_timer_set (guint32 milliseconds);
|
||||
void gdk_timer_enable (void);
|
||||
void gdk_timer_disable (void);
|
||||
|
||||
gint gdk_input_add_full (gint source,
|
||||
GdkInputCondition condition,
|
||||
GdkInputFunction function,
|
||||
@@ -87,18 +91,19 @@ gint gdk_input_add (gint source,
|
||||
void gdk_input_remove (gint tag);
|
||||
|
||||
gint gdk_pointer_grab (GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time);
|
||||
gint owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time);
|
||||
void gdk_pointer_ungrab (guint32 time);
|
||||
gint gdk_keyboard_grab (GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
guint32 time);
|
||||
gboolean owner_events,
|
||||
guint32 time);
|
||||
void gdk_keyboard_ungrab (guint32 time);
|
||||
gboolean gdk_pointer_is_grabbed (void);
|
||||
|
||||
|
||||
gint gdk_screen_width (void);
|
||||
gint gdk_screen_height (void);
|
||||
|
||||
@@ -111,14 +116,749 @@ void gdk_beep (void);
|
||||
void gdk_key_repeat_disable (void);
|
||||
void gdk_key_repeat_restore (void);
|
||||
|
||||
|
||||
/* Visuals
|
||||
*/
|
||||
gint gdk_visual_get_best_depth (void);
|
||||
GdkVisualType gdk_visual_get_best_type (void);
|
||||
GdkVisual* gdk_visual_get_system (void);
|
||||
GdkVisual* gdk_visual_get_best (void);
|
||||
GdkVisual* gdk_visual_get_best_with_depth (gint depth);
|
||||
GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
|
||||
GdkVisual* gdk_visual_get_best_with_both (gint depth,
|
||||
GdkVisualType visual_type);
|
||||
|
||||
/* Actually, these are no-ops... */
|
||||
GdkVisual* gdk_visual_ref (GdkVisual *visual);
|
||||
void gdk_visual_unref (GdkVisual *visual);
|
||||
|
||||
void gdk_query_depths (gint **depths,
|
||||
gint *count);
|
||||
void gdk_query_visual_types (GdkVisualType **visual_types,
|
||||
gint *count);
|
||||
|
||||
GList* gdk_list_visuals (void);
|
||||
|
||||
|
||||
/* Windows
|
||||
*/
|
||||
GdkWindow* gdk_window_new (GdkWindow *parent,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
|
||||
void gdk_window_destroy (GdkWindow *window);
|
||||
GdkWindow* gdk_window_ref (GdkWindow *window);
|
||||
void gdk_window_unref (GdkWindow *window);
|
||||
|
||||
GdkWindow* gdk_window_at_pointer (gint *win_x,
|
||||
gint *win_y);
|
||||
void gdk_window_show (GdkWindow *window);
|
||||
void gdk_window_hide (GdkWindow *window);
|
||||
void gdk_window_withdraw (GdkWindow *window);
|
||||
void gdk_window_move (GdkWindow *window,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_window_resize (GdkWindow *window,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_move_resize (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_reparent (GdkWindow *window,
|
||||
GdkWindow *new_parent,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_window_clear (GdkWindow *window);
|
||||
void gdk_window_clear_area (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_clear_area_e(GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_copy_area (GdkWindow *window,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
GdkWindow *source_window,
|
||||
gint source_x,
|
||||
gint source_y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_raise (GdkWindow *window);
|
||||
void gdk_window_lower (GdkWindow *window);
|
||||
|
||||
void gdk_window_set_user_data (GdkWindow *window,
|
||||
gpointer user_data);
|
||||
void gdk_window_set_override_redirect(GdkWindow *window,
|
||||
gboolean override_redirect);
|
||||
|
||||
void gdk_window_add_filter (GdkWindow *window,
|
||||
GdkFilterFunc function,
|
||||
gpointer data);
|
||||
void gdk_window_remove_filter (GdkWindow *window,
|
||||
GdkFilterFunc function,
|
||||
gpointer data);
|
||||
|
||||
/*
|
||||
* This allows for making shaped (partially transparent) windows
|
||||
* - cool feature, needed for Drag and Drag for example.
|
||||
* The shape_mask can be the mask
|
||||
* from gdk_pixmap_create_from_xpm. Stefan Wille
|
||||
*/
|
||||
void gdk_window_shape_combine_mask (GdkWindow *window,
|
||||
GdkBitmap *shape_mask,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
/*
|
||||
* This routine allows you to quickly take the shapes of all the child windows
|
||||
* of a window and use their shapes as the shape mask for this window - useful
|
||||
* for container windows that dont want to look like a big box
|
||||
*
|
||||
* - Raster
|
||||
*/
|
||||
void gdk_window_set_child_shapes (GdkWindow *window);
|
||||
|
||||
/*
|
||||
* This routine allows you to merge (ie ADD) child shapes to your
|
||||
* own window's shape keeping its current shape and ADDING the shild
|
||||
* shapes to it.
|
||||
*
|
||||
* - Raster
|
||||
*/
|
||||
void gdk_window_merge_child_shapes (GdkWindow *window);
|
||||
|
||||
/*
|
||||
* Check if a window has been shown, and whether all it's
|
||||
* parents up to a toplevel have been shown, respectively.
|
||||
* Note that a window that is_viewable below is not necessarily
|
||||
* viewable in the X sense.
|
||||
*/
|
||||
gboolean gdk_window_is_visible (GdkWindow *window);
|
||||
gboolean gdk_window_is_viewable (GdkWindow *window);
|
||||
|
||||
/* Set static bit gravity on the parent, and static
|
||||
* window gravity on all children.
|
||||
*/
|
||||
gboolean gdk_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static);
|
||||
/*
|
||||
* The following function adds a global filter for all client
|
||||
* messages of type message_type
|
||||
*/
|
||||
void gdk_add_client_message_filter (GdkAtom message_type,
|
||||
GdkFilterFunc func,
|
||||
gpointer data);
|
||||
|
||||
/* Drag and Drop */
|
||||
|
||||
GdkDragContext * gdk_drag_context_new (void);
|
||||
void gdk_drag_context_ref (GdkDragContext *context);
|
||||
void gdk_drag_context_unref (GdkDragContext *context);
|
||||
|
||||
/* Destination side */
|
||||
|
||||
void gdk_drag_status (GdkDragContext *context,
|
||||
GdkDragAction action,
|
||||
guint32 time);
|
||||
void gdk_drop_reply (GdkDragContext *context,
|
||||
gboolean ok,
|
||||
guint32 time);
|
||||
void gdk_drop_finish (GdkDragContext *context,
|
||||
gboolean success,
|
||||
guint32 time);
|
||||
GdkAtom gdk_drag_get_selection (GdkDragContext *context);
|
||||
|
||||
/* Source side */
|
||||
|
||||
GdkDragContext * gdk_drag_begin (GdkWindow *window,
|
||||
GList *targets);
|
||||
guint32 gdk_drag_get_protocol (guint32 xid,
|
||||
GdkDragProtocol *protocol);
|
||||
void gdk_drag_find_window (GdkDragContext *context,
|
||||
GdkWindow *drag_window,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkWindow **dest_window,
|
||||
GdkDragProtocol *protocol);
|
||||
gboolean gdk_drag_motion (GdkDragContext *context,
|
||||
GdkWindow *dest_window,
|
||||
GdkDragProtocol protocol,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkDragAction suggested_action,
|
||||
GdkDragAction possible_actions,
|
||||
guint32 time);
|
||||
void gdk_drag_drop (GdkDragContext *context,
|
||||
guint32 time);
|
||||
void gdk_drag_abort (GdkDragContext *context,
|
||||
guint32 time);
|
||||
|
||||
/* GdkWindow */
|
||||
|
||||
void gdk_window_set_hints (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint min_width,
|
||||
gint min_height,
|
||||
gint max_width,
|
||||
gint max_height,
|
||||
gint flags);
|
||||
void gdk_window_set_geometry_hints (GdkWindow *window,
|
||||
GdkGeometry *geometry,
|
||||
GdkWindowHints flags);
|
||||
void gdk_set_sm_client_id (const gchar *sm_client_id);
|
||||
|
||||
|
||||
void gdk_window_set_title (GdkWindow *window,
|
||||
const gchar *title);
|
||||
void gdk_window_set_role (GdkWindow *window,
|
||||
const gchar *role);
|
||||
void gdk_window_set_transient_for (GdkWindow *window,
|
||||
GdkWindow *leader);
|
||||
void gdk_window_set_background (GdkWindow *window,
|
||||
GdkColor *color);
|
||||
void gdk_window_set_back_pixmap (GdkWindow *window,
|
||||
GdkPixmap *pixmap,
|
||||
gboolean parent_relative);
|
||||
void gdk_window_set_cursor (GdkWindow *window,
|
||||
GdkCursor *cursor);
|
||||
void gdk_window_set_colormap (GdkWindow *window,
|
||||
GdkColormap *colormap);
|
||||
void gdk_window_get_user_data (GdkWindow *window,
|
||||
gpointer *data);
|
||||
void gdk_window_get_geometry (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *depth);
|
||||
void gdk_window_get_position (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
void gdk_window_get_size (GdkWindow *window,
|
||||
gint *width,
|
||||
gint *height);
|
||||
GdkVisual* gdk_window_get_visual (GdkWindow *window);
|
||||
GdkColormap* gdk_window_get_colormap (GdkWindow *window);
|
||||
GdkWindowType gdk_window_get_type (GdkWindow *window);
|
||||
gint gdk_window_get_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
gboolean gdk_window_get_deskrelative_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
void gdk_window_get_root_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
GdkWindow* gdk_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* gdk_window_get_parent (GdkWindow *window);
|
||||
GdkWindow* gdk_window_get_toplevel (GdkWindow *window);
|
||||
GList* gdk_window_get_children (GdkWindow *window);
|
||||
GdkEventMask gdk_window_get_events (GdkWindow *window);
|
||||
void gdk_window_set_events (GdkWindow *window,
|
||||
GdkEventMask event_mask);
|
||||
|
||||
void gdk_window_set_icon (GdkWindow *window,
|
||||
GdkWindow *icon_window,
|
||||
GdkPixmap *pixmap,
|
||||
GdkBitmap *mask);
|
||||
void gdk_window_set_icon_name (GdkWindow *window,
|
||||
const gchar *name);
|
||||
void gdk_window_set_group (GdkWindow *window,
|
||||
GdkWindow *leader);
|
||||
void gdk_window_set_decorations (GdkWindow *window,
|
||||
GdkWMDecoration decorations);
|
||||
void gdk_window_set_functions (GdkWindow *window,
|
||||
GdkWMFunction functions);
|
||||
GList * gdk_window_get_toplevels (void);
|
||||
|
||||
void gdk_window_register_dnd (GdkWindow *window);
|
||||
|
||||
void gdk_drawable_set_data (GdkDrawable *drawable,
|
||||
const gchar *key,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy_func);
|
||||
|
||||
|
||||
/* Cursors
|
||||
*/
|
||||
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
|
||||
GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
||||
GdkPixmap *mask,
|
||||
GdkColor *fg,
|
||||
GdkColor *bg,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_cursor_destroy (GdkCursor *cursor);
|
||||
|
||||
|
||||
/* GCs
|
||||
*/
|
||||
GdkGC* gdk_gc_new (GdkWindow *window);
|
||||
GdkGC* gdk_gc_new_with_values (GdkWindow *window,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask);
|
||||
GdkGC* gdk_gc_ref (GdkGC *gc);
|
||||
void gdk_gc_unref (GdkGC *gc);
|
||||
void gdk_gc_destroy (GdkGC *gc);
|
||||
void gdk_gc_get_values (GdkGC *gc,
|
||||
GdkGCValues *values);
|
||||
void gdk_gc_set_foreground (GdkGC *gc,
|
||||
GdkColor *color);
|
||||
void gdk_gc_set_background (GdkGC *gc,
|
||||
GdkColor *color);
|
||||
void gdk_gc_set_font (GdkGC *gc,
|
||||
GdkFont *font);
|
||||
void gdk_gc_set_function (GdkGC *gc,
|
||||
GdkFunction function);
|
||||
void gdk_gc_set_fill (GdkGC *gc,
|
||||
GdkFill fill);
|
||||
void gdk_gc_set_tile (GdkGC *gc,
|
||||
GdkPixmap *tile);
|
||||
void gdk_gc_set_stipple (GdkGC *gc,
|
||||
GdkPixmap *stipple);
|
||||
void gdk_gc_set_ts_origin (GdkGC *gc,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_gc_set_clip_origin (GdkGC *gc,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_gc_set_clip_mask (GdkGC *gc,
|
||||
GdkBitmap *mask);
|
||||
void gdk_gc_set_clip_rectangle (GdkGC *gc,
|
||||
GdkRectangle *rectangle);
|
||||
void gdk_gc_set_clip_region (GdkGC *gc,
|
||||
GdkRegion *region);
|
||||
void gdk_gc_set_subwindow (GdkGC *gc,
|
||||
GdkSubwindowMode mode);
|
||||
void gdk_gc_set_exposures (GdkGC *gc,
|
||||
gboolean exposures);
|
||||
void gdk_gc_set_line_attributes (GdkGC *gc,
|
||||
gint line_width,
|
||||
GdkLineStyle line_style,
|
||||
GdkCapStyle cap_style,
|
||||
GdkJoinStyle join_style);
|
||||
void gdk_gc_set_dashes (GdkGC *gc,
|
||||
gint dash_offset,
|
||||
gint8 dash_list[],
|
||||
gint n);
|
||||
void gdk_gc_copy (GdkGC *dst_gc,
|
||||
GdkGC *src_gc);
|
||||
|
||||
|
||||
/* Pixmaps
|
||||
*/
|
||||
GdkPixmap* gdk_pixmap_new (GdkWindow *window,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth);
|
||||
GdkBitmap* gdk_bitmap_create_from_data (GdkWindow *window,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height);
|
||||
GdkPixmap* gdk_pixmap_create_from_data (GdkWindow *window,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth,
|
||||
GdkColor *fg,
|
||||
GdkColor *bg);
|
||||
GdkPixmap* gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
const gchar *filename);
|
||||
GdkPixmap* gdk_pixmap_colormap_create_from_xpm (
|
||||
GdkWindow *window,
|
||||
GdkColormap *colormap,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
const gchar *filename);
|
||||
GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
gchar **data);
|
||||
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d (
|
||||
GdkWindow *window,
|
||||
GdkColormap *colormap,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
gchar **data);
|
||||
GdkPixmap *gdk_pixmap_ref (GdkPixmap *pixmap);
|
||||
void gdk_pixmap_unref (GdkPixmap *pixmap);
|
||||
|
||||
GdkBitmap *gdk_bitmap_ref (GdkBitmap *pixmap);
|
||||
void gdk_bitmap_unref (GdkBitmap *pixmap);
|
||||
|
||||
|
||||
/* Images
|
||||
*/
|
||||
GdkImage* gdk_image_new_bitmap(GdkVisual *visual,
|
||||
gpointer data,
|
||||
gint width,
|
||||
gint height);
|
||||
GdkImage* gdk_image_new (GdkImageType type,
|
||||
GdkVisual *visual,
|
||||
gint width,
|
||||
gint height);
|
||||
GdkImage* gdk_image_get (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_image_put_pixel (GdkImage *image,
|
||||
gint x,
|
||||
gint y,
|
||||
guint32 pixel);
|
||||
guint32 gdk_image_get_pixel (GdkImage *image,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_image_destroy (GdkImage *image);
|
||||
|
||||
|
||||
/* Color
|
||||
*/
|
||||
GdkColormap* gdk_colormap_new (GdkVisual *visual,
|
||||
gboolean allocate);
|
||||
GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
|
||||
void gdk_colormap_unref (GdkColormap *cmap);
|
||||
|
||||
GdkColormap* gdk_colormap_get_system (void);
|
||||
gint gdk_colormap_get_system_size (void);
|
||||
|
||||
void gdk_colormap_change (GdkColormap *colormap,
|
||||
gint ncolors);
|
||||
|
||||
gint gdk_colormap_alloc_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors,
|
||||
gboolean writeable,
|
||||
gboolean best_match,
|
||||
gboolean *success);
|
||||
gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
|
||||
GdkColor *color,
|
||||
gboolean writeable,
|
||||
gboolean best_match);
|
||||
void gdk_colormap_free_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors);
|
||||
|
||||
GdkVisual* gdk_colormap_get_visual (GdkColormap *colormap);
|
||||
|
||||
GdkColor* gdk_color_copy (const GdkColor *color);
|
||||
void gdk_color_free (GdkColor *color);
|
||||
|
||||
gboolean gdk_color_parse (const gchar *spec,
|
||||
GdkColor *color);
|
||||
guint gdk_color_hash (const GdkColor *colora,
|
||||
const GdkColor *colorb);
|
||||
gboolean gdk_color_equal (const GdkColor *colora,
|
||||
const GdkColor *colorb);
|
||||
|
||||
|
||||
/* The following functions are deprecated */
|
||||
void gdk_colors_store (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors);
|
||||
gboolean gdk_colors_alloc (GdkColormap *colormap,
|
||||
gboolean contiguous,
|
||||
gulong *planes,
|
||||
gint nplanes,
|
||||
gulong *pixels,
|
||||
gint npixels);
|
||||
void gdk_colors_free (GdkColormap *colormap,
|
||||
gulong *pixels,
|
||||
gint npixels,
|
||||
gulong planes);
|
||||
gboolean gdk_color_white (GdkColormap *colormap,
|
||||
GdkColor *color);
|
||||
gboolean gdk_color_black (GdkColormap *colormap,
|
||||
GdkColor *color);
|
||||
gboolean gdk_color_alloc (GdkColormap *colormap,
|
||||
GdkColor *color);
|
||||
gboolean gdk_color_change (GdkColormap *colormap,
|
||||
GdkColor *color);
|
||||
|
||||
|
||||
/* Fonts
|
||||
*/
|
||||
GdkFont* gdk_font_load (const gchar *font_name);
|
||||
GdkFont* gdk_fontset_load (const gchar *fontset_name);
|
||||
GdkFont* gdk_font_ref (GdkFont *font);
|
||||
void gdk_font_unref (GdkFont *font);
|
||||
gint gdk_font_id (const GdkFont *font);
|
||||
gboolean gdk_font_equal (const GdkFont *fonta,
|
||||
const GdkFont *fontb);
|
||||
gint gdk_string_width (GdkFont *font,
|
||||
const gchar *string);
|
||||
gint gdk_text_width (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
gint gdk_text_width_wc (GdkFont *font,
|
||||
const GdkWChar *text,
|
||||
gint text_length);
|
||||
gint gdk_char_width (GdkFont *font,
|
||||
gchar character);
|
||||
gint gdk_char_width_wc (GdkFont *font,
|
||||
GdkWChar character);
|
||||
gint gdk_string_measure (GdkFont *font,
|
||||
const gchar *string);
|
||||
gint gdk_text_measure (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
gint gdk_char_measure (GdkFont *font,
|
||||
gchar character);
|
||||
gint gdk_string_height (GdkFont *font,
|
||||
const gchar *string);
|
||||
gint gdk_text_height (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
gint gdk_char_height (GdkFont *font,
|
||||
gchar character);
|
||||
|
||||
void gdk_text_extents (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length,
|
||||
gint *lbearing,
|
||||
gint *rbearing,
|
||||
gint *width,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
void gdk_text_extents_wc (GdkFont *font,
|
||||
const GdkWChar *text,
|
||||
gint text_length,
|
||||
gint *lbearing,
|
||||
gint *rbearing,
|
||||
gint *width,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
void gdk_string_extents (GdkFont *font,
|
||||
const gchar *string,
|
||||
gint *lbearing,
|
||||
gint *rbearing,
|
||||
gint *width,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
|
||||
/* Drawing
|
||||
*/
|
||||
void gdk_draw_point (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_draw_line (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void gdk_draw_rectangle (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_draw_arc (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gint angle1,
|
||||
gint angle2);
|
||||
void gdk_draw_polygon (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
void gdk_draw_string (GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const gchar *string);
|
||||
void gdk_draw_text (GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
void gdk_draw_text_wc (GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const GdkWChar *text,
|
||||
gint text_length);
|
||||
void gdk_draw_pixmap (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkDrawable *src,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_draw_image (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
void gdk_draw_segments (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkSegment *segs,
|
||||
gint nsegs);
|
||||
void gdk_draw_lines (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Selections
|
||||
*/
|
||||
gboolean gdk_selection_owner_set (GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gint send_event);
|
||||
GdkWindow* gdk_selection_owner_get (GdkAtom selection);
|
||||
void gdk_selection_convert (GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint32 time);
|
||||
gboolean gdk_selection_property_get (GdkWindow *requestor,
|
||||
guchar **data,
|
||||
GdkAtom *prop_type,
|
||||
gint *prop_format);
|
||||
void gdk_selection_send_notify (guint32 requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time);
|
||||
|
||||
gint gdk_text_property_to_text_list (GdkAtom encoding, gint format,
|
||||
guchar *text, gint length,
|
||||
gchar ***list);
|
||||
void gdk_free_text_list (gchar **list);
|
||||
gint gdk_string_to_compound_text (const gchar *str,
|
||||
GdkAtom *encoding, gint *format,
|
||||
guchar **ctext, gint *length);
|
||||
void gdk_free_compound_text (guchar *ctext);
|
||||
|
||||
/* Properties
|
||||
*/
|
||||
GdkAtom gdk_atom_intern (const gchar *atom_name,
|
||||
gint only_if_exists);
|
||||
gchar* gdk_atom_name (GdkAtom atom);
|
||||
gboolean gdk_property_get (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gulong offset,
|
||||
gulong length,
|
||||
gint pdelete,
|
||||
GdkAtom *actual_property_type,
|
||||
gint *actual_format,
|
||||
gint *actual_length,
|
||||
guchar **data);
|
||||
void gdk_property_change (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
guchar *data,
|
||||
gint nelements);
|
||||
void gdk_property_delete (GdkWindow *window,
|
||||
GdkAtom property);
|
||||
|
||||
|
||||
|
||||
/* Rectangle utilities
|
||||
*/
|
||||
gboolean gdk_rectangle_intersect (GdkRectangle *src1,
|
||||
GdkRectangle *src2,
|
||||
GdkRectangle *dest);
|
||||
GdkRectangle *src2,
|
||||
GdkRectangle *dest);
|
||||
void gdk_rectangle_union (GdkRectangle *src1,
|
||||
GdkRectangle *src2,
|
||||
GdkRectangle *dest);
|
||||
GdkRectangle *src2,
|
||||
GdkRectangle *dest);
|
||||
|
||||
/* XInput support
|
||||
*/
|
||||
void gdk_input_init (void);
|
||||
void gdk_input_exit (void);
|
||||
GList * gdk_input_list_devices (void);
|
||||
void gdk_input_set_extension_events (GdkWindow *window,
|
||||
gint mask,
|
||||
GdkExtensionMode mode);
|
||||
void gdk_input_set_source (guint32 deviceid,
|
||||
GdkInputSource source);
|
||||
gboolean gdk_input_set_mode (guint32 deviceid,
|
||||
GdkInputMode mode);
|
||||
void gdk_input_set_axes (guint32 deviceid,
|
||||
GdkAxisUse *axes);
|
||||
void gdk_input_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
void gdk_input_window_get_pointer (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *pressure,
|
||||
gdouble *xtilt,
|
||||
gdouble *ytilt,
|
||||
GdkModifierType *mask);
|
||||
GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
gint *nevents_return);
|
||||
|
||||
/* International Input Method Support Functions
|
||||
*/
|
||||
|
||||
gboolean gdk_im_ready (void);
|
||||
|
||||
void gdk_im_begin (GdkIC *ic,
|
||||
GdkWindow *window);
|
||||
void gdk_im_end (void);
|
||||
GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style);
|
||||
GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style);
|
||||
|
||||
GdkIC* gdk_ic_new (GdkICAttr *attr,
|
||||
GdkICAttributesType mask);
|
||||
void gdk_ic_destroy (GdkIC *ic);
|
||||
GdkIMStyle gdk_ic_get_style (GdkIC *ic);
|
||||
GdkEventMask gdk_ic_get_events (GdkIC *ic);
|
||||
|
||||
GdkICAttr* gdk_ic_attr_new (void);
|
||||
void gdk_ic_attr_destroy (GdkICAttr *attr);
|
||||
|
||||
GdkICAttributesType gdk_ic_set_attr (GdkIC *ic,
|
||||
GdkICAttr *attr,
|
||||
GdkICAttributesType mask);
|
||||
GdkICAttributesType gdk_ic_get_attr (GdkIC *ic,
|
||||
GdkICAttr *attr,
|
||||
GdkICAttributesType mask);
|
||||
|
||||
/* Conversion functions between wide char and multibyte strings.
|
||||
*/
|
||||
@@ -127,6 +867,101 @@ gint gdk_mbstowcs (GdkWChar *dest,
|
||||
const gchar *src,
|
||||
gint dest_max);
|
||||
|
||||
|
||||
/* Color Context */
|
||||
|
||||
GdkColorContext *gdk_color_context_new (GdkVisual *visual,
|
||||
GdkColormap *colormap);
|
||||
|
||||
GdkColorContext *gdk_color_context_new_mono (GdkVisual *visual,
|
||||
GdkColormap *colormap);
|
||||
|
||||
void gdk_color_context_free (GdkColorContext *cc);
|
||||
|
||||
gulong gdk_color_context_get_pixel (GdkColorContext *cc,
|
||||
gushort red,
|
||||
gushort green,
|
||||
gushort blue,
|
||||
gint *failed);
|
||||
void gdk_color_context_get_pixels (GdkColorContext *cc,
|
||||
gushort *reds,
|
||||
gushort *greens,
|
||||
gushort *blues,
|
||||
gint ncolors,
|
||||
gulong *colors,
|
||||
gint *nallocated);
|
||||
void gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
|
||||
gushort *reds,
|
||||
gushort *greens,
|
||||
gushort *blues,
|
||||
gint ncolors,
|
||||
gint *used,
|
||||
gulong *colors,
|
||||
gint *nallocated);
|
||||
|
||||
gint gdk_color_context_query_color (GdkColorContext *cc,
|
||||
GdkColor *color);
|
||||
gint gdk_color_context_query_colors (GdkColorContext *cc,
|
||||
GdkColor *colors,
|
||||
gint num_colors);
|
||||
|
||||
gint gdk_color_context_add_palette (GdkColorContext *cc,
|
||||
GdkColor *palette,
|
||||
gint num_palette);
|
||||
|
||||
void gdk_color_context_init_dither (GdkColorContext *cc);
|
||||
void gdk_color_context_free_dither (GdkColorContext *cc);
|
||||
|
||||
gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
|
||||
gushort *red,
|
||||
gushort *green,
|
||||
gushort *blue,
|
||||
gint *failed);
|
||||
guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc,
|
||||
gint *red,
|
||||
gint *green,
|
||||
gint *blue,
|
||||
gint *failed);
|
||||
/* Regions
|
||||
*/
|
||||
|
||||
GdkRegion* gdk_region_new (void);
|
||||
void gdk_region_destroy (GdkRegion *region);
|
||||
|
||||
void gdk_region_get_clipbox(GdkRegion *region,
|
||||
GdkRectangle *rectangle);
|
||||
|
||||
gboolean gdk_region_empty (GdkRegion *region);
|
||||
gboolean gdk_region_equal (GdkRegion *region1,
|
||||
GdkRegion *region2);
|
||||
gboolean gdk_region_point_in (GdkRegion *region,
|
||||
int x,
|
||||
int y);
|
||||
GdkOverlapType gdk_region_rect_in (GdkRegion *region,
|
||||
GdkRectangle *rect);
|
||||
|
||||
GdkRegion* gdk_region_polygon (GdkPoint *points,
|
||||
gint npoints,
|
||||
GdkFillRule fill_rule);
|
||||
|
||||
void gdk_region_offset (GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy);
|
||||
void gdk_region_shrink (GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy);
|
||||
|
||||
GdkRegion* gdk_region_union_with_rect (GdkRegion *region,
|
||||
GdkRectangle *rect);
|
||||
GdkRegion* gdk_regions_intersect (GdkRegion *source1,
|
||||
GdkRegion *source2);
|
||||
GdkRegion* gdk_regions_union (GdkRegion *source1,
|
||||
GdkRegion *source2);
|
||||
GdkRegion* gdk_regions_subtract (GdkRegion *source1,
|
||||
GdkRegion *source2);
|
||||
GdkRegion* gdk_regions_xor (GdkRegion *source1,
|
||||
GdkRegion *source2);
|
||||
|
||||
/* Miscellaneous */
|
||||
void gdk_event_send_clientmessage_toall (GdkEvent *event);
|
||||
gboolean gdk_event_send_client_message (GdkEvent *event,
|
||||
@@ -134,21 +969,17 @@ gboolean gdk_event_send_client_message (GdkEvent *event,
|
||||
|
||||
/* Key values
|
||||
*/
|
||||
gchar* gdk_keyval_name (guint keyval);
|
||||
guint gdk_keyval_from_name (const gchar *keyval_name);
|
||||
void gdk_keyval_convert_case (guint symbol,
|
||||
guint *lower,
|
||||
guint *upper);
|
||||
guint gdk_keyval_to_upper (guint keyval);
|
||||
guint gdk_keyval_to_lower (guint keyval);
|
||||
gboolean gdk_keyval_is_upper (guint keyval);
|
||||
gboolean gdk_keyval_is_lower (guint keyval);
|
||||
|
||||
gchar* gdk_keyval_name (guint keyval);
|
||||
guint gdk_keyval_from_name (const gchar *keyval_name);
|
||||
guint gdk_keyval_to_upper (guint keyval);
|
||||
guint gdk_keyval_to_lower (guint keyval);
|
||||
gboolean gdk_keyval_is_upper (guint keyval);
|
||||
gboolean gdk_keyval_is_lower (guint keyval);
|
||||
|
||||
/* Threading
|
||||
*/
|
||||
|
||||
GDKVAR GMutex *gdk_threads_mutex;
|
||||
extern GMutex *gdk_threads_mutex;
|
||||
|
||||
void gdk_threads_enter (void);
|
||||
void gdk_threads_leave (void);
|
||||
@@ -167,6 +998,8 @@ void gdk_threads_leave (void);
|
||||
# define GDK_THREADS_LEAVE()
|
||||
#endif /* !G_THREADS_ENABLED */
|
||||
|
||||
#include <gdk/gdkrgb.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -61,25 +61,15 @@
|
||||
*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gdkcc.h"
|
||||
#include "gdkcolor.h"
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
|
||||
#define MAX_IMAGE_COLORS 256
|
||||
|
||||
typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
|
||||
|
||||
struct _GdkColorContextPrivate
|
||||
{
|
||||
GdkColorContext color_context;
|
||||
Display *xdisplay;
|
||||
XStandardColormap std_cmap;
|
||||
};
|
||||
|
||||
static guint
|
||||
hash_color (gconstpointer key)
|
||||
149
gdk/gdkcc.h
149
gdk/gdkcc.h
@@ -1,149 +0,0 @@
|
||||
#ifndef __GDK_CC_H__
|
||||
#define __GDK_CC_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _GdkColorContextDither GdkColorContextDither;
|
||||
typedef struct _GdkColorContext GdkColorContext;
|
||||
|
||||
|
||||
/* Color Context modes.
|
||||
*
|
||||
* GDK_CC_MODE_UNDEFINED - unknown
|
||||
* GDK_CC_MODE_BW - default B/W
|
||||
* GDK_CC_MODE_STD_CMAP - has a standard colormap
|
||||
* GDK_CC_MODE_TRUE - is a TrueColor/DirectColor visual
|
||||
* GDK_CC_MODE_MY_GRAY - my grayramp
|
||||
* GDK_CC_MODE_PALETTE - has a pre-allocated palette
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_CC_MODE_UNDEFINED,
|
||||
GDK_CC_MODE_BW,
|
||||
GDK_CC_MODE_STD_CMAP,
|
||||
GDK_CC_MODE_TRUE,
|
||||
GDK_CC_MODE_MY_GRAY,
|
||||
GDK_CC_MODE_PALETTE
|
||||
} GdkColorContextMode;
|
||||
|
||||
struct _GdkColorContextDither
|
||||
{
|
||||
gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
|
||||
gint fast_err[32][32][32]; /* internal RGB error information */
|
||||
gint fast_erg[32][32][32];
|
||||
gint fast_erb[32][32][32];
|
||||
};
|
||||
|
||||
struct _GdkColorContext
|
||||
{
|
||||
GdkVisual *visual;
|
||||
GdkColormap *colormap;
|
||||
|
||||
gint num_colors; /* available no. of colors in colormap */
|
||||
gint max_colors; /* maximum no. of colors */
|
||||
gint num_allocated; /* no. of allocated colors */
|
||||
|
||||
GdkColorContextMode mode;
|
||||
gint need_to_free_colormap;
|
||||
GdkAtom std_cmap_atom;
|
||||
|
||||
gulong *clut; /* color look-up table */
|
||||
GdkColor *cmap; /* colormap */
|
||||
|
||||
GHashTable *color_hash; /* hash table of allocated colors */
|
||||
GdkColor *palette; /* preallocated palette */
|
||||
gint num_palette; /* size of palette */
|
||||
|
||||
GdkColorContextDither *fast_dither; /* fast dither matrix */
|
||||
|
||||
struct
|
||||
{
|
||||
gint red;
|
||||
gint green;
|
||||
gint blue;
|
||||
} shifts;
|
||||
|
||||
struct
|
||||
{
|
||||
gulong red;
|
||||
gulong green;
|
||||
gulong blue;
|
||||
} masks;
|
||||
|
||||
struct
|
||||
{
|
||||
gint red;
|
||||
gint green;
|
||||
gint blue;
|
||||
} bits;
|
||||
|
||||
gulong max_entry;
|
||||
|
||||
gulong black_pixel;
|
||||
gulong white_pixel;
|
||||
};
|
||||
|
||||
GdkColorContext *gdk_color_context_new (GdkVisual *visual,
|
||||
GdkColormap *colormap);
|
||||
|
||||
GdkColorContext *gdk_color_context_new_mono (GdkVisual *visual,
|
||||
GdkColormap *colormap);
|
||||
|
||||
void gdk_color_context_free (GdkColorContext *cc);
|
||||
|
||||
gulong gdk_color_context_get_pixel (GdkColorContext *cc,
|
||||
gushort red,
|
||||
gushort green,
|
||||
gushort blue,
|
||||
gint *failed);
|
||||
void gdk_color_context_get_pixels (GdkColorContext *cc,
|
||||
gushort *reds,
|
||||
gushort *greens,
|
||||
gushort *blues,
|
||||
gint ncolors,
|
||||
gulong *colors,
|
||||
gint *nallocated);
|
||||
void gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
|
||||
gushort *reds,
|
||||
gushort *greens,
|
||||
gushort *blues,
|
||||
gint ncolors,
|
||||
gint *used,
|
||||
gulong *colors,
|
||||
gint *nallocated);
|
||||
|
||||
gint gdk_color_context_query_color (GdkColorContext *cc,
|
||||
GdkColor *color);
|
||||
gint gdk_color_context_query_colors (GdkColorContext *cc,
|
||||
GdkColor *colors,
|
||||
gint num_colors);
|
||||
|
||||
gint gdk_color_context_add_palette (GdkColorContext *cc,
|
||||
GdkColor *palette,
|
||||
gint num_palette);
|
||||
|
||||
void gdk_color_context_init_dither (GdkColorContext *cc);
|
||||
void gdk_color_context_free_dither (GdkColorContext *cc);
|
||||
|
||||
gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
|
||||
gushort *red,
|
||||
gushort *green,
|
||||
gushort *blue,
|
||||
gint *failed);
|
||||
guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc,
|
||||
gint *red,
|
||||
gint *green,
|
||||
gint *blue,
|
||||
gint *failed);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_CC_H__ */
|
||||
1079
gdk/gdkcolor.c
1079
gdk/gdkcolor.c
File diff suppressed because it is too large
Load Diff
123
gdk/gdkcolor.h
123
gdk/gdkcolor.h
@@ -1,123 +0,0 @@
|
||||
#ifndef __GDK_COLOR_H__
|
||||
#define __GDK_COLOR_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* The color type.
|
||||
* A color consists of red, green and blue values in the
|
||||
* range 0-65535 and a pixel value. The pixel value is highly
|
||||
* dependent on the depth and colormap which this color will
|
||||
* be used to draw into. Therefore, sharing colors between
|
||||
* colormaps is a bad idea.
|
||||
*/
|
||||
struct _GdkColor
|
||||
{
|
||||
gulong pixel;
|
||||
gushort red;
|
||||
gushort green;
|
||||
gushort blue;
|
||||
};
|
||||
|
||||
/* The colormap type.
|
||||
*/
|
||||
|
||||
typedef struct _GdkColormapClass GdkColormapClass;
|
||||
|
||||
#define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
|
||||
#define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
|
||||
#define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
|
||||
#define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
|
||||
#define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
|
||||
#define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
|
||||
|
||||
|
||||
struct _GdkColormap
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
/*< public >*/
|
||||
gint size;
|
||||
GdkColor *colors;
|
||||
|
||||
/*< private >*/
|
||||
GdkVisual *visual;
|
||||
|
||||
gpointer windowing_data;
|
||||
};
|
||||
|
||||
struct _GdkColormapClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
};
|
||||
|
||||
GType gdk_colormap_get_type (void);
|
||||
|
||||
GdkColormap* gdk_colormap_new (GdkVisual *visual,
|
||||
gboolean allocate);
|
||||
GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
|
||||
void gdk_colormap_unref (GdkColormap *cmap);
|
||||
|
||||
GdkColormap* gdk_colormap_get_system (void);
|
||||
gint gdk_colormap_get_system_size (void);
|
||||
|
||||
void gdk_colormap_change (GdkColormap *colormap,
|
||||
gint ncolors);
|
||||
|
||||
|
||||
gint gdk_colormap_alloc_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors,
|
||||
gboolean writeable,
|
||||
gboolean best_match,
|
||||
gboolean *success);
|
||||
gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
|
||||
GdkColor *color,
|
||||
gboolean writeable,
|
||||
gboolean best_match);
|
||||
void gdk_colormap_free_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors);
|
||||
|
||||
GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
|
||||
|
||||
GdkColor *gdk_color_copy (const GdkColor *color);
|
||||
void gdk_color_free (GdkColor *color);
|
||||
gint gdk_color_parse (const gchar *spec,
|
||||
GdkColor *color);
|
||||
guint gdk_color_hash (const GdkColor *colora);
|
||||
gboolean gdk_color_equal (const GdkColor *colora,
|
||||
const GdkColor *colorb);
|
||||
|
||||
/* The following functions are deprecated */
|
||||
void gdk_colors_store (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors);
|
||||
gint gdk_colors_alloc (GdkColormap *colormap,
|
||||
gboolean contiguous,
|
||||
gulong *planes,
|
||||
gint nplanes,
|
||||
gulong *pixels,
|
||||
gint npixels);
|
||||
void gdk_colors_free (GdkColormap *colormap,
|
||||
gulong *pixels,
|
||||
gint npixels,
|
||||
gulong planes);
|
||||
gint gdk_color_white (GdkColormap *colormap,
|
||||
GdkColor *color);
|
||||
gint gdk_color_black (GdkColormap *colormap,
|
||||
GdkColor *color);
|
||||
gint gdk_color_alloc (GdkColormap *colormap,
|
||||
GdkColor *color);
|
||||
gint gdk_color_change (GdkColormap *colormap,
|
||||
GdkColor *color);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_COLOR_H__ */
|
||||
@@ -1,48 +0,0 @@
|
||||
#ifndef __GDK_COMPAT_H__
|
||||
#define __GDK_COMPAT_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* use -DGDK_DISABLE_COMPAT_H to compile your code and asure that it
|
||||
* works with future GTK+ versions as well.
|
||||
*/
|
||||
#ifndef GDK_DISABLE_COMPAT_H
|
||||
|
||||
#define gdk_draw_pixmap gdk_draw_drawable
|
||||
#define gdk_draw_bitmap gdk_draw_drawable
|
||||
|
||||
#define gdk_window_get_size gdk_drawable_get_size
|
||||
/* We can't really be compatible here, due to GObject */
|
||||
/* #define gdk_window_get_type gdk_drawable_get_type */
|
||||
#define gdk_window_get_colormap gdk_drawable_get_colormap
|
||||
#define gdk_window_set_colormap gdk_drawable_set_colormap
|
||||
#define gdk_window_get_visual gdk_drawable_get_visual
|
||||
|
||||
#define gdk_window_ref gdk_drawable_ref
|
||||
#define gdk_window_unref gdk_drawable_unref
|
||||
#define gdk_bitmap_ref gdk_drawable_ref
|
||||
#define gdk_bitmap_unref gdk_drawable_unref
|
||||
#define gdk_pixmap_ref gdk_drawable_ref
|
||||
#define gdk_pixmap_unref gdk_drawable_unref
|
||||
|
||||
#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \
|
||||
gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height)
|
||||
|
||||
#define gdk_gc_destroy gdk_gc_unref
|
||||
#define gdk_image_destroy gdk_image_unref
|
||||
#define gdk_cursor_destroy gdk_cursor_unref
|
||||
|
||||
|
||||
#define GDK_WINDOW_PIXMAP GDK_DRAWABLE_PIXMAP
|
||||
|
||||
#endif /* GDK_DISABLE_COMPAT_H */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_COMPAT_H__ */
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
/* Handcrafted for Win32 */
|
||||
|
||||
#define GDK_WINDOWING_WIN32
|
||||
#define GDK_HAVE_WCHAR_H 1
|
||||
#ifdef _MSC_VER
|
||||
#define GDK_HAVE_WCTYPE_H 1
|
||||
#endif
|
||||
#define GDK_USE_UTF8_MBS 1
|
||||
|
||||
@@ -24,29 +24,69 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "gdkcursor.h"
|
||||
#include "gdkinternals.h"
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/cursorfont.h>
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
|
||||
GdkCursor*
|
||||
gdk_cursor_ref (GdkCursor *cursor)
|
||||
gdk_cursor_new (GdkCursorType cursor_type)
|
||||
{
|
||||
g_return_val_if_fail (cursor != NULL, NULL);
|
||||
g_return_val_if_fail (cursor->ref_count > 0, NULL);
|
||||
GdkCursorPrivate *private;
|
||||
GdkCursor *cursor;
|
||||
Cursor xcursor;
|
||||
|
||||
cursor->ref_count += 1;
|
||||
xcursor = XCreateFontCursor (gdk_display, cursor_type);
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->xdisplay = gdk_display;
|
||||
private->xcursor = xcursor;
|
||||
cursor = (GdkCursor*) private;
|
||||
cursor->type = cursor_type;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
GdkCursor*
|
||||
gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, GdkColor *fg, GdkColor *bg, gint x, gint y)
|
||||
{
|
||||
GdkCursorPrivate *private;
|
||||
GdkCursor *cursor;
|
||||
Pixmap source_pixmap, mask_pixmap;
|
||||
Cursor xcursor;
|
||||
XColor xfg, xbg;
|
||||
|
||||
source_pixmap = ((GdkPixmapPrivate *) source)->xwindow;
|
||||
mask_pixmap = ((GdkPixmapPrivate *) mask)->xwindow;
|
||||
|
||||
xfg.pixel = fg->pixel;
|
||||
xfg.red = fg->red;
|
||||
xfg.blue = fg->blue;
|
||||
xfg.green = fg->green;
|
||||
xbg.pixel = bg->pixel;
|
||||
xbg.red = bg->red;
|
||||
xbg.blue = bg->blue;
|
||||
xbg.green = bg->green;
|
||||
|
||||
xcursor = XCreatePixmapCursor (gdk_display, source_pixmap, mask_pixmap, &xfg, &xbg, x, y);
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->xdisplay = gdk_display;
|
||||
private->xcursor = xcursor;
|
||||
cursor = (GdkCursor *) private;
|
||||
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_cursor_unref (GdkCursor *cursor)
|
||||
gdk_cursor_destroy (GdkCursor *cursor)
|
||||
{
|
||||
GdkCursorPrivate *private;
|
||||
|
||||
g_return_if_fail (cursor != NULL);
|
||||
g_return_if_fail (cursor->ref_count > 0);
|
||||
|
||||
cursor->ref_count -= 1;
|
||||
private = (GdkCursorPrivate *) cursor;
|
||||
XFreeCursor (private->xdisplay, private->xcursor);
|
||||
|
||||
if (cursor->ref_count == 0)
|
||||
_gdk_cursor_destroy (cursor);
|
||||
g_free (private);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#ifndef __GDK_CURSOR_H__
|
||||
#define __GDK_CURSOR_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Cursor types.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
#include <gdk/gdkcursors.h>
|
||||
GDK_LAST_CURSOR,
|
||||
GDK_CURSOR_IS_PIXMAP = -1
|
||||
} GdkCursorType;
|
||||
|
||||
struct _GdkCursor
|
||||
{
|
||||
GdkCursorType type;
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
/* Cursors
|
||||
*/
|
||||
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
|
||||
GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
||||
GdkPixmap *mask,
|
||||
GdkColor *fg,
|
||||
GdkColor *bg,
|
||||
gint x,
|
||||
gint y);
|
||||
GdkCursor* gdk_cursor_ref (GdkCursor *cursor);
|
||||
void gdk_cursor_unref (GdkCursor *cursor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_CURSOR_H__ */
|
||||
@@ -27,14 +27,11 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <string.h>
|
||||
#include "gdkx.h"
|
||||
#include "gdk/gdkprivate.h"
|
||||
#include "gdk.h"
|
||||
|
||||
#include "gdk.h" /* For gdk_flush() */
|
||||
#include "gdkdnd.h"
|
||||
#include "gdkproperty.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
|
||||
typedef struct _GdkDragContextPrivateData GdkDragContextPrivateData;
|
||||
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
|
||||
|
||||
typedef enum {
|
||||
GDK_DRAG_STATUS_DRAG,
|
||||
@@ -58,7 +55,7 @@ typedef struct {
|
||||
/* Structure that holds information about a drag in progress.
|
||||
* this is used on both source and destination sides.
|
||||
*/
|
||||
struct _GdkDragContextPrivateData {
|
||||
struct _GdkDragContextPrivate {
|
||||
GdkDragContext context;
|
||||
|
||||
GdkAtom motif_selection;
|
||||
@@ -82,8 +79,6 @@ struct _GdkDragContextPrivateData {
|
||||
GdkWindowCache *window_cache;
|
||||
};
|
||||
|
||||
#define PRIVATE_DATA(context) ((GdkDragContextPrivateData *) GDK_DRAG_CONTEXT (context)->windowing_data)
|
||||
|
||||
GdkDragContext *current_dest_drag = NULL;
|
||||
|
||||
/* Forward declarations */
|
||||
@@ -123,115 +118,66 @@ static void xdnd_manage_source_filter (GdkDragContext *context,
|
||||
GdkWindow *window,
|
||||
gboolean add_filter);
|
||||
|
||||
static void gdk_drag_context_init (GdkDragContext *dragcontext);
|
||||
static void gdk_drag_context_class_init (GdkDragContextClass *klass);
|
||||
static void gdk_drag_context_finalize (GObject *object);
|
||||
|
||||
static gpointer parent_class = NULL;
|
||||
static GList *contexts;
|
||||
|
||||
GType
|
||||
gdk_drag_context_get_type (void)
|
||||
{
|
||||
static GType object_type = 0;
|
||||
|
||||
if (!object_type)
|
||||
{
|
||||
static const GTypeInfo object_info =
|
||||
{
|
||||
sizeof (GdkDragContextClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gdk_drag_context_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GdkDragContext),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gdk_drag_context_init,
|
||||
};
|
||||
|
||||
object_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"GdkDragContext",
|
||||
&object_info);
|
||||
}
|
||||
|
||||
return object_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_drag_context_init (GdkDragContext *dragcontext)
|
||||
{
|
||||
GdkDragContextPrivateData *private;
|
||||
|
||||
private = g_new0 (GdkDragContextPrivateData, 1);
|
||||
|
||||
dragcontext->windowing_data = private;
|
||||
|
||||
contexts = g_list_prepend (contexts, dragcontext);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_drag_context_class_init (GdkDragContextClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gdk_drag_context_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_drag_context_finalize (GObject *object)
|
||||
{
|
||||
GdkDragContext *context = GDK_DRAG_CONTEXT (object);
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
|
||||
g_list_free (context->targets);
|
||||
|
||||
if (context->source_window)
|
||||
{
|
||||
if ((context->protocol == GDK_DRAG_PROTO_XDND) &&
|
||||
!context->is_source)
|
||||
xdnd_manage_source_filter (context, context->source_window, FALSE);
|
||||
|
||||
gdk_window_unref (context->source_window);
|
||||
}
|
||||
|
||||
if (context->dest_window)
|
||||
gdk_window_unref (context->dest_window);
|
||||
|
||||
if (private->window_cache)
|
||||
gdk_window_cache_destroy (private->window_cache);
|
||||
|
||||
contexts = g_list_remove (contexts, context);
|
||||
|
||||
g_free (private);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/* Drag Contexts */
|
||||
|
||||
static GList *contexts;
|
||||
|
||||
GdkDragContext *
|
||||
gdk_drag_context_new (void)
|
||||
{
|
||||
return GDK_DRAG_CONTEXT (g_type_create_instance (gdk_drag_context_get_type ()));
|
||||
GdkDragContextPrivate *result;
|
||||
|
||||
result = g_new0 (GdkDragContextPrivate, 1);
|
||||
|
||||
result->ref_count = 1;
|
||||
|
||||
contexts = g_list_prepend (contexts, result);
|
||||
|
||||
return (GdkDragContext *)result;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drag_context_ref (GdkDragContext *context)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
|
||||
g_return_if_fail (context != NULL);
|
||||
|
||||
g_object_ref (G_OBJECT (context));
|
||||
((GdkDragContextPrivate *)context)->ref_count++;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drag_context_unref (GdkDragContext *context)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
g_object_unref (G_OBJECT (context));
|
||||
g_return_if_fail (context != NULL);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count--;
|
||||
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
g_dataset_destroy (private);
|
||||
|
||||
g_list_free (context->targets);
|
||||
|
||||
if (context->source_window)
|
||||
{
|
||||
if ((context->protocol == GDK_DRAG_PROTO_XDND) &&
|
||||
!context->is_source)
|
||||
xdnd_manage_source_filter (context, context->source_window, FALSE);
|
||||
|
||||
gdk_window_unref (context->source_window);
|
||||
}
|
||||
|
||||
if (context->dest_window)
|
||||
gdk_window_unref (context->dest_window);
|
||||
|
||||
if (private->window_cache)
|
||||
gdk_window_cache_destroy (private->window_cache);
|
||||
|
||||
contexts = g_list_remove (contexts, private);
|
||||
g_free (private);
|
||||
}
|
||||
}
|
||||
|
||||
static GdkDragContext *
|
||||
@@ -241,23 +187,23 @@ gdk_drag_context_find (gboolean is_source,
|
||||
{
|
||||
GList *tmp_list = contexts;
|
||||
GdkDragContext *context;
|
||||
GdkDragContextPrivateData *private;
|
||||
GdkDragContextPrivate *private;
|
||||
Window context_dest_xid;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
context = (GdkDragContext *)tmp_list->data;
|
||||
private = PRIVATE_DATA (context);
|
||||
private = (GdkDragContextPrivate *)context;
|
||||
|
||||
context_dest_xid = context->dest_window ?
|
||||
(private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_DRAWABLE_XID (context->dest_window)) :
|
||||
(private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)) :
|
||||
None;
|
||||
|
||||
if ((!context->is_source == !is_source) &&
|
||||
((source_xid == None) || (context->source_window &&
|
||||
(GDK_DRAWABLE_XID (context->source_window) == source_xid))) &&
|
||||
(GDK_WINDOW_XWINDOW (context->source_window) == source_xid))) &&
|
||||
((dest_xid == None) || (context_dest_xid == dest_xid)))
|
||||
return context;
|
||||
|
||||
@@ -423,7 +369,7 @@ gdk_window_cache_new (void)
|
||||
result->old_event_mask = xwa.your_event_mask;
|
||||
XSelectInput (gdk_display, gdk_root_window,
|
||||
result->old_event_mask | SubstructureNotifyMask);
|
||||
gdk_window_add_filter (gdk_parent_root,
|
||||
gdk_window_add_filter ((GdkWindow *)&gdk_root_parent,
|
||||
gdk_window_cache_filter, result);
|
||||
|
||||
gdk_error_code = 0;
|
||||
@@ -462,7 +408,7 @@ static void
|
||||
gdk_window_cache_destroy (GdkWindowCache *cache)
|
||||
{
|
||||
XSelectInput (gdk_display, gdk_root_window, cache->old_event_mask);
|
||||
gdk_window_remove_filter (gdk_parent_root,
|
||||
gdk_window_remove_filter ((GdkWindow *)&gdk_root_parent,
|
||||
gdk_window_cache_filter, cache);
|
||||
|
||||
g_list_foreach (cache->children, (GFunc)g_free, NULL);
|
||||
@@ -1301,7 +1247,7 @@ motif_dnd_get_flags (GdkDragContext *context)
|
||||
static void
|
||||
motif_set_targets (GdkDragContext *context)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
MotifDragInitiatorInfo info;
|
||||
gint i;
|
||||
static GdkAtom motif_drag_initiator_info = GDK_NONE;
|
||||
@@ -1326,8 +1272,8 @@ motif_set_targets (GdkDragContext *context)
|
||||
|
||||
info.selection_atom = private->motif_selection;
|
||||
|
||||
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
|
||||
GDK_DRAWABLE_XID (context->source_window),
|
||||
XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
|
||||
GDK_WINDOW_XWINDOW (context->source_window),
|
||||
private->motif_selection,
|
||||
motif_drag_initiator_info, 8, PropModeReplace,
|
||||
(guchar *)&info, sizeof (info));
|
||||
@@ -1385,29 +1331,29 @@ motif_send_enter (GdkDragContext *context,
|
||||
guint32 time)
|
||||
{
|
||||
XEvent xev;
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
|
||||
xev.xclient.format = 8;
|
||||
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
|
||||
MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_ENTER;
|
||||
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
|
||||
MOTIF_XCLIENT_SHORT (&xev, 1) = 0;
|
||||
MOTIF_XCLIENT_LONG (&xev, 1) = time;
|
||||
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_DRAWABLE_XID (context->source_window);
|
||||
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
|
||||
if (!private->motif_targets_set)
|
||||
motif_set_targets (context);
|
||||
|
||||
MOTIF_XCLIENT_LONG (&xev, 3) = private->motif_selection;
|
||||
|
||||
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
|
||||
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->dest_window)));
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1419,20 +1365,20 @@ motif_send_leave (GdkDragContext *context,
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
|
||||
xev.xclient.format = 8;
|
||||
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
|
||||
MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_LEAVE;
|
||||
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
|
||||
MOTIF_XCLIENT_SHORT (&xev, 1) = 0;
|
||||
MOTIF_XCLIENT_LONG (&xev, 1) = time;
|
||||
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_DRAWABLE_XID (context->source_window);
|
||||
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
MOTIF_XCLIENT_LONG (&xev, 3) = 0;
|
||||
|
||||
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
|
||||
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->dest_window)));
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1444,12 +1390,12 @@ motif_send_motion (GdkDragContext *context,
|
||||
{
|
||||
gboolean retval;
|
||||
XEvent xev;
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
|
||||
xev.xclient.format = 8;
|
||||
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
|
||||
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
|
||||
MOTIF_XCLIENT_SHORT (&xev, 1) = motif_dnd_get_flags (context);
|
||||
@@ -1474,11 +1420,11 @@ motif_send_motion (GdkDragContext *context,
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
|
||||
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->dest_window)));
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)));
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -1487,12 +1433,12 @@ static void
|
||||
motif_send_drop (GdkDragContext *context, guint32 time)
|
||||
{
|
||||
XEvent xev;
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
|
||||
xev.xclient.format = 8;
|
||||
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
|
||||
MOTIF_XCLIENT_BYTE (&xev, 0) = XmDROP_START;
|
||||
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
|
||||
@@ -1503,13 +1449,13 @@ motif_send_drop (GdkDragContext *context, guint32 time)
|
||||
MOTIF_XCLIENT_SHORT (&xev, 5) = private->last_y;
|
||||
|
||||
MOTIF_XCLIENT_LONG (&xev, 3) = private->motif_selection;
|
||||
MOTIF_XCLIENT_LONG (&xev, 4) = GDK_DRAWABLE_XID (context->source_window);
|
||||
MOTIF_XCLIENT_LONG (&xev, 4) = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
|
||||
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
|
||||
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->dest_window)));
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)));
|
||||
}
|
||||
|
||||
/* Target Side */
|
||||
@@ -1588,7 +1534,7 @@ motif_drag_context_new (GdkWindow *dest_window,
|
||||
guint32 atom)
|
||||
{
|
||||
GdkDragContext *new_context;
|
||||
GdkDragContextPrivateData *private;
|
||||
GdkDragContextPrivate *private;
|
||||
|
||||
/* FIXME, current_dest_drag really shouldn't be NULL'd
|
||||
* if we error below.
|
||||
@@ -1605,7 +1551,7 @@ motif_drag_context_new (GdkWindow *dest_window,
|
||||
}
|
||||
|
||||
new_context = gdk_drag_context_new ();
|
||||
private = PRIVATE_DATA (new_context);
|
||||
private = (GdkDragContextPrivate *)new_context;
|
||||
|
||||
new_context->protocol = GDK_DRAG_PROTO_MOTIF;
|
||||
new_context->is_source = FALSE;
|
||||
@@ -1702,7 +1648,7 @@ motif_motion (GdkEvent *event,
|
||||
gint16 x_root,
|
||||
gint16 y_root)
|
||||
{
|
||||
GdkDragContextPrivateData *private;
|
||||
GdkDragContextPrivate *private;
|
||||
|
||||
GDK_NOTE(DND, g_message ("Motif DND motion: flags: %#4x time: %d (%d, %d)",
|
||||
flags, timestamp, x_root, y_root));
|
||||
@@ -1711,7 +1657,7 @@ motif_motion (GdkEvent *event,
|
||||
(current_dest_drag->protocol == GDK_DRAG_PROTO_MOTIF) &&
|
||||
(timestamp >= current_dest_drag->start_time))
|
||||
{
|
||||
private = PRIVATE_DATA (current_dest_drag);
|
||||
private = (GdkDragContextPrivate *)current_dest_drag;
|
||||
|
||||
event->dnd.type = GDK_DRAG_MOTION;
|
||||
event->dnd.context = current_dest_drag;
|
||||
@@ -1740,7 +1686,7 @@ motif_operation_changed (GdkEvent *event,
|
||||
guint16 flags,
|
||||
guint32 timestamp)
|
||||
{
|
||||
GdkDragContextPrivateData *private;
|
||||
GdkDragContextPrivate *private;
|
||||
|
||||
GDK_NOTE(DND, g_message ("Motif DND operation changed: flags: %#4x time: %d",
|
||||
flags, timestamp));
|
||||
@@ -1755,7 +1701,7 @@ motif_operation_changed (GdkEvent *event,
|
||||
gdk_drag_context_ref (current_dest_drag);
|
||||
|
||||
event->dnd.time = timestamp;
|
||||
private = PRIVATE_DATA (current_dest_drag);
|
||||
private = (GdkDragContextPrivate *)current_dest_drag;
|
||||
|
||||
motif_dnd_translate_flags (current_dest_drag, flags);
|
||||
|
||||
@@ -1814,12 +1760,12 @@ motif_drag_status (GdkEvent *event,
|
||||
g_message ("Motif status message: flags %x", flags));
|
||||
|
||||
context = gdk_drag_context_find (TRUE,
|
||||
GDK_DRAWABLE_XID (event->any.window),
|
||||
GDK_WINDOW_XWINDOW (event->any.window),
|
||||
None);
|
||||
|
||||
if (context)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
if ((private->drag_status == GDK_DRAG_STATUS_MOTION_WAIT) ||
|
||||
(private->drag_status == GDK_DRAG_STATUS_ACTION_WAIT))
|
||||
private->drag_status = GDK_DRAG_STATUS_DRAG;
|
||||
@@ -2018,7 +1964,7 @@ xdnd_status_filter (GdkXEvent *xev,
|
||||
context = gdk_drag_context_find (TRUE, xevent->xclient.window, dest_window);
|
||||
if (context)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
if (private->drag_status == GDK_DRAG_STATUS_MOTION_WAIT)
|
||||
private->drag_status = GDK_DRAG_STATUS_DRAG;
|
||||
|
||||
@@ -2071,7 +2017,7 @@ xdnd_finished_filter (GdkXEvent *xev,
|
||||
static void
|
||||
xdnd_set_targets (GdkDragContext *context)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
GdkAtom *atomlist;
|
||||
GList *tmp_list = context->targets;
|
||||
gint i;
|
||||
@@ -2086,8 +2032,8 @@ xdnd_set_targets (GdkDragContext *context)
|
||||
i++;
|
||||
}
|
||||
|
||||
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
|
||||
GDK_DRAWABLE_XID (context->source_window),
|
||||
XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
|
||||
GDK_WINDOW_XWINDOW (context->source_window),
|
||||
gdk_atom_intern ("XdndTypeList", FALSE),
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(guchar *)atomlist, n_atoms);
|
||||
@@ -2100,7 +2046,7 @@ xdnd_set_targets (GdkDragContext *context)
|
||||
static void
|
||||
xdnd_set_actions (GdkDragContext *context)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
GdkAtom *atomlist;
|
||||
gint i;
|
||||
gint n_atoms;
|
||||
@@ -2134,8 +2080,8 @@ xdnd_set_actions (GdkDragContext *context)
|
||||
}
|
||||
}
|
||||
|
||||
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
|
||||
GDK_DRAWABLE_XID (context->source_window),
|
||||
XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
|
||||
GDK_WINDOW_XWINDOW (context->source_window),
|
||||
gdk_atom_intern ("XdndActionList", FALSE),
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(guchar *)atomlist, n_atoms);
|
||||
@@ -2170,15 +2116,15 @@ static void
|
||||
xdnd_send_enter (GdkDragContext *context)
|
||||
{
|
||||
XEvent xev;
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
xev.xclient.data.l[1] = (3 << 24); /* version */
|
||||
xev.xclient.data.l[2] = 0;
|
||||
xev.xclient.data.l[3] = 0;
|
||||
@@ -2206,12 +2152,12 @@ xdnd_send_enter (GdkDragContext *context)
|
||||
}
|
||||
}
|
||||
|
||||
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
|
||||
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
|
||||
FALSE, &xev))
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->dest_window)));
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)));
|
||||
gdk_window_unref (context->dest_window);
|
||||
context->dest_window = NULL;
|
||||
}
|
||||
@@ -2222,26 +2168,26 @@ xdnd_send_leave (GdkDragContext *context)
|
||||
{
|
||||
XEvent xev;
|
||||
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = 0;
|
||||
xev.xclient.data.l[3] = 0;
|
||||
xev.xclient.data.l[4] = 0;
|
||||
|
||||
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
|
||||
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
|
||||
FALSE, &xev))
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->dest_window)));
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)));
|
||||
gdk_window_unref (context->dest_window);
|
||||
context->dest_window = NULL;
|
||||
}
|
||||
@@ -2250,7 +2196,7 @@ xdnd_send_leave (GdkDragContext *context)
|
||||
static void
|
||||
xdnd_send_drop (GdkDragContext *context, guint32 time)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
XEvent xev;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
@@ -2258,19 +2204,19 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = time;
|
||||
xev.xclient.data.l[3] = 0;
|
||||
xev.xclient.data.l[4] = 0;
|
||||
|
||||
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
|
||||
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
|
||||
FALSE, &xev))
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->dest_window)));
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)));
|
||||
gdk_window_unref (context->dest_window);
|
||||
context->dest_window = NULL;
|
||||
}
|
||||
@@ -2283,7 +2229,7 @@ xdnd_send_motion (GdkDragContext *context,
|
||||
GdkDragAction action,
|
||||
guint32 time)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
XEvent xev;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
@@ -2291,19 +2237,19 @@ xdnd_send_motion (GdkDragContext *context,
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = (x_root << 16) | y_root;
|
||||
xev.xclient.data.l[3] = time;
|
||||
xev.xclient.data.l[4] = xdnd_action_to_atom (action);
|
||||
|
||||
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
|
||||
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
|
||||
FALSE, &xev))
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->dest_window)));
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)));
|
||||
gdk_window_unref (context->dest_window);
|
||||
context->dest_window = NULL;
|
||||
}
|
||||
@@ -2403,8 +2349,8 @@ xdnd_read_actions (GdkDragContext *context)
|
||||
|
||||
/* Get the XdndActionList, if set */
|
||||
|
||||
XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
|
||||
GDK_DRAWABLE_XID (context->source_window),
|
||||
XGetWindowProperty (GDK_WINDOW_XDISPLAY (context->source_window),
|
||||
GDK_WINDOW_XWINDOW (context->source_window),
|
||||
gdk_atom_intern ("XdndActionList", FALSE), 0, 65536,
|
||||
False, XA_ATOM, &type, &format, &nitems,
|
||||
&after, (guchar **)&data);
|
||||
@@ -2416,7 +2362,7 @@ xdnd_read_actions (GdkDragContext *context)
|
||||
for (i=0; i<nitems; i++)
|
||||
context->actions |= xdnd_action_from_atom (data[i]);
|
||||
|
||||
(PRIVATE_DATA (context))->xdnd_have_actions = TRUE;
|
||||
((GdkDragContextPrivate *)context)->xdnd_have_actions = TRUE;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (gdk_debug_flags & GDK_DEBUG_DND)
|
||||
@@ -2474,10 +2420,17 @@ xdnd_manage_source_filter (GdkDragContext *context,
|
||||
gboolean add_filter)
|
||||
{
|
||||
gint old_warnings = 0; /* quiet gcc */
|
||||
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
|
||||
|
||||
gboolean is_foreign = (private->window_type == GDK_WINDOW_FOREIGN);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
if (is_foreign)
|
||||
{
|
||||
old_warnings = gdk_error_warnings;
|
||||
gdk_error_warnings = 0;
|
||||
}
|
||||
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
if (!private->destroyed)
|
||||
{
|
||||
if (add_filter)
|
||||
{
|
||||
@@ -2499,8 +2452,11 @@ xdnd_manage_source_filter (GdkDragContext *context,
|
||||
}
|
||||
}
|
||||
|
||||
gdk_flush ();
|
||||
gdk_error_trap_pop ();
|
||||
if (is_foreign)
|
||||
{
|
||||
gdk_flush();
|
||||
gdk_error_warnings = old_warnings;
|
||||
}
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
@@ -2561,7 +2517,7 @@ xdnd_enter_filter (GdkXEvent *xev,
|
||||
if (get_types)
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (event->any.window),
|
||||
XGetWindowProperty (GDK_WINDOW_XDISPLAY (event->any.window),
|
||||
source_window,
|
||||
gdk_atom_intern ("XdndTypeList", FALSE), 0, 65536,
|
||||
False, XA_ATOM, &type, &format, &nitems,
|
||||
@@ -2600,7 +2556,7 @@ xdnd_enter_filter (GdkXEvent *xev,
|
||||
gdk_drag_context_ref (new_context);
|
||||
|
||||
current_dest_drag = new_context;
|
||||
(PRIVATE_DATA (new_context))->xdnd_selection =
|
||||
((GdkDragContextPrivate *)new_context)->xdnd_selection =
|
||||
gdk_atom_intern ("XdndSelection", FALSE);
|
||||
|
||||
return GDK_FILTER_TRANSLATE;
|
||||
@@ -2620,7 +2576,7 @@ xdnd_leave_filter (GdkXEvent *xev,
|
||||
|
||||
if ((current_dest_drag != NULL) &&
|
||||
(current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
|
||||
(GDK_DRAWABLE_XID (current_dest_drag->source_window) == source_window))
|
||||
(GDK_WINDOW_XWINDOW (current_dest_drag->source_window) == source_window))
|
||||
{
|
||||
event->dnd.type = GDK_DRAG_LEAVE;
|
||||
/* Pass ownership of context to the event */
|
||||
@@ -2653,7 +2609,7 @@ xdnd_position_filter (GdkXEvent *xev,
|
||||
|
||||
if ((current_dest_drag != NULL) &&
|
||||
(current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
|
||||
(GDK_DRAWABLE_XID (current_dest_drag->source_window) == source_window))
|
||||
(GDK_WINDOW_XWINDOW (current_dest_drag->source_window) == source_window))
|
||||
{
|
||||
event->dnd.type = GDK_DRAG_MOTION;
|
||||
event->dnd.context = current_dest_drag;
|
||||
@@ -2662,14 +2618,14 @@ xdnd_position_filter (GdkXEvent *xev,
|
||||
event->dnd.time = time;
|
||||
|
||||
current_dest_drag->suggested_action = xdnd_action_from_atom (action);
|
||||
if (!(PRIVATE_DATA (current_dest_drag))->xdnd_have_actions)
|
||||
if (!((GdkDragContextPrivate *)current_dest_drag)->xdnd_have_actions)
|
||||
current_dest_drag->actions = current_dest_drag->suggested_action;
|
||||
|
||||
event->dnd.x_root = x_root;
|
||||
event->dnd.y_root = y_root;
|
||||
|
||||
(PRIVATE_DATA (current_dest_drag))->last_x = x_root;
|
||||
(PRIVATE_DATA (current_dest_drag))->last_y = y_root;
|
||||
((GdkDragContextPrivate *)current_dest_drag)->last_x = x_root;
|
||||
((GdkDragContextPrivate *)current_dest_drag)->last_y = y_root;
|
||||
|
||||
return GDK_FILTER_TRANSLATE;
|
||||
}
|
||||
@@ -2692,10 +2648,10 @@ xdnd_drop_filter (GdkXEvent *xev,
|
||||
|
||||
if ((current_dest_drag != NULL) &&
|
||||
(current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
|
||||
(GDK_DRAWABLE_XID (current_dest_drag->source_window) == source_window))
|
||||
(GDK_WINDOW_XWINDOW (current_dest_drag->source_window) == source_window))
|
||||
{
|
||||
GdkDragContextPrivateData *private;
|
||||
private = PRIVATE_DATA (current_dest_drag);
|
||||
GdkDragContextPrivate *private;
|
||||
private = (GdkDragContextPrivate *)current_dest_drag;
|
||||
|
||||
event->dnd.type = GDK_DROP_START;
|
||||
|
||||
@@ -2885,7 +2841,7 @@ gdk_drag_find_window (GdkDragContext *context,
|
||||
GdkWindow **dest_window,
|
||||
GdkDragProtocol *protocol)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
Window dest;
|
||||
|
||||
g_return_if_fail (context != NULL);
|
||||
@@ -2895,7 +2851,7 @@ gdk_drag_find_window (GdkDragContext *context,
|
||||
|
||||
dest = get_client_window_at_coords (private->window_cache,
|
||||
drag_window ?
|
||||
GDK_DRAWABLE_XID (drag_window) : GDK_NONE,
|
||||
GDK_WINDOW_XWINDOW (drag_window) : GDK_NONE,
|
||||
x_root, y_root);
|
||||
|
||||
if (private->dest_xid != dest)
|
||||
@@ -2941,7 +2897,7 @@ gdk_drag_motion (GdkDragContext *context,
|
||||
GdkDragAction possible_actions,
|
||||
guint32 time)
|
||||
{
|
||||
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
g_return_val_if_fail (context != NULL, FALSE);
|
||||
|
||||
@@ -3115,12 +3071,12 @@ gdk_drag_status (GdkDragContext *context,
|
||||
GdkDragAction action,
|
||||
guint32 time)
|
||||
{
|
||||
GdkDragContextPrivateData *private;
|
||||
GdkDragContextPrivate *private;
|
||||
XEvent xev;
|
||||
|
||||
g_return_if_fail (context != NULL);
|
||||
|
||||
private = PRIVATE_DATA (context);
|
||||
private = (GdkDragContextPrivate *)context;
|
||||
|
||||
context->action = action;
|
||||
|
||||
@@ -3129,7 +3085,7 @@ gdk_drag_status (GdkDragContext *context,
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
|
||||
xev.xclient.format = 8;
|
||||
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
|
||||
if (private->drag_status == GDK_DRAG_STATUS_ACTION_WAIT)
|
||||
{
|
||||
@@ -3175,30 +3131,30 @@ gdk_drag_status (GdkDragContext *context,
|
||||
MOTIF_XCLIENT_SHORT (&xev, 4) = private->last_x;
|
||||
MOTIF_XCLIENT_SHORT (&xev, 5) = private->last_y;
|
||||
|
||||
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->source_window),
|
||||
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->source_window)));
|
||||
GDK_WINDOW_XWINDOW (context->source_window)));
|
||||
}
|
||||
else if (context->protocol == GDK_DRAG_PROTO_XDND)
|
||||
{
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndStatus", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
|
||||
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
xev.xclient.data.l[1] = (action != 0) ? (2 | 1) : 0;
|
||||
xev.xclient.data.l[2] = 0;
|
||||
xev.xclient.data.l[3] = 0;
|
||||
xev.xclient.data.l[4] = xdnd_action_to_atom (action);
|
||||
|
||||
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->source_window),
|
||||
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
|
||||
FALSE, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->source_window)));
|
||||
GDK_WINDOW_XWINDOW (context->source_window)));
|
||||
}
|
||||
|
||||
private->old_action = action;
|
||||
@@ -3209,11 +3165,11 @@ gdk_drop_reply (GdkDragContext *context,
|
||||
gboolean ok,
|
||||
guint32 time)
|
||||
{
|
||||
GdkDragContextPrivateData *private;
|
||||
GdkDragContextPrivate *private;
|
||||
|
||||
g_return_if_fail (context != NULL);
|
||||
|
||||
private = PRIVATE_DATA (context);
|
||||
private = (GdkDragContextPrivate *)context;
|
||||
|
||||
if (context->protocol == GDK_DRAG_PROTO_MOTIF)
|
||||
{
|
||||
@@ -3238,7 +3194,7 @@ gdk_drop_reply (GdkDragContext *context,
|
||||
MOTIF_XCLIENT_SHORT (&xev, 2) = private->last_x;
|
||||
MOTIF_XCLIENT_SHORT (&xev, 3) = private->last_y;
|
||||
|
||||
gdk_send_xevent (GDK_DRAWABLE_XID (context->source_window),
|
||||
gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
|
||||
FALSE, 0, &xev);
|
||||
}
|
||||
}
|
||||
@@ -3257,19 +3213,19 @@ gdk_drop_finish (GdkDragContext *context,
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndFinished", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
|
||||
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->dest_window);
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = 0;
|
||||
xev.xclient.data.l[3] = 0;
|
||||
xev.xclient.data.l[4] = 0;
|
||||
|
||||
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->source_window),
|
||||
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
|
||||
FALSE, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_DRAWABLE_XID (context->source_window)));
|
||||
GDK_WINDOW_XWINDOW (context->source_window)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3282,11 +3238,6 @@ gdk_window_register_dnd (GdkWindow *window)
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
if (GPOINTER_TO_INT (gdk_drawable_get_data (window, "gdk-dnd-registered")))
|
||||
return;
|
||||
else
|
||||
gdk_drawable_set_data (window, "gdk-dnd-registered", GINT_TO_POINTER(TRUE), NULL);
|
||||
|
||||
/* Set Motif drag receiver information property */
|
||||
|
||||
if (!motif_drag_receiver_info_atom)
|
||||
@@ -3299,7 +3250,7 @@ gdk_window_register_dnd (GdkWindow *window)
|
||||
info.num_drop_sites = 0;
|
||||
info.total_size = sizeof(info);
|
||||
|
||||
XChangeProperty (gdk_display, GDK_DRAWABLE_XID (window),
|
||||
XChangeProperty (gdk_display, GDK_WINDOW_XWINDOW (window),
|
||||
motif_drag_receiver_info_atom,
|
||||
motif_drag_receiver_info_atom,
|
||||
8, PropModeReplace,
|
||||
@@ -3312,8 +3263,8 @@ gdk_window_register_dnd (GdkWindow *window)
|
||||
xdnd_aware_atom = gdk_atom_intern ("XdndAware", FALSE);
|
||||
|
||||
/* The property needs to be of type XA_ATOM, not XA_INTEGER. Blech */
|
||||
XChangeProperty (GDK_DRAWABLE_XDISPLAY (window),
|
||||
GDK_DRAWABLE_XID (window),
|
||||
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
|
||||
GDK_WINDOW_XWINDOW (window),
|
||||
xdnd_aware_atom, XA_ATOM,
|
||||
32, PropModeReplace,
|
||||
(guchar *)&xdnd_version, 1);
|
||||
@@ -3333,9 +3284,9 @@ gdk_drag_get_selection (GdkDragContext *context)
|
||||
g_return_val_if_fail (context != NULL, GDK_NONE);
|
||||
|
||||
if (context->protocol == GDK_DRAG_PROTO_MOTIF)
|
||||
return (PRIVATE_DATA (context))->motif_selection;
|
||||
return ((GdkDragContextPrivate *)context)->motif_selection;
|
||||
else if (context->protocol == GDK_DRAG_PROTO_XDND)
|
||||
return (PRIVATE_DATA (context))->xdnd_selection;
|
||||
return ((GdkDragContextPrivate *)context)->xdnd_selection;
|
||||
else
|
||||
return GDK_NONE;
|
||||
}
|
||||
125
gdk/gdkdnd.h
125
gdk/gdkdnd.h
@@ -1,125 +0,0 @@
|
||||
#ifndef __GDK_DND_H__
|
||||
#define __GDK_DND_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _GdkDragContext GdkDragContext;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_ACTION_DEFAULT = 1 << 0,
|
||||
GDK_ACTION_COPY = 1 << 1,
|
||||
GDK_ACTION_MOVE = 1 << 2,
|
||||
GDK_ACTION_LINK = 1 << 3,
|
||||
GDK_ACTION_PRIVATE = 1 << 4,
|
||||
GDK_ACTION_ASK = 1 << 5
|
||||
} GdkDragAction;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_DRAG_PROTO_MOTIF,
|
||||
GDK_DRAG_PROTO_XDND,
|
||||
GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming
|
||||
* drags */
|
||||
GDK_DRAG_PROTO_NONE, /* Not a valid drag window */
|
||||
GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
|
||||
GDK_DRAG_PROTO_OLE2 /* The complex OLE2 dnd (not implemented) */
|
||||
} GdkDragProtocol;
|
||||
|
||||
/* Object that holds information about a drag in progress.
|
||||
* this is used on both source and destination sides.
|
||||
*/
|
||||
|
||||
typedef struct _GdkDragContextClass GdkDragContextClass;
|
||||
|
||||
#define GDK_TYPE_DRAG_CONTEXT (gdk_drag_context_get_type ())
|
||||
#define GDK_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG_CONTEXT, GdkDragContext))
|
||||
#define GDK_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
|
||||
#define GDK_IS_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAG_CONTEXT))
|
||||
#define GDK_IS_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
|
||||
#define GDK_DRAG_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
|
||||
|
||||
struct _GdkDragContext {
|
||||
GObject parent_instance;
|
||||
|
||||
/*< public >*/
|
||||
|
||||
GdkDragProtocol protocol;
|
||||
|
||||
gboolean is_source;
|
||||
|
||||
GdkWindow *source_window;
|
||||
GdkWindow *dest_window;
|
||||
|
||||
GList *targets;
|
||||
GdkDragAction actions;
|
||||
GdkDragAction suggested_action;
|
||||
GdkDragAction action;
|
||||
|
||||
guint32 start_time;
|
||||
|
||||
/*< private >*/
|
||||
|
||||
gpointer windowing_data;
|
||||
};
|
||||
|
||||
struct _GdkDragContextClass {
|
||||
GObjectClass parent_class;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/* Drag and Drop */
|
||||
|
||||
GType gdk_drag_context_get_type (void);
|
||||
GdkDragContext * gdk_drag_context_new (void);
|
||||
void gdk_drag_context_ref (GdkDragContext *context);
|
||||
void gdk_drag_context_unref (GdkDragContext *context);
|
||||
|
||||
/* Destination side */
|
||||
|
||||
void gdk_drag_status (GdkDragContext *context,
|
||||
GdkDragAction action,
|
||||
guint32 time);
|
||||
void gdk_drop_reply (GdkDragContext *context,
|
||||
gboolean ok,
|
||||
guint32 time);
|
||||
void gdk_drop_finish (GdkDragContext *context,
|
||||
gboolean success,
|
||||
guint32 time);
|
||||
GdkAtom gdk_drag_get_selection (GdkDragContext *context);
|
||||
|
||||
/* Source side */
|
||||
|
||||
GdkDragContext * gdk_drag_begin (GdkWindow *window,
|
||||
GList *targets);
|
||||
guint32 gdk_drag_get_protocol (guint32 xid,
|
||||
GdkDragProtocol *protocol);
|
||||
void gdk_drag_find_window (GdkDragContext *context,
|
||||
GdkWindow *drag_window,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkWindow **dest_window,
|
||||
GdkDragProtocol *protocol);
|
||||
gboolean gdk_drag_motion (GdkDragContext *context,
|
||||
GdkWindow *dest_window,
|
||||
GdkDragProtocol protocol,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkDragAction suggested_action,
|
||||
GdkDragAction possible_actions,
|
||||
guint32 time);
|
||||
void gdk_drag_drop (GdkDragContext *context,
|
||||
guint32 time);
|
||||
void gdk_drag_abort (GdkDragContext *context,
|
||||
guint32 time);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif __GDK_DND_H__
|
||||
571
gdk/gdkdraw.c
571
gdk/gdkdraw.c
@@ -24,171 +24,31 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "gdkdrawable.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkwindow.h"
|
||||
|
||||
static void gdk_drawable_init (GdkDrawable *drawable);
|
||||
static void gdk_drawable_class_init (GdkDrawableClass *klass);
|
||||
static void gdk_drawable_finalize (GObject *object);
|
||||
|
||||
static gpointer parent_class = NULL;
|
||||
|
||||
GType
|
||||
gdk_drawable_get_type (void)
|
||||
{
|
||||
static GType object_type = 0;
|
||||
|
||||
if (!object_type)
|
||||
{
|
||||
static const GTypeInfo object_info =
|
||||
{
|
||||
sizeof (GdkDrawableClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gdk_drawable_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GdkDrawable),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gdk_drawable_init,
|
||||
};
|
||||
|
||||
object_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"GdkDrawable",
|
||||
&object_info);
|
||||
}
|
||||
|
||||
return object_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_drawable_init (GdkDrawable *drawable)
|
||||
{
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xos.h>
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_drawable_class_init (GdkDrawableClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gdk_drawable_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_drawable_finalize (GObject *object)
|
||||
{
|
||||
GdkDrawable *drawable = GDK_DRAWABLE (object);
|
||||
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/* Manipulation of drawables
|
||||
*/
|
||||
|
||||
void
|
||||
gdk_drawable_set_data (GdkDrawable *drawable,
|
||||
const gchar *key,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy_func)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
|
||||
g_object_set_qdata_full (G_OBJECT (drawable),
|
||||
g_quark_from_string (key),
|
||||
data,
|
||||
destroy_func);
|
||||
}
|
||||
|
||||
gpointer
|
||||
gdk_drawable_get_data (GdkDrawable *drawable,
|
||||
const gchar *key)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
|
||||
|
||||
return g_object_get_qdata (G_OBJECT (drawable),
|
||||
g_quark_try_string (key));
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drawable_get_size (GdkDrawable *drawable,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
gdk_drawable_get_visual (GdkDrawable *drawable)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
|
||||
|
||||
return GDK_DRAWABLE_GET_CLASS (drawable)->get_visual (drawable);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_drawable_get_depth (GdkDrawable *drawable)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), 0);
|
||||
|
||||
return GDK_DRAWABLE_GET_CLASS (drawable)->get_depth (drawable);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drawable_set_colormap (GdkDrawable *drawable,
|
||||
GdkColormap *cmap)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->set_colormap (drawable, cmap);
|
||||
}
|
||||
|
||||
GdkColormap*
|
||||
gdk_drawable_get_colormap (GdkDrawable *drawable)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
|
||||
|
||||
return GDK_DRAWABLE_GET_CLASS (drawable)->get_colormap (drawable);
|
||||
}
|
||||
|
||||
GdkDrawable*
|
||||
gdk_drawable_ref (GdkDrawable *drawable)
|
||||
{
|
||||
return (GdkDrawable *) g_object_ref (G_OBJECT (drawable));
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drawable_unref (GdkDrawable *drawable)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
|
||||
g_object_unref (G_OBJECT (drawable));
|
||||
}
|
||||
|
||||
/* Drawing
|
||||
*/
|
||||
void
|
||||
gdk_draw_point (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GdkPoint point;
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
point.x = x;
|
||||
point.y = y;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, &point, 1);
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawPoint (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -199,16 +59,19 @@ gdk_draw_line (GdkDrawable *drawable,
|
||||
gint x2,
|
||||
gint y2)
|
||||
{
|
||||
GdkSegment segment;
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
segment.x1 = x1;
|
||||
segment.y1 = y1;
|
||||
segment.x2 = x2;
|
||||
segment.y2 = y2;
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, &segment, 1);
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawLine (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -219,25 +82,29 @@ gdk_draw_rectangle (GdkDrawable *drawable,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
{
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
if (width < 0 || height < 0)
|
||||
{
|
||||
gint real_width;
|
||||
gint real_height;
|
||||
|
||||
gdk_drawable_get_size (drawable, &real_width, &real_height);
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
if (width < 0)
|
||||
width = real_width;
|
||||
if (height < 0)
|
||||
height = real_height;
|
||||
}
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_rectangle (drawable, gc, filled, x, y,
|
||||
width, height);
|
||||
if (width == -1)
|
||||
width = drawable_private->width;
|
||||
if (height == -1)
|
||||
height = drawable_private->height;
|
||||
|
||||
if (filled)
|
||||
XFillRectangle (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, width, height);
|
||||
else
|
||||
XDrawRectangle (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -250,25 +117,29 @@ gdk_draw_arc (GdkDrawable *drawable,
|
||||
gint height,
|
||||
gint angle1,
|
||||
gint angle2)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
{
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
if (width < 0 || height < 0)
|
||||
{
|
||||
gint real_width;
|
||||
gint real_height;
|
||||
|
||||
gdk_drawable_get_size (drawable, &real_width, &real_height);
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
if (width < 0)
|
||||
width = real_width;
|
||||
if (height < 0)
|
||||
height = real_height;
|
||||
}
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_arc (drawable, gc, filled,
|
||||
x, y, width, height, angle1, angle2);
|
||||
if (width == -1)
|
||||
width = drawable_private->width;
|
||||
if (height == -1)
|
||||
height = drawable_private->height;
|
||||
|
||||
if (filled)
|
||||
XFillArc (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, width, height, angle1, angle2);
|
||||
else
|
||||
XDrawArc (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, width, height, angle1, angle2);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -278,11 +149,46 @@ gdk_draw_polygon (GdkDrawable *drawable,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
GdkPoint *local_points = points;
|
||||
gint local_npoints = npoints;
|
||||
gint local_alloc = 0;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_polygon (drawable, gc, filled,
|
||||
points, npoints);
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (filled)
|
||||
{
|
||||
XFillPolygon (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, (XPoint*) points, npoints, Complex, CoordModeOrigin);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((points[0].x != points[npoints-1].x) ||
|
||||
(points[0].y != points[npoints-1].y))
|
||||
{
|
||||
local_alloc = 1;
|
||||
++local_npoints;
|
||||
local_points = (GdkPoint*) g_malloc (local_npoints * sizeof(GdkPoint));
|
||||
memcpy (local_points, points, npoints * sizeof(GdkPoint));
|
||||
local_points[npoints].x = points[0].x;
|
||||
local_points[npoints].y = points[0].y;
|
||||
}
|
||||
|
||||
XDrawLines (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc,
|
||||
(XPoint*) local_points, local_npoints,
|
||||
CoordModeOrigin);
|
||||
|
||||
if (local_alloc)
|
||||
g_free (local_points);
|
||||
}
|
||||
}
|
||||
|
||||
/* gdk_draw_string
|
||||
@@ -299,7 +205,45 @@ gdk_draw_string (GdkDrawable *drawable,
|
||||
gint y,
|
||||
const gchar *string)
|
||||
{
|
||||
gdk_draw_text (drawable, font, gc, x, y, string, _gdk_font_strlen (font, string));
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkFontPrivate *font_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (font != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (string != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
if (font->type == GDK_FONT_FONT)
|
||||
{
|
||||
XFontStruct *xfont = (XFontStruct *) font_private->xfont;
|
||||
XSetFont(drawable_private->xdisplay, gc_private->xgc, xfont->fid);
|
||||
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
|
||||
{
|
||||
XDrawString (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, string, strlen (string));
|
||||
}
|
||||
else
|
||||
{
|
||||
XDrawString16 (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, (XChar2b *) string,
|
||||
strlen (string) / 2);
|
||||
}
|
||||
}
|
||||
else if (font->type == GDK_FONT_FONTSET)
|
||||
{
|
||||
XFontSet fontset = (XFontSet) font_private->xfont;
|
||||
XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
fontset, gc_private->xgc, x, y, string, strlen (string));
|
||||
}
|
||||
else
|
||||
g_error("undefined font type\n");
|
||||
}
|
||||
|
||||
/* gdk_draw_text
|
||||
@@ -317,12 +261,44 @@ gdk_draw_text (GdkDrawable *drawable,
|
||||
const gchar *text,
|
||||
gint text_length)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkFontPrivate *font_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (font != NULL);
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_text (drawable, font, gc, x, y, text, text_length);
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
if (font->type == GDK_FONT_FONT)
|
||||
{
|
||||
XFontStruct *xfont = (XFontStruct *) font_private->xfont;
|
||||
XSetFont(drawable_private->xdisplay, gc_private->xgc, xfont->fid);
|
||||
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
|
||||
{
|
||||
XDrawString (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, text, text_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
XDrawString16 (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, (XChar2b *) text, text_length / 2);
|
||||
}
|
||||
}
|
||||
else if (font->type == GDK_FONT_FONTSET)
|
||||
{
|
||||
XFontSet fontset = (XFontSet) font_private->xfont;
|
||||
XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
fontset, gc_private->xgc, x, y, text, text_length);
|
||||
}
|
||||
else
|
||||
g_error("undefined font type\n");
|
||||
}
|
||||
|
||||
void
|
||||
@@ -334,45 +310,94 @@ gdk_draw_text_wc (GdkDrawable *drawable,
|
||||
const GdkWChar *text,
|
||||
gint text_length)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkFontPrivate *font_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (font != NULL);
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_text_wc (drawable, font, gc, x, y, text, text_length);
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
if (font->type == GDK_FONT_FONT)
|
||||
{
|
||||
XFontStruct *xfont = (XFontStruct *) font_private->xfont;
|
||||
gchar *text_8bit;
|
||||
gint i;
|
||||
XSetFont(drawable_private->xdisplay, gc_private->xgc, xfont->fid);
|
||||
text_8bit = g_new (gchar, text_length);
|
||||
for (i=0; i<text_length; i++) text_8bit[i] = text[i];
|
||||
XDrawString (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, x, y, text_8bit, text_length);
|
||||
g_free (text_8bit);
|
||||
}
|
||||
else if (font->type == GDK_FONT_FONTSET)
|
||||
{
|
||||
if (sizeof(GdkWChar) == sizeof(wchar_t))
|
||||
{
|
||||
XwcDrawString (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
(XFontSet) font_private->xfont,
|
||||
gc_private->xgc, x, y, (wchar_t *)text, text_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
wchar_t *text_wchar;
|
||||
gint i;
|
||||
text_wchar = g_new (wchar_t, text_length);
|
||||
for (i=0; i<text_length; i++) text_wchar[i] = text[i];
|
||||
XwcDrawString (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
(XFontSet) font_private->xfont,
|
||||
gc_private->xgc, x, y, text_wchar, text_length);
|
||||
g_free (text_wchar);
|
||||
}
|
||||
}
|
||||
else
|
||||
g_error("undefined font type\n");
|
||||
}
|
||||
|
||||
void
|
||||
gdk_draw_drawable (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkDrawable *src,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height)
|
||||
gdk_draw_pixmap (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPixmap *src,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkWindowPrivate *src_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (src != NULL);
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
if (width < 0 || height < 0)
|
||||
{
|
||||
gint real_width;
|
||||
gint real_height;
|
||||
|
||||
gdk_drawable_get_size (drawable, &real_width, &real_height);
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
src_private = (GdkWindowPrivate*) src;
|
||||
if (drawable_private->destroyed || src_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (width < 0)
|
||||
width = real_width;
|
||||
if (height < 0)
|
||||
height = real_height;
|
||||
}
|
||||
if (width == -1)
|
||||
width = src_private->width;
|
||||
if (height == -1)
|
||||
height = src_private->height;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc, src,
|
||||
xsrc, ysrc, xdest, ydest,
|
||||
width, height);
|
||||
XCopyArea (drawable_private->xdisplay,
|
||||
src_private->xwindow,
|
||||
drawable_private->xwindow,
|
||||
gc_private->xgc,
|
||||
xsrc, ysrc,
|
||||
width, height,
|
||||
xdest, ydest);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -386,17 +411,23 @@ gdk_draw_image (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
GdkImagePrivate *image_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (image != NULL);
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
image_private = (GdkImagePrivate*) image;
|
||||
|
||||
g_return_if_fail (image_private->image_put != NULL);
|
||||
|
||||
if (width == -1)
|
||||
width = image->width;
|
||||
if (height == -1)
|
||||
height = image->height;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_image (drawable, gc, image, xsrc, ysrc,
|
||||
xdest, ydest, width, height);
|
||||
(* image_private->image_put) (drawable, gc, image, xsrc, ysrc,
|
||||
xdest, ydest, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -405,15 +436,24 @@ gdk_draw_points (GdkDrawable *drawable,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail ((points != NULL) && (npoints > 0));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (npoints >= 0);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
if (npoints == 0)
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, points, npoints);
|
||||
XDrawPoints (drawable_private->xdisplay,
|
||||
drawable_private->xwindow,
|
||||
gc_private->xgc,
|
||||
(XPoint *) points,
|
||||
npoints,
|
||||
CoordModeOrigin);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -422,32 +462,53 @@ gdk_draw_segments (GdkDrawable *drawable,
|
||||
GdkSegment *segs,
|
||||
gint nsegs)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
if (nsegs == 0)
|
||||
if (nsegs <= 0)
|
||||
return;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (segs != NULL);
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (nsegs >= 0);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, segs, nsegs);
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawSegments (drawable_private->xdisplay,
|
||||
drawable_private->xwindow,
|
||||
gc_private->xgc,
|
||||
(XSegment *) segs,
|
||||
nsegs);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_draw_lines (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (points != NULL);
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (npoints >= 0);
|
||||
|
||||
if (npoints == 0)
|
||||
if (npoints <= 0)
|
||||
return;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_lines (drawable, gc, points, npoints);
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (points != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawLines (drawable_private->xdisplay,
|
||||
drawable_private->xwindow,
|
||||
gc_private->xgc,
|
||||
(XPoint *) points,
|
||||
npoints,
|
||||
CoordModeOrigin);
|
||||
}
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
#ifndef __GDK_DRAWABLE_H__
|
||||
#define __GDK_DRAWABLE_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkgc.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _GdkDrawableClass GdkDrawableClass;
|
||||
|
||||
#define GDK_TYPE_DRAWABLE (gdk_drawable_get_type ())
|
||||
#define GDK_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE, GdkDrawable))
|
||||
#define GDK_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE, GdkDrawableClass))
|
||||
#define GDK_IS_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE))
|
||||
#define GDK_IS_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE))
|
||||
#define GDK_DRAWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE, GdkDrawableClass))
|
||||
|
||||
struct _GdkDrawable
|
||||
{
|
||||
GObject parent_instance;
|
||||
};
|
||||
|
||||
struct _GdkDrawableClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
GdkGC *(*create_gc) (GdkDrawable *drawable,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask mask);
|
||||
void (*draw_rectangle) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (*draw_arc) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gint angle1,
|
||||
gint angle2);
|
||||
void (*draw_polygon) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
void (*draw_text) (GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
void (*draw_text_wc) (GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const GdkWChar *text,
|
||||
gint text_length);
|
||||
void (*draw_drawable) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkDrawable *src,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
void (*draw_points) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
void (*draw_segments) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkSegment *segs,
|
||||
gint nsegs);
|
||||
void (*draw_lines) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
|
||||
void (*draw_image) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
gint (*get_depth) (GdkDrawable *drawable);
|
||||
void (*get_size) (GdkDrawable *drawable,
|
||||
gint *width,
|
||||
gint *height);
|
||||
|
||||
void (*set_colormap) (GdkDrawable *drawable,
|
||||
GdkColormap *cmap);
|
||||
|
||||
GdkColormap* (*get_colormap) (GdkDrawable *drawable);
|
||||
GdkVisual* (*get_visual) (GdkDrawable *drawable);
|
||||
};
|
||||
|
||||
GType gdk_drawable_get_type (void);
|
||||
|
||||
/* Manipulation of drawables
|
||||
*/
|
||||
|
||||
void gdk_drawable_set_data (GdkDrawable *drawable,
|
||||
const gchar *key,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy_func);
|
||||
gpointer gdk_drawable_get_data (GdkDrawable *drawable,
|
||||
const gchar *key);
|
||||
|
||||
void gdk_drawable_get_size (GdkDrawable *drawable,
|
||||
gint *width,
|
||||
gint *height);
|
||||
void gdk_drawable_set_colormap (GdkDrawable *drawable,
|
||||
GdkColormap *colormap);
|
||||
GdkColormap* gdk_drawable_get_colormap (GdkDrawable *drawable);
|
||||
GdkVisual* gdk_drawable_get_visual (GdkDrawable *drawable);
|
||||
gint gdk_drawable_get_depth (GdkDrawable *drawable);
|
||||
GdkDrawable* gdk_drawable_ref (GdkDrawable *drawable);
|
||||
void gdk_drawable_unref (GdkDrawable *drawable);
|
||||
|
||||
/* Drawing
|
||||
*/
|
||||
void gdk_draw_point (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_draw_line (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2);
|
||||
void gdk_draw_rectangle (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_draw_arc (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gint angle1,
|
||||
gint angle2);
|
||||
void gdk_draw_polygon (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint filled,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
void gdk_draw_string (GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const gchar *string);
|
||||
void gdk_draw_text (GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
void gdk_draw_text_wc (GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const GdkWChar *text,
|
||||
gint text_length);
|
||||
void gdk_draw_drawable (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkDrawable *src,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_draw_image (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
void gdk_draw_segments (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkSegment *segs,
|
||||
gint nsegs);
|
||||
void gdk_draw_lines (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_DRAWABLE_H__ */
|
||||
1771
gdk/gdkevents.c
1771
gdk/gdkevents.c
File diff suppressed because it is too large
Load Diff
438
gdk/gdkevents.h
438
gdk/gdkevents.h
@@ -1,438 +0,0 @@
|
||||
#ifndef __GDK_EVENTS_H__
|
||||
#define __GDK_EVENTS_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkdnd.h>
|
||||
#include <gdk/gdkinput.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
|
||||
|
||||
typedef struct _GdkEventAny GdkEventAny;
|
||||
typedef struct _GdkEventExpose GdkEventExpose;
|
||||
typedef struct _GdkEventNoExpose GdkEventNoExpose;
|
||||
typedef struct _GdkEventVisibility GdkEventVisibility;
|
||||
typedef struct _GdkEventMotion GdkEventMotion;
|
||||
typedef struct _GdkEventButton GdkEventButton;
|
||||
typedef struct _GdkEventScroll GdkEventScroll;
|
||||
typedef struct _GdkEventKey GdkEventKey;
|
||||
typedef struct _GdkEventFocus GdkEventFocus;
|
||||
typedef struct _GdkEventCrossing GdkEventCrossing;
|
||||
typedef struct _GdkEventConfigure GdkEventConfigure;
|
||||
typedef struct _GdkEventProperty GdkEventProperty;
|
||||
typedef struct _GdkEventSelection GdkEventSelection;
|
||||
typedef struct _GdkEventProximity GdkEventProximity;
|
||||
typedef struct _GdkEventClient GdkEventClient;
|
||||
|
||||
typedef struct _GdkEventDND GdkEventDND;
|
||||
|
||||
typedef union _GdkEvent GdkEvent;
|
||||
|
||||
typedef void (*GdkEventFunc) (GdkEvent *event,
|
||||
gpointer data);
|
||||
|
||||
/* Event filtering */
|
||||
|
||||
typedef void GdkXEvent; /* Can be cast to XEvent */
|
||||
|
||||
typedef enum {
|
||||
GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */
|
||||
GDK_FILTER_TRANSLATE, /* Translated event stored */
|
||||
GDK_FILTER_REMOVE /* Terminate processing, removing event */
|
||||
} GdkFilterReturn;
|
||||
|
||||
typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
|
||||
|
||||
/* Event types.
|
||||
* Nothing: No event occurred.
|
||||
* Delete: A window delete event was sent by the window manager.
|
||||
* The specified window should be deleted.
|
||||
* Destroy: A window has been destroyed.
|
||||
* Expose: Part of a window has been uncovered.
|
||||
* NoExpose: Same as expose, but no expose event was generated.
|
||||
* VisibilityNotify: A window has become fully/partially/not obscured.
|
||||
* MotionNotify: The mouse has moved.
|
||||
* ButtonPress: A mouse button was pressed.
|
||||
* ButtonRelease: A mouse button was release.
|
||||
* KeyPress: A key was pressed.
|
||||
* KeyRelease: A key was released.
|
||||
* EnterNotify: A window was entered.
|
||||
* LeaveNotify: A window was exited.
|
||||
* FocusChange: The focus window has changed. (The focus window gets
|
||||
* keyboard events).
|
||||
* Resize: A window has been resized.
|
||||
* Map: A window has been mapped. (It is now visible on the screen).
|
||||
* Unmap: A window has been unmapped. (It is no longer visible on
|
||||
* the screen).
|
||||
* Scroll: A mouse wheel was scrolled either up or down.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_NOTHING = -1,
|
||||
GDK_DELETE = 0,
|
||||
GDK_DESTROY = 1,
|
||||
GDK_EXPOSE = 2,
|
||||
GDK_MOTION_NOTIFY = 3,
|
||||
GDK_BUTTON_PRESS = 4,
|
||||
GDK_2BUTTON_PRESS = 5,
|
||||
GDK_3BUTTON_PRESS = 6,
|
||||
GDK_BUTTON_RELEASE = 7,
|
||||
GDK_KEY_PRESS = 8,
|
||||
GDK_KEY_RELEASE = 9,
|
||||
GDK_ENTER_NOTIFY = 10,
|
||||
GDK_LEAVE_NOTIFY = 11,
|
||||
GDK_FOCUS_CHANGE = 12,
|
||||
GDK_CONFIGURE = 13,
|
||||
GDK_MAP = 14,
|
||||
GDK_UNMAP = 15,
|
||||
GDK_PROPERTY_NOTIFY = 16,
|
||||
GDK_SELECTION_CLEAR = 17,
|
||||
GDK_SELECTION_REQUEST = 18,
|
||||
GDK_SELECTION_NOTIFY = 19,
|
||||
GDK_PROXIMITY_IN = 20,
|
||||
GDK_PROXIMITY_OUT = 21,
|
||||
GDK_DRAG_ENTER = 22,
|
||||
GDK_DRAG_LEAVE = 23,
|
||||
GDK_DRAG_MOTION = 24,
|
||||
GDK_DRAG_STATUS = 25,
|
||||
GDK_DROP_START = 26,
|
||||
GDK_DROP_FINISHED = 27,
|
||||
GDK_CLIENT_EVENT = 28,
|
||||
GDK_VISIBILITY_NOTIFY = 29,
|
||||
GDK_NO_EXPOSE = 30,
|
||||
GDK_SCROLL = 31
|
||||
} GdkEventType;
|
||||
|
||||
/* Event masks. (Used to select what types of events a window
|
||||
* will receive).
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_EXPOSURE_MASK = 1 << 1,
|
||||
GDK_POINTER_MOTION_MASK = 1 << 2,
|
||||
GDK_POINTER_MOTION_HINT_MASK = 1 << 3,
|
||||
GDK_BUTTON_MOTION_MASK = 1 << 4,
|
||||
GDK_BUTTON1_MOTION_MASK = 1 << 5,
|
||||
GDK_BUTTON2_MOTION_MASK = 1 << 6,
|
||||
GDK_BUTTON3_MOTION_MASK = 1 << 7,
|
||||
GDK_BUTTON_PRESS_MASK = 1 << 8,
|
||||
GDK_BUTTON_RELEASE_MASK = 1 << 9,
|
||||
GDK_KEY_PRESS_MASK = 1 << 10,
|
||||
GDK_KEY_RELEASE_MASK = 1 << 11,
|
||||
GDK_ENTER_NOTIFY_MASK = 1 << 12,
|
||||
GDK_LEAVE_NOTIFY_MASK = 1 << 13,
|
||||
GDK_FOCUS_CHANGE_MASK = 1 << 14,
|
||||
GDK_STRUCTURE_MASK = 1 << 15,
|
||||
GDK_PROPERTY_CHANGE_MASK = 1 << 16,
|
||||
GDK_VISIBILITY_NOTIFY_MASK = 1 << 17,
|
||||
GDK_PROXIMITY_IN_MASK = 1 << 18,
|
||||
GDK_PROXIMITY_OUT_MASK = 1 << 19,
|
||||
GDK_SUBSTRUCTURE_MASK = 1 << 20,
|
||||
GDK_SCROLL_MASK = 1 << 21,
|
||||
GDK_ALL_EVENTS_MASK = 0x3FFFFE
|
||||
} GdkEventMask;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_VISIBILITY_UNOBSCURED,
|
||||
GDK_VISIBILITY_PARTIAL,
|
||||
GDK_VISIBILITY_FULLY_OBSCURED
|
||||
} GdkVisibilityState;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_SCROLL_UP,
|
||||
GDK_SCROLL_DOWN,
|
||||
GDK_SCROLL_LEFT,
|
||||
GDK_SCROLL_RIGHT
|
||||
} GdkScrollDirection;
|
||||
|
||||
/* Types of enter/leave notifications.
|
||||
* Ancestor:
|
||||
* Virtual:
|
||||
* Inferior:
|
||||
* Nonlinear:
|
||||
* NonlinearVirtual:
|
||||
* Unknown: An unknown type of enter/leave event occurred.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_NOTIFY_ANCESTOR = 0,
|
||||
GDK_NOTIFY_VIRTUAL = 1,
|
||||
GDK_NOTIFY_INFERIOR = 2,
|
||||
GDK_NOTIFY_NONLINEAR = 3,
|
||||
GDK_NOTIFY_NONLINEAR_VIRTUAL = 4,
|
||||
GDK_NOTIFY_UNKNOWN = 5
|
||||
} GdkNotifyType;
|
||||
|
||||
/* Enter/leave event modes.
|
||||
* NotifyNormal
|
||||
* NotifyGrab
|
||||
* NotifyUngrab
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_CROSSING_NORMAL,
|
||||
GDK_CROSSING_GRAB,
|
||||
GDK_CROSSING_UNGRAB
|
||||
} GdkCrossingMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_PROPERTY_NEW_VALUE,
|
||||
GDK_PROPERTY_DELETE
|
||||
} GdkPropertyState;
|
||||
|
||||
struct _GdkEventAny
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
};
|
||||
|
||||
struct _GdkEventExpose
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkRectangle area;
|
||||
gint count; /* If non-zero, how many more events follow. */
|
||||
};
|
||||
|
||||
struct _GdkEventNoExpose
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
/* XXX: does anyone need the X major_code or minor_code fields? */
|
||||
};
|
||||
|
||||
struct _GdkEventVisibility
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkVisibilityState state;
|
||||
};
|
||||
|
||||
struct _GdkEventMotion
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble pressure;
|
||||
gdouble xtilt;
|
||||
gdouble ytilt;
|
||||
guint state;
|
||||
gint16 is_hint;
|
||||
GdkInputSource source;
|
||||
guint32 deviceid;
|
||||
gdouble x_root, y_root;
|
||||
};
|
||||
|
||||
struct _GdkEventButton
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble pressure;
|
||||
gdouble xtilt;
|
||||
gdouble ytilt;
|
||||
guint state;
|
||||
guint button;
|
||||
GdkInputSource source;
|
||||
guint32 deviceid;
|
||||
gdouble x_root, y_root;
|
||||
};
|
||||
|
||||
struct _GdkEventScroll
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble pressure;
|
||||
gdouble xtilt;
|
||||
gdouble ytilt;
|
||||
guint state;
|
||||
GdkScrollDirection direction;
|
||||
GdkInputSource source;
|
||||
guint32 deviceid;
|
||||
gdouble x_root, y_root;
|
||||
};
|
||||
|
||||
struct _GdkEventKey
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
guint state;
|
||||
guint keyval;
|
||||
gint length;
|
||||
gchar *string;
|
||||
};
|
||||
|
||||
struct _GdkEventCrossing
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkWindow *subwindow;
|
||||
guint32 time;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble x_root;
|
||||
gdouble y_root;
|
||||
GdkCrossingMode mode;
|
||||
GdkNotifyType detail;
|
||||
gboolean focus;
|
||||
guint state;
|
||||
};
|
||||
|
||||
struct _GdkEventFocus
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
gint16 in;
|
||||
};
|
||||
|
||||
struct _GdkEventConfigure
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
gint x, y;
|
||||
gint width;
|
||||
gint height;
|
||||
};
|
||||
|
||||
struct _GdkEventProperty
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkAtom atom;
|
||||
guint32 time;
|
||||
guint state;
|
||||
};
|
||||
|
||||
struct _GdkEventSelection
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkAtom selection;
|
||||
GdkAtom target;
|
||||
GdkAtom property;
|
||||
guint32 requestor;
|
||||
guint32 time;
|
||||
};
|
||||
|
||||
/* This event type will be used pretty rarely. It only is important
|
||||
for XInput aware programs that are drawing their own cursor */
|
||||
|
||||
struct _GdkEventProximity
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
GdkInputSource source;
|
||||
guint32 deviceid;
|
||||
};
|
||||
|
||||
struct _GdkEventClient
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkAtom message_type;
|
||||
gushort data_format;
|
||||
union {
|
||||
char b[20];
|
||||
short s[10];
|
||||
long l[5];
|
||||
} data;
|
||||
};
|
||||
|
||||
/* Event types for DND */
|
||||
|
||||
struct _GdkEventDND {
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkDragContext *context;
|
||||
|
||||
guint32 time;
|
||||
gshort x_root, y_root;
|
||||
};
|
||||
|
||||
union _GdkEvent
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkEventAny any;
|
||||
GdkEventExpose expose;
|
||||
GdkEventNoExpose no_expose;
|
||||
GdkEventVisibility visibility;
|
||||
GdkEventMotion motion;
|
||||
GdkEventButton button;
|
||||
GdkEventScroll scroll;
|
||||
GdkEventKey key;
|
||||
GdkEventCrossing crossing;
|
||||
GdkEventFocus focus_change;
|
||||
GdkEventConfigure configure;
|
||||
GdkEventProperty property;
|
||||
GdkEventSelection selection;
|
||||
GdkEventProximity proximity;
|
||||
GdkEventClient client;
|
||||
GdkEventDND dnd;
|
||||
};
|
||||
|
||||
gboolean gdk_events_pending (void);
|
||||
GdkEvent* gdk_event_get (void);
|
||||
|
||||
GdkEvent* gdk_event_peek (void);
|
||||
GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window);
|
||||
void gdk_event_put (GdkEvent *event);
|
||||
|
||||
GdkEvent* gdk_event_copy (GdkEvent *event);
|
||||
void gdk_event_free (GdkEvent *event);
|
||||
guint32 gdk_event_get_time (GdkEvent *event);
|
||||
|
||||
void gdk_event_handler_set (GdkEventFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify notify);
|
||||
|
||||
void gdk_set_show_events (gboolean show_events);
|
||||
gboolean gdk_get_show_events (void);
|
||||
|
||||
/*
|
||||
* The following function adds a global filter for all client
|
||||
* messages of type message_type
|
||||
*/
|
||||
void gdk_add_client_message_filter (GdkAtom message_type,
|
||||
GdkFilterFunc func,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_EVENTS_H__ */
|
||||
695
gdk/gdkfont.c
695
gdk/gdkfont.c
@@ -24,8 +24,178 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "gdkfont.h"
|
||||
#include "gdkinternals.h"
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xos.h>
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
static GHashTable *font_name_hash = NULL;
|
||||
static GHashTable *fontset_name_hash = NULL;
|
||||
|
||||
static void
|
||||
gdk_font_hash_insert (GdkFontType type, GdkFont *font, const gchar *font_name)
|
||||
{
|
||||
GdkFontPrivate *private = (GdkFontPrivate *)font;
|
||||
GHashTable **hashp = (type == GDK_FONT_FONT) ?
|
||||
&font_name_hash : &fontset_name_hash;
|
||||
|
||||
if (!*hashp)
|
||||
*hashp = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
private->names = g_slist_prepend (private->names, g_strdup (font_name));
|
||||
g_hash_table_insert (*hashp, private->names->data, font);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_font_hash_remove (GdkFontType type, GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private = (GdkFontPrivate *)font;
|
||||
GSList *tmp_list;
|
||||
GHashTable *hash = (type == GDK_FONT_FONT) ?
|
||||
font_name_hash : fontset_name_hash;
|
||||
|
||||
tmp_list = private->names;
|
||||
while (tmp_list)
|
||||
{
|
||||
g_hash_table_remove (hash, tmp_list->data);
|
||||
g_free (tmp_list->data);
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
g_slist_free (private->names);
|
||||
private->names = NULL;
|
||||
}
|
||||
|
||||
static GdkFont *
|
||||
gdk_font_hash_lookup (GdkFontType type, const gchar *font_name)
|
||||
{
|
||||
GdkFont *result;
|
||||
GHashTable *hash = (type == GDK_FONT_FONT) ?
|
||||
font_name_hash : fontset_name_hash;
|
||||
|
||||
if (!hash)
|
||||
return NULL;
|
||||
else
|
||||
{
|
||||
result = g_hash_table_lookup (hash, font_name);
|
||||
if (result)
|
||||
gdk_font_ref (result);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
gdk_font_load (const gchar *font_name)
|
||||
{
|
||||
GdkFont *font;
|
||||
GdkFontPrivate *private;
|
||||
XFontStruct *xfont;
|
||||
|
||||
g_return_val_if_fail (font_name != NULL, NULL);
|
||||
|
||||
font = gdk_font_hash_lookup (GDK_FONT_FONT, font_name);
|
||||
if (font)
|
||||
return font;
|
||||
|
||||
xfont = XLoadQueryFont (gdk_display, font_name);
|
||||
if (xfont == NULL)
|
||||
return NULL;
|
||||
|
||||
font = gdk_font_lookup (xfont->fid);
|
||||
if (font != NULL)
|
||||
{
|
||||
private = (GdkFontPrivate *) font;
|
||||
if (xfont != private->xfont)
|
||||
XFreeFont (gdk_display, xfont);
|
||||
|
||||
gdk_font_ref (font);
|
||||
}
|
||||
else
|
||||
{
|
||||
private = g_new (GdkFontPrivate, 1);
|
||||
private->xdisplay = gdk_display;
|
||||
private->xfont = xfont;
|
||||
private->ref_count = 1;
|
||||
private->names = NULL;
|
||||
|
||||
font = (GdkFont*) private;
|
||||
font->type = GDK_FONT_FONT;
|
||||
font->ascent = xfont->ascent;
|
||||
font->descent = xfont->descent;
|
||||
|
||||
gdk_xid_table_insert (&xfont->fid, font);
|
||||
}
|
||||
|
||||
gdk_font_hash_insert (GDK_FONT_FONT, font, font_name);
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
gdk_fontset_load (const gchar *fontset_name)
|
||||
{
|
||||
GdkFont *font;
|
||||
GdkFontPrivate *private;
|
||||
XFontSet fontset;
|
||||
gint missing_charset_count;
|
||||
gchar **missing_charset_list;
|
||||
gchar *def_string;
|
||||
|
||||
font = gdk_font_hash_lookup (GDK_FONT_FONTSET, fontset_name);
|
||||
if (font)
|
||||
return font;
|
||||
|
||||
private = g_new (GdkFontPrivate, 1);
|
||||
font = (GdkFont*) private;
|
||||
|
||||
private->xdisplay = gdk_display;
|
||||
fontset = XCreateFontSet (gdk_display, fontset_name,
|
||||
&missing_charset_list, &missing_charset_count,
|
||||
&def_string);
|
||||
|
||||
if (missing_charset_count)
|
||||
{
|
||||
gint i;
|
||||
g_warning ("Missing charsets in FontSet creation\n");
|
||||
for (i=0;i<missing_charset_count;i++)
|
||||
g_warning (" %s\n", missing_charset_list[i]);
|
||||
XFreeStringList (missing_charset_list);
|
||||
}
|
||||
|
||||
private->ref_count = 1;
|
||||
|
||||
if (!fontset)
|
||||
{
|
||||
g_free (font);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
gint num_fonts;
|
||||
gint i;
|
||||
XFontStruct **font_structs;
|
||||
gchar **font_names;
|
||||
|
||||
private->xfont = fontset;
|
||||
font->type = GDK_FONT_FONTSET;
|
||||
num_fonts = XFontsOfFontSet (fontset, &font_structs, &font_names);
|
||||
|
||||
font->ascent = font->descent = 0;
|
||||
|
||||
for (i = 0; i < num_fonts; i++)
|
||||
{
|
||||
font->ascent = MAX (font->ascent, font_structs[i]->ascent);
|
||||
font->descent = MAX (font->descent, font_structs[i]->descent);
|
||||
}
|
||||
|
||||
private->names = NULL;
|
||||
gdk_font_hash_insert (GDK_FONT_FONTSET, font, fontset_name);
|
||||
|
||||
return font;
|
||||
}
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
gdk_font_ref (GdkFont *font)
|
||||
@@ -50,35 +220,304 @@ gdk_font_unref (GdkFont *font)
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
_gdk_font_destroy (font);
|
||||
{
|
||||
gdk_font_hash_remove (font->type, font);
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
gdk_xid_table_remove (((XFontStruct *) private->xfont)->fid);
|
||||
XFreeFont (private->xdisplay, (XFontStruct *) private->xfont);
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
XFreeFontSet (private->xdisplay, (XFontSet) private->xfont);
|
||||
break;
|
||||
default:
|
||||
g_error ("unknown font type.");
|
||||
break;
|
||||
}
|
||||
g_free (font);
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_font_id (const GdkFont *font)
|
||||
{
|
||||
const GdkFontPrivate *font_private;
|
||||
|
||||
g_return_val_if_fail (font != NULL, 0);
|
||||
|
||||
font_private = (const GdkFontPrivate*) font;
|
||||
|
||||
if (font->type == GDK_FONT_FONT)
|
||||
{
|
||||
return ((XFontStruct *) font_private->xfont)->fid;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_font_equal (const GdkFont *fonta,
|
||||
const GdkFont *fontb)
|
||||
{
|
||||
const GdkFontPrivate *privatea;
|
||||
const GdkFontPrivate *privateb;
|
||||
|
||||
g_return_val_if_fail (fonta != NULL, FALSE);
|
||||
g_return_val_if_fail (fontb != NULL, FALSE);
|
||||
|
||||
privatea = (const GdkFontPrivate*) fonta;
|
||||
privateb = (const GdkFontPrivate*) fontb;
|
||||
|
||||
if (fonta->type == GDK_FONT_FONT && fontb->type == GDK_FONT_FONT)
|
||||
{
|
||||
return (((XFontStruct *) privatea->xfont)->fid ==
|
||||
((XFontStruct *) privateb->xfont)->fid);
|
||||
}
|
||||
else if (fonta->type == GDK_FONT_FONTSET && fontb->type == GDK_FONT_FONTSET)
|
||||
{
|
||||
gchar *namea, *nameb;
|
||||
|
||||
namea = XBaseFontNameListOfFontSet((XFontSet) privatea->xfont);
|
||||
nameb = XBaseFontNameListOfFontSet((XFontSet) privateb->xfont);
|
||||
|
||||
return (strcmp(namea, nameb) == 0);
|
||||
}
|
||||
else
|
||||
/* fontset != font */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_string_width (GdkFont *font,
|
||||
const gchar *string)
|
||||
{
|
||||
GdkFontPrivate *font_private;
|
||||
gint width;
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (string != NULL, -1);
|
||||
|
||||
return gdk_text_width (font, string, _gdk_font_strlen (font, string));
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
xfont = (XFontStruct *) font_private->xfont;
|
||||
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
|
||||
{
|
||||
width = XTextWidth (xfont, string, strlen (string));
|
||||
}
|
||||
else
|
||||
{
|
||||
width = XTextWidth16 (xfont, (XChar2b *) string, strlen (string) / 2);
|
||||
}
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) font_private->xfont;
|
||||
width = XmbTextEscapement (fontset, string, strlen(string));
|
||||
break;
|
||||
default:
|
||||
width = 0;
|
||||
}
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_text_width (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
gint width;
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (text != NULL, -1);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
xfont = (XFontStruct *) private->xfont;
|
||||
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
|
||||
{
|
||||
width = XTextWidth (xfont, text, text_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2);
|
||||
}
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
width = XmbTextEscapement (fontset, text, text_length);
|
||||
break;
|
||||
default:
|
||||
width = 0;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_text_width_wc (GdkFont *font,
|
||||
const GdkWChar *text,
|
||||
gint text_length)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
gint width;
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (text != NULL, -1);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
xfont = (XFontStruct *) private->xfont;
|
||||
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
|
||||
{
|
||||
gchar *text_8bit;
|
||||
gint i;
|
||||
text_8bit = g_new (gchar, text_length);
|
||||
for (i=0; i<text_length; i++) text_8bit[i] = text[i];
|
||||
width = XTextWidth (xfont, text_8bit, text_length);
|
||||
g_free (text_8bit);
|
||||
}
|
||||
else
|
||||
{
|
||||
width = 0;
|
||||
}
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
if (sizeof(GdkWChar) == sizeof(wchar_t))
|
||||
{
|
||||
fontset = (XFontSet) private->xfont;
|
||||
width = XwcTextEscapement (fontset, (wchar_t *)text, text_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
wchar_t *text_wchar;
|
||||
gint i;
|
||||
fontset = (XFontSet) private->xfont;
|
||||
text_wchar = g_new(wchar_t, text_length);
|
||||
for (i=0; i<text_length; i++) text_wchar[i] = text[i];
|
||||
width = XwcTextEscapement (fontset, text_wchar, text_length);
|
||||
g_free (text_wchar);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
width = 0;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
/* Problem: What if a character is a 16 bits character ?? */
|
||||
gint
|
||||
gdk_char_width (GdkFont *font,
|
||||
gchar character)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
XCharStruct *chars;
|
||||
gint width;
|
||||
guint ch = character & 0xff; /* get rid of sign-extension */
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
|
||||
return gdk_text_width (font, &character, 1);
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
/* only 8 bits characters are considered here */
|
||||
xfont = (XFontStruct *) private->xfont;
|
||||
if ((xfont->min_byte1 == 0) &&
|
||||
(xfont->max_byte1 == 0) &&
|
||||
(ch >= xfont->min_char_or_byte2) &&
|
||||
(ch <= xfont->max_char_or_byte2))
|
||||
{
|
||||
chars = xfont->per_char;
|
||||
if (chars)
|
||||
width = chars[ch - xfont->min_char_or_byte2].width;
|
||||
else
|
||||
width = xfont->min_bounds.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = XTextWidth (xfont, &character, 1);
|
||||
}
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
width = XmbTextEscapement (fontset, &character, 1) ;
|
||||
break;
|
||||
default:
|
||||
width = 0;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_char_width_wc (GdkFont *font,
|
||||
GdkWChar character)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
XCharStruct *chars;
|
||||
gint width;
|
||||
guint ch = character & 0xff; /* get rid of sign-extension */
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
|
||||
return gdk_text_width_wc (font, &character, 1);
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
/* only 8 bits characters are considered here */
|
||||
xfont = (XFontStruct *) private->xfont;
|
||||
if ((xfont->min_byte1 == 0) &&
|
||||
(xfont->max_byte1 == 0) &&
|
||||
(ch >= xfont->min_char_or_byte2) &&
|
||||
(ch <= xfont->max_char_or_byte2))
|
||||
{
|
||||
chars = xfont->per_char;
|
||||
if (chars)
|
||||
width = chars[ch - xfont->min_char_or_byte2].width;
|
||||
else
|
||||
width = xfont->min_bounds.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
char ch2 = character;
|
||||
width = XTextWidth (xfont, &ch2, 1);
|
||||
}
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
{
|
||||
wchar_t char_wc = character;
|
||||
width = XwcTextEscapement (fontset, &char_wc, 1) ;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
width = 0;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
gint
|
||||
@@ -88,7 +527,162 @@ gdk_string_measure (GdkFont *font,
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (string != NULL, -1);
|
||||
|
||||
return gdk_text_measure (font, string, _gdk_font_strlen (font, string));
|
||||
return gdk_text_measure (font, string, strlen (string));
|
||||
}
|
||||
|
||||
void
|
||||
gdk_text_extents (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length,
|
||||
gint *lbearing,
|
||||
gint *rbearing,
|
||||
gint *width,
|
||||
gint *ascent,
|
||||
gint *descent)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
XCharStruct overall;
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
XRectangle ink, logical;
|
||||
int direction;
|
||||
int font_ascent;
|
||||
int font_descent;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
xfont = (XFontStruct *) private->xfont;
|
||||
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
|
||||
{
|
||||
XTextExtents (xfont, text, text_length,
|
||||
&direction, &font_ascent, &font_descent,
|
||||
&overall);
|
||||
}
|
||||
else
|
||||
{
|
||||
XTextExtents16 (xfont, (XChar2b *) text, text_length / 2,
|
||||
&direction, &font_ascent, &font_descent,
|
||||
&overall);
|
||||
}
|
||||
if (lbearing)
|
||||
*lbearing = overall.lbearing;
|
||||
if (rbearing)
|
||||
*rbearing = overall.rbearing;
|
||||
if (width)
|
||||
*width = overall.width;
|
||||
if (ascent)
|
||||
*ascent = overall.ascent;
|
||||
if (descent)
|
||||
*descent = overall.descent;
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
XmbTextExtents (fontset, text, text_length, &ink, &logical);
|
||||
if (lbearing)
|
||||
*lbearing = ink.x;
|
||||
if (rbearing)
|
||||
*rbearing = ink.x + ink.width;
|
||||
if (width)
|
||||
*width = logical.width;
|
||||
if (ascent)
|
||||
*ascent = -ink.y;
|
||||
if (descent)
|
||||
*descent = ink.y + ink.height;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
gdk_text_extents_wc (GdkFont *font,
|
||||
const GdkWChar *text,
|
||||
gint text_length,
|
||||
gint *lbearing,
|
||||
gint *rbearing,
|
||||
gint *width,
|
||||
gint *ascent,
|
||||
gint *descent)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
XCharStruct overall;
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
XRectangle ink, logical;
|
||||
int direction;
|
||||
int font_ascent;
|
||||
int font_descent;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
{
|
||||
gchar *text_8bit;
|
||||
gint i;
|
||||
|
||||
xfont = (XFontStruct *) private->xfont;
|
||||
g_return_if_fail ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0));
|
||||
|
||||
text_8bit = g_new (gchar, text_length);
|
||||
for (i=0; i<text_length; i++)
|
||||
text_8bit[i] = text[i];
|
||||
|
||||
XTextExtents (xfont, text_8bit, text_length,
|
||||
&direction, &font_ascent, &font_descent,
|
||||
&overall);
|
||||
g_free (text_8bit);
|
||||
|
||||
if (lbearing)
|
||||
*lbearing = overall.lbearing;
|
||||
if (rbearing)
|
||||
*rbearing = overall.rbearing;
|
||||
if (width)
|
||||
*width = overall.width;
|
||||
if (ascent)
|
||||
*ascent = overall.ascent;
|
||||
if (descent)
|
||||
*descent = overall.descent;
|
||||
break;
|
||||
}
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
|
||||
if (sizeof(GdkWChar) == sizeof(wchar_t))
|
||||
XwcTextExtents (fontset, (wchar_t *)text, text_length, &ink, &logical);
|
||||
else
|
||||
{
|
||||
wchar_t *text_wchar;
|
||||
gint i;
|
||||
|
||||
text_wchar = g_new (wchar_t, text_length);
|
||||
for (i = 0; i < text_length; i++)
|
||||
text_wchar[i] = text[i];
|
||||
XwcTextExtents (fontset, text_wchar, text_length, &ink, &logical);
|
||||
g_free (text_wchar);
|
||||
}
|
||||
if (lbearing)
|
||||
*lbearing = ink.x;
|
||||
if (rbearing)
|
||||
*rbearing = ink.x + ink.width;
|
||||
if (width)
|
||||
*width = logical.width;
|
||||
if (ascent)
|
||||
*ascent = -ink.y;
|
||||
if (descent)
|
||||
*descent = ink.y + ink.height;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@@ -103,7 +697,7 @@ gdk_string_extents (GdkFont *font,
|
||||
g_return_if_fail (font != NULL);
|
||||
g_return_if_fail (string != NULL);
|
||||
|
||||
gdk_text_extents (font, string, _gdk_font_strlen (font, string),
|
||||
gdk_text_extents (font, string, strlen (string),
|
||||
lbearing, rbearing, width, ascent, descent);
|
||||
}
|
||||
|
||||
@@ -113,14 +707,50 @@ gdk_text_measure (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length)
|
||||
{
|
||||
gint rbearing;
|
||||
GdkFontPrivate *private;
|
||||
XCharStruct overall;
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
XRectangle ink, log;
|
||||
int direction;
|
||||
int font_ascent;
|
||||
int font_descent;
|
||||
gint width;
|
||||
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (text != NULL, -1);
|
||||
|
||||
gdk_text_extents (font, text, text_length, NULL, &rbearing, NULL, NULL, NULL);
|
||||
return rbearing;
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
xfont = (XFontStruct *) private->xfont;
|
||||
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
|
||||
{
|
||||
XTextExtents (xfont, text, text_length,
|
||||
&direction, &font_ascent, &font_descent,
|
||||
&overall);
|
||||
}
|
||||
else
|
||||
{
|
||||
XTextExtents16 (xfont, (XChar2b *) text, text_length / 2,
|
||||
&direction, &font_ascent, &font_descent,
|
||||
&overall);
|
||||
}
|
||||
width = overall.rbearing;
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
XmbTextExtents (fontset, text, text_length, &ink, &log);
|
||||
width = ink.x + ink.width;
|
||||
break;
|
||||
default:
|
||||
width = 0;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_char_measure (GdkFont *font,
|
||||
gchar character)
|
||||
@@ -137,7 +767,7 @@ gdk_string_height (GdkFont *font,
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (string != NULL, -1);
|
||||
|
||||
return gdk_text_height (font, string, _gdk_font_strlen (font, string));
|
||||
return gdk_text_height (font, string, strlen (string));
|
||||
}
|
||||
|
||||
gint
|
||||
@@ -145,13 +775,48 @@ gdk_text_height (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length)
|
||||
{
|
||||
gint ascent, descent;
|
||||
GdkFontPrivate *private;
|
||||
XCharStruct overall;
|
||||
XFontStruct *xfont;
|
||||
XFontSet fontset;
|
||||
XRectangle ink, log;
|
||||
int direction;
|
||||
int font_ascent;
|
||||
int font_descent;
|
||||
gint height;
|
||||
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (text != NULL, -1);
|
||||
|
||||
gdk_text_extents (font, text, text_length, NULL, NULL, NULL, &ascent, &descent);
|
||||
return ascent + descent;
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
xfont = (XFontStruct *) private->xfont;
|
||||
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
|
||||
{
|
||||
XTextExtents (xfont, text, text_length,
|
||||
&direction, &font_ascent, &font_descent,
|
||||
&overall);
|
||||
}
|
||||
else
|
||||
{
|
||||
XTextExtents16 (xfont, (XChar2b *) text, text_length / 2,
|
||||
&direction, &font_ascent, &font_descent,
|
||||
&overall);
|
||||
}
|
||||
height = overall.ascent + overall.descent;
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
XmbTextExtents (fontset, text, text_length, &ink, &log);
|
||||
height = log.height;
|
||||
break;
|
||||
default:
|
||||
height = 0;
|
||||
}
|
||||
return height;
|
||||
}
|
||||
|
||||
gint
|
||||
|
||||
103
gdk/gdkfont.h
103
gdk/gdkfont.h
@@ -1,103 +0,0 @@
|
||||
#ifndef __GDK_FONT_H__
|
||||
#define __GDK_FONT_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Types of font.
|
||||
* GDK_FONT_FONT: the font is an XFontStruct.
|
||||
* GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_FONT_FONT,
|
||||
GDK_FONT_FONTSET
|
||||
} GdkFontType;
|
||||
|
||||
struct _GdkFont
|
||||
{
|
||||
GdkFontType type;
|
||||
gint ascent;
|
||||
gint descent;
|
||||
};
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
/* Temporary functions, will be replaced by something else for all backends
|
||||
* eventually. Don't use!
|
||||
*/
|
||||
gchar** gdk_font_list_new (const gchar *font_pattern, gint *n_returned);
|
||||
void gdk_font_list_free (gchar **font_list);
|
||||
#endif
|
||||
GdkFont* gdk_font_load (const gchar *font_name);
|
||||
GdkFont* gdk_fontset_load (const gchar *fontset_name);
|
||||
GdkFont* gdk_font_ref (GdkFont *font);
|
||||
void gdk_font_unref (GdkFont *font);
|
||||
gint gdk_font_id (const GdkFont *font);
|
||||
gboolean gdk_font_equal (const GdkFont *fonta,
|
||||
const GdkFont *fontb);
|
||||
|
||||
gint gdk_string_width (GdkFont *font,
|
||||
const gchar *string);
|
||||
gint gdk_text_width (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
gint gdk_text_width_wc (GdkFont *font,
|
||||
const GdkWChar *text,
|
||||
gint text_length);
|
||||
gint gdk_char_width (GdkFont *font,
|
||||
gchar character);
|
||||
gint gdk_char_width_wc (GdkFont *font,
|
||||
GdkWChar character);
|
||||
gint gdk_string_measure (GdkFont *font,
|
||||
const gchar *string);
|
||||
gint gdk_text_measure (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
gint gdk_char_measure (GdkFont *font,
|
||||
gchar character);
|
||||
gint gdk_string_height (GdkFont *font,
|
||||
const gchar *string);
|
||||
gint gdk_text_height (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length);
|
||||
gint gdk_char_height (GdkFont *font,
|
||||
gchar character);
|
||||
|
||||
void gdk_text_extents (GdkFont *font,
|
||||
const gchar *text,
|
||||
gint text_length,
|
||||
gint *lbearing,
|
||||
gint *rbearing,
|
||||
gint *width,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
void gdk_text_extents_wc (GdkFont *font,
|
||||
const GdkWChar *text,
|
||||
gint text_length,
|
||||
gint *lbearing,
|
||||
gint *rbearing,
|
||||
gint *width,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
void gdk_string_extents (GdkFont *font,
|
||||
const gchar *string,
|
||||
gint *lbearing,
|
||||
gint *rbearing,
|
||||
gint *width,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
/* Ditto temporary */
|
||||
gchar* gdk_font_full_name_get (GdkFont *font);
|
||||
void gdk_font_full_name_free (gchar *name);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_FONT_H__ */
|
||||
833
gdk/gdkgc.c
833
gdk/gdkgc.c
@@ -25,233 +25,603 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gdkgc.h"
|
||||
#include <X11/Xlib.h>
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
static void gdk_gc_init (GdkGC *gc);
|
||||
static void gdk_gc_class_init (GdkGCClass *klass);
|
||||
static void gdk_gc_finalize (GObject *object);
|
||||
|
||||
static gpointer parent_class = NULL;
|
||||
|
||||
GType
|
||||
gdk_gc_get_type (void)
|
||||
GdkGC*
|
||||
gdk_gc_new (GdkWindow *window)
|
||||
{
|
||||
static GType object_type = 0;
|
||||
|
||||
if (!object_type)
|
||||
{
|
||||
static const GTypeInfo object_info =
|
||||
{
|
||||
sizeof (GdkGCClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gdk_gc_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GdkGC),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gdk_gc_init,
|
||||
};
|
||||
|
||||
object_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"GdkGC",
|
||||
&object_info);
|
||||
}
|
||||
|
||||
return object_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gc_init (GdkGC *gc)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gc_class_init (GdkGCClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gdk_gc_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gc_finalize (GObject *object)
|
||||
{
|
||||
GdkGC *gc = GDK_GC (object);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
return gdk_gc_new_with_values (window, NULL, 0);
|
||||
}
|
||||
|
||||
GdkGC*
|
||||
gdk_gc_new (GdkDrawable *drawable)
|
||||
{
|
||||
g_return_val_if_fail (drawable != NULL, NULL);
|
||||
|
||||
if (GDK_IS_WINDOW (drawable) && GDK_WINDOW_DESTROYED (drawable))
|
||||
return NULL;
|
||||
|
||||
return gdk_gc_new_with_values (drawable, NULL, 0);
|
||||
}
|
||||
|
||||
GdkGC*
|
||||
gdk_gc_new_with_values (GdkDrawable *drawable,
|
||||
gdk_gc_new_with_values (GdkWindow *window,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
GdkGC *gc;
|
||||
GdkGCPrivate *private;
|
||||
Window xwindow;
|
||||
XGCValues xvalues;
|
||||
unsigned long xvalues_mask;
|
||||
|
||||
g_return_val_if_fail (drawable != NULL, NULL);
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
if (GDK_IS_WINDOW (drawable) && GDK_WINDOW_DESTROYED (drawable))
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
if (window_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
gc = GDK_DRAWABLE_GET_CLASS (drawable)->create_gc (drawable,
|
||||
values,
|
||||
values_mask);
|
||||
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
|
||||
gc->clip_x_origin = values->clip_x_origin;
|
||||
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
|
||||
gc->clip_y_origin = values->clip_y_origin;
|
||||
private = g_new (GdkGCPrivate, 1);
|
||||
gc = (GdkGC*) private;
|
||||
|
||||
xwindow = window_private->xwindow;
|
||||
private->xdisplay = window_private->xdisplay;
|
||||
private->ref_count = 1;
|
||||
|
||||
xvalues.function = GXcopy;
|
||||
xvalues.fill_style = FillSolid;
|
||||
xvalues.arc_mode = ArcPieSlice;
|
||||
xvalues.subwindow_mode = ClipByChildren;
|
||||
xvalues.graphics_exposures = True;
|
||||
xvalues_mask = GCFunction | GCFillStyle | GCArcMode | GCSubwindowMode | GCGraphicsExposures;
|
||||
|
||||
if (values_mask & GDK_GC_FOREGROUND)
|
||||
{
|
||||
xvalues.foreground = values->foreground.pixel;
|
||||
xvalues_mask |= GCForeground;
|
||||
}
|
||||
if (values_mask & GDK_GC_BACKGROUND)
|
||||
{
|
||||
xvalues.background = values->background.pixel;
|
||||
xvalues_mask |= GCBackground;
|
||||
}
|
||||
if ((values_mask & GDK_GC_FONT) && (values->font->type == GDK_FONT_FONT))
|
||||
{
|
||||
xvalues.font = ((XFontStruct *) ((GdkFontPrivate*) values->font)->xfont)->fid;
|
||||
xvalues_mask |= GCFont;
|
||||
}
|
||||
if (values_mask & GDK_GC_FUNCTION)
|
||||
{
|
||||
switch (values->function)
|
||||
{
|
||||
case GDK_COPY:
|
||||
xvalues.function = GXcopy;
|
||||
break;
|
||||
case GDK_INVERT:
|
||||
xvalues.function = GXinvert;
|
||||
break;
|
||||
case GDK_XOR:
|
||||
xvalues.function = GXxor;
|
||||
break;
|
||||
case GDK_CLEAR:
|
||||
xvalues.function = GXclear;
|
||||
break;
|
||||
case GDK_AND:
|
||||
xvalues.function = GXand;
|
||||
break;
|
||||
case GDK_AND_REVERSE:
|
||||
xvalues.function = GXandReverse;
|
||||
break;
|
||||
case GDK_AND_INVERT:
|
||||
xvalues.function = GXandInverted;
|
||||
break;
|
||||
case GDK_NOOP:
|
||||
xvalues.function = GXnoop;
|
||||
break;
|
||||
case GDK_OR:
|
||||
xvalues.function = GXor;
|
||||
break;
|
||||
case GDK_EQUIV:
|
||||
xvalues.function = GXequiv;
|
||||
break;
|
||||
case GDK_OR_REVERSE:
|
||||
xvalues.function = GXorReverse;
|
||||
break;
|
||||
case GDK_COPY_INVERT:
|
||||
xvalues.function = GXcopyInverted;
|
||||
break;
|
||||
case GDK_OR_INVERT:
|
||||
xvalues.function = GXorInverted;
|
||||
break;
|
||||
case GDK_NAND:
|
||||
xvalues.function = GXnand;
|
||||
break;
|
||||
case GDK_SET:
|
||||
xvalues.function = GXset;
|
||||
break;
|
||||
}
|
||||
xvalues_mask |= GCFunction;
|
||||
}
|
||||
if (values_mask & GDK_GC_FILL)
|
||||
{
|
||||
switch (values->fill)
|
||||
{
|
||||
case GDK_SOLID:
|
||||
xvalues.fill_style = FillSolid;
|
||||
break;
|
||||
case GDK_TILED:
|
||||
xvalues.fill_style = FillTiled;
|
||||
break;
|
||||
case GDK_STIPPLED:
|
||||
xvalues.fill_style = FillStippled;
|
||||
break;
|
||||
case GDK_OPAQUE_STIPPLED:
|
||||
xvalues.fill_style = FillOpaqueStippled;
|
||||
break;
|
||||
}
|
||||
xvalues_mask |= GCFillStyle;
|
||||
}
|
||||
if (values_mask & GDK_GC_TILE)
|
||||
{
|
||||
xvalues.tile = ((GdkPixmapPrivate*) values->tile)->xwindow;
|
||||
xvalues_mask |= GCTile;
|
||||
}
|
||||
if (values_mask & GDK_GC_STIPPLE)
|
||||
{
|
||||
xvalues.stipple = ((GdkPixmapPrivate*) values->stipple)->xwindow;
|
||||
xvalues_mask |= GCStipple;
|
||||
}
|
||||
if (values_mask & GDK_GC_CLIP_MASK)
|
||||
{
|
||||
xvalues.clip_mask = ((GdkPixmapPrivate*) values->clip_mask)->xwindow;
|
||||
xvalues_mask |= GCClipMask;
|
||||
}
|
||||
if (values_mask & GDK_GC_SUBWINDOW)
|
||||
{
|
||||
xvalues.subwindow_mode = values->subwindow_mode;
|
||||
xvalues_mask |= GCSubwindowMode;
|
||||
}
|
||||
if (values_mask & GDK_GC_TS_X_ORIGIN)
|
||||
gc->ts_x_origin = values->ts_x_origin;
|
||||
{
|
||||
xvalues.ts_x_origin = values->ts_x_origin;
|
||||
xvalues_mask |= GCTileStipXOrigin;
|
||||
}
|
||||
if (values_mask & GDK_GC_TS_Y_ORIGIN)
|
||||
gc->ts_y_origin = values->ts_y_origin;
|
||||
{
|
||||
xvalues.ts_y_origin = values->ts_y_origin;
|
||||
xvalues_mask |= GCTileStipYOrigin;
|
||||
}
|
||||
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
|
||||
{
|
||||
xvalues.clip_x_origin = values->clip_x_origin;
|
||||
xvalues_mask |= GCClipXOrigin;
|
||||
}
|
||||
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
|
||||
{
|
||||
xvalues.clip_y_origin = values->clip_y_origin;
|
||||
xvalues_mask |= GCClipYOrigin;
|
||||
}
|
||||
|
||||
if (values_mask & GDK_GC_EXPOSURES)
|
||||
xvalues.graphics_exposures = values->graphics_exposures;
|
||||
else
|
||||
xvalues.graphics_exposures = False;
|
||||
xvalues_mask |= GCGraphicsExposures;
|
||||
|
||||
if (values_mask & GDK_GC_LINE_WIDTH)
|
||||
{
|
||||
xvalues.line_width = values->line_width;
|
||||
xvalues_mask |= GCLineWidth;
|
||||
}
|
||||
if (values_mask & GDK_GC_LINE_STYLE)
|
||||
{
|
||||
switch (values->line_style)
|
||||
{
|
||||
case GDK_LINE_SOLID:
|
||||
xvalues.line_style = LineSolid;
|
||||
break;
|
||||
case GDK_LINE_ON_OFF_DASH:
|
||||
xvalues.line_style = LineOnOffDash;
|
||||
break;
|
||||
case GDK_LINE_DOUBLE_DASH:
|
||||
xvalues.line_style = LineDoubleDash;
|
||||
break;
|
||||
}
|
||||
xvalues_mask |= GCLineStyle;
|
||||
}
|
||||
if (values_mask & GDK_GC_CAP_STYLE)
|
||||
{
|
||||
switch (values->cap_style)
|
||||
{
|
||||
case GDK_CAP_NOT_LAST:
|
||||
xvalues.cap_style = CapNotLast;
|
||||
break;
|
||||
case GDK_CAP_BUTT:
|
||||
xvalues.cap_style = CapButt;
|
||||
break;
|
||||
case GDK_CAP_ROUND:
|
||||
xvalues.cap_style = CapRound;
|
||||
break;
|
||||
case GDK_CAP_PROJECTING:
|
||||
xvalues.cap_style = CapProjecting;
|
||||
break;
|
||||
}
|
||||
xvalues_mask |= GCCapStyle;
|
||||
}
|
||||
if (values_mask & GDK_GC_JOIN_STYLE)
|
||||
{
|
||||
switch (values->join_style)
|
||||
{
|
||||
case GDK_JOIN_MITER:
|
||||
xvalues.join_style = JoinMiter;
|
||||
break;
|
||||
case GDK_JOIN_ROUND:
|
||||
xvalues.join_style = JoinRound;
|
||||
break;
|
||||
case GDK_JOIN_BEVEL:
|
||||
xvalues.join_style = JoinBevel;
|
||||
break;
|
||||
}
|
||||
xvalues_mask |= GCJoinStyle;
|
||||
}
|
||||
|
||||
private->xgc = XCreateGC (private->xdisplay, xwindow, xvalues_mask, &xvalues);
|
||||
|
||||
return gc;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_destroy (GdkGC *gc)
|
||||
{
|
||||
gdk_gc_unref (gc);
|
||||
}
|
||||
|
||||
GdkGC *
|
||||
gdk_gc_ref (GdkGC *gc)
|
||||
{
|
||||
return (GdkGC *) g_object_ref (G_OBJECT (gc));
|
||||
GdkGCPrivate *private = (GdkGCPrivate*) gc;
|
||||
|
||||
g_return_val_if_fail (gc != NULL, NULL);
|
||||
private->ref_count += 1;
|
||||
|
||||
return gc;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_unref (GdkGC *gc)
|
||||
{
|
||||
g_object_unref (G_OBJECT (gc));
|
||||
GdkGCPrivate *private = (GdkGCPrivate*) gc;
|
||||
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
if (private->ref_count > 1)
|
||||
private->ref_count -= 1;
|
||||
else
|
||||
{
|
||||
XFreeGC (private->xdisplay, private->xgc);
|
||||
memset (gc, 0, sizeof (GdkGCPrivate));
|
||||
g_free (gc);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_get_values (GdkGC *gc,
|
||||
GdkGCValues *values)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
GdkGCPrivate *private;
|
||||
XGCValues xvalues;
|
||||
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (values != NULL);
|
||||
|
||||
GDK_GC_GET_CLASS (gc)->get_values (gc, values);
|
||||
}
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
void
|
||||
gdk_gc_set_values (GdkGC *gc,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (values != NULL);
|
||||
if (XGetGCValues (private->xdisplay, private->xgc,
|
||||
GCForeground | GCBackground | GCFont |
|
||||
GCFunction | GCTile | GCStipple | /* GCClipMask | */
|
||||
GCSubwindowMode | GCGraphicsExposures |
|
||||
GCTileStipXOrigin | GCTileStipYOrigin |
|
||||
GCClipXOrigin | GCClipYOrigin |
|
||||
GCLineWidth | GCLineStyle | GCCapStyle |
|
||||
GCFillStyle | GCJoinStyle, &xvalues))
|
||||
{
|
||||
values->foreground.pixel = xvalues.foreground;
|
||||
values->background.pixel = xvalues.background;
|
||||
values->font = gdk_font_lookup (xvalues.font);
|
||||
|
||||
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
|
||||
gc->clip_x_origin = values->clip_x_origin;
|
||||
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
|
||||
gc->clip_y_origin = values->clip_y_origin;
|
||||
if (values_mask & GDK_GC_TS_X_ORIGIN)
|
||||
gc->ts_x_origin = values->ts_x_origin;
|
||||
if (values_mask & GDK_GC_TS_Y_ORIGIN)
|
||||
gc->ts_y_origin = values->ts_y_origin;
|
||||
|
||||
GDK_GC_GET_CLASS (gc)->set_values (gc, values, values_mask);
|
||||
switch (xvalues.function)
|
||||
{
|
||||
case GXcopy:
|
||||
values->function = GDK_COPY;
|
||||
break;
|
||||
case GXinvert:
|
||||
values->function = GDK_INVERT;
|
||||
break;
|
||||
case GXxor:
|
||||
values->function = GDK_XOR;
|
||||
break;
|
||||
case GXclear:
|
||||
values->function = GDK_CLEAR;
|
||||
break;
|
||||
case GXand:
|
||||
values->function = GDK_AND;
|
||||
break;
|
||||
case GXandReverse:
|
||||
values->function = GDK_AND_REVERSE;
|
||||
break;
|
||||
case GXandInverted:
|
||||
values->function = GDK_AND_INVERT;
|
||||
break;
|
||||
case GXnoop:
|
||||
values->function = GDK_NOOP;
|
||||
break;
|
||||
case GXor:
|
||||
values->function = GDK_OR;
|
||||
break;
|
||||
case GXequiv:
|
||||
values->function = GDK_EQUIV;
|
||||
break;
|
||||
case GXorReverse:
|
||||
values->function = GDK_OR_REVERSE;
|
||||
break;
|
||||
case GXcopyInverted:
|
||||
values->function =GDK_COPY_INVERT;
|
||||
break;
|
||||
case GXorInverted:
|
||||
values->function = GDK_OR_INVERT;
|
||||
break;
|
||||
case GXnand:
|
||||
values->function = GDK_NAND;
|
||||
break;
|
||||
case GXset:
|
||||
values->function = GDK_SET;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (xvalues.fill_style)
|
||||
{
|
||||
case FillSolid:
|
||||
values->fill = GDK_SOLID;
|
||||
break;
|
||||
case FillTiled:
|
||||
values->fill = GDK_TILED;
|
||||
break;
|
||||
case FillStippled:
|
||||
values->fill = GDK_STIPPLED;
|
||||
break;
|
||||
case FillOpaqueStippled:
|
||||
values->fill = GDK_OPAQUE_STIPPLED;
|
||||
break;
|
||||
}
|
||||
|
||||
values->tile = gdk_pixmap_lookup (xvalues.tile);
|
||||
values->stipple = gdk_pixmap_lookup (xvalues.stipple);
|
||||
values->clip_mask = NULL;
|
||||
values->subwindow_mode = xvalues.subwindow_mode;
|
||||
values->ts_x_origin = xvalues.ts_x_origin;
|
||||
values->ts_y_origin = xvalues.ts_y_origin;
|
||||
values->clip_x_origin = xvalues.clip_x_origin;
|
||||
values->clip_y_origin = xvalues.clip_y_origin;
|
||||
values->graphics_exposures = xvalues.graphics_exposures;
|
||||
values->line_width = xvalues.line_width;
|
||||
|
||||
switch (xvalues.line_style)
|
||||
{
|
||||
case LineSolid:
|
||||
values->line_style = GDK_LINE_SOLID;
|
||||
break;
|
||||
case LineOnOffDash:
|
||||
values->line_style = GDK_LINE_ON_OFF_DASH;
|
||||
break;
|
||||
case LineDoubleDash:
|
||||
values->line_style = GDK_LINE_DOUBLE_DASH;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (xvalues.cap_style)
|
||||
{
|
||||
case CapNotLast:
|
||||
values->cap_style = GDK_CAP_NOT_LAST;
|
||||
break;
|
||||
case CapButt:
|
||||
values->cap_style = GDK_CAP_BUTT;
|
||||
break;
|
||||
case CapRound:
|
||||
values->cap_style = GDK_CAP_ROUND;
|
||||
break;
|
||||
case CapProjecting:
|
||||
values->cap_style = GDK_CAP_PROJECTING;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (xvalues.join_style)
|
||||
{
|
||||
case JoinMiter:
|
||||
values->join_style = GDK_JOIN_MITER;
|
||||
break;
|
||||
case JoinRound:
|
||||
values->join_style = GDK_JOIN_ROUND;
|
||||
break;
|
||||
case JoinBevel:
|
||||
values->join_style = GDK_JOIN_BEVEL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memset (values, 0, sizeof (GdkGCValues));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_foreground (GdkGC *gc,
|
||||
GdkColor *color)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
values.foreground = *color;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
XSetForeground (private->xdisplay, private->xgc, color->pixel);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_background (GdkGC *gc,
|
||||
GdkColor *color)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
values.background = *color;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_BACKGROUND);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
XSetBackground (private->xdisplay, private->xgc, color->pixel);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_font (GdkGC *gc,
|
||||
GdkFont *font)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *gc_private;
|
||||
GdkFontPrivate *font_private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
values.font = font;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_FONT);
|
||||
if (font->type == GDK_FONT_FONT)
|
||||
{
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
XSetFont (gc_private->xdisplay, gc_private->xgc,
|
||||
((XFontStruct *) font_private->xfont)->fid);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_function (GdkGC *gc,
|
||||
GdkFunction function)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.function = function;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_FUNCTION);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
switch (function)
|
||||
{
|
||||
case GDK_COPY:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXcopy);
|
||||
break;
|
||||
case GDK_INVERT:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXinvert);
|
||||
break;
|
||||
case GDK_XOR:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXxor);
|
||||
break;
|
||||
case GDK_CLEAR:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXclear);
|
||||
break;
|
||||
case GDK_AND:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXand);
|
||||
break;
|
||||
case GDK_AND_REVERSE:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXandReverse);
|
||||
break;
|
||||
case GDK_AND_INVERT:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXandInverted);
|
||||
break;
|
||||
case GDK_NOOP:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXnoop);
|
||||
break;
|
||||
case GDK_OR:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXor);
|
||||
break;
|
||||
case GDK_EQUIV:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXequiv);
|
||||
break;
|
||||
case GDK_OR_REVERSE:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXorReverse);
|
||||
break;
|
||||
case GDK_COPY_INVERT:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXcopyInverted);
|
||||
break;
|
||||
case GDK_OR_INVERT:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXorInverted);
|
||||
break;
|
||||
case GDK_NAND:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXnand);
|
||||
break;
|
||||
case GDK_SET:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_fill (GdkGC *gc,
|
||||
GdkFill fill)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.fill = fill;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_FILL);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
switch (fill)
|
||||
{
|
||||
case GDK_SOLID:
|
||||
XSetFillStyle (private->xdisplay, private->xgc, FillSolid);
|
||||
break;
|
||||
case GDK_TILED:
|
||||
XSetFillStyle (private->xdisplay, private->xgc, FillTiled);
|
||||
break;
|
||||
case GDK_STIPPLED:
|
||||
XSetFillStyle (private->xdisplay, private->xgc, FillStippled);
|
||||
break;
|
||||
case GDK_OPAQUE_STIPPLED:
|
||||
XSetFillStyle (private->xdisplay, private->xgc, FillOpaqueStippled);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_tile (GdkGC *gc,
|
||||
GdkPixmap *tile)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
GdkPixmapPrivate *pixmap_private;
|
||||
Pixmap pixmap;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.tile = tile;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_TILE);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
pixmap = None;
|
||||
if (tile)
|
||||
{
|
||||
pixmap_private = (GdkPixmapPrivate*) tile;
|
||||
pixmap = pixmap_private->xwindow;
|
||||
}
|
||||
|
||||
XSetTile (private->xdisplay, private->xgc, pixmap);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_stipple (GdkGC *gc,
|
||||
GdkPixmap *stipple)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
GdkPixmapPrivate *pixmap_private;
|
||||
Pixmap pixmap;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.stipple = stipple;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_STIPPLE);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
pixmap = None;
|
||||
if (stipple)
|
||||
{
|
||||
pixmap_private = (GdkPixmapPrivate*) stipple;
|
||||
pixmap = pixmap_private->xwindow;
|
||||
}
|
||||
|
||||
XSetStipple (private->xdisplay, private->xgc, pixmap);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -259,15 +629,13 @@ gdk_gc_set_ts_origin (GdkGC *gc,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.ts_x_origin = x;
|
||||
values.ts_y_origin = y;
|
||||
|
||||
gdk_gc_set_values (gc, &values,
|
||||
GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
XSetTSOrigin (private->xdisplay, private->xgc, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -275,52 +643,112 @@ gdk_gc_set_clip_origin (GdkGC *gc,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.clip_x_origin = x;
|
||||
values.clip_y_origin = y;
|
||||
|
||||
gdk_gc_set_values (gc, &values,
|
||||
GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
XSetClipOrigin (private->xdisplay, private->xgc, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_clip_mask (GdkGC *gc,
|
||||
GdkBitmap *mask)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
Pixmap xmask;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.clip_mask = mask;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_CLIP_MASK);
|
||||
if (mask)
|
||||
{
|
||||
GdkWindowPrivate *mask_private;
|
||||
|
||||
mask_private = (GdkWindowPrivate*) mask;
|
||||
if (mask_private->destroyed)
|
||||
return;
|
||||
xmask = mask_private->xwindow;
|
||||
}
|
||||
else
|
||||
xmask = None;
|
||||
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
XSetClipMask (private->xdisplay, private->xgc, xmask);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gdk_gc_set_clip_rectangle (GdkGC *gc,
|
||||
GdkRectangle *rectangle)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
XRectangle xrectangle;
|
||||
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (rectangle)
|
||||
{
|
||||
xrectangle.x = rectangle->x;
|
||||
xrectangle.y = rectangle->y;
|
||||
xrectangle.width = rectangle->width;
|
||||
xrectangle.height = rectangle->height;
|
||||
|
||||
XSetClipRectangles (private->xdisplay, private->xgc, 0, 0,
|
||||
&xrectangle, 1, Unsorted);
|
||||
}
|
||||
else
|
||||
XSetClipMask (private->xdisplay, private->xgc, None);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_clip_region (GdkGC *gc,
|
||||
GdkRegion *region)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (region)
|
||||
{
|
||||
GdkRegionPrivate *region_private;
|
||||
|
||||
region_private = (GdkRegionPrivate*) region;
|
||||
XSetRegion (private->xdisplay, private->xgc, region_private->xregion);
|
||||
}
|
||||
else
|
||||
XSetClipMask (private->xdisplay, private->xgc, None);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_subwindow (GdkGC *gc,
|
||||
GdkSubwindowMode mode)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.subwindow_mode = mode;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_SUBWINDOW);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
XSetSubwindowMode (private->xdisplay, private->xgc, mode);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_exposures (GdkGC *gc,
|
||||
gboolean exposures)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
values.graphics_exposures = exposures;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_EXPOSURES);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
XSetGraphicsExposures (private->xdisplay, private->xgc, exposures);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -330,28 +758,91 @@ gdk_gc_set_line_attributes (GdkGC *gc,
|
||||
GdkCapStyle cap_style,
|
||||
GdkJoinStyle join_style)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *private;
|
||||
int xline_style;
|
||||
int xcap_style;
|
||||
int xjoin_style;
|
||||
|
||||
values.line_width = line_width;
|
||||
values.line_style = line_style;
|
||||
values.cap_style = cap_style;
|
||||
values.join_style = join_style;
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
gdk_gc_set_values (gc, &values,
|
||||
GDK_GC_LINE_WIDTH |
|
||||
GDK_GC_LINE_STYLE |
|
||||
GDK_GC_CAP_STYLE |
|
||||
GDK_GC_JOIN_STYLE);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
switch (line_style)
|
||||
{
|
||||
case GDK_LINE_SOLID:
|
||||
xline_style = LineSolid;
|
||||
break;
|
||||
case GDK_LINE_ON_OFF_DASH:
|
||||
xline_style = LineOnOffDash;
|
||||
break;
|
||||
case GDK_LINE_DOUBLE_DASH:
|
||||
xline_style = LineDoubleDash;
|
||||
break;
|
||||
default:
|
||||
xline_style = None;
|
||||
}
|
||||
|
||||
switch (cap_style)
|
||||
{
|
||||
case GDK_CAP_NOT_LAST:
|
||||
xcap_style = CapNotLast;
|
||||
break;
|
||||
case GDK_CAP_BUTT:
|
||||
xcap_style = CapButt;
|
||||
break;
|
||||
case GDK_CAP_ROUND:
|
||||
xcap_style = CapRound;
|
||||
break;
|
||||
case GDK_CAP_PROJECTING:
|
||||
xcap_style = CapProjecting;
|
||||
break;
|
||||
default:
|
||||
xcap_style = None;
|
||||
}
|
||||
|
||||
switch (join_style)
|
||||
{
|
||||
case GDK_JOIN_MITER:
|
||||
xjoin_style = JoinMiter;
|
||||
break;
|
||||
case GDK_JOIN_ROUND:
|
||||
xjoin_style = JoinRound;
|
||||
break;
|
||||
case GDK_JOIN_BEVEL:
|
||||
xjoin_style = JoinBevel;
|
||||
break;
|
||||
default:
|
||||
xjoin_style = None;
|
||||
}
|
||||
|
||||
XSetLineAttributes (private->xdisplay, private->xgc, line_width,
|
||||
xline_style, xcap_style, xjoin_style);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_dashes (GdkGC *gc,
|
||||
gint dash_offset,
|
||||
gint8 dash_list[],
|
||||
gint n)
|
||||
gdk_gc_set_dashes (GdkGC *gc,
|
||||
gint dash_offset,
|
||||
gint8 dash_list[],
|
||||
gint n)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (dash_list != NULL);
|
||||
|
||||
GDK_GC_GET_CLASS (gc)->set_dashes (gc, dash_offset, dash_list, n);
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
XSetDashes (private->xdisplay, private->xgc, dash_offset, dash_list, n);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
|
||||
{
|
||||
GdkGCPrivate *dst_private, *src_private;
|
||||
|
||||
src_private = (GdkGCPrivate *) src_gc;
|
||||
dst_private = (GdkGCPrivate *) dst_gc;
|
||||
|
||||
XCopyGC (src_private->xdisplay, src_private->xgc, ~((~1) << GCLastBit),
|
||||
dst_private->xgc);
|
||||
}
|
||||
|
||||
244
gdk/gdkgc.h
244
gdk/gdkgc.h
@@ -1,244 +0,0 @@
|
||||
#ifndef __GDK_GC_H__
|
||||
#define __GDK_GC_H__
|
||||
|
||||
#include <gdk/gdkcolor.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _GdkGCValues GdkGCValues;
|
||||
typedef struct _GdkGCClass GdkGCClass;
|
||||
|
||||
/* GC cap styles
|
||||
* CapNotLast:
|
||||
* CapButt:
|
||||
* CapRound:
|
||||
* CapProjecting:
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_CAP_NOT_LAST,
|
||||
GDK_CAP_BUTT,
|
||||
GDK_CAP_ROUND,
|
||||
GDK_CAP_PROJECTING
|
||||
} GdkCapStyle;
|
||||
|
||||
/* GC fill types.
|
||||
* Solid:
|
||||
* Tiled:
|
||||
* Stippled:
|
||||
* OpaqueStippled:
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_SOLID,
|
||||
GDK_TILED,
|
||||
GDK_STIPPLED,
|
||||
GDK_OPAQUE_STIPPLED
|
||||
} GdkFill;
|
||||
|
||||
/* GC function types.
|
||||
* Copy: Overwrites destination pixels with the source pixels.
|
||||
* Invert: Inverts the destination pixels.
|
||||
* Xor: Xor's the destination pixels with the source pixels.
|
||||
* Clear: set pixels to 0
|
||||
* And: source AND destination
|
||||
* And Reverse: source AND (NOT destination)
|
||||
* And Invert: (NOT source) AND destination
|
||||
* Noop: destination
|
||||
* Or: source OR destination
|
||||
* Nor: (NOT source) AND (NOT destination)
|
||||
* Equiv: (NOT source) XOR destination
|
||||
* Xor Reverse: source OR (NOT destination)
|
||||
* Copy Inverted: NOT source
|
||||
* Xor Inverted: (NOT source) OR destination
|
||||
* Nand: (NOT source) OR (NOT destination)
|
||||
* Set: set pixels to 1
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_COPY,
|
||||
GDK_INVERT,
|
||||
GDK_XOR,
|
||||
GDK_CLEAR,
|
||||
GDK_AND,
|
||||
GDK_AND_REVERSE,
|
||||
GDK_AND_INVERT,
|
||||
GDK_NOOP,
|
||||
GDK_OR,
|
||||
GDK_EQUIV,
|
||||
GDK_OR_REVERSE,
|
||||
GDK_COPY_INVERT,
|
||||
GDK_OR_INVERT,
|
||||
GDK_NAND,
|
||||
GDK_SET
|
||||
} GdkFunction;
|
||||
|
||||
/* GC join styles
|
||||
* JoinMiter:
|
||||
* JoinRound:
|
||||
* JoinBevel:
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_JOIN_MITER,
|
||||
GDK_JOIN_ROUND,
|
||||
GDK_JOIN_BEVEL
|
||||
} GdkJoinStyle;
|
||||
|
||||
/* GC line styles
|
||||
* Solid:
|
||||
* OnOffDash:
|
||||
* DoubleDash:
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_LINE_SOLID,
|
||||
GDK_LINE_ON_OFF_DASH,
|
||||
GDK_LINE_DOUBLE_DASH
|
||||
} GdkLineStyle;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_CLIP_BY_CHILDREN = 0,
|
||||
GDK_INCLUDE_INFERIORS = 1
|
||||
} GdkSubwindowMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_GC_FOREGROUND = 1 << 0,
|
||||
GDK_GC_BACKGROUND = 1 << 1,
|
||||
GDK_GC_FONT = 1 << 2,
|
||||
GDK_GC_FUNCTION = 1 << 3,
|
||||
GDK_GC_FILL = 1 << 4,
|
||||
GDK_GC_TILE = 1 << 5,
|
||||
GDK_GC_STIPPLE = 1 << 6,
|
||||
GDK_GC_CLIP_MASK = 1 << 7,
|
||||
GDK_GC_SUBWINDOW = 1 << 8,
|
||||
GDK_GC_TS_X_ORIGIN = 1 << 9,
|
||||
GDK_GC_TS_Y_ORIGIN = 1 << 10,
|
||||
GDK_GC_CLIP_X_ORIGIN = 1 << 11,
|
||||
GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
|
||||
GDK_GC_EXPOSURES = 1 << 13,
|
||||
GDK_GC_LINE_WIDTH = 1 << 14,
|
||||
GDK_GC_LINE_STYLE = 1 << 15,
|
||||
GDK_GC_CAP_STYLE = 1 << 16,
|
||||
GDK_GC_JOIN_STYLE = 1 << 17
|
||||
} GdkGCValuesMask;
|
||||
|
||||
struct _GdkGCValues
|
||||
{
|
||||
GdkColor foreground;
|
||||
GdkColor background;
|
||||
GdkFont *font;
|
||||
GdkFunction function;
|
||||
GdkFill fill;
|
||||
GdkPixmap *tile;
|
||||
GdkPixmap *stipple;
|
||||
GdkPixmap *clip_mask;
|
||||
GdkSubwindowMode subwindow_mode;
|
||||
gint ts_x_origin;
|
||||
gint ts_y_origin;
|
||||
gint clip_x_origin;
|
||||
gint clip_y_origin;
|
||||
gint graphics_exposures;
|
||||
gint line_width;
|
||||
GdkLineStyle line_style;
|
||||
GdkCapStyle cap_style;
|
||||
GdkJoinStyle join_style;
|
||||
};
|
||||
|
||||
#define GDK_TYPE_GC (gdk_gc_get_type ())
|
||||
#define GDK_GC(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC, GdkGC))
|
||||
#define GDK_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC, GdkGCClass))
|
||||
#define GDK_IS_GC(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC))
|
||||
#define GDK_IS_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC))
|
||||
#define GDK_GC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC, GdkGCClass))
|
||||
|
||||
struct _GdkGC
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
gint clip_x_origin;
|
||||
gint clip_y_origin;
|
||||
gint ts_x_origin;
|
||||
gint ts_y_origin;
|
||||
};
|
||||
|
||||
struct _GdkGCClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
void (*get_values) (GdkGC *gc,
|
||||
GdkGCValues *values);
|
||||
void (*set_values) (GdkGC *gc,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask mask);
|
||||
void (*set_dashes) (GdkGC *gc,
|
||||
gint dash_offset,
|
||||
gint8 dash_list[],
|
||||
gint n);
|
||||
};
|
||||
|
||||
|
||||
GType gdk_gc_get_type (void);
|
||||
GdkGC *gdk_gc_new (GdkDrawable *drawable);
|
||||
GdkGC *gdk_gc_new_with_values (GdkDrawable *drawable,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask);
|
||||
GdkGC *gdk_gc_ref (GdkGC *gc);
|
||||
void gdk_gc_unref (GdkGC *gc);
|
||||
void gdk_gc_get_values (GdkGC *gc,
|
||||
GdkGCValues *values);
|
||||
void gdk_gc_set_values (GdkGC *gc,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask);
|
||||
void gdk_gc_set_foreground (GdkGC *gc,
|
||||
GdkColor *color);
|
||||
void gdk_gc_set_background (GdkGC *gc,
|
||||
GdkColor *color);
|
||||
void gdk_gc_set_font (GdkGC *gc,
|
||||
GdkFont *font);
|
||||
void gdk_gc_set_function (GdkGC *gc,
|
||||
GdkFunction function);
|
||||
void gdk_gc_set_fill (GdkGC *gc,
|
||||
GdkFill fill);
|
||||
void gdk_gc_set_tile (GdkGC *gc,
|
||||
GdkPixmap *tile);
|
||||
void gdk_gc_set_stipple (GdkGC *gc,
|
||||
GdkPixmap *stipple);
|
||||
void gdk_gc_set_ts_origin (GdkGC *gc,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_gc_set_clip_origin (GdkGC *gc,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_gc_set_clip_mask (GdkGC *gc,
|
||||
GdkBitmap *mask);
|
||||
void gdk_gc_set_clip_rectangle (GdkGC *gc,
|
||||
GdkRectangle *rectangle);
|
||||
void gdk_gc_set_clip_region (GdkGC *gc,
|
||||
GdkRegion *region);
|
||||
void gdk_gc_set_subwindow (GdkGC *gc,
|
||||
GdkSubwindowMode mode);
|
||||
void gdk_gc_set_exposures (GdkGC *gc,
|
||||
gboolean exposures);
|
||||
void gdk_gc_set_line_attributes (GdkGC *gc,
|
||||
gint line_width,
|
||||
GdkLineStyle line_style,
|
||||
GdkCapStyle cap_style,
|
||||
GdkJoinStyle join_style);
|
||||
void gdk_gc_set_dashes (GdkGC *gc,
|
||||
gint dash_offset,
|
||||
gint8 dash_list[],
|
||||
gint n);
|
||||
void gdk_gc_copy (GdkGC *dst_gc,
|
||||
GdkGC *src_gc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_DRAWABLE_H__ */
|
||||
@@ -25,17 +25,57 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include "gdktypes.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "config.h"
|
||||
|
||||
guint gdk_debug_flags = 0;
|
||||
GdkWindow *gdk_parent_root = NULL;
|
||||
gint gdk_use_xshm = TRUE;
|
||||
gchar *gdk_display_name = NULL;
|
||||
Display *gdk_display = NULL;
|
||||
gint gdk_screen;
|
||||
Window gdk_root_window;
|
||||
Window gdk_leader_window;
|
||||
GdkWindowPrivate gdk_root_parent = { { NULL, }, NULL, };
|
||||
Atom gdk_wm_delete_window;
|
||||
Atom gdk_wm_take_focus;
|
||||
Atom gdk_wm_protocols;
|
||||
Atom gdk_wm_window_protocols[2];
|
||||
Atom gdk_selection_property;
|
||||
GdkDndCursorInfo gdk_dnd_cursorinfo = {None, None, NULL, NULL,
|
||||
{0,0}, {0,0}, NULL};
|
||||
GdkDndGlobals gdk_dnd = {None,None,None,
|
||||
None,None,None,
|
||||
None,
|
||||
&gdk_dnd_cursorinfo,
|
||||
NULL,
|
||||
0,
|
||||
FALSE, FALSE, FALSE,
|
||||
None,
|
||||
{0,0},
|
||||
{0,0}, {0,0},
|
||||
{0,0,0,0}, NULL, None, 0};
|
||||
gchar *gdk_progclass = NULL;
|
||||
gint gdk_error_code = 0;
|
||||
gint gdk_error_warnings = TRUE;
|
||||
gint gdk_null_window_warnings = TRUE;
|
||||
GList *gdk_default_filters = NULL;
|
||||
GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
|
||||
GList *gdk_queued_events = NULL;
|
||||
GList *gdk_queued_tail = NULL;
|
||||
|
||||
gboolean gdk_xim_using; /* using XIM Protocol if TRUE */
|
||||
#ifdef USE_XIM
|
||||
GdkICPrivate *gdk_xim_ic; /* currently using IC */
|
||||
#endif /* USE_XIM */
|
||||
GdkWindow *gdk_xim_window; /* currently using Widow */
|
||||
|
||||
GdkWindowPrivate *gdk_xgrab_window = NULL; /* Window that currently holds the
|
||||
* x pointer grab
|
||||
*/
|
||||
|
||||
GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
|
||||
|
||||
#ifdef USE_XIM
|
||||
GdkICPrivate *gdk_xim_ic; /* currently using IC */
|
||||
GdkWindow *gdk_xim_window; /* currently using Window */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -30,17 +30,16 @@
|
||||
/* GDK uses "glib". (And so does GTK).
|
||||
*/
|
||||
#include <glib.h>
|
||||
#include <gdkconfig.h>
|
||||
|
||||
/* international string support */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(GDK_HAVE_BROKEN_WCTYPE) && (defined(GDK_HAVE_WCTYPE_H) || defined(GDK_HAVE_WCHAR_H)) && !defined(X_LOCALE)
|
||||
# ifdef GDK_HAVE_WCTYPE_H
|
||||
#if !defined(G_HAVE_BROKEN_WCTYPE) && (defined(G_HAVE_WCTYPE_H) || defined(G_HAVE_WCHAR_H)) && !defined(X_LOCALE)
|
||||
# ifdef G_HAVE_WCTYPE_H
|
||||
# include <wctype.h>
|
||||
# else
|
||||
# ifdef GDK_HAVE_WCHAR_H
|
||||
# ifdef G_HAVE_WCHAR_H
|
||||
# include <wchar.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
@@ -25,13 +25,10 @@
|
||||
*/
|
||||
|
||||
#include <X11/Xlocale.h>
|
||||
|
||||
#include "gdk.h" /* For gdk_flush() */
|
||||
#include "gdkim.h"
|
||||
#include "gdkpixmap.h"
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdki18n.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdkx.h"
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -625,7 +622,7 @@ gdk_ic_new (GdkICAttr *attr, GdkICAttributesType mask)
|
||||
}
|
||||
|
||||
if (attr->client_window == NULL ||
|
||||
GDK_WINDOW_DESTROYED (attr->client_window))
|
||||
((GdkWindowPrivate *)attr->client_window)->destroyed)
|
||||
{
|
||||
g_warning ("Client_window is null or already destroyed.\n");
|
||||
return NULL;
|
||||
@@ -1084,7 +1081,7 @@ gdk_ic_set_attr (GdkIC *ic,
|
||||
if (mask & GDK_IC_PREEDIT_PIXMAP)
|
||||
{
|
||||
if (attr->preedit_pixmap != NULL &&
|
||||
GDK_WINDOW_DESTROYED (attr->preedit_pixmap))
|
||||
((GdkPixmapPrivate *)attr->preedit_pixmap)->destroyed)
|
||||
{
|
||||
g_warning ("Preedit pixmap is already destroyed.\n");
|
||||
error |= GDK_IC_PREEDIT_PIXMAP;
|
||||
@@ -1171,7 +1168,7 @@ gdk_ic_set_attr (GdkIC *ic,
|
||||
if (mask & GDK_IC_STATUS_PIXMAP)
|
||||
{
|
||||
if (attr->status_pixmap != NULL &&
|
||||
GDK_WINDOW_DESTROYED (attr->status_pixmap))
|
||||
((GdkPixmapPrivate *)attr->status_pixmap)->destroyed)
|
||||
{
|
||||
g_warning ("Preedit pixmap is already destroyed.\n");
|
||||
error |= GDK_IC_STATUS_PIXMAP;
|
||||
@@ -1591,7 +1588,7 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
|
||||
gint i;
|
||||
|
||||
for (i=0; i<dest_max && src[i]; i++)
|
||||
dest[i] = src[i];
|
||||
dest[i] = (guchar)src[i];
|
||||
|
||||
return i;
|
||||
}
|
||||
126
gdk/gdkim.h
126
gdk/gdkim.h
@@ -1,126 +0,0 @@
|
||||
/* International Input Method Support Functions
|
||||
*/
|
||||
|
||||
#ifndef __GDK_IM_H__
|
||||
#define __GDK_IM_H__
|
||||
|
||||
#include <gdk/gdkcolor.h>
|
||||
#include <gdk/gdkevents.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _GdkIC GdkIC;
|
||||
typedef struct _GdkICAttr GdkICAttr;
|
||||
|
||||
typedef enum /*< flags >*/
|
||||
{
|
||||
GDK_IM_PREEDIT_AREA = 0x0001,
|
||||
GDK_IM_PREEDIT_CALLBACKS = 0x0002,
|
||||
GDK_IM_PREEDIT_POSITION = 0x0004,
|
||||
GDK_IM_PREEDIT_NOTHING = 0x0008,
|
||||
GDK_IM_PREEDIT_NONE = 0x0010,
|
||||
GDK_IM_PREEDIT_MASK = 0x001f,
|
||||
|
||||
GDK_IM_STATUS_AREA = 0x0100,
|
||||
GDK_IM_STATUS_CALLBACKS = 0x0200,
|
||||
GDK_IM_STATUS_NOTHING = 0x0400,
|
||||
GDK_IM_STATUS_NONE = 0x0800,
|
||||
GDK_IM_STATUS_MASK = 0x0f00
|
||||
} GdkIMStyle;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_IC_STYLE = 1 << 0,
|
||||
GDK_IC_CLIENT_WINDOW = 1 << 1,
|
||||
GDK_IC_FOCUS_WINDOW = 1 << 2,
|
||||
GDK_IC_FILTER_EVENTS = 1 << 3,
|
||||
GDK_IC_SPOT_LOCATION = 1 << 4,
|
||||
GDK_IC_LINE_SPACING = 1 << 5,
|
||||
GDK_IC_CURSOR = 1 << 6,
|
||||
|
||||
GDK_IC_PREEDIT_FONTSET = 1 << 10,
|
||||
GDK_IC_PREEDIT_AREA = 1 << 11,
|
||||
GDK_IC_PREEDIT_AREA_NEEDED = 1 << 12,
|
||||
GDK_IC_PREEDIT_FOREGROUND = 1 << 13,
|
||||
GDK_IC_PREEDIT_BACKGROUND = 1 << 14,
|
||||
GDK_IC_PREEDIT_PIXMAP = 1 << 15,
|
||||
GDK_IC_PREEDIT_COLORMAP = 1 << 16,
|
||||
|
||||
GDK_IC_STATUS_FONTSET = 1 << 21,
|
||||
GDK_IC_STATUS_AREA = 1 << 22,
|
||||
GDK_IC_STATUS_AREA_NEEDED = 1 << 23,
|
||||
GDK_IC_STATUS_FOREGROUND = 1 << 24,
|
||||
GDK_IC_STATUS_BACKGROUND = 1 << 25,
|
||||
GDK_IC_STATUS_PIXMAP = 1 << 26,
|
||||
GDK_IC_STATUS_COLORMAP = 1 << 27,
|
||||
|
||||
GDK_IC_ALL_REQ = GDK_IC_STYLE |
|
||||
GDK_IC_CLIENT_WINDOW,
|
||||
|
||||
GDK_IC_PREEDIT_AREA_REQ = GDK_IC_PREEDIT_AREA |
|
||||
GDK_IC_PREEDIT_FONTSET,
|
||||
GDK_IC_PREEDIT_POSITION_REQ = GDK_IC_PREEDIT_AREA | GDK_IC_SPOT_LOCATION |
|
||||
GDK_IC_PREEDIT_FONTSET,
|
||||
|
||||
GDK_IC_STATUS_AREA_REQ = GDK_IC_STATUS_AREA |
|
||||
GDK_IC_STATUS_FONTSET
|
||||
} GdkICAttributesType;
|
||||
|
||||
struct _GdkICAttr
|
||||
{
|
||||
GdkIMStyle style;
|
||||
GdkWindow *client_window;
|
||||
GdkWindow *focus_window;
|
||||
GdkEventMask filter_events;
|
||||
GdkPoint spot_location;
|
||||
gint line_spacing;
|
||||
GdkCursor *cursor;
|
||||
|
||||
GdkFont *preedit_fontset;
|
||||
GdkRectangle preedit_area;
|
||||
GdkRectangle preedit_area_needed;
|
||||
GdkColor preedit_foreground;
|
||||
GdkColor preedit_background;
|
||||
GdkPixmap *preedit_pixmap;
|
||||
GdkColormap *preedit_colormap;
|
||||
|
||||
GdkFont *status_fontset;
|
||||
GdkRectangle status_area;
|
||||
GdkRectangle status_area_needed;
|
||||
GdkColor status_foreground;
|
||||
GdkColor status_background;
|
||||
GdkPixmap *status_pixmap;
|
||||
GdkColormap *status_colormap;
|
||||
};
|
||||
|
||||
gboolean gdk_im_ready (void);
|
||||
|
||||
void gdk_im_begin (GdkIC *ic,
|
||||
GdkWindow *window);
|
||||
void gdk_im_end (void);
|
||||
GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style);
|
||||
GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style);
|
||||
|
||||
GdkIC* gdk_ic_new (GdkICAttr *attr,
|
||||
GdkICAttributesType mask);
|
||||
void gdk_ic_destroy (GdkIC *ic);
|
||||
GdkIMStyle gdk_ic_get_style (GdkIC *ic);
|
||||
GdkEventMask gdk_ic_get_events (GdkIC *ic);
|
||||
|
||||
GdkICAttr* gdk_ic_attr_new (void);
|
||||
void gdk_ic_attr_destroy (GdkICAttr *attr);
|
||||
|
||||
GdkICAttributesType gdk_ic_set_attr (GdkIC *ic,
|
||||
GdkICAttr *attr,
|
||||
GdkICAttributesType mask);
|
||||
GdkICAttributesType gdk_ic_get_attr (GdkIC *ic,
|
||||
GdkICAttr *attr,
|
||||
GdkICAttributesType mask);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_IM_H__ */
|
||||
476
gdk/gdkimage.c
476
gdk/gdkimage.c
@@ -24,22 +24,482 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* gcc -ansi -pedantic on GNU/Linux causes warnings and errors
|
||||
* unless this is defined:
|
||||
* warning: #warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
|
||||
*/
|
||||
#ifndef _XOPEN_SOURCE
|
||||
# define _XOPEN_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "gdkimage.h"
|
||||
#if defined (HAVE_IPC_H) && defined (HAVE_SHM_H) && defined (HAVE_XSHM_H)
|
||||
#define USE_SHM
|
||||
#endif
|
||||
|
||||
#ifdef USE_SHM
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#endif /* USE_SHM */
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#ifdef USE_SHM
|
||||
#include <X11/extensions/XShm.h>
|
||||
#endif /* USE_SHM */
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
GdkImage *
|
||||
gdk_image_ref (GdkImage *image)
|
||||
|
||||
static void gdk_image_put_normal (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
static void gdk_image_put_shared (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
|
||||
static GList *image_list = NULL;
|
||||
|
||||
|
||||
void
|
||||
gdk_image_exit (void)
|
||||
{
|
||||
return (GdkImage *) g_object_ref (G_OBJECT (image));
|
||||
GdkImage *image;
|
||||
|
||||
while (image_list)
|
||||
{
|
||||
image = image_list->data;
|
||||
gdk_image_destroy (image);
|
||||
}
|
||||
}
|
||||
|
||||
GdkImage *
|
||||
gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint w, gint h)
|
||||
/*
|
||||
* Desc: create a new bitmap image
|
||||
*/
|
||||
{
|
||||
Visual *xvisual;
|
||||
GdkImage *image;
|
||||
GdkImagePrivate *private;
|
||||
private = g_new(GdkImagePrivate, 1);
|
||||
image = (GdkImage *) private;
|
||||
private->xdisplay = gdk_display;
|
||||
private->image_put = gdk_image_put_normal;
|
||||
image->type = GDK_IMAGE_NORMAL;
|
||||
image->visual = visual;
|
||||
image->width = w;
|
||||
image->height = h;
|
||||
image->depth = 1;
|
||||
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
|
||||
private->ximage = XCreateImage(private->xdisplay, xvisual, 1, XYBitmap,
|
||||
0, 0, w ,h, 8, 0);
|
||||
private->ximage->data = data;
|
||||
private->ximage->bitmap_bit_order = MSBFirst;
|
||||
private->ximage->byte_order = MSBFirst;
|
||||
image->byte_order = MSBFirst;
|
||||
image->mem = private->ximage->data;
|
||||
image->bpl = private->ximage->bytes_per_line;
|
||||
image->bpp = 1;
|
||||
return(image);
|
||||
} /* gdk_image_new_bitmap() */
|
||||
|
||||
static int
|
||||
gdk_image_check_xshm(Display *display)
|
||||
/*
|
||||
* Desc: query the server for support for the MIT_SHM extension
|
||||
* Return: 0 = not available
|
||||
* 1 = shared XImage support available
|
||||
* 2 = shared Pixmap support available also
|
||||
*/
|
||||
{
|
||||
#ifdef USE_SHM
|
||||
int major, minor, ignore;
|
||||
Bool pixmaps;
|
||||
|
||||
if (XQueryExtension(display, "MIT-SHM", &ignore, &ignore, &ignore))
|
||||
{
|
||||
if (XShmQueryVersion(display, &major, &minor, &pixmaps )==True)
|
||||
{
|
||||
return (pixmaps==True) ? 2 : 1;
|
||||
}
|
||||
}
|
||||
#endif /* USE_SHM */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_image_unref (GdkImage *image)
|
||||
gdk_image_init (void)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_IMAGE (image));
|
||||
|
||||
g_object_unref (G_OBJECT (image));
|
||||
if (gdk_use_xshm)
|
||||
{
|
||||
if (!gdk_image_check_xshm (gdk_display))
|
||||
{
|
||||
gdk_use_xshm = False;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GdkImage*
|
||||
gdk_image_new (GdkImageType type,
|
||||
GdkVisual *visual,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkImage *image;
|
||||
GdkImagePrivate *private;
|
||||
#ifdef USE_SHM
|
||||
XShmSegmentInfo *x_shm_info;
|
||||
#endif /* USE_SHM */
|
||||
Visual *xvisual;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case GDK_IMAGE_FASTEST:
|
||||
image = gdk_image_new (GDK_IMAGE_SHARED, visual, width, height);
|
||||
|
||||
if (!image)
|
||||
image = gdk_image_new (GDK_IMAGE_NORMAL, visual, width, height);
|
||||
break;
|
||||
|
||||
default:
|
||||
private = g_new (GdkImagePrivate, 1);
|
||||
image = (GdkImage*) private;
|
||||
|
||||
private->xdisplay = gdk_display;
|
||||
private->image_put = NULL;
|
||||
|
||||
image->type = type;
|
||||
image->visual = visual;
|
||||
image->width = width;
|
||||
image->height = height;
|
||||
image->depth = visual->depth;
|
||||
|
||||
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case GDK_IMAGE_SHARED:
|
||||
#ifdef USE_SHM
|
||||
if (gdk_use_xshm)
|
||||
{
|
||||
private->image_put = gdk_image_put_shared;
|
||||
|
||||
private->x_shm_info = g_new (XShmSegmentInfo, 1);
|
||||
x_shm_info = private->x_shm_info;
|
||||
|
||||
private->ximage = XShmCreateImage (private->xdisplay, xvisual, visual->depth,
|
||||
ZPixmap, NULL, x_shm_info, width, height);
|
||||
if (private->ximage == NULL)
|
||||
{
|
||||
g_warning ("XShmCreateImage failed");
|
||||
|
||||
g_free (image);
|
||||
gdk_use_xshm = False;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
x_shm_info->shmid = shmget (IPC_PRIVATE,
|
||||
private->ximage->bytes_per_line * private->ximage->height,
|
||||
IPC_CREAT | 0777);
|
||||
|
||||
if (x_shm_info->shmid == -1)
|
||||
{
|
||||
g_warning ("shmget failed!");
|
||||
|
||||
XDestroyImage (private->ximage);
|
||||
g_free (private->x_shm_info);
|
||||
g_free (image);
|
||||
|
||||
gdk_use_xshm = False;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
x_shm_info->readOnly = False;
|
||||
x_shm_info->shmaddr = shmat (x_shm_info->shmid, 0, 0);
|
||||
private->ximage->data = x_shm_info->shmaddr;
|
||||
|
||||
if (x_shm_info->shmaddr == (char*) -1)
|
||||
{
|
||||
g_warning ("shmat failed!");
|
||||
|
||||
XDestroyImage (private->ximage);
|
||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||
|
||||
g_free (private->x_shm_info);
|
||||
g_free (image);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdk_error_trap_push ();
|
||||
|
||||
XShmAttach (private->xdisplay, x_shm_info);
|
||||
XSync (private->xdisplay, False);
|
||||
|
||||
if (gdk_error_trap_pop ())
|
||||
{
|
||||
/* this is the common failure case so omit warning */
|
||||
XDestroyImage (private->ximage);
|
||||
shmdt (x_shm_info->shmaddr);
|
||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||
|
||||
g_free (private->x_shm_info);
|
||||
g_free (image);
|
||||
|
||||
gdk_use_xshm = False;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* We mark the segment as destroyed so that when
|
||||
* the last process detaches, it will be deleted.
|
||||
* There is a small possibility of leaking if
|
||||
* we die in XShmAttach. In theory, a signal handler
|
||||
* could be set up.
|
||||
*/
|
||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||
|
||||
if (image)
|
||||
image_list = g_list_prepend (image_list, image);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_free (image);
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
#else /* USE_SHM */
|
||||
g_free (image);
|
||||
return NULL;
|
||||
#endif /* USE_SHM */
|
||||
case GDK_IMAGE_NORMAL:
|
||||
private->image_put = gdk_image_put_normal;
|
||||
|
||||
private->ximage = XCreateImage (private->xdisplay, xvisual, visual->depth,
|
||||
ZPixmap, 0, 0, width, height, 32, 0);
|
||||
|
||||
/* Use malloc, not g_malloc here, because X will call free()
|
||||
* on this data
|
||||
*/
|
||||
private->ximage->data = malloc (private->ximage->bytes_per_line *
|
||||
private->ximage->height);
|
||||
break;
|
||||
|
||||
case GDK_IMAGE_FASTEST:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
if (image)
|
||||
{
|
||||
image->byte_order = private->ximage->byte_order;
|
||||
image->mem = private->ximage->data;
|
||||
image->bpl = private->ximage->bytes_per_line;
|
||||
image->bpp = (private->ximage->bits_per_pixel + 7) / 8;
|
||||
}
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
GdkImage*
|
||||
gdk_image_get (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkImage *image;
|
||||
GdkImagePrivate *private;
|
||||
GdkWindowPrivate *win_private;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
win_private = (GdkWindowPrivate *) window;
|
||||
if (win_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
private = g_new (GdkImagePrivate, 1);
|
||||
image = (GdkImage*) private;
|
||||
|
||||
private->xdisplay = gdk_display;
|
||||
private->image_put = gdk_image_put_normal;
|
||||
private->ximage = XGetImage (private->xdisplay,
|
||||
win_private->xwindow,
|
||||
x, y, width, height,
|
||||
AllPlanes, ZPixmap);
|
||||
|
||||
image->type = GDK_IMAGE_NORMAL;
|
||||
image->visual = gdk_window_get_visual (window);
|
||||
image->width = width;
|
||||
image->height = height;
|
||||
image->depth = private->ximage->depth;
|
||||
|
||||
image->mem = private->ximage->data;
|
||||
image->bpl = private->ximage->bytes_per_line;
|
||||
image->bpp = private->ximage->bits_per_pixel;
|
||||
image->byte_order = private->ximage->byte_order;
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
guint32
|
||||
gdk_image_get_pixel (GdkImage *image,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
guint32 pixel;
|
||||
GdkImagePrivate *private;
|
||||
|
||||
g_return_val_if_fail (image != NULL, 0);
|
||||
|
||||
private = (GdkImagePrivate *) image;
|
||||
|
||||
pixel = XGetPixel (private->ximage, x, y);
|
||||
|
||||
return pixel;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_image_put_pixel (GdkImage *image,
|
||||
gint x,
|
||||
gint y,
|
||||
guint32 pixel)
|
||||
{
|
||||
GdkImagePrivate *private;
|
||||
|
||||
g_return_if_fail (image != NULL);
|
||||
|
||||
private = (GdkImagePrivate *) image;
|
||||
|
||||
pixel = XPutPixel (private->ximage, x, y, pixel);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_image_destroy (GdkImage *image)
|
||||
{
|
||||
GdkImagePrivate *private;
|
||||
#ifdef USE_SHM
|
||||
XShmSegmentInfo *x_shm_info;
|
||||
#endif /* USE_SHM */
|
||||
|
||||
g_return_if_fail (image != NULL);
|
||||
|
||||
private = (GdkImagePrivate*) image;
|
||||
switch (image->type)
|
||||
{
|
||||
case GDK_IMAGE_NORMAL:
|
||||
XDestroyImage (private->ximage);
|
||||
break;
|
||||
|
||||
case GDK_IMAGE_SHARED:
|
||||
#ifdef USE_SHM
|
||||
gdk_flush();
|
||||
|
||||
XShmDetach (private->xdisplay, private->x_shm_info);
|
||||
XDestroyImage (private->ximage);
|
||||
|
||||
x_shm_info = private->x_shm_info;
|
||||
shmdt (x_shm_info->shmaddr);
|
||||
|
||||
g_free (private->x_shm_info);
|
||||
|
||||
image_list = g_list_remove (image_list, image);
|
||||
#else /* USE_SHM */
|
||||
g_error ("trying to destroy shared memory image when gdk was compiled without shared memory support");
|
||||
#endif /* USE_SHM */
|
||||
break;
|
||||
|
||||
case GDK_IMAGE_FASTEST:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
g_free (image);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_image_put_normal (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkImagePrivate *image_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (image != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
image_private = (GdkImagePrivate*) image;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
g_return_if_fail (image->type == GDK_IMAGE_NORMAL);
|
||||
|
||||
XPutImage (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, image_private->ximage,
|
||||
xsrc, ysrc, xdest, ydest, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_image_put_shared (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
#ifdef USE_SHM
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkImagePrivate *image_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (image != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
image_private = (GdkImagePrivate*) image;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
g_return_if_fail (image->type == GDK_IMAGE_SHARED);
|
||||
|
||||
XShmPutImage (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, image_private->ximage,
|
||||
xsrc, ysrc, xdest, ydest, width, height, False);
|
||||
#else /* USE_SHM */
|
||||
g_error ("trying to draw shared memory image when gdk was compiled without shared memory support");
|
||||
#endif /* USE_SHM */
|
||||
}
|
||||
|
||||
101
gdk/gdkimage.h
101
gdk/gdkimage.h
@@ -1,101 +0,0 @@
|
||||
#ifndef __GDK_IMAGE_H__
|
||||
#define __GDK_IMAGE_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Types of images.
|
||||
* Normal: Normal X image type. These are slow as they involve passing
|
||||
* the entire image through the X connection each time a draw
|
||||
* request is required. On Win32, a bitmap.
|
||||
* Shared: Shared memory X image type. These are fast as the X server
|
||||
* and the program actually use the same piece of memory. They
|
||||
* should be used with care though as there is the possibility
|
||||
* for both the X server and the program to be reading/writing
|
||||
* the image simultaneously and producing undesired results.
|
||||
* On Win32, also a bitmap.
|
||||
* Shared Pixmap: Also a shared memory image, which also has a
|
||||
* pixmap using the same memory. Used by gdk_imlib with the
|
||||
* Win32 backend.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_IMAGE_NORMAL,
|
||||
GDK_IMAGE_SHARED,
|
||||
GDK_IMAGE_FASTEST,
|
||||
GDK_IMAGE_SHARED_PIXMAP
|
||||
} GdkImageType;
|
||||
|
||||
typedef struct _GdkImageClass GdkImageClass;
|
||||
|
||||
#define GDK_TYPE_IMAGE (gdk_image_get_type ())
|
||||
#define GDK_IMAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_IMAGE, GdkImage))
|
||||
#define GDK_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_IMAGE, GdkImageClass))
|
||||
#define GDK_IS_IMAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_IMAGE))
|
||||
#define GDK_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_IMAGE))
|
||||
#define GDK_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_IMAGE, GdkImageClass))
|
||||
|
||||
struct _GdkImage
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GdkImageType type;
|
||||
GdkVisual *visual; /* visual used to create the image */
|
||||
GdkByteOrder byte_order;
|
||||
gint width;
|
||||
gint height;
|
||||
guint16 depth;
|
||||
guint16 bpp; /* bytes per pixel */
|
||||
guint16 bpl; /* bytes per line */
|
||||
gpointer mem;
|
||||
|
||||
gpointer windowing_data;
|
||||
};
|
||||
|
||||
struct _GdkImageClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_image_get_type (void);
|
||||
|
||||
GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
|
||||
gpointer data,
|
||||
gint width,
|
||||
gint height);
|
||||
GdkImage* gdk_image_new (GdkImageType type,
|
||||
GdkVisual *visual,
|
||||
gint width,
|
||||
gint height);
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
GdkImage* gdk_image_bitmap_new(GdkImageType type,
|
||||
GdkVisual *visual,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
#endif
|
||||
GdkImage* gdk_image_get (GdkDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
GdkImage * gdk_image_ref (GdkImage *image);
|
||||
void gdk_image_unref (GdkImage *image);
|
||||
|
||||
void gdk_image_put_pixel (GdkImage *image,
|
||||
gint x,
|
||||
gint y,
|
||||
guint32 pixel);
|
||||
guint32 gdk_image_get_pixel (GdkImage *image,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_IMAGE_H__ */
|
||||
@@ -28,15 +28,27 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkinput.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkinputprivate.h"
|
||||
#include "gdkinput.h"
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
|
||||
static gint gdk_input_enable_window (GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev);
|
||||
static gint gdk_input_disable_window (GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev);
|
||||
static GdkInputWindow *gdk_input_window_find (GdkWindow *window);
|
||||
static GdkDevicePrivate *gdk_input_find_device (guint32 id);
|
||||
|
||||
|
||||
/* Incorporate the specific routines depending on compilation options */
|
||||
|
||||
static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
|
||||
|
||||
const GdkDeviceInfo gdk_input_core_info =
|
||||
static const GdkDeviceInfo gdk_input_core_info =
|
||||
{
|
||||
GDK_CORE_POINTER,
|
||||
"Core Pointer",
|
||||
@@ -55,8 +67,15 @@ gchar *gdk_input_gxid_host;
|
||||
gint gdk_input_gxid_port;
|
||||
gint gdk_input_ignore_core;
|
||||
|
||||
GList *gdk_input_devices;
|
||||
GList *gdk_input_windows;
|
||||
/* Local variables */
|
||||
|
||||
static GList *gdk_input_devices;
|
||||
static GList *gdk_input_windows;
|
||||
|
||||
#include "gdkinputnone.h"
|
||||
#include "gdkinputcommon.h"
|
||||
#include "gdkinputxfree.h"
|
||||
#include "gdkinputgxi.h"
|
||||
|
||||
GList *
|
||||
gdk_input_list_devices (void)
|
||||
@@ -108,20 +127,20 @@ gdk_input_motion_events (GdkWindow *window,
|
||||
guint32 stop,
|
||||
gint *nevents_return)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
XTimeCoord *xcoords;
|
||||
GdkTimeCoord *coords;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
if (window_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
if (deviceid == GDK_CORE_POINTER)
|
||||
{
|
||||
xcoords = XGetMotionEvents (GDK_DRAWABLE_XDISPLAY (window),
|
||||
GDK_DRAWABLE_XID (window),
|
||||
xcoords = XGetMotionEvents (gdk_display,
|
||||
window_private->xwindow,
|
||||
start, stop, nevents_return);
|
||||
if (xcoords)
|
||||
{
|
||||
@@ -159,7 +178,7 @@ gdk_input_motion_events (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
static gint
|
||||
gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
|
||||
{
|
||||
if (gdk_input_vtable.enable_window)
|
||||
@@ -168,7 +187,7 @@ gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gint
|
||||
static gint
|
||||
gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
|
||||
{
|
||||
if (gdk_input_vtable.disable_window)
|
||||
@@ -178,7 +197,7 @@ gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
|
||||
}
|
||||
|
||||
|
||||
GdkInputWindow *
|
||||
static GdkInputWindow *
|
||||
gdk_input_window_find(GdkWindow *window)
|
||||
{
|
||||
GList *tmp_list;
|
||||
@@ -200,15 +219,13 @@ void
|
||||
gdk_input_set_extension_events (GdkWindow *window, gint mask,
|
||||
GdkExtensionMode mode)
|
||||
{
|
||||
GdkWindowObject *window_private;
|
||||
GdkWindowPrivate *window_private;
|
||||
GList *tmp_list;
|
||||
GdkInputWindow *iw;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
window_private = (GdkWindowObject*) window;
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
if (window_private->destroyed)
|
||||
return;
|
||||
|
||||
if (mode == GDK_EXTENSION_EVENTS_NONE)
|
||||
@@ -305,7 +322,7 @@ gdk_input_exit (void)
|
||||
g_list_free(gdk_input_windows);
|
||||
}
|
||||
|
||||
GdkDevicePrivate *
|
||||
static GdkDevicePrivate *
|
||||
gdk_input_find_device(guint32 id)
|
||||
{
|
||||
GList *tmp_list = gdk_input_devices;
|
||||
236
gdk/gdkinput.h
236
gdk/gdkinput.h
@@ -1,108 +1,160 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_INPUT_H__
|
||||
#define __GDK_INPUT_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#ifndef XINPUT_NONE
|
||||
#include <X11/extensions/XInput.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
typedef struct _GdkAxisInfo GdkAxisInfo;
|
||||
typedef struct _GdkInputVTable GdkInputVTable;
|
||||
typedef struct _GdkDevicePrivate GdkDevicePrivate;
|
||||
typedef struct _GdkInputWindow GdkInputWindow;
|
||||
|
||||
typedef struct _GdkDeviceKey GdkDeviceKey;
|
||||
typedef struct _GdkDeviceInfo GdkDeviceInfo;
|
||||
typedef struct _GdkTimeCoord GdkTimeCoord;
|
||||
struct _GdkInputVTable {
|
||||
gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
|
||||
void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
|
||||
void (*set_key) (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
|
||||
GdkTimeCoord* (*motion_events) (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
gint *nevents_return);
|
||||
void (*get_pointer) (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *pressure,
|
||||
gdouble *xtilt,
|
||||
gdouble *ytilt,
|
||||
GdkModifierType *mask);
|
||||
gint (*grab_pointer) (GdkWindow * window,
|
||||
gint owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow * confine_to,
|
||||
guint32 time);
|
||||
void (*ungrab_pointer) (guint32 time);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_EXTENSION_EVENTS_NONE,
|
||||
GDK_EXTENSION_EVENTS_ALL,
|
||||
GDK_EXTENSION_EVENTS_CURSOR
|
||||
} GdkExtensionMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_SOURCE_MOUSE,
|
||||
GDK_SOURCE_PEN,
|
||||
GDK_SOURCE_ERASER,
|
||||
GDK_SOURCE_CURSOR
|
||||
} GdkInputSource;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_MODE_DISABLED,
|
||||
GDK_MODE_SCREEN,
|
||||
GDK_MODE_WINDOW
|
||||
} GdkInputMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_AXIS_IGNORE,
|
||||
GDK_AXIS_X,
|
||||
GDK_AXIS_Y,
|
||||
GDK_AXIS_PRESSURE,
|
||||
GDK_AXIS_XTILT,
|
||||
GDK_AXIS_YTILT,
|
||||
GDK_AXIS_LAST
|
||||
} GdkAxisUse;
|
||||
|
||||
struct _GdkDeviceInfo
|
||||
{
|
||||
guint32 deviceid;
|
||||
gchar *name;
|
||||
GdkInputSource source;
|
||||
GdkInputMode mode;
|
||||
gint has_cursor; /* TRUE if the X pointer follows device motion */
|
||||
gint num_axes;
|
||||
GdkAxisUse *axes; /* Specifies use for each axis */
|
||||
gint num_keys;
|
||||
GdkDeviceKey *keys;
|
||||
void (*configure_event) (XConfigureEvent *xevent, GdkWindow *window);
|
||||
void (*enter_event) (XCrossingEvent *xevent, GdkWindow *window);
|
||||
gint (*other_event) (GdkEvent *event, XEvent *xevent, GdkWindow *window);
|
||||
/* Handle an unidentified event. Returns TRUE if handled, FALSE
|
||||
otherwise */
|
||||
gint (*window_none_event) (GdkEvent *event, XEvent *xevent);
|
||||
gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
|
||||
gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
|
||||
};
|
||||
|
||||
struct _GdkDeviceKey
|
||||
/* information about a device axis */
|
||||
struct _GdkAxisInfo
|
||||
{
|
||||
guint keyval;
|
||||
GdkModifierType modifiers;
|
||||
/* reported x resolution */
|
||||
gint xresolution;
|
||||
|
||||
/* reported x minimum/maximum values */
|
||||
gint xmin_value, xmax_value;
|
||||
|
||||
/* calibrated resolution (for aspect ration) - only relative values
|
||||
between axes used */
|
||||
gint resolution;
|
||||
|
||||
/* calibrated minimum/maximum values */
|
||||
gint min_value, max_value;
|
||||
};
|
||||
|
||||
struct _GdkTimeCoord
|
||||
{
|
||||
guint32 time;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble pressure;
|
||||
gdouble xtilt;
|
||||
gdouble ytilt;
|
||||
#define GDK_INPUT_NUM_EVENTC 6
|
||||
|
||||
struct _GdkDevicePrivate {
|
||||
GdkDeviceInfo info;
|
||||
|
||||
#ifndef XINPUT_NONE
|
||||
/* information about the axes */
|
||||
GdkAxisInfo *axes;
|
||||
|
||||
/* reverse lookup on axis use type */
|
||||
gint axis_for_use[GDK_AXIS_LAST];
|
||||
|
||||
/* Information about XInput device */
|
||||
XDevice *xdevice;
|
||||
|
||||
/* minimum key code for device */
|
||||
gint min_keycode;
|
||||
|
||||
int buttonpress_type, buttonrelease_type, keypress_type,
|
||||
keyrelease_type, motionnotify_type, proximityin_type,
|
||||
proximityout_type, changenotify_type;
|
||||
|
||||
/* true if we need to select a different set of events, but
|
||||
can't because this is the core pointer */
|
||||
gint needs_update;
|
||||
|
||||
/* Mask of buttons (used for button grabs) */
|
||||
gint button_state;
|
||||
|
||||
/* true if we've claimed the device as active. (used only for XINPUT_GXI) */
|
||||
gint claimed;
|
||||
#endif /* !XINPUT_NONE */
|
||||
};
|
||||
|
||||
GList * gdk_input_list_devices (void);
|
||||
void gdk_input_set_extension_events (GdkWindow *window,
|
||||
gint mask,
|
||||
GdkExtensionMode mode);
|
||||
void gdk_input_set_source (guint32 deviceid,
|
||||
GdkInputSource source);
|
||||
gboolean gdk_input_set_mode (guint32 deviceid,
|
||||
GdkInputMode mode);
|
||||
void gdk_input_set_axes (guint32 deviceid,
|
||||
GdkAxisUse *axes);
|
||||
void gdk_input_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
void gdk_input_window_get_pointer (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *pressure,
|
||||
gdouble *xtilt,
|
||||
gdouble *ytilt,
|
||||
GdkModifierType *mask);
|
||||
GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
gint *nevents_return);
|
||||
struct _GdkInputWindow
|
||||
{
|
||||
/* gdk window */
|
||||
GdkWindow *window;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
/* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
|
||||
GdkExtensionMode mode;
|
||||
|
||||
/* position relative to root window */
|
||||
gint16 root_x;
|
||||
gint16 root_y;
|
||||
|
||||
/* rectangles relative to window of windows obscuring this one */
|
||||
GdkRectangle *obscuring;
|
||||
gint num_obscuring;
|
||||
|
||||
/* Is there a pointer grab for this window ? */
|
||||
gint grabbed;
|
||||
};
|
||||
|
||||
/* Global data */
|
||||
|
||||
extern GdkInputVTable gdk_input_vtable;
|
||||
/* information about network port and host for gxid daemon */
|
||||
extern gchar *gdk_input_gxid_host;
|
||||
extern gint gdk_input_gxid_port;
|
||||
extern gint gdk_input_ignore_core;
|
||||
|
||||
/* Function declarations */
|
||||
|
||||
void gdk_input_window_destroy (GdkWindow *window);
|
||||
|
||||
#endif /* __GDK_INPUT_H__ */
|
||||
|
||||
@@ -24,13 +24,22 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "gdkinputprivate.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkx.h"
|
||||
#if defined(XINPUT_GXI) || defined(XINPUT_XFREE)
|
||||
|
||||
/* Forward declarations */
|
||||
static void gdk_input_get_root_relative_geometry (Display *dpy, Window w,
|
||||
int *x_ret, int *y_ret,
|
||||
int *width_ret,
|
||||
int *height_ret);
|
||||
static GdkDevicePrivate *gdk_input_device_new(XDeviceInfo *device,
|
||||
gint include_core);
|
||||
static void gdk_input_common_find_events(GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev,
|
||||
gint mask,
|
||||
XEventClass *classes,
|
||||
int *num_classes);
|
||||
static void gdk_input_common_select_events(GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev);
|
||||
static void gdk_input_translate_coordinates(GdkDevicePrivate *gdkdev,
|
||||
GdkInputWindow *input_window,
|
||||
gint *axis_data,
|
||||
@@ -38,21 +47,34 @@ static void gdk_input_translate_coordinates(GdkDevicePrivate *gdkdev,
|
||||
gdouble *pressure,
|
||||
gdouble *xtilt, gdouble *ytilt);
|
||||
static guint gdk_input_translate_state(guint state, guint device_state);
|
||||
void gdk_input_common_get_pointer (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *pressure,
|
||||
gdouble *xtilt,
|
||||
gdouble *ytilt,
|
||||
GdkModifierType *mask);
|
||||
static gint gdk_input_common_init(gint include_core);
|
||||
static gint gdk_input_common_other_event (GdkEvent *event,
|
||||
XEvent *xevent,
|
||||
GdkInputWindow *input_window,
|
||||
GdkDevicePrivate *gdkdev);
|
||||
static void gdk_input_common_set_axes (guint32 deviceid, GdkAxisUse *axes);
|
||||
static GdkTimeCoord * gdk_input_common_motion_events (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
gint *nevents_return);
|
||||
static void gdk_input_common_get_pointer (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *pressure,
|
||||
gdouble *xtilt,
|
||||
gdouble *ytilt,
|
||||
GdkModifierType *mask);
|
||||
|
||||
#define GDK_MAX_DEVICE_CLASSES 13
|
||||
|
||||
/* Global variables */
|
||||
|
||||
static gint gdk_input_root_width;
|
||||
static gint gdk_input_root_height;
|
||||
|
||||
void
|
||||
static void
|
||||
gdk_input_get_root_relative_geometry(Display *dpy, Window w, int *x_ret, int *y_ret,
|
||||
int *width_ret, int *height_ret)
|
||||
{
|
||||
@@ -282,7 +304,7 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
return gdkdev;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gdk_input_common_find_events(GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev,
|
||||
gint mask,
|
||||
@@ -384,7 +406,7 @@ gdk_input_common_find_events(GdkWindow *window,
|
||||
*num_classes = i;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gdk_input_common_select_events(GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev)
|
||||
{
|
||||
@@ -441,7 +463,7 @@ gdk_input_common_init(gint include_core)
|
||||
XFreeDeviceList(devices);
|
||||
}
|
||||
|
||||
gdk_input_devices = g_list_append (gdk_input_devices, (gpointer)&gdk_input_core_info);
|
||||
gdk_input_devices = g_list_append (gdk_input_devices, &gdk_input_core_info);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -453,14 +475,14 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
|
||||
gdouble *x, gdouble *y, gdouble *pressure,
|
||||
gdouble *xtilt, gdouble *ytilt)
|
||||
{
|
||||
GdkDrawablePrivate *drawable_priv;
|
||||
GdkWindowPrivate *win_priv;
|
||||
|
||||
int x_axis, y_axis, pressure_axis, xtilt_axis, ytilt_axis;
|
||||
|
||||
double device_width, device_height;
|
||||
double x_offset, y_offset, x_scale, y_scale;
|
||||
|
||||
drawable_priv = (GdkDrawablePrivate *) input_window->window;
|
||||
win_priv = (GdkWindowPrivate *) input_window->window;
|
||||
|
||||
x_axis = gdkdev->axis_for_use[GDK_AXIS_X];
|
||||
y_axis = gdkdev->axis_for_use[GDK_AXIS_Y];
|
||||
@@ -486,26 +508,26 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
|
||||
double device_aspect = (device_height*gdkdev->axes[y_axis].resolution) /
|
||||
(device_width*gdkdev->axes[x_axis].resolution);
|
||||
|
||||
if (device_aspect * drawable_priv->width >= drawable_priv->height)
|
||||
if (device_aspect * win_priv->width >= win_priv->height)
|
||||
{
|
||||
/* device taller than window */
|
||||
x_scale = drawable_priv->width / device_width;
|
||||
x_scale = win_priv->width / device_width;
|
||||
y_scale = (x_scale * gdkdev->axes[x_axis].resolution)
|
||||
/ gdkdev->axes[y_axis].resolution;
|
||||
|
||||
x_offset = 0;
|
||||
y_offset = -(device_height * y_scale -
|
||||
drawable_priv->height)/2;
|
||||
win_priv->height)/2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* window taller than device */
|
||||
y_scale = drawable_priv->height / device_height;
|
||||
y_scale = win_priv->height / device_height;
|
||||
x_scale = (y_scale * gdkdev->axes[y_axis].resolution)
|
||||
/ gdkdev->axes[x_axis].resolution;
|
||||
|
||||
y_offset = 0;
|
||||
x_offset = - (device_width * x_scale - drawable_priv->width)/2;
|
||||
x_offset = - (device_width * x_scale - win_priv->width)/2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,11 +584,10 @@ gdk_input_translate_state(guint state, guint device_state)
|
||||
return device_state | (state & 0xFF);
|
||||
}
|
||||
|
||||
|
||||
gint
|
||||
gdk_input_common_other_event (GdkEvent *event,
|
||||
XEvent *xevent,
|
||||
GdkInputWindow *input_window,
|
||||
static gint
|
||||
gdk_input_common_other_event (GdkEvent *event,
|
||||
XEvent *xevent,
|
||||
GdkInputWindow *input_window,
|
||||
GdkDevicePrivate *gdkdev)
|
||||
{
|
||||
if ((xevent->type == gdkdev->buttonpress_type) ||
|
||||
@@ -718,7 +739,7 @@ gdk_input_common_other_event (GdkEvent *event,
|
||||
return -1; /* wasn't one of our event types */
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gdk_input_common_set_axes (guint32 deviceid, GdkAxisUse *axes)
|
||||
{
|
||||
int i;
|
||||
@@ -737,11 +758,10 @@ gdk_input_common_set_axes (guint32 deviceid, GdkAxisUse *axes)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_input_common_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers)
|
||||
void gdk_input_common_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers)
|
||||
{
|
||||
GdkDevicePrivate *gdkdev = gdk_input_find_device(deviceid);
|
||||
|
||||
@@ -753,7 +773,7 @@ gdk_input_common_set_key (guint32 deviceid,
|
||||
gdkdev->info.keys[index].modifiers = modifiers;
|
||||
}
|
||||
|
||||
GdkTimeCoord *
|
||||
static GdkTimeCoord *
|
||||
gdk_input_common_motion_events (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
guint32 start,
|
||||
@@ -802,7 +822,7 @@ gdk_input_common_motion_events (GdkWindow *window,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gdk_input_common_get_pointer (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
gdouble *x,
|
||||
@@ -869,6 +889,9 @@ gdk_input_common_get_pointer (GdkWindow *window,
|
||||
}
|
||||
input_class = (XInputClass *)(((char *)input_class)+input_class->length);
|
||||
}
|
||||
XFreeDeviceState (state);
|
||||
|
||||
XFreeDeviceState (state);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -24,10 +24,7 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "gdkinputprivate.h"
|
||||
#include "gdkx.h"
|
||||
#ifdef XINPUT_GXI
|
||||
|
||||
/* #define DEBUG_SWITCHING */
|
||||
|
||||
@@ -317,8 +314,8 @@ gdk_input_gxi_other_event (GdkEvent *event,
|
||||
if (return_val > 0 && event->type == GDK_MOTION_NOTIFY &&
|
||||
(!gdkdev->button_state) && (!input_window->grabbed) &&
|
||||
((event->motion.x < 0) || (event->motion.y < 0) ||
|
||||
(event->motion.x > ((GdkDrawablePrivate *)window)->width) ||
|
||||
(event->motion.y > ((GdkDrawablePrivate *)window)->height) ||
|
||||
(event->motion.x > ((GdkWindowPrivate *)window)->width) ||
|
||||
(event->motion.y > ((GdkWindowPrivate *)window)->height) ||
|
||||
gdk_input_is_obscured(input_window,event->motion.x,event->motion.y)))
|
||||
{
|
||||
#ifdef DEBUG_SWITCHING
|
||||
@@ -648,3 +645,5 @@ gdk_input_gxi_ungrab_pointer (guint32 time)
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* XINPUT_GXI */
|
||||
@@ -17,8 +17,6 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gdkinputprivate.h"
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
@@ -26,6 +24,8 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifdef XINPUT_NONE
|
||||
|
||||
static void gdk_input_none_get_pointer (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
gdouble *x,
|
||||
@@ -77,3 +77,5 @@ gdk_input_none_get_pointer (GdkWindow *window,
|
||||
if (xtilt) *xtilt = 0;
|
||||
if (ytilt) *ytilt = 0;
|
||||
}
|
||||
|
||||
#endif /* XINPUT_NONE */
|
||||
@@ -17,8 +17,6 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gdkinputprivate.h"
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
@@ -26,6 +24,8 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifdef XINPUT_XFREE
|
||||
|
||||
/* forward declarations */
|
||||
|
||||
static gint gdk_input_xfree_set_mode (guint32 deviceid, GdkInputMode mode);
|
||||
@@ -42,10 +42,10 @@ static gint gdk_input_xfree_enable_window(GdkWindow *window,
|
||||
static gint gdk_input_xfree_disable_window(GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev);
|
||||
static gint gdk_input_xfree_grab_pointer (GdkWindow * window,
|
||||
gint owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow * confine_to,
|
||||
guint32 time);
|
||||
gint owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow * confine_to,
|
||||
guint32 time);
|
||||
static void gdk_input_xfree_ungrab_pointer (guint32 time);
|
||||
|
||||
void
|
||||
@@ -155,7 +155,7 @@ gdk_input_check_proximity (void)
|
||||
xic = (XInputClass *)((char *)xic + xic->length);
|
||||
}
|
||||
|
||||
XFreeDeviceState (state);
|
||||
XFreeDeviceState (state);
|
||||
}
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
@@ -372,3 +372,5 @@ gdk_input_xfree_ungrab_pointer (guint32 time)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* XINPUT_XFREE */
|
||||
@@ -1,216 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
/* Uninstalled header defining types and functions internal to GDK */
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkprivate.h>
|
||||
|
||||
#ifndef __GDK_INTERNALS_H__
|
||||
#define __GDK_INTERNALS_H__
|
||||
|
||||
/**********************
|
||||
* General Facilities *
|
||||
**********************/
|
||||
|
||||
/* Debugging support */
|
||||
|
||||
typedef enum {
|
||||
GDK_DEBUG_MISC = 1 << 0,
|
||||
GDK_DEBUG_EVENTS = 1 << 1,
|
||||
GDK_DEBUG_DND = 1 << 2,
|
||||
GDK_DEBUG_COLOR_CONTEXT = 1 << 3,
|
||||
GDK_DEBUG_XIM = 1 << 4
|
||||
} GdkDebugFlag;
|
||||
|
||||
extern gint gdk_debug_level;
|
||||
extern gboolean gdk_show_events;
|
||||
extern GList *gdk_default_filters;
|
||||
|
||||
GDKVAR guint gdk_debug_flags;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
#define GDK_NOTE(type,action) G_STMT_START { \
|
||||
if (gdk_debug_flags & GDK_DEBUG_##type) \
|
||||
{ action; }; } G_STMT_END
|
||||
|
||||
#else /* !G_ENABLE_DEBUG */
|
||||
|
||||
#define GDK_NOTE(type,action)
|
||||
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
/* Arg parsing */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_ARG_STRING,
|
||||
GDK_ARG_INT,
|
||||
GDK_ARG_BOOL,
|
||||
GDK_ARG_NOBOOL,
|
||||
GDK_ARG_CALLBACK
|
||||
} GdkArgType;
|
||||
|
||||
typedef struct _GdkArgContext GdkArgContext;
|
||||
typedef struct _GdkArgDesc GdkArgDesc;
|
||||
|
||||
typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
|
||||
|
||||
struct _GdkArgContext
|
||||
{
|
||||
GPtrArray *tables;
|
||||
gpointer cb_data;
|
||||
};
|
||||
|
||||
struct _GdkArgDesc
|
||||
{
|
||||
const char *name;
|
||||
GdkArgType type;
|
||||
gpointer location;
|
||||
GdkArgFunc callback;
|
||||
};
|
||||
|
||||
/* Event handling */
|
||||
|
||||
extern GdkEventFunc gdk_event_func; /* Callback for events */
|
||||
extern gpointer gdk_event_data;
|
||||
extern GDestroyNotify gdk_event_notify;
|
||||
|
||||
/* FIFO's for event queue, and for events put back using
|
||||
* gdk_event_put().
|
||||
*/
|
||||
extern GList *gdk_queued_events;
|
||||
extern GList *gdk_queued_tail;
|
||||
|
||||
GdkEvent* gdk_event_new (void);
|
||||
|
||||
void gdk_events_init (void);
|
||||
void gdk_events_queue (void);
|
||||
GdkEvent* gdk_event_unqueue (void);
|
||||
|
||||
GList* gdk_event_queue_find_first (void);
|
||||
void gdk_event_queue_remove_link (GList *node);
|
||||
void gdk_event_queue_append (GdkEvent *event);
|
||||
|
||||
void gdk_event_button_generate (GdkEvent *event);
|
||||
|
||||
/*************************************
|
||||
* Interfaces used by windowing code *
|
||||
*************************************/
|
||||
|
||||
#ifdef USE_XIM
|
||||
/* XIM support */
|
||||
gint gdk_im_open (void);
|
||||
void gdk_im_close (void);
|
||||
void gdk_ic_cleanup (void);
|
||||
#endif /* USE_XIM */
|
||||
|
||||
void _gdk_window_destroy (GdkWindow *window,
|
||||
gboolean foreign_destroy);
|
||||
void _gdk_window_clear_update_area (GdkWindow *window);
|
||||
|
||||
|
||||
/*****************************************
|
||||
* Interfaces provided by windowing code *
|
||||
*****************************************/
|
||||
|
||||
/* Font/string functions implemented in module-specific code */
|
||||
gint _gdk_font_strlen (GdkFont *font, const char *str);
|
||||
void _gdk_font_destroy (GdkFont *font);
|
||||
|
||||
void _gdk_colormap_real_destroy (GdkColormap *colormap);
|
||||
|
||||
void _gdk_cursor_destroy (GdkCursor *cursor);
|
||||
|
||||
extern GdkArgDesc _gdk_windowing_args[];
|
||||
gboolean _gdk_windowing_init_check (int argc,
|
||||
char **argv);
|
||||
void _gdk_windowing_window_get_offsets (GdkWindow *window,
|
||||
gint *x_offset,
|
||||
gint *y_offset);
|
||||
void _gdk_windowing_window_clear_area (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void _gdk_windowing_window_clear_area_e (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
/* Called before processing updates for a window. This gives the windowing
|
||||
* layer a chance to save the region for later use in avoiding duplicate
|
||||
* exposes. The return value indicates whether the function has a saved
|
||||
* the region; if the result is TRUE, then the windowing layer is responsible
|
||||
* for destroying the region later.
|
||||
*/
|
||||
gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
|
||||
GdkRegion *area);
|
||||
|
||||
/* Called to do the windowing system specific part of gdk_window_destroy(),
|
||||
*
|
||||
* window: The window being destroyed
|
||||
* recursing: If TRUE, then this is being called because a parent
|
||||
* was destroyed. This generally means that the call to the windowing system
|
||||
* to destroy the window can be omitted, since it will be destroyed as a result
|
||||
* of the parent being destroyed. Unless @foreign_destroy
|
||||
*
|
||||
* foreign_destroy: If TRUE, the window or a parent was destroyed by some external
|
||||
* agency. The window has already been destroyed and no windowing
|
||||
* system calls should be made. (This may never happen for some
|
||||
* windowing systems.)
|
||||
*/
|
||||
void _gdk_windowing_window_destroy (GdkWindow *window,
|
||||
gboolean recursing,
|
||||
gboolean foreign_destroy);
|
||||
|
||||
/* Implementation types */
|
||||
GType gdk_window_impl_get_type (void);
|
||||
GType gdk_pixmap_impl_get_type (void);
|
||||
|
||||
/************************************
|
||||
* Initialization and exit routines *
|
||||
************************************/
|
||||
|
||||
void gdk_windowing_window_init (void);
|
||||
void gdk_visual_init (void);
|
||||
void gdk_dnd_init (void);
|
||||
|
||||
void gdk_windowing_image_init (void);
|
||||
void gdk_image_exit (void);
|
||||
|
||||
void gdk_input_init (void);
|
||||
void gdk_input_exit (void);
|
||||
|
||||
void gdk_windowing_exit (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_INTERNALS_H__ */
|
||||
@@ -10,7 +10,6 @@
|
||||
#define GDK_Escape 0xFF1B
|
||||
#define GDK_Delete 0xFFFF
|
||||
#define GDK_Multi_key 0xFF20
|
||||
#define GDK_Codeinput 0xFF37
|
||||
#define GDK_SingleCandidate 0xFF3C
|
||||
#define GDK_MultipleCandidate 0xFF3D
|
||||
#define GDK_PreviousCandidate 0xFF3E
|
||||
@@ -31,7 +30,6 @@
|
||||
#define GDK_Kana_Shift 0xFF2E
|
||||
#define GDK_Eisu_Shift 0xFF2F
|
||||
#define GDK_Eisu_toggle 0xFF30
|
||||
#define GDK_Kanji_Bangou 0xFF37
|
||||
#define GDK_Zen_Koho 0xFF3D
|
||||
#define GDK_Mae_Koho 0xFF3E
|
||||
#define GDK_Home 0xFF50
|
||||
@@ -610,9 +608,6 @@
|
||||
#define GDK_uogonek 0x3f9
|
||||
#define GDK_utilde 0x3fd
|
||||
#define GDK_umacron 0x3fe
|
||||
#define GDK_OE 0x13bc
|
||||
#define GDK_oe 0x13bd
|
||||
#define GDK_Ydiaeresis 0x13be
|
||||
#define GDK_overline 0x47e
|
||||
#define GDK_kana_fullstop 0x4a1
|
||||
#define GDK_kana_openingbracket 0x4a2
|
||||
@@ -1320,16 +1315,3 @@
|
||||
#define GDK_Hangul_J_KkogjiDalrinIeung 0xef9
|
||||
#define GDK_Hangul_J_YeorinHieuh 0xefa
|
||||
#define GDK_Korean_Won 0xeff
|
||||
#define GDK_EcuSign 0x20a0
|
||||
#define GDK_ColonSign 0x20a1
|
||||
#define GDK_CruzeiroSign 0x20a2
|
||||
#define GDK_FFrancSign 0x20a3
|
||||
#define GDK_LiraSign 0x20a4
|
||||
#define GDK_MillSign 0x20a5
|
||||
#define GDK_NairaSign 0x20a6
|
||||
#define GDK_PesetaSign 0x20a7
|
||||
#define GDK_RupeeSign 0x20a8
|
||||
#define GDK_WonSign 0x20a9
|
||||
#define GDK_NewSheqelSign 0x20aa
|
||||
#define GDK_DongSign 0x20ab
|
||||
#define GDK_EuroSign 0x20ac
|
||||
|
||||
1148
gdk/gdkpixmap.c
1148
gdk/gdkpixmap.c
File diff suppressed because it is too large
Load Diff
@@ -1,89 +0,0 @@
|
||||
#ifndef __GDK_PIXMAP_H__
|
||||
#define __GDK_PIXMAP_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkdrawable.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _GdkPixmapObject GdkPixmapObject;
|
||||
typedef struct _GdkPixmapObjectClass GdkPixmapObjectClass;
|
||||
|
||||
#define GDK_TYPE_PIXMAP (gdk_pixmap_get_type ())
|
||||
#define GDK_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXMAP, GdkPixmap))
|
||||
#define GDK_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXMAP, GdkPixmapObjectClass))
|
||||
#define GDK_IS_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXMAP))
|
||||
#define GDK_IS_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXMAP))
|
||||
#define GDK_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXMAP, GdkPixmapClass))
|
||||
|
||||
struct _GdkPixmapObject
|
||||
{
|
||||
GdkDrawable parent_instance;
|
||||
|
||||
GdkDrawable *impl; /* window-system-specific delegate object */
|
||||
|
||||
gint depth;
|
||||
};
|
||||
|
||||
struct _GdkPixmapObjectClass
|
||||
{
|
||||
GdkDrawableClass parent_class;
|
||||
|
||||
};
|
||||
|
||||
GType gdk_pixmap_get_type (void);
|
||||
|
||||
/* Pixmaps
|
||||
*/
|
||||
GdkPixmap* gdk_pixmap_new (GdkWindow *window,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth);
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
GdkPixmap* gdk_pixmap_create_on_shared_image
|
||||
(GdkImage **image_return,
|
||||
GdkWindow *window,
|
||||
GdkVisual *visual,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth);
|
||||
#endif
|
||||
GdkBitmap* gdk_bitmap_create_from_data (GdkWindow *window,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height);
|
||||
GdkPixmap* gdk_pixmap_create_from_data (GdkWindow *window,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth,
|
||||
GdkColor *fg,
|
||||
GdkColor *bg);
|
||||
GdkPixmap* gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
const gchar *filename);
|
||||
GdkPixmap* gdk_pixmap_colormap_create_from_xpm
|
||||
(GdkWindow *window,
|
||||
GdkColormap *colormap,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
const gchar *filename);
|
||||
GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
gchar **data);
|
||||
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d
|
||||
(GdkWindow *window,
|
||||
GdkColormap *colormap,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
gchar **data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_PIXMAP_H__ */
|
||||
@@ -1,291 +0,0 @@
|
||||
/* $TOG: poly.h /main/5 1998/02/06 17:47:27 kaleb $ */
|
||||
/************************************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
|
||||
All Rights Reserved.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of The Open Group shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from The Open Group.
|
||||
|
||||
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of Digital not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
************************************************************************/
|
||||
|
||||
/*
|
||||
* This file contains a few macros to help track
|
||||
* the edge of a filled object. The object is assumed
|
||||
* to be filled in scanline order, and thus the
|
||||
* algorithm used is an extension of Bresenham's line
|
||||
* drawing algorithm which assumes that y is always the
|
||||
* major axis.
|
||||
* Since these pieces of code are the same for any filled shape,
|
||||
* it is more convenient to gather the library in one
|
||||
* place, but since these pieces of code are also in
|
||||
* the inner loops of output primitives, procedure call
|
||||
* overhead is out of the question.
|
||||
* See the author for a derivation if needed.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* In scan converting polygons, we want to choose those pixels
|
||||
* which are inside the polygon. Thus, we add .5 to the starting
|
||||
* x coordinate for both left and right edges. Now we choose the
|
||||
* first pixel which is inside the pgon for the left edge and the
|
||||
* first pixel which is outside the pgon for the right edge.
|
||||
* Draw the left pixel, but not the right.
|
||||
*
|
||||
* How to add .5 to the starting x coordinate:
|
||||
* If the edge is moving to the right, then subtract dy from the
|
||||
* error term from the general form of the algorithm.
|
||||
* If the edge is moving to the left, then add dy to the error term.
|
||||
*
|
||||
* The reason for the difference between edges moving to the left
|
||||
* and edges moving to the right is simple: If an edge is moving
|
||||
* to the right, then we want the algorithm to flip immediately.
|
||||
* If it is moving to the left, then we don't want it to flip until
|
||||
* we traverse an entire pixel.
|
||||
*/
|
||||
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \
|
||||
int dx; /* local storage */ \
|
||||
\
|
||||
/* \
|
||||
* if the edge is horizontal, then it is ignored \
|
||||
* and assumed not to be processed. Otherwise, do this stuff. \
|
||||
*/ \
|
||||
if ((dy) != 0) { \
|
||||
xStart = (x1); \
|
||||
dx = (x2) - xStart; \
|
||||
if (dx < 0) { \
|
||||
m = dx / (dy); \
|
||||
m1 = m - 1; \
|
||||
incr1 = -2 * dx + 2 * (dy) * m1; \
|
||||
incr2 = -2 * dx + 2 * (dy) * m; \
|
||||
d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
|
||||
} else { \
|
||||
m = dx / (dy); \
|
||||
m1 = m + 1; \
|
||||
incr1 = 2 * dx - 2 * (dy) * m1; \
|
||||
incr2 = 2 * dx - 2 * (dy) * m; \
|
||||
d = -2 * m * (dy) + 2 * dx; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \
|
||||
if (m1 > 0) { \
|
||||
if (d > 0) { \
|
||||
minval += m1; \
|
||||
d += incr1; \
|
||||
} \
|
||||
else { \
|
||||
minval += m; \
|
||||
d += incr2; \
|
||||
} \
|
||||
} else {\
|
||||
if (d >= 0) { \
|
||||
minval += m1; \
|
||||
d += incr1; \
|
||||
} \
|
||||
else { \
|
||||
minval += m; \
|
||||
d += incr2; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This structure contains all of the information needed
|
||||
* to run the bresenham algorithm.
|
||||
* The variables may be hardcoded into the declarations
|
||||
* instead of using this structure to make use of
|
||||
* register declarations.
|
||||
*/
|
||||
typedef struct {
|
||||
int minor_axis; /* minor axis */
|
||||
int d; /* decision variable */
|
||||
int m, m1; /* slope and slope+1 */
|
||||
int incr1, incr2; /* error increments */
|
||||
} BRESINFO;
|
||||
|
||||
|
||||
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \
|
||||
BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \
|
||||
bres.m, bres.m1, bres.incr1, bres.incr2)
|
||||
|
||||
#define BRESINCRPGONSTRUCT(bres) \
|
||||
BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* These are the data structures needed to scan
|
||||
* convert regions. Two different scan conversion
|
||||
* methods are available -- the even-odd method, and
|
||||
* the winding number method.
|
||||
* The even-odd rule states that a point is inside
|
||||
* the polygon if a ray drawn from that point in any
|
||||
* direction will pass through an odd number of
|
||||
* path segments.
|
||||
* By the winding number rule, a point is decided
|
||||
* to be inside the polygon if a ray drawn from that
|
||||
* point in any direction passes through a different
|
||||
* number of clockwise and counter-clockwise path
|
||||
* segments.
|
||||
*
|
||||
* These data structures are adapted somewhat from
|
||||
* the algorithm in (Foley/Van Dam) for scan converting
|
||||
* polygons.
|
||||
* The basic algorithm is to start at the top (smallest y)
|
||||
* of the polygon, stepping down to the bottom of
|
||||
* the polygon by incrementing the y coordinate. We
|
||||
* keep a list of edges which the current scanline crosses,
|
||||
* sorted by x. This list is called the Active Edge Table (AET)
|
||||
* As we change the y-coordinate, we update each entry in
|
||||
* in the active edge table to reflect the edges new xcoord.
|
||||
* This list must be sorted at each scanline in case
|
||||
* two edges intersect.
|
||||
* We also keep a data structure known as the Edge Table (ET),
|
||||
* which keeps track of all the edges which the current
|
||||
* scanline has not yet reached. The ET is basically a
|
||||
* list of ScanLineList structures containing a list of
|
||||
* edges which are entered at a given scanline. There is one
|
||||
* ScanLineList per scanline at which an edge is entered.
|
||||
* When we enter a new edge, we move it from the ET to the AET.
|
||||
*
|
||||
* From the AET, we can implement the even-odd rule as in
|
||||
* (Foley/Van Dam).
|
||||
* The winding number rule is a little trickier. We also
|
||||
* keep the EdgeTableEntries in the AET linked by the
|
||||
* nextWETE (winding EdgeTableEntry) link. This allows
|
||||
* the edges to be linked just as before for updating
|
||||
* purposes, but only uses the edges linked by the nextWETE
|
||||
* link as edges representing spans of the polygon to
|
||||
* drawn (as with the even-odd rule).
|
||||
*/
|
||||
|
||||
/*
|
||||
* for the winding number rule
|
||||
*/
|
||||
#define CLOCKWISE 1
|
||||
#define COUNTERCLOCKWISE -1
|
||||
|
||||
typedef struct _EdgeTableEntry {
|
||||
int ymax; /* ycoord at which we exit this edge. */
|
||||
BRESINFO bres; /* Bresenham info to run the edge */
|
||||
struct _EdgeTableEntry *next; /* next in the list */
|
||||
struct _EdgeTableEntry *back; /* for insertion sort */
|
||||
struct _EdgeTableEntry *nextWETE; /* for winding num rule */
|
||||
int ClockWise; /* flag for winding number rule */
|
||||
} EdgeTableEntry;
|
||||
|
||||
|
||||
typedef struct _ScanLineList{
|
||||
int scanline; /* the scanline represented */
|
||||
EdgeTableEntry *edgelist; /* header node */
|
||||
struct _ScanLineList *next; /* next in the list */
|
||||
} ScanLineList;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int ymax; /* ymax for the polygon */
|
||||
int ymin; /* ymin for the polygon */
|
||||
ScanLineList scanlines; /* header node */
|
||||
} EdgeTable;
|
||||
|
||||
|
||||
/*
|
||||
* Here is a struct to help with storage allocation
|
||||
* so we can allocate a big chunk at a time, and then take
|
||||
* pieces from this heap when we need to.
|
||||
*/
|
||||
#define SLLSPERBLOCK 25
|
||||
|
||||
typedef struct _ScanLineListBlock {
|
||||
ScanLineList SLLs[SLLSPERBLOCK];
|
||||
struct _ScanLineListBlock *next;
|
||||
} ScanLineListBlock;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* a few macros for the inner loops of the fill code where
|
||||
* performance considerations don't allow a procedure call.
|
||||
*
|
||||
* Evaluate the given edge at the given scanline.
|
||||
* If the edge has expired, then we leave it and fix up
|
||||
* the active edge table; otherwise, we increment the
|
||||
* x value to be ready for the next scanline.
|
||||
* The winding number rule is in effect, so we must notify
|
||||
* the caller when the edge has been removed so he
|
||||
* can reorder the Winding Active Edge Table.
|
||||
*/
|
||||
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \
|
||||
if (pAET->ymax == y) { /* leaving this edge */ \
|
||||
pPrevAET->next = pAET->next; \
|
||||
pAET = pPrevAET->next; \
|
||||
fixWAET = 1; \
|
||||
if (pAET) \
|
||||
pAET->back = pPrevAET; \
|
||||
} \
|
||||
else { \
|
||||
BRESINCRPGONSTRUCT(pAET->bres); \
|
||||
pPrevAET = pAET; \
|
||||
pAET = pAET->next; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Evaluate the given edge at the given scanline.
|
||||
* If the edge has expired, then we leave it and fix up
|
||||
* the active edge table; otherwise, we increment the
|
||||
* x value to be ready for the next scanline.
|
||||
* The even-odd rule is in effect.
|
||||
*/
|
||||
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
|
||||
if (pAET->ymax == y) { /* leaving this edge */ \
|
||||
pPrevAET->next = pAET->next; \
|
||||
pAET = pPrevAET->next; \
|
||||
if (pAET) \
|
||||
pAET->back = pPrevAET; \
|
||||
} \
|
||||
else { \
|
||||
BRESINCRPGONSTRUCT(pAET->bres); \
|
||||
pPrevAET = pAET; \
|
||||
pAET = pAET->next; \
|
||||
} \
|
||||
}
|
||||
@@ -1,616 +0,0 @@
|
||||
/* $TOG: PolyReg.c /main/15 1998/02/06 17:47:08 kaleb $ */
|
||||
/************************************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
|
||||
All Rights Reserved.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of The Open Group shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from The Open Group.
|
||||
|
||||
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of Digital not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
************************************************************************/
|
||||
/* $XFree86: xc/lib/X11/PolyReg.c,v 1.4 1998/10/03 08:41:21 dawes Exp $ */
|
||||
|
||||
#define LARGE_COORDINATE 1000000
|
||||
#define SMALL_COORDINATE -LARGE_COORDINATE
|
||||
|
||||
#include <gdkregion.h>
|
||||
#include "gdkregion-generic.h"
|
||||
#include "gdkpoly-generic.h"
|
||||
|
||||
/*
|
||||
* InsertEdgeInET
|
||||
*
|
||||
* Insert the given edge into the edge table.
|
||||
* First we must find the correct bucket in the
|
||||
* Edge table, then find the right slot in the
|
||||
* bucket. Finally, we can insert it.
|
||||
*
|
||||
*/
|
||||
static void
|
||||
InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
|
||||
EdgeTable *ET;
|
||||
EdgeTableEntry *ETE;
|
||||
int scanline;
|
||||
ScanLineListBlock **SLLBlock;
|
||||
int *iSLLBlock;
|
||||
{
|
||||
EdgeTableEntry *start, *prev;
|
||||
ScanLineList *pSLL, *pPrevSLL;
|
||||
ScanLineListBlock *tmpSLLBlock;
|
||||
|
||||
/*
|
||||
* find the right bucket to put the edge into
|
||||
*/
|
||||
pPrevSLL = &ET->scanlines;
|
||||
pSLL = pPrevSLL->next;
|
||||
while (pSLL && (pSLL->scanline < scanline))
|
||||
{
|
||||
pPrevSLL = pSLL;
|
||||
pSLL = pSLL->next;
|
||||
}
|
||||
|
||||
/*
|
||||
* reassign pSLL (pointer to ScanLineList) if necessary
|
||||
*/
|
||||
if ((!pSLL) || (pSLL->scanline > scanline))
|
||||
{
|
||||
if (*iSLLBlock > SLLSPERBLOCK-1)
|
||||
{
|
||||
tmpSLLBlock =
|
||||
(ScanLineListBlock *)g_malloc(sizeof(ScanLineListBlock));
|
||||
(*SLLBlock)->next = tmpSLLBlock;
|
||||
tmpSLLBlock->next = (ScanLineListBlock *)NULL;
|
||||
*SLLBlock = tmpSLLBlock;
|
||||
*iSLLBlock = 0;
|
||||
}
|
||||
pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
|
||||
|
||||
pSLL->next = pPrevSLL->next;
|
||||
pSLL->edgelist = (EdgeTableEntry *)NULL;
|
||||
pPrevSLL->next = pSLL;
|
||||
}
|
||||
pSLL->scanline = scanline;
|
||||
|
||||
/*
|
||||
* now insert the edge in the right bucket
|
||||
*/
|
||||
prev = (EdgeTableEntry *)NULL;
|
||||
start = pSLL->edgelist;
|
||||
while (start && (start->bres.minor_axis < ETE->bres.minor_axis))
|
||||
{
|
||||
prev = start;
|
||||
start = start->next;
|
||||
}
|
||||
ETE->next = start;
|
||||
|
||||
if (prev)
|
||||
prev->next = ETE;
|
||||
else
|
||||
pSLL->edgelist = ETE;
|
||||
}
|
||||
|
||||
/*
|
||||
* CreateEdgeTable
|
||||
*
|
||||
* This routine creates the edge table for
|
||||
* scan converting polygons.
|
||||
* The Edge Table (ET) looks like:
|
||||
*
|
||||
* EdgeTable
|
||||
* --------
|
||||
* | ymax | ScanLineLists
|
||||
* |scanline|-->------------>-------------->...
|
||||
* -------- |scanline| |scanline|
|
||||
* |edgelist| |edgelist|
|
||||
* --------- ---------
|
||||
* | |
|
||||
* | |
|
||||
* V V
|
||||
* list of ETEs list of ETEs
|
||||
*
|
||||
* where ETE is an EdgeTableEntry data structure,
|
||||
* and there is one ScanLineList per scanline at
|
||||
* which an edge is initially entered.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
|
||||
int count;
|
||||
GdkPoint *pts;
|
||||
EdgeTable *ET;
|
||||
EdgeTableEntry *AET;
|
||||
EdgeTableEntry *pETEs;
|
||||
ScanLineListBlock *pSLLBlock;
|
||||
{
|
||||
GdkPoint *top, *bottom;
|
||||
GdkPoint *PrevPt, *CurrPt;
|
||||
int iSLLBlock = 0;
|
||||
int dy;
|
||||
|
||||
if (count < 2) return;
|
||||
|
||||
/*
|
||||
* initialize the Active Edge Table
|
||||
*/
|
||||
AET->next = (EdgeTableEntry *)NULL;
|
||||
AET->back = (EdgeTableEntry *)NULL;
|
||||
AET->nextWETE = (EdgeTableEntry *)NULL;
|
||||
AET->bres.minor_axis = SMALL_COORDINATE;
|
||||
|
||||
/*
|
||||
* initialize the Edge Table.
|
||||
*/
|
||||
ET->scanlines.next = (ScanLineList *)NULL;
|
||||
ET->ymax = SMALL_COORDINATE;
|
||||
ET->ymin = LARGE_COORDINATE;
|
||||
pSLLBlock->next = (ScanLineListBlock *)NULL;
|
||||
|
||||
PrevPt = &pts[count-1];
|
||||
|
||||
/*
|
||||
* for each vertex in the array of points.
|
||||
* In this loop we are dealing with two vertices at
|
||||
* a time -- these make up one edge of the polygon.
|
||||
*/
|
||||
while (count--)
|
||||
{
|
||||
CurrPt = pts++;
|
||||
|
||||
/*
|
||||
* find out which point is above and which is below.
|
||||
*/
|
||||
if (PrevPt->y > CurrPt->y)
|
||||
{
|
||||
bottom = PrevPt, top = CurrPt;
|
||||
pETEs->ClockWise = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
bottom = CurrPt, top = PrevPt;
|
||||
pETEs->ClockWise = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* don't add horizontal edges to the Edge table.
|
||||
*/
|
||||
if (bottom->y != top->y)
|
||||
{
|
||||
pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */
|
||||
|
||||
/*
|
||||
* initialize integer edge algorithm
|
||||
*/
|
||||
dy = bottom->y - top->y;
|
||||
BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
|
||||
|
||||
InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock);
|
||||
|
||||
if (PrevPt->y > ET->ymax)
|
||||
ET->ymax = PrevPt->y;
|
||||
if (PrevPt->y < ET->ymin)
|
||||
ET->ymin = PrevPt->y;
|
||||
pETEs++;
|
||||
}
|
||||
|
||||
PrevPt = CurrPt;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* loadAET
|
||||
*
|
||||
* This routine moves EdgeTableEntries from the
|
||||
* EdgeTable into the Active Edge Table,
|
||||
* leaving them sorted by smaller x coordinate.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
loadAET(AET, ETEs)
|
||||
EdgeTableEntry *AET, *ETEs;
|
||||
{
|
||||
EdgeTableEntry *pPrevAET;
|
||||
EdgeTableEntry *tmp;
|
||||
|
||||
pPrevAET = AET;
|
||||
AET = AET->next;
|
||||
while (ETEs)
|
||||
{
|
||||
while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis))
|
||||
{
|
||||
pPrevAET = AET;
|
||||
AET = AET->next;
|
||||
}
|
||||
tmp = ETEs->next;
|
||||
ETEs->next = AET;
|
||||
if (AET)
|
||||
AET->back = ETEs;
|
||||
ETEs->back = pPrevAET;
|
||||
pPrevAET->next = ETEs;
|
||||
pPrevAET = ETEs;
|
||||
|
||||
ETEs = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* computeWAET
|
||||
*
|
||||
* This routine links the AET by the
|
||||
* nextWETE (winding EdgeTableEntry) link for
|
||||
* use by the winding number rule. The final
|
||||
* Active Edge Table (AET) might look something
|
||||
* like:
|
||||
*
|
||||
* AET
|
||||
* ---------- --------- ---------
|
||||
* |ymax | |ymax | |ymax |
|
||||
* | ... | |... | |... |
|
||||
* |next |->|next |->|next |->...
|
||||
* |nextWETE| |nextWETE| |nextWETE|
|
||||
* --------- --------- ^--------
|
||||
* | | |
|
||||
* V-------------------> V---> ...
|
||||
*
|
||||
*/
|
||||
static void
|
||||
computeWAET(AET)
|
||||
EdgeTableEntry *AET;
|
||||
{
|
||||
EdgeTableEntry *pWETE;
|
||||
int inside = 1;
|
||||
int isInside = 0;
|
||||
|
||||
AET->nextWETE = (EdgeTableEntry *)NULL;
|
||||
pWETE = AET;
|
||||
AET = AET->next;
|
||||
while (AET)
|
||||
{
|
||||
if (AET->ClockWise)
|
||||
isInside++;
|
||||
else
|
||||
isInside--;
|
||||
|
||||
if ((!inside && !isInside) ||
|
||||
( inside && isInside))
|
||||
{
|
||||
pWETE->nextWETE = AET;
|
||||
pWETE = AET;
|
||||
inside = !inside;
|
||||
}
|
||||
AET = AET->next;
|
||||
}
|
||||
pWETE->nextWETE = (EdgeTableEntry *)NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* InsertionSort
|
||||
*
|
||||
* Just a simple insertion sort using
|
||||
* pointers and back pointers to sort the Active
|
||||
* Edge Table.
|
||||
*
|
||||
*/
|
||||
|
||||
static int
|
||||
InsertionSort(AET)
|
||||
EdgeTableEntry *AET;
|
||||
{
|
||||
EdgeTableEntry *pETEchase;
|
||||
EdgeTableEntry *pETEinsert;
|
||||
EdgeTableEntry *pETEchaseBackTMP;
|
||||
int changed = 0;
|
||||
|
||||
AET = AET->next;
|
||||
while (AET)
|
||||
{
|
||||
pETEinsert = AET;
|
||||
pETEchase = AET;
|
||||
while (pETEchase->back->bres.minor_axis > AET->bres.minor_axis)
|
||||
pETEchase = pETEchase->back;
|
||||
|
||||
AET = AET->next;
|
||||
if (pETEchase != pETEinsert)
|
||||
{
|
||||
pETEchaseBackTMP = pETEchase->back;
|
||||
pETEinsert->back->next = AET;
|
||||
if (AET)
|
||||
AET->back = pETEinsert->back;
|
||||
pETEinsert->next = pETEchase;
|
||||
pETEchase->back->next = pETEinsert;
|
||||
pETEchase->back = pETEinsert;
|
||||
pETEinsert->back = pETEchaseBackTMP;
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
return(changed);
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up our act.
|
||||
*/
|
||||
static void
|
||||
FreeStorage(pSLLBlock)
|
||||
ScanLineListBlock *pSLLBlock;
|
||||
{
|
||||
ScanLineListBlock *tmpSLLBlock;
|
||||
|
||||
while (pSLLBlock)
|
||||
{
|
||||
tmpSLLBlock = pSLLBlock->next;
|
||||
g_free (pSLLBlock);
|
||||
pSLLBlock = tmpSLLBlock;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an array of rectangles from a list of points.
|
||||
* If indeed these things (POINTS, RECTS) are the same,
|
||||
* then this proc is still needed, because it allocates
|
||||
* storage for the array, which was allocated on the
|
||||
* stack by the calling procedure.
|
||||
*
|
||||
*/
|
||||
static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg)
|
||||
int numFullPtBlocks, iCurPtBlock;
|
||||
POINTBLOCK *FirstPtBlock;
|
||||
GdkRegion *reg;
|
||||
{
|
||||
GdkRegionBox *rects;
|
||||
GdkPoint *pts;
|
||||
POINTBLOCK *CurPtBlock;
|
||||
int i;
|
||||
GdkRegionBox *extents;
|
||||
int numRects;
|
||||
|
||||
extents = ®->extents;
|
||||
|
||||
numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1;
|
||||
|
||||
reg->rects = g_renew (GdkRegionBox, reg->rects, numRects);
|
||||
|
||||
reg->size = numRects;
|
||||
CurPtBlock = FirstPtBlock;
|
||||
rects = reg->rects - 1;
|
||||
numRects = 0;
|
||||
extents->x1 = G_MAXSHORT, extents->x2 = G_MINSHORT;
|
||||
|
||||
for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) {
|
||||
/* the loop uses 2 points per iteration */
|
||||
i = NUMPTSTOBUFFER >> 1;
|
||||
if (!numFullPtBlocks)
|
||||
i = iCurPtBlock >> 1;
|
||||
for (pts = CurPtBlock->pts; i--; pts += 2) {
|
||||
if (pts->x == pts[1].x)
|
||||
continue;
|
||||
if (numRects && pts->x == rects->x1 && pts->y == rects->y2 &&
|
||||
pts[1].x == rects->x2 &&
|
||||
(numRects == 1 || rects[-1].y1 != rects->y1) &&
|
||||
(i && pts[2].y > pts[1].y)) {
|
||||
rects->y2 = pts[1].y + 1;
|
||||
continue;
|
||||
}
|
||||
numRects++;
|
||||
rects++;
|
||||
rects->x1 = pts->x; rects->y1 = pts->y;
|
||||
rects->x2 = pts[1].x; rects->y2 = pts[1].y + 1;
|
||||
if (rects->x1 < extents->x1)
|
||||
extents->x1 = rects->x1;
|
||||
if (rects->x2 > extents->x2)
|
||||
extents->x2 = rects->x2;
|
||||
}
|
||||
CurPtBlock = CurPtBlock->next;
|
||||
}
|
||||
|
||||
if (numRects) {
|
||||
extents->y1 = reg->rects->y1;
|
||||
extents->y2 = rects->y2;
|
||||
} else {
|
||||
extents->x1 = 0;
|
||||
extents->y1 = 0;
|
||||
extents->x2 = 0;
|
||||
extents->y2 = 0;
|
||||
}
|
||||
reg->numRects = numRects;
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* polytoregion
|
||||
*
|
||||
* Scan converts a polygon by returning a run-length
|
||||
* encoding of the resultant bitmap -- the run-length
|
||||
* encoding is in the form of an array of rectangles.
|
||||
*/
|
||||
GdkRegion *
|
||||
gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule)
|
||||
{
|
||||
GdkRegion *region;
|
||||
EdgeTableEntry *pAET; /* Active Edge Table */
|
||||
int y; /* current scanline */
|
||||
int iPts = 0; /* number of pts in buffer */
|
||||
EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/
|
||||
ScanLineList *pSLL; /* current scanLineList */
|
||||
GdkPoint *pts; /* output buffer */
|
||||
EdgeTableEntry *pPrevAET; /* ptr to previous AET */
|
||||
EdgeTable ET; /* header node for ET */
|
||||
EdgeTableEntry AET; /* header node for AET */
|
||||
EdgeTableEntry *pETEs; /* EdgeTableEntries pool */
|
||||
ScanLineListBlock SLLBlock; /* header for scanlinelist */
|
||||
int fixWAET = FALSE;
|
||||
POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
|
||||
POINTBLOCK *tmpPtBlock;
|
||||
int numFullPtBlocks = 0;
|
||||
|
||||
region = gdk_region_new ();
|
||||
|
||||
/* special case a rectangle */
|
||||
pts = Pts;
|
||||
if (((Count == 4) ||
|
||||
((Count == 5) && (pts[4].x == pts[0].x) && (pts[4].y == pts[0].y))) &&
|
||||
(((pts[0].y == pts[1].y) &&
|
||||
(pts[1].x == pts[2].x) &&
|
||||
(pts[2].y == pts[3].y) &&
|
||||
(pts[3].x == pts[0].x)) ||
|
||||
((pts[0].x == pts[1].x) &&
|
||||
(pts[1].y == pts[2].y) &&
|
||||
(pts[2].x == pts[3].x) &&
|
||||
(pts[3].y == pts[0].y)))) {
|
||||
region->extents.x1 = MIN(pts[0].x, pts[2].x);
|
||||
region->extents.y1 = MIN(pts[0].y, pts[2].y);
|
||||
region->extents.x2 = MAX(pts[0].x, pts[2].x);
|
||||
region->extents.y2 = MAX(pts[0].y, pts[2].y);
|
||||
if ((region->extents.x1 != region->extents.x2) &&
|
||||
(region->extents.y1 != region->extents.y2)) {
|
||||
region->numRects = 1;
|
||||
*(region->rects) = region->extents;
|
||||
}
|
||||
return(region);
|
||||
}
|
||||
|
||||
pETEs = g_new (EdgeTableEntry, Count);
|
||||
|
||||
pts = FirstPtBlock.pts;
|
||||
CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock);
|
||||
pSLL = ET.scanlines.next;
|
||||
curPtBlock = &FirstPtBlock;
|
||||
|
||||
if (rule == GDK_EVEN_ODD_RULE) {
|
||||
/*
|
||||
* for each scanline
|
||||
*/
|
||||
for (y = ET.ymin; y < ET.ymax; y++) {
|
||||
/*
|
||||
* Add a new edge to the active edge table when we
|
||||
* get to the next edge.
|
||||
*/
|
||||
if (pSLL != NULL && y == pSLL->scanline) {
|
||||
loadAET(&AET, pSLL->edgelist);
|
||||
pSLL = pSLL->next;
|
||||
}
|
||||
pPrevAET = &AET;
|
||||
pAET = AET.next;
|
||||
|
||||
/*
|
||||
* for each active edge
|
||||
*/
|
||||
while (pAET) {
|
||||
pts->x = pAET->bres.minor_axis, pts->y = y;
|
||||
pts++, iPts++;
|
||||
|
||||
/*
|
||||
* send out the buffer
|
||||
*/
|
||||
if (iPts == NUMPTSTOBUFFER) {
|
||||
tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK));
|
||||
curPtBlock->next = tmpPtBlock;
|
||||
curPtBlock = tmpPtBlock;
|
||||
pts = curPtBlock->pts;
|
||||
numFullPtBlocks++;
|
||||
iPts = 0;
|
||||
}
|
||||
EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
|
||||
}
|
||||
(void) InsertionSort(&AET);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* for each scanline
|
||||
*/
|
||||
for (y = ET.ymin; y < ET.ymax; y++) {
|
||||
/*
|
||||
* Add a new edge to the active edge table when we
|
||||
* get to the next edge.
|
||||
*/
|
||||
if (pSLL != NULL && y == pSLL->scanline) {
|
||||
loadAET(&AET, pSLL->edgelist);
|
||||
computeWAET(&AET);
|
||||
pSLL = pSLL->next;
|
||||
}
|
||||
pPrevAET = &AET;
|
||||
pAET = AET.next;
|
||||
pWETE = pAET;
|
||||
|
||||
/*
|
||||
* for each active edge
|
||||
*/
|
||||
while (pAET) {
|
||||
/*
|
||||
* add to the buffer only those edges that
|
||||
* are in the Winding active edge table.
|
||||
*/
|
||||
if (pWETE == pAET) {
|
||||
pts->x = pAET->bres.minor_axis, pts->y = y;
|
||||
pts++, iPts++;
|
||||
|
||||
/*
|
||||
* send out the buffer
|
||||
*/
|
||||
if (iPts == NUMPTSTOBUFFER) {
|
||||
tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK));
|
||||
curPtBlock->next = tmpPtBlock;
|
||||
curPtBlock = tmpPtBlock;
|
||||
pts = curPtBlock->pts;
|
||||
numFullPtBlocks++; iPts = 0;
|
||||
}
|
||||
pWETE = pWETE->nextWETE;
|
||||
}
|
||||
EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
|
||||
}
|
||||
|
||||
/*
|
||||
* recompute the winding active edge table if
|
||||
* we just resorted or have exited an edge.
|
||||
*/
|
||||
if (InsertionSort(&AET) || fixWAET) {
|
||||
computeWAET(&AET);
|
||||
fixWAET = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
FreeStorage(SLLBlock.next);
|
||||
(void) PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
|
||||
for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
|
||||
tmpPtBlock = curPtBlock->next;
|
||||
g_free (curPtBlock);
|
||||
curPtBlock = tmpPtBlock;
|
||||
}
|
||||
g_free (pETEs);
|
||||
return(region);
|
||||
}
|
||||
284
gdk/gdkprivate.h
284
gdk/gdkprivate.h
@@ -27,38 +27,83 @@
|
||||
#ifndef __GDK_PRIVATE_H__
|
||||
#define __GDK_PRIVATE_H__
|
||||
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkevents.h>
|
||||
#include <gdk/gdkfont.h>
|
||||
#include <gdk/gdkgc.h>
|
||||
#include <gdk/gdkim.h>
|
||||
#include <gdk/gdkimage.h>
|
||||
#include <gdk/gdkregion.h>
|
||||
#include <gdk/gdkvisual.h>
|
||||
#include <gdk/gdkwindow.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define GDK_PARENT_RELATIVE_BG ((GdkPixmap *)1L)
|
||||
#define GDK_NO_BG ((GdkPixmap *)2L)
|
||||
|
||||
#define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
|
||||
#define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
|
||||
|
||||
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
|
||||
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
|
||||
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
typedef struct _GdkWindowPrivate GdkWindowPrivate;
|
||||
typedef struct _GdkWindowPrivate GdkPixmapPrivate;
|
||||
typedef struct _GdkImagePrivate GdkImagePrivate;
|
||||
typedef struct _GdkGCPrivate GdkGCPrivate;
|
||||
typedef struct _GdkColormapPrivate GdkColormapPrivate;
|
||||
typedef struct _GdkColorInfo GdkColorInfo;
|
||||
typedef struct _GdkVisualPrivate GdkVisualPrivate;
|
||||
typedef struct _GdkFontPrivate GdkFontPrivate;
|
||||
typedef struct _GdkCursorPrivate GdkCursorPrivate;
|
||||
typedef struct _GdkEventFilter GdkEventFilter;
|
||||
typedef struct _GdkClientFilter GdkClientFilter;
|
||||
typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
|
||||
typedef struct _GdkRegionPrivate GdkRegionPrivate;
|
||||
|
||||
struct _GdkFontPrivate
|
||||
|
||||
struct _GdkWindowPrivate
|
||||
{
|
||||
GdkFont font;
|
||||
GdkWindow window;
|
||||
GdkWindow *parent;
|
||||
Window xwindow;
|
||||
Display *xdisplay;
|
||||
gint16 x;
|
||||
gint16 y;
|
||||
guint16 width;
|
||||
guint16 height;
|
||||
guint8 resize_count;
|
||||
guint8 window_type;
|
||||
guint ref_count;
|
||||
guint destroyed : 2;
|
||||
guint mapped : 1;
|
||||
guint guffaw_gravity : 1;
|
||||
|
||||
gint extension_events;
|
||||
|
||||
GList *filters;
|
||||
GdkColormap *colormap;
|
||||
GList *children;
|
||||
};
|
||||
|
||||
struct _GdkImagePrivate
|
||||
{
|
||||
GdkImage image;
|
||||
XImage *ximage;
|
||||
Display *xdisplay;
|
||||
gpointer x_shm_info;
|
||||
|
||||
void (*image_put) (GdkDrawable *window,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
};
|
||||
|
||||
struct _GdkGCPrivate
|
||||
{
|
||||
GdkGC gc;
|
||||
GC xgc;
|
||||
Display *xdisplay;
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
@@ -72,6 +117,74 @@ struct _GdkColorInfo
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
struct _GdkColormapPrivate
|
||||
{
|
||||
GdkColormap colormap;
|
||||
Colormap xcolormap;
|
||||
Display *xdisplay;
|
||||
GdkVisual *visual;
|
||||
gint private_val;
|
||||
|
||||
GHashTable *hash;
|
||||
GdkColorInfo *info;
|
||||
time_t last_sync_time;
|
||||
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
struct _GdkVisualPrivate
|
||||
{
|
||||
GdkVisual visual;
|
||||
Visual *xvisual;
|
||||
};
|
||||
|
||||
struct _GdkFontPrivate
|
||||
{
|
||||
GdkFont font;
|
||||
/* XFontStruct *xfont; */
|
||||
/* generic pointer point to XFontStruct or XFontSet */
|
||||
gpointer xfont;
|
||||
Display *xdisplay;
|
||||
guint ref_count;
|
||||
|
||||
GSList *names;
|
||||
};
|
||||
|
||||
struct _GdkCursorPrivate
|
||||
{
|
||||
GdkCursor cursor;
|
||||
Cursor xcursor;
|
||||
Display *xdisplay;
|
||||
};
|
||||
|
||||
struct _GdkDndCursorInfo {
|
||||
Cursor gdk_cursor_dragdefault, gdk_cursor_dragok;
|
||||
GdkWindow *drag_pm_default, *drag_pm_ok;
|
||||
GdkPoint default_hotspot, ok_hotspot;
|
||||
GList *xids;
|
||||
};
|
||||
typedef struct _GdkDndCursorInfo GdkDndCursorInfo;
|
||||
|
||||
struct _GdkDndGlobals {
|
||||
GdkAtom gdk_XdeEnter, gdk_XdeLeave, gdk_XdeRequest;
|
||||
GdkAtom gdk_XdeDataAvailable, gdk_XdeDataShow, gdk_XdeCancel;
|
||||
GdkAtom gdk_XdeTypelist;
|
||||
|
||||
GdkDndCursorInfo *c;
|
||||
GdkWindow **drag_startwindows;
|
||||
guint drag_numwindows;
|
||||
gboolean drag_really, drag_perhaps, dnd_grabbed;
|
||||
Window dnd_drag_target;
|
||||
GdkPoint drag_dropcoords;
|
||||
|
||||
GdkPoint dnd_drag_start, dnd_drag_oldpos;
|
||||
GdkRectangle dnd_drag_dropzone;
|
||||
GdkWindowPrivate *real_sw;
|
||||
Window dnd_drag_curwin;
|
||||
Time last_drop_time; /* An incredible hack, sosumi miguel */
|
||||
};
|
||||
typedef struct _GdkDndGlobals GdkDndGlobals;
|
||||
|
||||
struct _GdkEventFilter {
|
||||
GdkFilterFunc function;
|
||||
gpointer data;
|
||||
@@ -83,11 +196,131 @@ struct _GdkClientFilter {
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
#ifdef USE_XIM
|
||||
|
||||
typedef struct _GdkICPrivate GdkICPrivate;
|
||||
|
||||
struct _GdkICPrivate
|
||||
{
|
||||
XIC xic;
|
||||
GdkICAttr *attr;
|
||||
GdkICAttributesType mask;
|
||||
};
|
||||
|
||||
#endif /* USE_XIM */
|
||||
|
||||
struct _GdkColorContextPrivate
|
||||
{
|
||||
GdkColorContext color_context;
|
||||
Display *xdisplay;
|
||||
XStandardColormap std_cmap;
|
||||
};
|
||||
|
||||
struct _GdkRegionPrivate
|
||||
{
|
||||
GdkRegion region;
|
||||
Region xregion;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
GDK_DEBUG_MISC = 1 << 0,
|
||||
GDK_DEBUG_EVENTS = 1 << 1,
|
||||
GDK_DEBUG_DND = 1 << 2,
|
||||
GDK_DEBUG_COLOR_CONTEXT = 1 << 3,
|
||||
GDK_DEBUG_XIM = 1 << 4
|
||||
} GdkDebugFlag;
|
||||
|
||||
void gdk_events_init (void);
|
||||
void gdk_window_init (void);
|
||||
void gdk_visual_init (void);
|
||||
void gdk_dnd_init (void);
|
||||
|
||||
void gdk_image_init (void);
|
||||
void gdk_image_exit (void);
|
||||
|
||||
GdkColormap* gdk_colormap_lookup (Colormap xcolormap);
|
||||
GdkVisual* gdk_visual_lookup (Visual *xvisual);
|
||||
|
||||
void gdk_window_add_colormap_windows (GdkWindow *window);
|
||||
void gdk_window_destroy_notify (GdkWindow *window);
|
||||
|
||||
GDKVAR GdkWindow *gdk_parent_root;
|
||||
GDKVAR gint gdk_error_code;
|
||||
GDKVAR gint gdk_error_warnings;
|
||||
void gdk_xid_table_insert (XID *xid,
|
||||
gpointer data);
|
||||
void gdk_xid_table_remove (XID xid);
|
||||
gpointer gdk_xid_table_lookup (XID xid);
|
||||
|
||||
gint gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
|
||||
XEvent *event_send);
|
||||
|
||||
/* If you pass x = y = -1, it queries the pointer
|
||||
to find out where it currently is.
|
||||
If you pass x = y = -2, it does anything necessary
|
||||
to know that the drag is ending.
|
||||
*/
|
||||
void gdk_dnd_display_drag_cursor(gint x,
|
||||
gint y,
|
||||
gboolean drag_ok,
|
||||
gboolean change_made);
|
||||
|
||||
/* Please see gdkwindow.c for comments on how to use */
|
||||
Window gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y, GList *excludes, gboolean excl_child);
|
||||
Window gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child);
|
||||
|
||||
extern gint gdk_debug_level;
|
||||
extern gint gdk_show_events;
|
||||
extern gint gdk_use_xshm;
|
||||
extern gint gdk_stack_trace;
|
||||
extern gchar *gdk_display_name;
|
||||
extern Display *gdk_display;
|
||||
extern gint gdk_screen;
|
||||
extern Window gdk_root_window;
|
||||
extern Window gdk_leader_window;
|
||||
extern GdkWindowPrivate gdk_root_parent;
|
||||
extern Atom gdk_wm_delete_window;
|
||||
extern Atom gdk_wm_take_focus;
|
||||
extern Atom gdk_wm_protocols;
|
||||
extern Atom gdk_wm_window_protocols[];
|
||||
extern Atom gdk_selection_property;
|
||||
extern GdkDndGlobals gdk_dnd;
|
||||
extern GdkWindow *selection_owner[];
|
||||
extern gchar *gdk_progclass;
|
||||
extern gint gdk_error_code;
|
||||
extern gint gdk_error_warnings;
|
||||
extern gint gdk_null_window_warnings;
|
||||
extern GList *gdk_default_filters;
|
||||
extern const int gdk_nevent_masks;
|
||||
extern const int gdk_event_mask_table[];
|
||||
|
||||
extern GdkWindowPrivate *gdk_xgrab_window; /* Window that currently holds the
|
||||
* x pointer grab
|
||||
*/
|
||||
|
||||
#ifdef USE_XIM
|
||||
/* XIM support */
|
||||
gint gdk_im_open (void);
|
||||
void gdk_im_close (void);
|
||||
void gdk_ic_cleanup (void);
|
||||
|
||||
extern GdkICPrivate *gdk_xim_ic; /* currently using IC */
|
||||
extern GdkWindow *gdk_xim_window; /* currently using Window */
|
||||
#endif /* USE_XIM */
|
||||
|
||||
/* Debugging support */
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
#define GDK_NOTE(type,action) G_STMT_START { \
|
||||
if (gdk_debug_flags & GDK_DEBUG_##type) \
|
||||
{ action; }; } G_STMT_END
|
||||
|
||||
#else /* !G_ENABLE_DEBUG */
|
||||
|
||||
#define GDK_NOTE(type,action)
|
||||
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
extern guint gdk_debug_flags;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -95,8 +328,3 @@ GDKVAR gint gdk_error_warnings;
|
||||
|
||||
|
||||
#endif /* __GDK_PRIVATE_H__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,20 +27,16 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gdkx.h"
|
||||
#include "gdkproperty.h"
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
GdkAtom
|
||||
gdk_atom_intern (const gchar *atom_name,
|
||||
gboolean only_if_exists)
|
||||
gint only_if_exists)
|
||||
{
|
||||
GdkAtom retval;
|
||||
static GHashTable *atom_hash = NULL;
|
||||
|
||||
g_return_val_if_fail (atom_name != NULL, GDK_NONE);
|
||||
|
||||
if (!atom_hash)
|
||||
atom_hash = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
@@ -112,16 +108,16 @@ gdk_property_get (GdkWindow *window,
|
||||
gulong ret_length;
|
||||
guchar *ret_data;
|
||||
|
||||
g_return_val_if_fail (window != NULL, FALSE);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
||||
|
||||
if (window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
private = (GdkWindowPrivate*) window;
|
||||
if (private->destroyed)
|
||||
return FALSE;
|
||||
|
||||
xdisplay = GDK_WINDOW_XDISPLAY (window);
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
xdisplay = private->xdisplay;
|
||||
xwindow = private->xwindow;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -190,27 +186,27 @@ gdk_property_get (GdkWindow *window,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_property_change (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
const guchar *data,
|
||||
gint nelements)
|
||||
gdk_property_change (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
guchar *data,
|
||||
gint nelements)
|
||||
{
|
||||
Display *xdisplay;
|
||||
Window xwindow;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
if (window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
private = (GdkWindowPrivate*) window;
|
||||
if (private->destroyed)
|
||||
return;
|
||||
|
||||
xdisplay = GDK_WINDOW_XDISPLAY (window);
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
xdisplay = private->xdisplay;
|
||||
xwindow = private->xwindow;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -219,7 +215,7 @@ gdk_property_change (GdkWindow *window,
|
||||
}
|
||||
|
||||
XChangeProperty (xdisplay, xwindow, property, type,
|
||||
format, mode, (guchar *)data, nelements);
|
||||
format, mode, data, nelements);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -229,16 +225,16 @@ gdk_property_delete (GdkWindow *window,
|
||||
Display *xdisplay;
|
||||
Window xwindow;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
if (window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
private = (GdkWindowPrivate*) window;
|
||||
if (private->destroyed)
|
||||
return;
|
||||
|
||||
xdisplay = GDK_WINDOW_XDISPLAY (window);
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
xdisplay = private->xdisplay;
|
||||
xwindow = private->xwindow;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1,58 +0,0 @@
|
||||
#ifndef __GDK_PROPERTY_H__
|
||||
#define __GDK_PROPERTY_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_PROP_MODE_REPLACE,
|
||||
GDK_PROP_MODE_PREPEND,
|
||||
GDK_PROP_MODE_APPEND
|
||||
} GdkPropMode;
|
||||
|
||||
GdkAtom gdk_atom_intern (const gchar *atom_name,
|
||||
gboolean only_if_exists);
|
||||
gchar* gdk_atom_name (GdkAtom atom);
|
||||
|
||||
gboolean gdk_property_get (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gulong offset,
|
||||
gulong length,
|
||||
gint pdelete,
|
||||
GdkAtom *actual_property_type,
|
||||
gint *actual_format,
|
||||
gint *actual_length,
|
||||
guchar **data);
|
||||
void gdk_property_change (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
const guchar *data,
|
||||
gint nelements);
|
||||
void gdk_property_delete (GdkWindow *window,
|
||||
GdkAtom property);
|
||||
|
||||
gint gdk_text_property_to_text_list (GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list);
|
||||
void gdk_free_text_list (gchar **list);
|
||||
gint gdk_string_to_compound_text (const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length);
|
||||
void gdk_free_compound_text (guchar *ctext);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_PROPERTY_H__ */
|
||||
@@ -24,25 +24,23 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include "gdk.h"
|
||||
|
||||
|
||||
|
||||
void
|
||||
gdk_rectangle_union (GdkRectangle *src1,
|
||||
GdkRectangle *src2,
|
||||
GdkRectangle *dest)
|
||||
{
|
||||
gint dest_x, dest_y;
|
||||
|
||||
g_return_if_fail (src1 != NULL);
|
||||
g_return_if_fail (src2 != NULL);
|
||||
g_return_if_fail (dest != NULL);
|
||||
|
||||
dest_x = MIN (src1->x, src2->x);
|
||||
dest_y = MIN (src1->y, src2->y);
|
||||
dest->width = MAX (src1->x + src1->width, src2->x + src2->width) - dest_x;
|
||||
dest->height = MAX (src1->y + src1->height, src2->y + src2->height) - dest_y;
|
||||
dest->x = dest_x;
|
||||
dest->y = dest_y;
|
||||
dest->x = MIN (src1->x, src2->x);
|
||||
dest->y = MIN (src1->y, src2->y);
|
||||
dest->width = MAX (src1->x + src1->width, src2->x + src2->width) - dest->x;
|
||||
dest->height = MAX (src1->y + src1->height, src2->y + src2->height) - dest->y;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -67,13 +65,13 @@ gdk_rectangle_intersect (GdkRectangle *src1,
|
||||
src1 = src2;
|
||||
src2 = temp;
|
||||
}
|
||||
dest->x = src2->x;
|
||||
|
||||
src1_x2 = src1->x + src1->width;
|
||||
src2_x2 = src2->x + src2->width;
|
||||
|
||||
if (src2->x < src1_x2)
|
||||
{
|
||||
dest->x = src2->x;
|
||||
|
||||
if (src1_x2 < src2_x2)
|
||||
dest->width = src1_x2 - dest->x;
|
||||
else
|
||||
@@ -85,6 +83,8 @@ gdk_rectangle_intersect (GdkRectangle *src1,
|
||||
src1 = src2;
|
||||
src2 = temp;
|
||||
}
|
||||
dest->y = src2->y;
|
||||
|
||||
src1_y2 = src1->y + src1->height;
|
||||
src2_y2 = src2->y + src2->height;
|
||||
|
||||
@@ -92,8 +92,6 @@ gdk_rectangle_intersect (GdkRectangle *src1,
|
||||
{
|
||||
return_val = TRUE;
|
||||
|
||||
dest->y = src2->y;
|
||||
|
||||
if (src1_y2 < src2_y2)
|
||||
dest->height = src1_y2 - dest->y;
|
||||
else
|
||||
@@ -106,11 +104,5 @@ gdk_rectangle_intersect (GdkRectangle *src1,
|
||||
}
|
||||
}
|
||||
|
||||
if (!return_val)
|
||||
{
|
||||
dest->width = 0;
|
||||
dest->height = 0;
|
||||
}
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,167 +0,0 @@
|
||||
/* $TOG: region.h /main/9 1998/02/06 17:50:30 kaleb $ */
|
||||
/************************************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
|
||||
All Rights Reserved.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of The Open Group shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from The Open Group.
|
||||
|
||||
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of Digital not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
************************************************************************/
|
||||
|
||||
#ifndef __GDK_REGION_GENERIC_H__
|
||||
#define __GDK_REGION_GENERIC_H__
|
||||
|
||||
typedef struct _GdkRegionBox GdkRegionBox;
|
||||
|
||||
struct _GdkRegionBox
|
||||
{
|
||||
int x1, x2, y1, y2;
|
||||
};
|
||||
|
||||
/*
|
||||
* clip region
|
||||
*/
|
||||
|
||||
struct _GdkRegion
|
||||
{
|
||||
long size;
|
||||
long numRects;
|
||||
GdkRegionBox *rects;
|
||||
GdkRegionBox extents;
|
||||
};
|
||||
|
||||
/* 1 if two BOXs overlap.
|
||||
* 0 if two BOXs do not overlap.
|
||||
* Remember, x2 and y2 are not in the region
|
||||
*/
|
||||
#define EXTENTCHECK(r1, r2) \
|
||||
((r1)->x2 > (r2)->x1 && \
|
||||
(r1)->x1 < (r2)->x2 && \
|
||||
(r1)->y2 > (r2)->y1 && \
|
||||
(r1)->y1 < (r2)->y2)
|
||||
|
||||
/*
|
||||
* update region extents
|
||||
*/
|
||||
#define EXTENTS(r,idRect){\
|
||||
if((r)->x1 < (idRect)->extents.x1)\
|
||||
(idRect)->extents.x1 = (r)->x1;\
|
||||
if((r)->y1 < (idRect)->extents.y1)\
|
||||
(idRect)->extents.y1 = (r)->y1;\
|
||||
if((r)->x2 > (idRect)->extents.x2)\
|
||||
(idRect)->extents.x2 = (r)->x2;\
|
||||
if((r)->y2 > (idRect)->extents.y2)\
|
||||
(idRect)->extents.y2 = (r)->y2;\
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to see if there is enough memory in the present region.
|
||||
*/
|
||||
#define MEMCHECK(reg, rect, firstrect){ \
|
||||
if ((reg)->numRects >= ((reg)->size - 1)) { \
|
||||
(firstrect) = g_renew (GdkRegionBox, (firstrect), 2 * (reg)->size); \
|
||||
(reg)->size *= 2; \
|
||||
(rect) = &(firstrect)[(reg)->numRects]; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* this routine checks to see if the previous rectangle is the same
|
||||
* or subsumes the new rectangle to add.
|
||||
*/
|
||||
|
||||
#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\
|
||||
(!(((Reg)->numRects > 0)&&\
|
||||
((R-1)->y1 == (Ry1)) &&\
|
||||
((R-1)->y2 == (Ry2)) &&\
|
||||
((R-1)->x1 <= (Rx1)) &&\
|
||||
((R-1)->x2 >= (Rx2))))
|
||||
|
||||
/* add a rectangle to the given Region */
|
||||
#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\
|
||||
if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\
|
||||
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
|
||||
(r)->x1 = (rx1);\
|
||||
(r)->y1 = (ry1);\
|
||||
(r)->x2 = (rx2);\
|
||||
(r)->y2 = (ry2);\
|
||||
EXTENTS((r), (reg));\
|
||||
(reg)->numRects++;\
|
||||
(r)++;\
|
||||
}\
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* add a rectangle to the given Region */
|
||||
#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\
|
||||
if ((rx1 < rx2) && (ry1 < ry2) &&\
|
||||
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
|
||||
(r)->x1 = (rx1);\
|
||||
(r)->y1 = (ry1);\
|
||||
(r)->x2 = (rx2);\
|
||||
(r)->y2 = (ry2);\
|
||||
(reg)->numRects++;\
|
||||
(r)++;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define EMPTY_REGION(pReg) pReg->numRects = 0
|
||||
|
||||
#define REGION_NOT_EMPTY(pReg) pReg->numRects
|
||||
|
||||
#define INBOX(r, x, y) \
|
||||
( ( ((r).x2 > x)) && \
|
||||
( ((r).x1 <= x)) && \
|
||||
( ((r).y2 > y)) && \
|
||||
( ((r).y1 <= y)) )
|
||||
|
||||
/*
|
||||
* number of points to buffer before sending them off
|
||||
* to scanlines() : Must be an even number
|
||||
*/
|
||||
#define NUMPTSTOBUFFER 200
|
||||
|
||||
/*
|
||||
* used to allocate buffers for points and link
|
||||
* the buffers together
|
||||
*/
|
||||
typedef struct _POINTBLOCK {
|
||||
GdkPoint pts[NUMPTSTOBUFFER];
|
||||
struct _POINTBLOCK *next;
|
||||
} POINTBLOCK;
|
||||
|
||||
#endif /* __GDK_REGION_GENERIC_H__ */
|
||||
@@ -26,7 +26,11 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
|
||||
|
||||
|
||||
GdkRegion*
|
||||
gdk_region_new (void)
|
||||
@@ -89,19 +93,19 @@ void
|
||||
gdk_region_get_clipbox(GdkRegion *region,
|
||||
GdkRectangle *rectangle)
|
||||
{
|
||||
GdkRegionPrivate *rp;
|
||||
XRectangle r;
|
||||
|
||||
g_return_if_fail(region != NULL);
|
||||
g_return_if_fail(rectangle != NULL);
|
||||
|
||||
rp = (GdkRegionPrivate *)region;
|
||||
XClipBox(rp->xregion, &r);
|
||||
|
||||
rectangle->x = r.x;
|
||||
rectangle->y = r.y;
|
||||
rectangle->width = r.width;
|
||||
rectangle->height = r.height;
|
||||
GdkRegionPrivate *rp;
|
||||
XRectangle r;
|
||||
|
||||
g_return_if_fail(region != NULL);
|
||||
g_return_if_fail(rectangle != NULL);
|
||||
|
||||
rp = (GdkRegionPrivate *)region;
|
||||
XClipBox(rp->xregion, &r);
|
||||
|
||||
rectangle->x = r.x;
|
||||
rectangle->y = r.y;
|
||||
rectangle->width = r.width;
|
||||
rectangle->height = r.height;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -1,73 +0,0 @@
|
||||
#ifndef __GDK_REGION_H__
|
||||
#define __GDK_REGION_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* GC fill rule for polygons
|
||||
* EvenOddRule
|
||||
* WindingRule
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_EVEN_ODD_RULE,
|
||||
GDK_WINDING_RULE
|
||||
} GdkFillRule;
|
||||
|
||||
/* Types of overlapping between a rectangle and a region
|
||||
* GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
|
||||
* GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
|
||||
* GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_OVERLAP_RECTANGLE_IN,
|
||||
GDK_OVERLAP_RECTANGLE_OUT,
|
||||
GDK_OVERLAP_RECTANGLE_PART
|
||||
} GdkOverlapType;
|
||||
|
||||
GdkRegion *gdk_region_new (void);
|
||||
GdkRegion *gdk_region_polygon (GdkPoint *points,
|
||||
gint npoints,
|
||||
GdkFillRule fill_rule);
|
||||
GdkRegion *gdk_region_copy (GdkRegion *region);
|
||||
GdkRegion *gdk_region_rectangle (GdkRectangle *rectangle);
|
||||
void gdk_region_destroy (GdkRegion *region);
|
||||
|
||||
void gdk_region_get_clipbox (GdkRegion *region,
|
||||
GdkRectangle *rectangle);
|
||||
|
||||
gboolean gdk_region_empty (GdkRegion *region);
|
||||
gboolean gdk_region_equal (GdkRegion *region1,
|
||||
GdkRegion *region2);
|
||||
gboolean gdk_region_point_in (GdkRegion *region,
|
||||
int x,
|
||||
int y);
|
||||
GdkOverlapType gdk_region_rect_in (GdkRegion *region,
|
||||
GdkRectangle *rect);
|
||||
|
||||
void gdk_region_offset (GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy);
|
||||
void gdk_region_shrink (GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy);
|
||||
void gdk_region_union_with_rect (GdkRegion *region,
|
||||
GdkRectangle *rect);
|
||||
void gdk_region_intersect (GdkRegion *source1,
|
||||
GdkRegion *source2);
|
||||
void gdk_region_union (GdkRegion *source1,
|
||||
GdkRegion *source2);
|
||||
void gdk_region_subtract (GdkRegion *source1,
|
||||
GdkRegion *source2);
|
||||
void gdk_region_xor (GdkRegion *source1,
|
||||
GdkRegion *source2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_REGION_H__ */
|
||||
42
gdk/gdkrgb.c
42
gdk/gdkrgb.c
@@ -56,12 +56,12 @@
|
||||
#else
|
||||
|
||||
/* Compiling as a part of Gtk 1.1 or later */
|
||||
#include "config.h"
|
||||
#include "../config.h"
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "gdk.h" /* For gdk_flush() */
|
||||
#include "gdkrgb.h"
|
||||
|
||||
typedef struct _GdkRgbInfo GdkRgbInfo;
|
||||
@@ -73,16 +73,6 @@ typedef void (*GdkRgbConvFunc) (GdkImage *image,
|
||||
gint x_align, gint y_align,
|
||||
GdkRgbCmap *cmap);
|
||||
|
||||
static const gchar* visual_names[] =
|
||||
{
|
||||
"static gray",
|
||||
"grayscale",
|
||||
"static color",
|
||||
"pseudo color",
|
||||
"true color",
|
||||
"direct color",
|
||||
};
|
||||
|
||||
/* Some of these fields should go, as they're not being used at all.
|
||||
Globals should generally migrate into here - it's very likely that
|
||||
we'll want to run more than one GdkRgbInfo context at the same time
|
||||
@@ -226,7 +216,7 @@ gdk_rgb_try_colormap (gint nr, gint ng, gint nb)
|
||||
gint idx;
|
||||
gint best[256];
|
||||
|
||||
if (nr * ng * nb < gdk_rgb_min_colors)
|
||||
if (!image_info->cmap_alloced && nr * ng * nb < gdk_rgb_min_colors)
|
||||
return FALSE;
|
||||
|
||||
if (image_info->cmap_alloced)
|
||||
@@ -415,6 +405,16 @@ static guint32
|
||||
gdk_rgb_score_visual (GdkVisual *visual)
|
||||
{
|
||||
guint32 quality, speed, sys, pseudo;
|
||||
static const gchar* visual_names[] =
|
||||
{
|
||||
"static gray",
|
||||
"grayscale",
|
||||
"static color",
|
||||
"pseudo color",
|
||||
"true color",
|
||||
"direct color",
|
||||
};
|
||||
|
||||
|
||||
quality = 0;
|
||||
speed = 1;
|
||||
@@ -466,7 +466,8 @@ gdk_rgb_score_visual (GdkVisual *visual)
|
||||
pseudo = (visual->type == GDK_VISUAL_PSEUDO_COLOR || visual->type == GDK_VISUAL_TRUE_COLOR);
|
||||
|
||||
if (gdk_rgb_verbose)
|
||||
g_print ("Visual type = %s, depth = %d, %x:%x:%x%s; score=%x\n",
|
||||
g_print ("Visual 0x%x, type = %s, depth = %d, %x:%x:%x%s; score=%x\n",
|
||||
(gint)(((GdkVisualPrivate *)visual)->xvisual->visualid),
|
||||
visual_names[visual->type],
|
||||
visual->depth,
|
||||
visual->red_mask,
|
||||
@@ -2680,19 +2681,12 @@ gdk_rgb_select_conv (GdkImage *image)
|
||||
gboolean mask_rgb, mask_bgr;
|
||||
|
||||
depth = image_info->visual->depth;
|
||||
|
||||
/* FIXME: save the bpp in the image; this is hack that works for
|
||||
* common visuals, not otherwise.
|
||||
*/
|
||||
if (depth <= 8)
|
||||
bpp = depth;
|
||||
else
|
||||
bpp = 8 * image->bpp;
|
||||
bpp = ((GdkImagePrivate *)image)->ximage->bits_per_pixel;
|
||||
|
||||
byte_order = image->byte_order;
|
||||
if (gdk_rgb_verbose)
|
||||
g_print ("Chose visual type=%s depth=%d, image bpp=%d, %s first\n",
|
||||
visual_names[image_info->visual->type], image_info->visual->depth,
|
||||
g_print ("Chose visual 0x%x, image bpp=%d, %s first\n",
|
||||
(gint)(((GdkVisualPrivate *)image_info->visual)->xvisual->visualid),
|
||||
bpp, byte_order == GDK_LSB_FIRST ? "lsb" : "msb");
|
||||
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#ifndef __GDK_RGB_H__
|
||||
#define __GDK_RGB_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -27,29 +27,30 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gdkproperty.h"
|
||||
#include "gdkselection.h"
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdkx.h"
|
||||
|
||||
|
||||
gboolean
|
||||
gdk_selection_owner_set (GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gboolean send_event)
|
||||
gint send_event)
|
||||
{
|
||||
Display *xdisplay;
|
||||
Window xwindow;
|
||||
|
||||
if (owner)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (owner))
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
private = (GdkWindowPrivate*) owner;
|
||||
if (private->destroyed)
|
||||
return FALSE;
|
||||
|
||||
xdisplay = GDK_WINDOW_XDISPLAY (owner);
|
||||
xwindow = GDK_WINDOW_XID (owner);
|
||||
xdisplay = private->xdisplay;
|
||||
xwindow = private->xwindow;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -80,11 +81,16 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
GdkAtom target,
|
||||
guint32 time)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (requestor))
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
g_return_if_fail (requestor != NULL);
|
||||
|
||||
private = (GdkWindowPrivate*) requestor;
|
||||
if (private->destroyed)
|
||||
return;
|
||||
|
||||
XConvertSelection (GDK_WINDOW_XDISPLAY (requestor), selection, target,
|
||||
gdk_selection_property, GDK_WINDOW_XID (requestor), time);
|
||||
XConvertSelection (private->xdisplay, selection, target,
|
||||
gdk_selection_property, private->xwindow, time);
|
||||
}
|
||||
|
||||
gint
|
||||
@@ -93,6 +99,7 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
GdkAtom *ret_type,
|
||||
gint *ret_format)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
gulong nitems;
|
||||
gulong nbytes;
|
||||
gulong length;
|
||||
@@ -101,18 +108,17 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
guchar *t = NULL;
|
||||
|
||||
g_return_val_if_fail (requestor != NULL, 0);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0);
|
||||
|
||||
/* If retrieved chunks are typically small, (and the ICCCM says the
|
||||
should be) it would be a win to try first with a buffer of
|
||||
moderate length, to avoid two round trips to the server */
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (requestor))
|
||||
private = (GdkWindowPrivate*) requestor;
|
||||
if (private->destroyed)
|
||||
return 0;
|
||||
|
||||
t = NULL;
|
||||
XGetWindowProperty (GDK_WINDOW_XDISPLAY (requestor),
|
||||
GDK_WINDOW_XID (requestor),
|
||||
XGetWindowProperty (private->xdisplay, private->xwindow,
|
||||
gdk_selection_property, 0, 0, False,
|
||||
AnyPropertyType, &prop_type, &prop_format,
|
||||
&nitems, &nbytes, &t);
|
||||
@@ -142,8 +148,7 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
protocol, in which case the client has to make sure they'll be
|
||||
notified of PropertyChange events _before_ the property is deleted.
|
||||
Otherwise there's no guarantee we'll win the race ... */
|
||||
XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (requestor),
|
||||
GDK_DRAWABLE_XID (requestor),
|
||||
XGetWindowProperty (private->xdisplay, private->xwindow,
|
||||
gdk_selection_property, 0, (nbytes + 3) / 4, False,
|
||||
AnyPropertyType, &prop_type, &prop_format,
|
||||
&nitems, &nbytes, &t);
|
||||
@@ -187,11 +192,9 @@ gdk_selection_send_notify (guint32 requestor,
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_text_property_to_text_list (GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
gdk_text_property_to_text_list (GdkAtom encoding, gint format,
|
||||
guchar *text, gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
XTextProperty property;
|
||||
gint count = 0;
|
||||
@@ -200,7 +203,7 @@ gdk_text_property_to_text_list (GdkAtom encoding,
|
||||
if (!list)
|
||||
return 0;
|
||||
|
||||
property.value = (guchar *)text;
|
||||
property.value = text;
|
||||
property.encoding = encoding;
|
||||
property.format = format;
|
||||
property.nitems = length;
|
||||
@@ -223,10 +226,8 @@ gdk_free_text_list (gchar **list)
|
||||
|
||||
gint
|
||||
gdk_string_to_compound_text (const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
GdkAtom *encoding, gint *format,
|
||||
guchar **ctext, gint *length)
|
||||
{
|
||||
gint res;
|
||||
XTextProperty property;
|
||||
@@ -1,65 +0,0 @@
|
||||
#ifndef __GDK_SELECTION_H__
|
||||
#define __GDK_SELECTION_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* The next three types define enums for predefined atoms relating
|
||||
to selections. In general, one will need to use gdk_intern_atom */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_SELECTION_PRIMARY = 1,
|
||||
GDK_SELECTION_SECONDARY = 2
|
||||
} GdkSelection;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_TARGET_BITMAP = 5,
|
||||
GDK_TARGET_COLORMAP = 7,
|
||||
GDK_TARGET_DRAWABLE = 17,
|
||||
GDK_TARGET_PIXMAP = 20,
|
||||
GDK_TARGET_STRING = 31
|
||||
} GdkTarget;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_SELECTION_TYPE_ATOM = 4,
|
||||
GDK_SELECTION_TYPE_BITMAP = 5,
|
||||
GDK_SELECTION_TYPE_COLORMAP = 7,
|
||||
GDK_SELECTION_TYPE_DRAWABLE = 17,
|
||||
GDK_SELECTION_TYPE_INTEGER = 19,
|
||||
GDK_SELECTION_TYPE_PIXMAP = 20,
|
||||
GDK_SELECTION_TYPE_WINDOW = 33,
|
||||
GDK_SELECTION_TYPE_STRING = 31
|
||||
} GdkSelectionType;
|
||||
|
||||
/* Selections
|
||||
*/
|
||||
gboolean gdk_selection_owner_set (GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gboolean send_event);
|
||||
GdkWindow* gdk_selection_owner_get (GdkAtom selection);
|
||||
void gdk_selection_convert (GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint32 time);
|
||||
gboolean gdk_selection_property_get (GdkWindow *requestor,
|
||||
guchar **data,
|
||||
GdkAtom *prop_type,
|
||||
gint *prop_format);
|
||||
void gdk_selection_send_notify (guint32 requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_SELECTION_H__ */
|
||||
1200
gdk/gdktypes.h
1200
gdk/gdktypes.h
File diff suppressed because it is too large
Load Diff
@@ -26,10 +26,10 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkx.h"
|
||||
|
||||
#include "gdkvisual.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
static void gdk_visual_add (GdkVisual *visual);
|
||||
static void gdk_visual_decompose_mask (gulong mask,
|
||||
@@ -1,85 +0,0 @@
|
||||
#ifndef __GDK_VISUAL_H__
|
||||
#define __GDK_VISUAL_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Types of visuals.
|
||||
* StaticGray:
|
||||
* Grayscale:
|
||||
* StaticColor:
|
||||
* PseudoColor:
|
||||
* TrueColor:
|
||||
* DirectColor:
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_VISUAL_STATIC_GRAY,
|
||||
GDK_VISUAL_GRAYSCALE,
|
||||
GDK_VISUAL_STATIC_COLOR,
|
||||
GDK_VISUAL_PSEUDO_COLOR,
|
||||
GDK_VISUAL_TRUE_COLOR,
|
||||
GDK_VISUAL_DIRECT_COLOR
|
||||
} GdkVisualType;
|
||||
|
||||
/* The visual type.
|
||||
* "type" is the type of visual this is (PseudoColor, TrueColor, etc).
|
||||
* "depth" is the bit depth of this visual.
|
||||
* "colormap_size" is the size of a colormap for this visual.
|
||||
* "bits_per_rgb" is the number of significant bits per red, green and blue.
|
||||
* The red, green and blue masks, shifts and precisions refer
|
||||
* to value needed to calculate pixel values in TrueColor and DirectColor
|
||||
* visuals. The "mask" is the significant bits within the pixel. The
|
||||
* "shift" is the number of bits left we must shift a primary for it
|
||||
* to be in position (according to the "mask"). "prec" refers to how
|
||||
* much precision the pixel value contains for a particular primary.
|
||||
*/
|
||||
struct _GdkVisual
|
||||
{
|
||||
GdkVisualType type;
|
||||
gint depth;
|
||||
GdkByteOrder byte_order;
|
||||
gint colormap_size;
|
||||
gint bits_per_rgb;
|
||||
|
||||
guint32 red_mask;
|
||||
gint red_shift;
|
||||
gint red_prec;
|
||||
|
||||
guint32 green_mask;
|
||||
gint green_shift;
|
||||
gint green_prec;
|
||||
|
||||
guint32 blue_mask;
|
||||
gint blue_shift;
|
||||
gint blue_prec;
|
||||
};
|
||||
|
||||
gint gdk_visual_get_best_depth (void);
|
||||
GdkVisualType gdk_visual_get_best_type (void);
|
||||
GdkVisual* gdk_visual_get_system (void);
|
||||
GdkVisual* gdk_visual_get_best (void);
|
||||
GdkVisual* gdk_visual_get_best_with_depth (gint depth);
|
||||
GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
|
||||
GdkVisual* gdk_visual_get_best_with_both (gint depth,
|
||||
GdkVisualType visual_type);
|
||||
|
||||
/* Actually, these are no-ops... */
|
||||
GdkVisual* gdk_visual_ref (GdkVisual *visual);
|
||||
void gdk_visual_unref (GdkVisual *visual);
|
||||
|
||||
void gdk_query_depths (gint **depths,
|
||||
gint *count);
|
||||
void gdk_query_visual_types (GdkVisualType **visual_types,
|
||||
gint *count);
|
||||
|
||||
GList* gdk_list_visuals (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_VISUAL_H__ */
|
||||
3818
gdk/gdkwindow.c
3818
gdk/gdkwindow.c
File diff suppressed because it is too large
Load Diff
407
gdk/gdkwindow.h
407
gdk/gdkwindow.h
@@ -1,407 +0,0 @@
|
||||
#ifndef __GDK_WINDOW_H__
|
||||
#define __GDK_WINDOW_H__
|
||||
|
||||
#include <gdk/gdkdrawable.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkwindow.h>
|
||||
#include <gdk/gdkevents.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _GdkGeometry GdkGeometry;
|
||||
typedef struct _GdkWindowAttr GdkWindowAttr;
|
||||
|
||||
/* Classes of windows.
|
||||
* InputOutput: Almost every window should be of this type. Such windows
|
||||
* receive events and are also displayed on screen.
|
||||
* InputOnly: Used only in special circumstances when events need to be
|
||||
* stolen from another window or windows. Input only windows
|
||||
* have no visible output, so they are handy for placing over
|
||||
* top of a group of windows in order to grab the events (or
|
||||
* filter the events) from those windows.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_INPUT_OUTPUT,
|
||||
GDK_INPUT_ONLY
|
||||
} GdkWindowClass;
|
||||
|
||||
/* Types of windows.
|
||||
* Root: There is only 1 root window and it is initialized
|
||||
* at startup. Creating a window of type GDK_WINDOW_ROOT
|
||||
* is an error.
|
||||
* Toplevel: Windows which interact with the window manager.
|
||||
* Child: Windows which are children of some other type of window.
|
||||
* (Any other type of window). Most windows are child windows.
|
||||
* Dialog: A special kind of toplevel window which interacts with
|
||||
* the window manager slightly differently than a regular
|
||||
* toplevel window. Dialog windows should be used for any
|
||||
* transient window.
|
||||
* Pixmap: Pixmaps are really just another kind of window which
|
||||
* doesn't actually appear on the screen. It can't have
|
||||
* children, either and is really just a convenience so
|
||||
* that the drawing functions can work on both windows
|
||||
* and pixmaps transparently. (ie. You shouldn't pass a
|
||||
* pixmap to any procedure which accepts a window with the
|
||||
* exception of the drawing functions).
|
||||
* Foreign: A window that actually belongs to another application
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_WINDOW_ROOT,
|
||||
GDK_WINDOW_TOPLEVEL,
|
||||
GDK_WINDOW_CHILD,
|
||||
GDK_WINDOW_DIALOG,
|
||||
GDK_WINDOW_TEMP,
|
||||
GDK_WINDOW_FOREIGN
|
||||
} GdkWindowType;
|
||||
|
||||
/* Window attribute mask values.
|
||||
* GDK_WA_TITLE: The "title" field is valid.
|
||||
* GDK_WA_X: The "x" field is valid.
|
||||
* GDK_WA_Y: The "y" field is valid.
|
||||
* GDK_WA_CURSOR: The "cursor" field is valid.
|
||||
* GDK_WA_COLORMAP: The "colormap" field is valid.
|
||||
* GDK_WA_VISUAL: The "visual" field is valid.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_WA_TITLE = 1 << 1,
|
||||
GDK_WA_X = 1 << 2,
|
||||
GDK_WA_Y = 1 << 3,
|
||||
GDK_WA_CURSOR = 1 << 4,
|
||||
GDK_WA_COLORMAP = 1 << 5,
|
||||
GDK_WA_VISUAL = 1 << 6,
|
||||
GDK_WA_WMCLASS = 1 << 7,
|
||||
GDK_WA_NOREDIR = 1 << 8
|
||||
} GdkWindowAttributesType;
|
||||
|
||||
/* Size restriction enumeration.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_HINT_POS = 1 << 0,
|
||||
GDK_HINT_MIN_SIZE = 1 << 1,
|
||||
GDK_HINT_MAX_SIZE = 1 << 2,
|
||||
GDK_HINT_BASE_SIZE = 1 << 3,
|
||||
GDK_HINT_ASPECT = 1 << 4,
|
||||
GDK_HINT_RESIZE_INC = 1 << 5
|
||||
} GdkWindowHints;
|
||||
|
||||
/* The next two enumeration values current match the
|
||||
* Motif constants. If this is changed, the implementation
|
||||
* of gdk_window_set_decorations/gdk_window_set_functions
|
||||
* will need to change as well.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_DECOR_ALL = 1 << 0,
|
||||
GDK_DECOR_BORDER = 1 << 1,
|
||||
GDK_DECOR_RESIZEH = 1 << 2,
|
||||
GDK_DECOR_TITLE = 1 << 3,
|
||||
GDK_DECOR_MENU = 1 << 4,
|
||||
GDK_DECOR_MINIMIZE = 1 << 5,
|
||||
GDK_DECOR_MAXIMIZE = 1 << 6
|
||||
} GdkWMDecoration;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_FUNC_ALL = 1 << 0,
|
||||
GDK_FUNC_RESIZE = 1 << 1,
|
||||
GDK_FUNC_MOVE = 1 << 2,
|
||||
GDK_FUNC_MINIMIZE = 1 << 3,
|
||||
GDK_FUNC_MAXIMIZE = 1 << 4,
|
||||
GDK_FUNC_CLOSE = 1 << 5
|
||||
} GdkWMFunction;
|
||||
|
||||
struct _GdkWindowAttr
|
||||
{
|
||||
gchar *title;
|
||||
gint event_mask;
|
||||
gint x, y;
|
||||
gint width;
|
||||
gint height;
|
||||
GdkWindowClass wclass;
|
||||
GdkVisual *visual;
|
||||
GdkColormap *colormap;
|
||||
GdkWindowType window_type;
|
||||
GdkCursor *cursor;
|
||||
gchar *wmclass_name;
|
||||
gchar *wmclass_class;
|
||||
gboolean override_redirect;
|
||||
};
|
||||
|
||||
struct _GdkGeometry {
|
||||
gint min_width;
|
||||
gint min_height;
|
||||
gint max_width;
|
||||
gint max_height;
|
||||
gint base_width;
|
||||
gint base_height;
|
||||
gint width_inc;
|
||||
gint height_inc;
|
||||
gdouble min_aspect;
|
||||
gdouble max_aspect;
|
||||
/* GdkGravity gravity; */
|
||||
};
|
||||
|
||||
typedef struct _GdkWindowObject GdkWindowObject;
|
||||
typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
|
||||
|
||||
#define GDK_TYPE_WINDOW (gdk_window_get_type ())
|
||||
#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
|
||||
#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowObjectClass))
|
||||
#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
|
||||
#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
|
||||
#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
|
||||
|
||||
struct _GdkWindowObject
|
||||
{
|
||||
GdkDrawable parent_instance;
|
||||
|
||||
gpointer user_data;
|
||||
|
||||
GdkDrawable *impl; /* window-system-specific delegate object */
|
||||
|
||||
GdkWindowObject *parent;
|
||||
|
||||
gint x;
|
||||
gint y;
|
||||
|
||||
gint extension_events;
|
||||
|
||||
GList *filters;
|
||||
GList *children;
|
||||
|
||||
GdkColor bg_color;
|
||||
GdkPixmap *bg_pixmap;
|
||||
|
||||
GSList *paint_stack;
|
||||
|
||||
GdkRegion *update_area;
|
||||
guint update_freeze_count;
|
||||
|
||||
guint8 window_type;
|
||||
guint8 depth;
|
||||
guint8 resize_count;
|
||||
guint mapped : 1;
|
||||
guint guffaw_gravity : 1;
|
||||
guint input_only : 1;
|
||||
|
||||
guint destroyed : 2;
|
||||
};
|
||||
|
||||
struct _GdkWindowObjectClass
|
||||
{
|
||||
GdkDrawableClass parent_class;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/* Windows
|
||||
*/
|
||||
GType gdk_window_get_type (void);
|
||||
GdkWindow* gdk_window_new (GdkWindow *parent,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
|
||||
void gdk_window_destroy (GdkWindow *window);
|
||||
|
||||
GdkWindowType gdk_window_get_window_type (GdkWindow *window);
|
||||
|
||||
GdkWindow* gdk_window_at_pointer (gint *win_x,
|
||||
gint *win_y);
|
||||
void gdk_window_show (GdkWindow *window);
|
||||
void gdk_window_hide (GdkWindow *window);
|
||||
void gdk_window_withdraw (GdkWindow *window);
|
||||
void gdk_window_move (GdkWindow *window,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_window_resize (GdkWindow *window,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_move_resize (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_reparent (GdkWindow *window,
|
||||
GdkWindow *new_parent,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_window_clear (GdkWindow *window);
|
||||
void gdk_window_clear_area (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_clear_area_e(GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_raise (GdkWindow *window);
|
||||
void gdk_window_lower (GdkWindow *window);
|
||||
|
||||
void gdk_window_set_user_data (GdkWindow *window,
|
||||
gpointer user_data);
|
||||
void gdk_window_set_override_redirect(GdkWindow *window,
|
||||
gboolean override_redirect);
|
||||
|
||||
void gdk_window_add_filter (GdkWindow *window,
|
||||
GdkFilterFunc function,
|
||||
gpointer data);
|
||||
void gdk_window_remove_filter (GdkWindow *window,
|
||||
GdkFilterFunc function,
|
||||
gpointer data);
|
||||
|
||||
/*
|
||||
* This allows for making shaped (partially transparent) windows
|
||||
* - cool feature, needed for Drag and Drag for example.
|
||||
* The shape_mask can be the mask
|
||||
* from gdk_pixmap_create_from_xpm. Stefan Wille
|
||||
*/
|
||||
void gdk_window_shape_combine_mask (GdkWindow *window,
|
||||
GdkBitmap *shape_mask,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
/*
|
||||
* This routine allows you to quickly take the shapes of all the child windows
|
||||
* of a window and use their shapes as the shape mask for this window - useful
|
||||
* for container windows that dont want to look like a big box
|
||||
*
|
||||
* - Raster
|
||||
*/
|
||||
void gdk_window_set_child_shapes (GdkWindow *window);
|
||||
|
||||
/*
|
||||
* This routine allows you to merge (ie ADD) child shapes to your
|
||||
* own window's shape keeping its current shape and ADDING the child
|
||||
* shapes to it.
|
||||
*
|
||||
* - Raster
|
||||
*/
|
||||
void gdk_window_merge_child_shapes (GdkWindow *window);
|
||||
|
||||
/*
|
||||
* Check if a window has been shown, and whether all its
|
||||
* parents up to a toplevel have been shown, respectively.
|
||||
* Note that a window that is_viewable below is not necessarily
|
||||
* viewable in the X sense.
|
||||
*/
|
||||
gboolean gdk_window_is_visible (GdkWindow *window);
|
||||
gboolean gdk_window_is_viewable (GdkWindow *window);
|
||||
|
||||
/* Set static bit gravity on the parent, and static
|
||||
* window gravity on all children.
|
||||
*/
|
||||
gboolean gdk_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static);
|
||||
|
||||
/* GdkWindow */
|
||||
|
||||
void gdk_window_set_hints (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint min_width,
|
||||
gint min_height,
|
||||
gint max_width,
|
||||
gint max_height,
|
||||
gint flags);
|
||||
void gdk_window_set_geometry_hints (GdkWindow *window,
|
||||
GdkGeometry *geometry,
|
||||
GdkWindowHints flags);
|
||||
void gdk_set_sm_client_id (const gchar *sm_client_id);
|
||||
|
||||
void gdk_window_begin_paint_rect (GdkWindow *window,
|
||||
GdkRectangle *rectangle);
|
||||
void gdk_window_begin_paint_region (GdkWindow *window,
|
||||
GdkRegion *region);
|
||||
void gdk_window_end_paint (GdkWindow *window);
|
||||
|
||||
void gdk_window_set_title (GdkWindow *window,
|
||||
const gchar *title);
|
||||
void gdk_window_set_role (GdkWindow *window,
|
||||
const gchar *role);
|
||||
void gdk_window_set_transient_for (GdkWindow *window,
|
||||
GdkWindow *leader);
|
||||
void gdk_window_set_background (GdkWindow *window,
|
||||
GdkColor *color);
|
||||
void gdk_window_set_back_pixmap (GdkWindow *window,
|
||||
GdkPixmap *pixmap,
|
||||
gboolean parent_relative);
|
||||
void gdk_window_set_cursor (GdkWindow *window,
|
||||
GdkCursor *cursor);
|
||||
void gdk_window_get_user_data (GdkWindow *window,
|
||||
gpointer *data);
|
||||
void gdk_window_get_geometry (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *depth);
|
||||
void gdk_window_get_position (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
gint gdk_window_get_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
gboolean gdk_window_get_deskrelative_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
void gdk_window_get_root_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
GdkWindow* gdk_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow * gdk_window_get_parent (GdkWindow *window);
|
||||
GdkWindow * gdk_window_get_toplevel (GdkWindow *window);
|
||||
|
||||
GList * gdk_window_get_children (GdkWindow *window);
|
||||
GdkEventMask gdk_window_get_events (GdkWindow *window);
|
||||
void gdk_window_set_events (GdkWindow *window,
|
||||
GdkEventMask event_mask);
|
||||
|
||||
void gdk_window_set_icon (GdkWindow *window,
|
||||
GdkWindow *icon_window,
|
||||
GdkPixmap *pixmap,
|
||||
GdkBitmap *mask);
|
||||
void gdk_window_set_icon_name (GdkWindow *window,
|
||||
const gchar *name);
|
||||
void gdk_window_set_group (GdkWindow *window,
|
||||
GdkWindow *leader);
|
||||
void gdk_window_set_decorations (GdkWindow *window,
|
||||
GdkWMDecoration decorations);
|
||||
void gdk_window_set_functions (GdkWindow *window,
|
||||
GdkWMFunction functions);
|
||||
GList * gdk_window_get_toplevels (void);
|
||||
|
||||
void gdk_window_register_dnd (GdkWindow *window);
|
||||
|
||||
/* Interface for dirty-region queueing */
|
||||
void gdk_window_invalidate_rect (GdkWindow *window,
|
||||
GdkRectangle *rect,
|
||||
gboolean invalidate_children);
|
||||
void gdk_window_invalidate_region (GdkWindow *window,
|
||||
GdkRegion *region,
|
||||
gboolean invalidate_children);
|
||||
GdkRegion *gdk_window_get_update_area (GdkWindow *window);
|
||||
|
||||
void gdk_window_freeze_updates (GdkWindow *window);
|
||||
void gdk_window_thaw_updates (GdkWindow *window);
|
||||
|
||||
void gdk_window_process_all_updates (void);
|
||||
void gdk_window_process_updates (GdkWindow *window,
|
||||
gboolean update_children);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_WINDOW_H__ */
|
||||
72
gdk/gdkx.h
Normal file
72
gdk/gdkx.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_X_H__
|
||||
#define __GDK_X_H__
|
||||
|
||||
#include <gdk/gdkprivate.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GDK_ROOT_WINDOW() gdk_root_window
|
||||
#define GDK_ROOT_PARENT() ((GdkWindow *)&gdk_root_parent)
|
||||
#define GDK_DISPLAY() gdk_display
|
||||
#define GDK_WINDOW_XDISPLAY(win) (((GdkWindowPrivate*) win)->xdisplay)
|
||||
#define GDK_WINDOW_XWINDOW(win) (((GdkWindowPrivate*) win)->xwindow)
|
||||
#define GDK_IMAGE_XDISPLAY(image) (((GdkImagePrivate*) image)->xdisplay)
|
||||
#define GDK_IMAGE_XIMAGE(image) (((GdkImagePrivate*) image)->ximage)
|
||||
#define GDK_GC_XDISPLAY(gc) (((GdkGCPrivate*) gc)->xdisplay)
|
||||
#define GDK_GC_XGC(gc) (((GdkGCPrivate*) gc)->xgc)
|
||||
#define GDK_COLORMAP_XDISPLAY(cmap) (((GdkColormapPrivate*) cmap)->xdisplay)
|
||||
#define GDK_COLORMAP_XCOLORMAP(cmap) (((GdkColormapPrivate*) cmap)->xcolormap)
|
||||
#define GDK_VISUAL_XVISUAL(vis) (((GdkVisualPrivate*) vis)->xvisual)
|
||||
#define GDK_FONT_XDISPLAY(font) (((GdkFontPrivate*) font)->xdisplay)
|
||||
#define GDK_FONT_XFONT(font) (((GdkFontPrivate*) font)->xfont)
|
||||
|
||||
|
||||
GdkVisual* gdkx_visual_get (VisualID xvisualid);
|
||||
/* XXX: Do not use this function until it is fixed. An X Colormap
|
||||
* is useless unless we also have the visual. */
|
||||
GdkColormap* gdkx_colormap_get (Colormap xcolormap);
|
||||
/* Utility function in gdk.c - not sure where it belongs, but it's
|
||||
needed in more than one place, so make it public */
|
||||
Window gdk_get_client_window (Display *dpy,
|
||||
Window win);
|
||||
|
||||
/* Functions to create pixmaps and windows from their X equivalents */
|
||||
GdkPixmap *gdk_pixmap_foreign_new (guint32 anid);
|
||||
GdkWindow *gdk_window_foreign_new (guint32 anid);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GDK_X_H__ */
|
||||
@@ -24,7 +24,7 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdkprivate.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static guint gdk_xid_hash (XID *xid);
|
||||
@@ -355,7 +355,7 @@ handle_claim_device(GxidClaimDevice *msg)
|
||||
{
|
||||
/* FIXME: this is a bit improper. We probably should do this only
|
||||
when a window is first claimed. But we might be fooled if
|
||||
an old client died without releasing it's windows. So until
|
||||
an old client died without releasing its windows. So until
|
||||
we look for client-window closings, do it here
|
||||
|
||||
(We do look for closings now...)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user