Compare commits
225 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
@@ -13,3 +13,5 @@ gtk-config
|
||||
config.cache
|
||||
ABOUT-NLS
|
||||
intl
|
||||
stamp-h.in
|
||||
gtk+.spec
|
||||
|
||||
+1941
-1
File diff suppressed because it is too large
Load Diff
+1941
-1
File diff suppressed because it is too large
Load Diff
+1941
-1
File diff suppressed because it is too large
Load Diff
+1941
-1
File diff suppressed because it is too large
Load Diff
+1941
-1
File diff suppressed because it is too large
Load Diff
+1941
-1
File diff suppressed because it is too large
Load Diff
@@ -7,12 +7,12 @@ you got this package.
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-1.2.0.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-1.2.0 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
% gzip -cd gtk+-1.2.6.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-1.2.6 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
% make install # install GTK
|
||||
% make install # install GTK
|
||||
|
||||
The Nitty-Gritty
|
||||
================
|
||||
@@ -43,6 +43,13 @@ which form of support to use:
|
||||
|
||||
For more information, follow the link from http://www.gtk.org
|
||||
|
||||
* --disable-nls do not use Native Language Support
|
||||
|
||||
If this flag is not specified, GTK+ will try to find
|
||||
and use the gettext() set of functions to provide translations
|
||||
of the strings in the standard dialogs into the
|
||||
user's native language.
|
||||
|
||||
* --enable-xim support XIM [default=yes]
|
||||
|
||||
Specifying --disable-xim will disable support for entering
|
||||
@@ -50,7 +57,7 @@ internationalized text using X Input Methods. This will give some
|
||||
slight savings in speed and memory use and might be necessary
|
||||
with older versions of X.
|
||||
|
||||
* --with-locale=LOCALE locale name you want to use
|
||||
* --with-locale=LOCALE locale name you want to use
|
||||
|
||||
The --with-locale options is used to determine if your operating
|
||||
system has support for the locale you will be using. If not, X's
|
||||
@@ -84,19 +91,43 @@ or,
|
||||
|
||||
setenv CFLAGS -O2 ; ./configure # csh and variants
|
||||
|
||||
Native-Language Support and gettext()
|
||||
=====================================
|
||||
|
||||
Using an uninstalled copy of GLIB
|
||||
=================================
|
||||
To provide native-language support (NLS) GTK+ uses the
|
||||
gettext() set of functions. These functions are found
|
||||
in the C library on many systems, such as the Solaris
|
||||
C library and the GNU C Library, version 2.
|
||||
|
||||
If your C library does not provide the necessary functionality,
|
||||
you may wish to install the GNU gettext package. You'll
|
||||
need version 0.10.35 or better. Version 0.10.35 is
|
||||
available from ftp://alpha.gnu.org/pub/gnu
|
||||
|
||||
Generally, GTK+ will properly detect what is installed
|
||||
on your system and enable or disable NLS as appropriate.
|
||||
However, in rare cases, it may be necessary to disable
|
||||
NLS manually to get GTK+ to compile. You can do this
|
||||
by specifying the --disable-nls flag when configuring
|
||||
GTK+.
|
||||
|
||||
Using an uninstalled copy of GLIB [ Unsupported ]
|
||||
=================================================
|
||||
|
||||
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.0
|
||||
./configure --with-glib=../glib-1.2.6
|
||||
|
||||
This, however, will not work if you built GLIB with different
|
||||
source and build directories.
|
||||
|
||||
It is recommended that you install GLIB before compiling
|
||||
GTK+. The --with-glib option is not regularly tested
|
||||
and may not function correctly. In addition,
|
||||
inter-library dependencies won't be generated when
|
||||
using --with-glib=.
|
||||
|
||||
Installation directories
|
||||
========================
|
||||
@@ -126,7 +157,7 @@ For complete details, see the file docs/gtk-config.txt
|
||||
Notes for using XIM support for Japanese input
|
||||
==============================================
|
||||
|
||||
* There is a bug in older versions of kinput2 that will cause GTK
|
||||
* There is a bug in older versions of kinput2 that will cause GTK+
|
||||
to hang when destroying a text entry. The latest versions of
|
||||
kinput is available from:
|
||||
|
||||
@@ -138,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.)
|
||||
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
Prerequisites
|
||||
=============
|
||||
|
||||
GTK+ requires the GLIB library, available at the same location as
|
||||
you got this package.
|
||||
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
% make install # install GTK
|
||||
|
||||
The Nitty-Gritty
|
||||
================
|
||||
|
||||
The 'configure' script can be given a number of options to enable
|
||||
and disable various features. For a complete list, type:
|
||||
|
||||
./configure --help
|
||||
|
||||
A few of the more important ones:
|
||||
|
||||
* --prefix=PREFIX install architecture-independent files in PREFIX
|
||||
[ Defaults to /usr/local ]
|
||||
|
||||
* --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
|
||||
[ Defaults to the value given to --prefix ]
|
||||
|
||||
* --with-xinput=[no/gxi/xfree] support XInput [default=no]
|
||||
|
||||
The --with-xinput flag specifies whether to compile with support
|
||||
for the XInput extension (mainly used for graphics tablets), and
|
||||
which form of support to use:
|
||||
|
||||
no : no support
|
||||
gxi : Use generic XInput support
|
||||
xfree : Use special features in the Wacom drivers in XFree86 3.3.1
|
||||
and later.
|
||||
|
||||
For more information, follow the link from http://www.gtk.org
|
||||
|
||||
* --disable-nls do not use Native Language Support
|
||||
|
||||
If this flag is not specified, GTK+ will try to find
|
||||
and use the gettext() set of functions to provide translations
|
||||
of the strings in the standard dialogs into the
|
||||
user's native language.
|
||||
|
||||
* --enable-xim support XIM [default=yes]
|
||||
|
||||
Specifying --disable-xim will disable support for entering
|
||||
internationalized text using X Input Methods. This will give some
|
||||
slight savings in speed and memory use and might be necessary
|
||||
with older versions of X.
|
||||
|
||||
* --with-locale=LOCALE locale name you want to use
|
||||
|
||||
The --with-locale options is used to determine if your operating
|
||||
system has support for the locale you will be using. If not, X's
|
||||
built in locale support will be used.
|
||||
|
||||
Because of bugs in autoconf, it is necessary to specify this
|
||||
option even if your LANG environment variable is correctly set.
|
||||
|
||||
This option does not determine which locale GTK will use at
|
||||
runtime. That will be determined from the usual environment
|
||||
variables. If you will be using multiple locales with GTK,
|
||||
specify the one for which your operating system has the worst
|
||||
support for the --with-locale option.
|
||||
|
||||
|
||||
Options can be given to the compiler and linker by setting
|
||||
environment variables before running configure. A few of the more
|
||||
important ones:
|
||||
|
||||
CC : The C compiler to use
|
||||
CPPFLAGS : Flags for the C preprocesser such as -I and -D
|
||||
CFLAGS : C compiler flags
|
||||
|
||||
The most important use of this is to set the
|
||||
optimization/debugging flags. For instance, to compile with no
|
||||
debugging information at all, run configure as:
|
||||
|
||||
CFLAGS=-O2 ./configure # Bourne compatible shells (sh/bash/zsh)
|
||||
|
||||
or,
|
||||
|
||||
setenv CFLAGS -O2 ; ./configure # csh and variants
|
||||
|
||||
Native-Language Support and gettext()
|
||||
=====================================
|
||||
|
||||
To provide native-language support (NLS) GTK+ uses the
|
||||
gettext() set of functions. These functions are found
|
||||
in the C library on many systems, such as the Solaris
|
||||
C library and the GNU C Library, version 2.
|
||||
|
||||
If your C library does not provide the necessary functionality,
|
||||
you may wish to install the GNU gettext package. You'll
|
||||
need version 0.10.35 or better. Version 0.10.35 is
|
||||
available from ftp://alpha.gnu.org/pub/gnu
|
||||
|
||||
Generally, GTK+ will properly detect what is installed
|
||||
on your system and enable or disable NLS as appropriate.
|
||||
However, in rare cases, it may be necessary to disable
|
||||
NLS manually to get GTK+ to compile. You can do this
|
||||
by specifying the --disable-nls flag when configuring
|
||||
GTK+.
|
||||
|
||||
Using an uninstalled copy of GLIB [ Unsupported ]
|
||||
=================================================
|
||||
|
||||
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-@GTK_VERSION@
|
||||
|
||||
This, however, will not work if you built GLIB with different
|
||||
source and build directories.
|
||||
|
||||
It is recommended that you install GLIB before compiling
|
||||
GTK+. The --with-glib option is not regularly tested
|
||||
and may not function correctly. In addition,
|
||||
inter-library dependencies won't be generated when
|
||||
using --with-glib=.
|
||||
|
||||
Installation directories
|
||||
========================
|
||||
|
||||
The location of the installed files is determined by the --prefix
|
||||
and --exec-prefix options given to configure. There are also more
|
||||
detailed flags to control individual directories. However, the
|
||||
use of these flags is not tested.
|
||||
|
||||
One particular detail to note, is that the architecture-dependent
|
||||
include file glibconfig.h is installed in:
|
||||
|
||||
$exec_pref/lib/glib/include/
|
||||
|
||||
if you have a version in $prefix/include, this is out of date
|
||||
and should be deleted.
|
||||
|
||||
A shell script gtk-config is created during the configure
|
||||
process, and installed in the bin/ directory
|
||||
($exec_prefix/bin). This is used to determine the location of GTK
|
||||
when building applications. If you move GTK after installation,
|
||||
it will be necessary to edit this file.
|
||||
|
||||
For complete details, see the file docs/gtk-config.txt
|
||||
|
||||
|
||||
Notes for using XIM support for Japanese input
|
||||
==============================================
|
||||
|
||||
* There is a bug in older versions of kinput2 that will cause GTK+
|
||||
to hang when destroying a text entry. The latest versions of
|
||||
kinput is available from:
|
||||
|
||||
ftp://ftp.sra.co.jp/pub/x11/kinput2
|
||||
|
||||
* The locale information file for the ja_JP EUC locale
|
||||
distributed with some recent versions of X11 specifies to use the
|
||||
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 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.)
|
||||
|
||||
To fix this, change the line:
|
||||
|
||||
use_stdc_env True
|
||||
|
||||
to
|
||||
|
||||
use_stdc_env False
|
||||
|
||||
in the file /usr/X11R6/lib/X11/locale/ja_JP/XLC_LOCALE.
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Email: gtk-bugs@gimp.org
|
||||
+12
-3
@@ -1,10 +1,13 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
## Makefile.am for GTK+
|
||||
|
||||
SRC_SUBDIRS = gdk gtk
|
||||
SUBDIRS = po $(SRC_SUBDIRS) docs
|
||||
|
||||
bin_SCRIPTS = gtk-config
|
||||
|
||||
# require automake 1.4
|
||||
AUTOMAKE_OPTIONS = 1.4
|
||||
|
||||
EXTRA_DIST = \
|
||||
HACKING \
|
||||
gtk+.spec.in \
|
||||
@@ -97,8 +100,14 @@ EXTRA_DIST = \
|
||||
examples/spinbutton/Makefile \
|
||||
examples/find-examples.sh
|
||||
|
||||
dist-hook:
|
||||
cp gtk+.spec $(distdir)
|
||||
dist-hook: gtk+.spec
|
||||
if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \
|
||||
CONFIG_FILES="INSTALL:$(srcdir)/INSTALL.in README:$(srcdir)/README.in" \
|
||||
CONFIG_HEADERS= \
|
||||
$(SHELL) config.status \
|
||||
&& cp INSTALL README $(distdir) ; \
|
||||
fi \
|
||||
&& cp gtk+.spec $(distdir)
|
||||
|
||||
m4datadir = $(datadir)/aclocal
|
||||
m4data_DATA = gtk.m4
|
||||
|
||||
@@ -1,3 +1,99 @@
|
||||
Overview of Changes in GTK+ 1.2.6:
|
||||
|
||||
* container queue_resize fixes
|
||||
* gtk[vh]scale: minor fixups
|
||||
* rename idle to idle_id in testgtk to avoid conflicts with
|
||||
broken libs
|
||||
* More consistant naming of gtkrc files
|
||||
* Added language support: ro, uk
|
||||
|
||||
Overview of Changes in GTK+ 1.2.5:
|
||||
|
||||
* more GtkCTree and GtkWindow bug fixes.
|
||||
* more redraw/resize queue fixes, better expose event
|
||||
discarding code.
|
||||
* more miscellaneous bugs fixed
|
||||
* new configure.in option --disable-rebuilds to completely disable
|
||||
rebuilds of autogenerated sources.
|
||||
* check for 5.002 now, to avoid failing autogeneration build rules due
|
||||
to old perl versions.
|
||||
* fonts (and fontsets) are cached now.
|
||||
* more autogeneration make rules and dependancy fixups, we should be
|
||||
save with autogeneration up to make -j12 now ;)
|
||||
* new window position GTK_WIN_POS_CENTER_ALWAYS, which will recenter the
|
||||
GtkWindow on every size change.
|
||||
* major rework of window manager hints handling code, fixed a bunch of
|
||||
races with the new resizing code.
|
||||
* the new wm hints and resizing code is absolutely perfect and bug free now,
|
||||
it only lacks testing ;)
|
||||
* fixed up various rc style memory prolems.
|
||||
* gtk_widget_modify_style() now properly changes the style of realized widgets
|
||||
and references the style passed into it. if people worked around this bug,
|
||||
this will introduce a slight memory leak in their code.
|
||||
The code should typically look like:
|
||||
GtkRcStyle *rc_style = gtk_rc_style_new ();
|
||||
[...]
|
||||
gtk_widget_modify_style (widget, rc_style);
|
||||
gtk_rc_style_unref (rc_style);
|
||||
* fix problems with positioning menus offscreen.
|
||||
* GtkText fixes for some crashes and drawing errors.
|
||||
* Better handling for unexpected window destroys in GDK and GTK+.
|
||||
This should make it possible to use a GtkPlug and catch the
|
||||
case where its parent socket is randomly killed.
|
||||
* FAQ updates.
|
||||
* FileSelection i18n patches, RadioButton fixups.
|
||||
* many translation improvements.
|
||||
* miscellaneous other bugs fixed.
|
||||
|
||||
Overview of Changes in GTK+ 1.2.4:
|
||||
|
||||
* DnD improvements (drags can be canceled with Esc now).
|
||||
* suppressed configure event reordering in Gdk.
|
||||
* rewrite of Gtk's configure event handling.
|
||||
* major improvements for the object argument system (Elena Devdariani).
|
||||
* major bugfixes for threading, GtkNotebook, GtkItemFactory, GtkCList and
|
||||
GtkCTree.
|
||||
* tutorial/FAQ updates, new file generation.txt on autogenerated sources.
|
||||
* configure's --with-glib= is "officially" unsupported.
|
||||
* upgrade to libtool 1.3.3.
|
||||
* various buglets fixed.
|
||||
|
||||
Overview of Changes in GTK+ 1.2.3:
|
||||
|
||||
* Upgrade to libtool 1.3
|
||||
* Check for dgettext (for systems with old versions of GNU Gettext)
|
||||
* Many bug fixes (see ChangeLog for details)
|
||||
|
||||
Overview of Changes in GTK+ 1.2.2:
|
||||
|
||||
* Improved Dnd behaviour with Motif applications.
|
||||
* Bug fixes for the Gtk selection code.
|
||||
* Minor bug fixes to the Gdk Atom cache and Dnd code (with --display option).
|
||||
* Bug fixes and leak plugs for the Gdk IM code.
|
||||
* Added gtk_object_get() facility to retrive object arguments easily.
|
||||
The var args list expects ("arg-name", &value) pairs.
|
||||
* Fixed mapping for GdkInputCondition<->GIOCondition, this should fix
|
||||
problems where closed pipes were no longer signalling GDK_INPUT_READ on
|
||||
systems with a native poll().
|
||||
* Some cleanups to GtkLabel's memory allocation code (shouldn't leak memory
|
||||
anymore).
|
||||
* We don't attempt to lookup xpm color "None" anymore, this should prevent
|
||||
eXodus (commercial X windows server) from popping up a color dialog every
|
||||
time a transparent pixmap is created.
|
||||
* Fixed bug where Gtk timout/idle handlers would execute without the global
|
||||
Gdk lock being held.
|
||||
* Other minor bug fixes.
|
||||
|
||||
Overview of Changes in GTK+ 1.2.1:
|
||||
|
||||
* Many Bug fixes have been applied to the menu and accelerator code.
|
||||
* GtkItemFactory can "adopt" foreign menu items now and manage their
|
||||
accelerator installation. This is often required to get GtkItemFactory
|
||||
like accelerator propagation between different windows with the same
|
||||
menu heirarchy and for centralized parsing and saving of accelerators.
|
||||
* GtkCList/GtkCTree buttons should always display correctly now.
|
||||
* Miscellaneous other bug fixes.
|
||||
|
||||
What's New in GTK+ 1.2.0 (since 1.0.x):
|
||||
|
||||
* New widgets: GtkFontSelector, GtkPacker, GtkItemFactory, GtkCTree,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 1.2.0. GTK+, which stands for the Gimp ToolKit,
|
||||
This is GTK+ version 1.2.6. 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.0
|
||||
Version: 1.2.6
|
||||
|
||||
[ Please substitute 1.2.0 with the version of GTK+ that
|
||||
[ Please substitute 1.2.6 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.0
|
||||
Version: 1.2.6
|
||||
|
||||
When I run gtk/testgtk, the button "handle box"
|
||||
is misnamed. There are multiple handle boxes in
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version @GTK_VERSION@. 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.
|
||||
|
||||
The official ftp site is:
|
||||
ftp://ftp.gtk.org/pub/gtk
|
||||
|
||||
The official web site is:
|
||||
http://www.gtk.org/
|
||||
|
||||
A mailing list is located at:
|
||||
gtk-list@redhat.com
|
||||
|
||||
To subscribe: mail -s subscribe gtk-list-request@redhat.com < /dev/null
|
||||
(Send mail to gtk-list-request@redhat.com with the subject "subscribe")
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
See the file 'INSTALL'
|
||||
|
||||
How to report bugs
|
||||
==================
|
||||
|
||||
Bugs should be reported to the GNOME bug tracking
|
||||
system. (http://bugs.gnome.org). To report a problem
|
||||
about GTK+, send mail to submit@bugs.gnome.org.
|
||||
|
||||
The subject of the mail should describe your problem.
|
||||
In the body of the mail, you should first include
|
||||
a "pseudo-header" that gives the package and
|
||||
version number. This should be separated by a blank
|
||||
line from the actual headers.
|
||||
|
||||
Package: gtk+
|
||||
Version: @GTK_VERSION@
|
||||
|
||||
[ Please substitute @GTK_VERSION@ with the version of GTK+ that
|
||||
you have installed ]
|
||||
|
||||
Then describe the bug. Include:
|
||||
|
||||
* Information about your system. For instance:
|
||||
|
||||
- What operating system and version
|
||||
- What version of X
|
||||
- For Linux, what version of the C library
|
||||
|
||||
And anything else you think is relevant.
|
||||
|
||||
* How to reproduce the bug.
|
||||
|
||||
If you can reproduce it with the testgtk program that is built
|
||||
in the gtk/ subdirectory, that will be most convenient. Otherwise,
|
||||
please include a short test program that exhibits the behavior.
|
||||
As a last resort, you can also provide a pointer to a larger piece
|
||||
of software that can be downloaded.
|
||||
|
||||
(Bugs that can be reproduced within the GIMP are almost as good
|
||||
as bugs that can be reproduced in testgtk. If you are reporting a
|
||||
bug found with the GIMP, please include the version number of the GIMP
|
||||
you are using)
|
||||
|
||||
* If the bug was a crash, the exact text that was printed out
|
||||
when the crash occured.
|
||||
|
||||
* Further information such as stack traces may be useful, but
|
||||
is not necessary. If you do send a stack trace, and the error
|
||||
is an X error, it will be more useful if the stacktrace
|
||||
is produced running the test program with the --sync command
|
||||
line option.
|
||||
|
||||
An example of a bug report:
|
||||
|
||||
====
|
||||
To: submit@bugs.gnome.org
|
||||
From: yourname@your.address.org
|
||||
Subject: handlebox test in testgtk is misnamed.
|
||||
|
||||
Package: gtk+
|
||||
Version: @GTK_VERSION@
|
||||
|
||||
When I run gtk/testgtk, the button "handle box"
|
||||
is misnamed. There are multiple handle boxes in
|
||||
the demo, so it should be "handle boxes", to
|
||||
be like "buttons" or "check buttons".
|
||||
===
|
||||
|
||||
Patches
|
||||
=======
|
||||
|
||||
Patches can be uploaded to the incoming/ directory on
|
||||
ftp.gtk.org. Please follow the instructions there, and include
|
||||
your name and email address in the README file.
|
||||
|
||||
If the patch fixes a bug, it is usually a good idea to include
|
||||
all the information described in "How to Report Bugs".
|
||||
@@ -12,21 +12,14 @@ Outstanding items:
|
||||
* Make all widget attributes configurable after the widget is created (timj).
|
||||
|
||||
* Radio buttons need to display CAN/HAS_DEFAULT correctly, if draw_inidicator
|
||||
is TRUE.
|
||||
is TRUE. (Radio buttons do not need to CAN_DEFAULT! OWT)
|
||||
|
||||
* gdk_expose_compress: ala-Xt, this would really help for opaque moves and
|
||||
such
|
||||
|
||||
* More dialogs: Print, GtkFontSelector, maybe others...
|
||||
* More dialogs: Print, maybe others...
|
||||
|
||||
* make the gtk_main callbacks consistent in their add/remove behaviour.
|
||||
|
||||
* Check return values on all calls to XIC[Get/Set]Values
|
||||
|
||||
* Rewrite the interface to the i18n stuff so GTK widgets don't need to
|
||||
retrieve X values, and so they don't have to know the value of the
|
||||
XNxxx character constants.
|
||||
|
||||
* The "--geometry" option should be supported
|
||||
|
||||
- Having gdk_init() parse the geometry option. (putting it into
|
||||
@@ -70,6 +63,11 @@ Outstanding items:
|
||||
cause confusing presses to be sent to containers that actually
|
||||
want to get events on themselves.
|
||||
|
||||
* The menu code should skip separators during keyboard navigation,
|
||||
whether they are sensitive or insensitive.
|
||||
|
||||
* OwnerButtonPressGrab needs to go!
|
||||
|
||||
Text/Edit widget:
|
||||
|
||||
Bugs:
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
#undef HAVE_XCONVERTCASE
|
||||
|
||||
#undef WITH_SYMBOL_UNDERSCORE
|
||||
|
||||
#undef NO_FD_SET
|
||||
|
||||
#undef RESOURCE_BASE
|
||||
|
||||
+217
-333
@@ -1,6 +1,6 @@
|
||||
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
|
||||
## Copyright (C) 1996-1998 Free Software Foundation, Inc.
|
||||
## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
|
||||
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
@@ -21,31 +21,66 @@
|
||||
## configuration script generated by Autoconf, you may include it under
|
||||
## the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# serial 29 AM_PROG_LIBTOOL
|
||||
AC_DEFUN(AM_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AM_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AM_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AM_PROG_LD])dnl
|
||||
AC_REQUIRE([AM_PROG_NM])dnl
|
||||
AC_REQUIRE([AM_SYS_NM_PARSE])dnl
|
||||
AC_REQUIRE([AM_SYS_SYMBOL_UNDERSCORE])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
# serial 40 AC_PROG_LIBTOOL
|
||||
AC_DEFUN(AC_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
||||
|
||||
# Save cache, so that ltconfig can load it
|
||||
AC_CACHE_SAVE
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
||||
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
||||
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
# Reload cache, that may have been modified by ltconfig
|
||||
AC_CACHE_LOAD
|
||||
|
||||
# This can be used to rebuild libtool when needed
|
||||
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
||||
|
||||
# Always use our own libtool.
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||
AC_SUBST(LIBTOOL)dnl
|
||||
|
||||
# Redirect the config.log output again, so that the ltconfig log is not
|
||||
# clobbered by the next message.
|
||||
exec 5>>./config.log
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_LIBTOOL_SETUP,
|
||||
[AC_PREREQ(2.13)dnl
|
||||
AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_LD])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
|
||||
# Check for any special flags to pass to ltconfig.
|
||||
libtool_flags=
|
||||
libtool_flags="--cache-file=$cache_file"
|
||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
||||
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
|
||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
||||
[libtool_flags="$libtool_flags --enable-dlopen"])
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
||||
AC_ARG_ENABLE(libtool-lock,
|
||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
||||
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
@@ -81,46 +116,31 @@ case "$host" in
|
||||
fi
|
||||
;;
|
||||
|
||||
*-*-cygwin32*)
|
||||
AM_SYS_LIBTOOL_CYGWIN32
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[*-*-cygwin* | *-*-mingw*)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
|
||||
])
|
||||
esac
|
||||
|
||||
# enable the --disable-libtool-lock switch
|
||||
|
||||
AC_ARG_ENABLE(libtool-lock,
|
||||
[ --disable-libtool-lock force libtool not to do file locking],
|
||||
need_locks=$enableval,
|
||||
need_locks=yes)
|
||||
|
||||
if test x"$need_locks" = xno; then
|
||||
libtool_flags="$libtool_flags --disable-lock"
|
||||
fi
|
||||
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
|
||||
DLLTOOL="$DLLTOOL" AS="$AS" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
# Redirect the config.log output again, so that the ltconfig log is not
|
||||
# clobbered by the next message.
|
||||
exec 5>>./config.log
|
||||
])
|
||||
|
||||
# AM_ENABLE_SHARED - implement the --enable-shared flag
|
||||
# Usage: AM_ENABLE_SHARED[(DEFAULT)]
|
||||
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
||||
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
||||
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
||||
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AM_ENABLE_SHARED,
|
||||
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
||||
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(shared,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
@@ -138,26 +158,22 @@ no) enable_shared=no ;;
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
|
||||
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
|
||||
AC_DEFUN(AM_DISABLE_SHARED,
|
||||
[AM_ENABLE_SHARED(no)])
|
||||
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
||||
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_SHARED(no)])
|
||||
|
||||
# AM_DISABLE_STATIC - set the default static flag to --disable-static
|
||||
AC_DEFUN(AM_DISABLE_STATIC,
|
||||
[AM_ENABLE_STATIC(no)])
|
||||
|
||||
# AM_ENABLE_STATIC - implement the --enable-static flag
|
||||
# Usage: AM_ENABLE_STATIC[(DEFAULT)]
|
||||
# AC_ENABLE_STATIC - implement the --enable-static flag
|
||||
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AM_ENABLE_STATIC,
|
||||
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
||||
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(static,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
@@ -175,12 +191,49 @@ no) enable_static=no ;;
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
|
||||
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_STATIC - set the default static flag to --disable-static
|
||||
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_STATIC(no)])
|
||||
|
||||
# AM_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AM_PROG_LD,
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
||||
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
||||
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(fast-install,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
||||
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_FAST_INSTALL(no)])
|
||||
|
||||
# AC_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AC_PROG_LD,
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
@@ -195,47 +248,15 @@ if test "$ac_cv_prog_gcc" = yes; then
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
changequote(,)dnl
|
||||
/* | [A-Za-z]:/*)
|
||||
# Canonicalize the path of ld
|
||||
[\\/]* | [A-Za-z]:[\\/]*)
|
||||
re_direlt='/[^/][^/]*/\.\./'
|
||||
sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
|
||||
changequote([,])dnl
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
case "$host_os" in
|
||||
cygwin*)
|
||||
# Convert to a UNC path for cygwin
|
||||
test -z "$LD" && LD=`echo X$ac_prog | sed -e "1s/^X//" -e "$sub_uncdrive"`
|
||||
;;
|
||||
*)
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
##
|
||||
## FIXME: The code fails later on if we try to use an $LD with
|
||||
## '\\' path separators.
|
||||
##
|
||||
changequote(,)dnl
|
||||
[A-Za-z]:[\\]*)
|
||||
# Canonicalize the path of ld
|
||||
re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
|
||||
sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
|
||||
changequote([,])dnl
|
||||
sub_uncdir='s%\\%/%g'
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
case "$host_os" in
|
||||
cygwin*)
|
||||
# Convert to a UNC path for cygwin
|
||||
test -z "$LD" && LD=`echo X$ac_prog | sed -e 's%^X%%' -e "$sub_uncdrive" -e "$sub_uncdir"`
|
||||
;;
|
||||
*)
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
esac
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
@@ -253,10 +274,10 @@ else
|
||||
fi
|
||||
AC_CACHE_VAL(ac_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog"; then
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
@@ -264,7 +285,7 @@ AC_CACHE_VAL(ac_cv_path_LD,
|
||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
test "$with_gnu_ld" != no && break
|
||||
else
|
||||
test "$with_gnu_ld" != yes && break
|
||||
test "$with_gnu_ld" != yes && break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -280,10 +301,10 @@ else
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_SUBST(LD)
|
||||
AM_PROG_LD_GNU
|
||||
AC_PROG_LD_GNU
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_PROG_LD_GNU,
|
||||
AC_DEFUN(AC_PROG_LD_GNU,
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
||||
@@ -293,29 +314,31 @@ else
|
||||
fi])
|
||||
])
|
||||
|
||||
# AM_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AM_PROG_NM,
|
||||
# AC_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AC_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[if test -n "$NM"; then
|
||||
# Let the user override the test.
|
||||
ac_cv_path_NM="$NM"
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/nm; then
|
||||
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
||||
# nm: unknown option "B" ignored
|
||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
break
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
break
|
||||
else
|
||||
ac_cv_path_NM="$ac_dir/nm"
|
||||
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
||||
continue # so that we can try to find one that supports BSD flags
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
@@ -326,221 +349,82 @@ AC_MSG_RESULT([$NM])
|
||||
AC_SUBST(NM)
|
||||
])
|
||||
|
||||
# AM_SYS_NM_PARSE - Check for command ro grab the raw symbol name followed
|
||||
# by C symbol name from nm.
|
||||
AC_DEFUN(AM_SYS_NM_PARSE,
|
||||
# AC_CHECK_LIBM - check for math library
|
||||
AC_DEFUN(AC_CHECK_LIBM,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AM_PROG_NM])dnl
|
||||
# Check for command to grab the raw symbol name followed by C symbol from nm.
|
||||
AC_MSG_CHECKING([command to parse $NM output])
|
||||
AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
|
||||
[# These are sane defaults that work on at least a few old systems.
|
||||
# {They come from Ultrix. What could be older than Ultrix?!! ;)}
|
||||
|
||||
changequote(,)dnl
|
||||
# Character class describing NM global symbol codes.
|
||||
ac_symcode='[BCDEGRSTU]'
|
||||
|
||||
# Regexp to match symbols that can be accessed directly from C.
|
||||
ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
|
||||
|
||||
# Transform the above into a raw symbol and a C symbol.
|
||||
ac_symxfrm='\1 \1'
|
||||
|
||||
# Define system-specific variables.
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
ac_symcode='[BCDTU]'
|
||||
LIBM=
|
||||
case "$host" in
|
||||
*-*-beos* | *-*-cygwin*)
|
||||
# These system don't have libm
|
||||
;;
|
||||
sunos* | cygwin32* | mingw32*)
|
||||
ac_sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
|
||||
ac_symxfrm='_\1 \1'
|
||||
*-ncr-sysv4.3*)
|
||||
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
||||
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
||||
;;
|
||||
irix*)
|
||||
# Cannot use undefined symbols on IRIX because inlined functions mess us up.
|
||||
ac_symcode='[BCDEGRST]'
|
||||
;;
|
||||
solaris*)
|
||||
ac_symcode='[BDTU]'
|
||||
*)
|
||||
AC_CHECK_LIB(m, main, LIBM="-lm")
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# If we're using GNU nm, then use its standard symbol codes.
|
||||
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
ac_symcode='[ABCDGISTUW]'
|
||||
fi
|
||||
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl convenience library, adds --enable-ltdl-convenience to
|
||||
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
|
||||
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
|
||||
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
|
||||
# '${top_builddir}/' (note the single quotes!) if your package is not
|
||||
# flat, and, if you're not using automake, define top_builddir as
|
||||
# appropriate in the Makefiles.
|
||||
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
case "$enable_ltdl_convenience" in
|
||||
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
||||
"") enable_ltdl_convenience=yes
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
||||
esac
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
|
||||
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
|
||||
])
|
||||
|
||||
case "$host_os" in
|
||||
cygwin32* | mingw32*)
|
||||
# We do not want undefined symbols on cygwin32. The user must
|
||||
# arrange to define them via -l arguments.
|
||||
ac_symcode='[ABCDGISTW]'
|
||||
;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
|
||||
# Write the raw and C identifiers.
|
||||
ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* $ac_symcode $ac_sympat$/$ac_symxfrm/p'"
|
||||
|
||||
# Check to see that the pipe works correctly.
|
||||
ac_pipe_works=no
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
char nm_test_var;
|
||||
void nm_test_func(){}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
int main(){nm_test_var='a';nm_test_func;return 0;}
|
||||
EOF
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
# Now try to grab the symbols.
|
||||
ac_nlist=conftest.nm
|
||||
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
|
||||
|
||||
# Try sorting and uniquifying the output.
|
||||
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
|
||||
mv -f "$ac_nlist"T "$ac_nlist"
|
||||
ac_wcout=`wc "$ac_nlist" 2>/dev/null`
|
||||
changequote(,)dnl
|
||||
ac_count=`echo "X$ac_wcout" | sed -e 's,^X,,' -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
|
||||
changequote([,])dnl
|
||||
(test "$ac_count" -ge 0) 2>/dev/null || ac_count=-1
|
||||
else
|
||||
rm -f "$ac_nlist"T
|
||||
ac_count=-1
|
||||
fi
|
||||
|
||||
# Make sure that we snagged all the symbols we need.
|
||||
if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
|
||||
if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
|
||||
cat <<EOF > conftest.c
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EOF
|
||||
# Now generate the symbol file.
|
||||
sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
|
||||
|
||||
cat <<EOF >> conftest.c
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define __ptr_t void *
|
||||
#else
|
||||
# define __ptr_t char *
|
||||
#endif
|
||||
|
||||
/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
|
||||
int dld_preloaded_symbol_count = $ac_count;
|
||||
|
||||
/* The mapping between symbol names and symbols. */
|
||||
struct {
|
||||
char *name;
|
||||
__ptr_t address;
|
||||
}
|
||||
changequote(,)dnl
|
||||
dld_preloaded_symbols[] =
|
||||
changequote([,])dnl
|
||||
{
|
||||
EOF
|
||||
sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
|
||||
cat <<\EOF >> conftest.c
|
||||
{0, (__ptr_t) 0}
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
EOF
|
||||
# Now try linking the two files.
|
||||
mv conftest.$ac_objext conftestm.$ac_objext
|
||||
ac_save_LIBS="$LIBS"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
LIBS="conftestm.$ac_objext"
|
||||
CFLAGS="$CFLAGS$no_builtin_flag"
|
||||
if AC_TRY_EVAL(ac_link) && test -s conftest; then
|
||||
ac_pipe_works=yes
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
LIBS="$ac_save_LIBS"
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
else
|
||||
echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl installable library, and adds --enable-ltdl-install to
|
||||
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
|
||||
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
|
||||
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
|
||||
# '${top_builddir}/' (note the single quotes!) if your package is not
|
||||
# flat, and, if you're not using automake, define top_builddir as
|
||||
# appropriate in the Makefiles.
|
||||
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
||||
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_CHECK_LIB(ltdl, main,
|
||||
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
||||
[if test x"$enable_ltdl_install" = xno; then
|
||||
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
||||
else
|
||||
enable_ltdl_install=yes
|
||||
fi
|
||||
])
|
||||
if test x"$enable_ltdl_install" = x"yes"; then
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
|
||||
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
|
||||
else
|
||||
echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
||||
LIBLTDL="-lltdl"
|
||||
INCLTDL=
|
||||
fi
|
||||
else
|
||||
echo "$progname: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
rm -rf conftest*
|
||||
|
||||
# Do not use the global_symbol_pipe unless it works.
|
||||
test "$ac_pipe_works" = yes || ac_cv_sys_global_symbol_pipe=
|
||||
])
|
||||
|
||||
ac_result=yes
|
||||
if test -z "$ac_cv_sys_global_symbol_pipe"; then
|
||||
ac_result=no
|
||||
fi
|
||||
AC_MSG_RESULT($ac_result)
|
||||
])
|
||||
dnl old names
|
||||
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
||||
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
||||
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
||||
|
||||
# AM_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
|
||||
AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32,
|
||||
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
])
|
||||
|
||||
# AM_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
|
||||
# with an underscore?
|
||||
AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE,
|
||||
[AC_REQUIRE([AM_PROG_NM])dnl
|
||||
AC_REQUIRE([AM_SYS_NM_PARSE])dnl
|
||||
AC_MSG_CHECKING([for _ prefix in compiled symbols])
|
||||
AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
|
||||
[ac_cv_sys_symbol_underscore=no
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
void nm_test_func(){}
|
||||
int main(){nm_test_func;return 0;}
|
||||
EOF
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
# Now try to grab the symbols.
|
||||
ac_nlist=conftest.nm
|
||||
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
|
||||
# See whether the symbols have a leading underscore.
|
||||
if egrep '^_nm_test_func' "$ac_nlist" >/dev/null; then
|
||||
ac_cv_sys_symbol_underscore=yes
|
||||
else
|
||||
if egrep '^nm_test_func ' "$ac_nlist" >/dev/null; then
|
||||
:
|
||||
else
|
||||
echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
rm -rf conftest*
|
||||
])
|
||||
AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
|
||||
if test x$ac_cv_sys_symbol_underscore = xyes; then
|
||||
AC_DEFINE(WITH_SYMBOL_UNDERSCORE,1,
|
||||
[define if compiled symbols have a leading underscore])
|
||||
fi
|
||||
])
|
||||
dnl This is just to silence aclocal about the macro not being used
|
||||
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
||||
|
||||
# Macro to add for using GNU gettext.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
@@ -589,22 +473,22 @@ AC_DEFUN(AM_GTK_WITH_NLS,
|
||||
CATOBJEXT=NONE
|
||||
|
||||
AC_CHECK_HEADER(libintl.h,
|
||||
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
|
||||
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
|
||||
[AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
|
||||
[AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
|
||||
gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" != "yes"; then
|
||||
if test "$gt_cv_func_dgettext_libc" != "yes"; then
|
||||
AC_CHECK_LIB(intl, bindtextdomain,
|
||||
[AC_CACHE_CHECK([for gettext in libintl],
|
||||
gt_cv_func_gettext_libintl,
|
||||
[AC_CHECK_LIB(intl, gettext,
|
||||
gt_cv_func_gettext_libintl=yes,
|
||||
gt_cv_func_gettext_libintl=no)],
|
||||
gt_cv_func_gettext_libintl=no)])
|
||||
[AC_CACHE_CHECK([for dgettext in libintl],
|
||||
gt_cv_func_dgettext_libintl,
|
||||
[AC_CHECK_LIB(intl, dgettext,
|
||||
gt_cv_func_dgettext_libintl=yes,
|
||||
gt_cv_func_dgettext_libintl=no)],
|
||||
gt_cv_func_dgettext_libintl=no)])
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" = "yes" \
|
||||
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
|
||||
if test "$gt_cv_func_dgettext_libc" = "yes" \
|
||||
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETTEXT)
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
|
||||
@@ -624,8 +508,8 @@ AC_DEFUN(AM_GTK_WITH_NLS,
|
||||
fi
|
||||
|
||||
# Added by Martin Baulig 12/15/98 for libc5 systems
|
||||
if test "$gt_cv_func_gettext_libc" != "yes" \
|
||||
&& test "$gt_cv_func_gettext_libintl" = "yes"; then
|
||||
if test "$gt_cv_func_dgettext_libc" != "yes" \
|
||||
&& test "$gt_cv_func_dgettext_libintl" = "yes"; then
|
||||
INTLLIBS=-lintl
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
fi
|
||||
|
||||
+1
-9
@@ -20,14 +20,6 @@ DIE=0
|
||||
DIE=1
|
||||
}
|
||||
|
||||
(libtool --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have libtool installed to compile $PROJECT."
|
||||
echo "Get ftp://alpha.gnu.org/gnu/libtool-1.2b.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have automake installed to compile $PROJECT."
|
||||
@@ -88,7 +80,7 @@ automake -a $am_opt
|
||||
autoconf
|
||||
cd $ORIGDIR
|
||||
|
||||
$srcdir/configure "$@"
|
||||
$srcdir/configure --enable-maintainer-mode "$@"
|
||||
|
||||
echo
|
||||
echo "Now type 'make' to compile $PROJECT."
|
||||
|
||||
Vendored
+211
-75
@@ -1,6 +1,7 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -23,6 +24,7 @@
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
||||
# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
@@ -35,6 +37,20 @@
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
# Use $HOST_CC if defined. $CC may point to a cross-compiler
|
||||
if test x"$CC_FOR_BUILD" = x; then
|
||||
if test x"$HOST_CC" != x; then
|
||||
CC_FOR_BUILD="$HOST_CC"
|
||||
else
|
||||
if test x"$CC" != x; then
|
||||
CC_FOR_BUILD="$CC"
|
||||
else
|
||||
CC_FOR_BUILD=cc
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 8/24/94.)
|
||||
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
|
||||
@@ -46,7 +62,8 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
|
||||
dummy=dummy-$$
|
||||
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
@@ -59,7 +76,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
cat <<EOF >dummy.s
|
||||
cat <<EOF >$dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
@@ -76,9 +93,9 @@ main:
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
${CC-cc} dummy.s -o dummy 2>/dev/null
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./dummy
|
||||
./$dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
@@ -97,8 +114,14 @@ EOF
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f dummy.s dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
|
||||
rm -f $dummy.s $dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit 0 ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# Should we change UNAME_MACHINE based on the output of uname instead
|
||||
# of the specific Alpha model?
|
||||
echo alpha-pc-interix
|
||||
exit 0 ;;
|
||||
21064:Windows_NT:50:3)
|
||||
echo alpha-dec-winnt3.5
|
||||
@@ -142,7 +165,7 @@ EOF
|
||||
SR2?01:HI-UX/MPP:*:*)
|
||||
echo hppa1.1-hitachi-hiuxmpp
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
|
||||
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
|
||||
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
|
||||
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
||||
echo pyramid-pyramid-sysv3
|
||||
@@ -150,7 +173,7 @@ EOF
|
||||
echo pyramid-pyramid-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
NILE:*:*:dcosx)
|
||||
NILE*:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
sun4H:SunOS:5.*:*)
|
||||
@@ -201,6 +224,32 @@ EOF
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
# The situation for MiNT is a little confusing. The machine name
|
||||
# can be virtually everything (everything which is not
|
||||
# "atarist" or "atariste" at least should have a processor
|
||||
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
|
||||
# to the lowercase version "mint" (or "freemint"). Finally
|
||||
# the system name "TOS" denotes a system which is actually not
|
||||
# MiNT. But MiNT is downward compatible to TOS, so this should
|
||||
# be no problem.
|
||||
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -234,12 +283,16 @@ EOF
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
2020:CLIX:*:*)
|
||||
2020:CLIX:*:* | 2430:CLIX:*:*)
|
||||
echo clipper-intergraph-clix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:*:UMIPS | mips:*:*:RISCos)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
int main (argc, argv) int argc; char **argv; {
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#if defined (host_mips) && defined (MIPSEB)
|
||||
#if defined (SYSTYPE_SYSV)
|
||||
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
|
||||
@@ -254,10 +307,10 @@ EOF
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy \
|
||||
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy \
|
||||
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Night_Hawk:Power_UNIX:*:*)
|
||||
@@ -309,7 +362,7 @@ EOF
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
main()
|
||||
@@ -320,8 +373,8 @@ EOF
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
@@ -368,25 +421,25 @@ EOF
|
||||
case "${UNAME_MACHINE}" in
|
||||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 )
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
9000/[678][0-9][0-9])
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
#endif
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
|
||||
switch (cpu)
|
||||
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
|
||||
case CPU_PA_RISC2_0:
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
@@ -394,20 +447,20 @@ EOF
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
#endif
|
||||
default: puts ("hppa1.0"); break;
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
|
||||
rm -f dummy.c dummy
|
||||
($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
|
||||
rm -f $dummy.c $dummy
|
||||
esac
|
||||
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
3050*:HI-UX:*:*)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
@@ -432,8 +485,8 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
@@ -442,6 +495,9 @@ EOF
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
*9??*:MPE/iX:*:*)
|
||||
echo hppa1.0-hp-mpeix
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
echo hppa1.1-hp-osf
|
||||
exit 0 ;;
|
||||
@@ -458,6 +514,9 @@ EOF
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
hppa*:OpenBSD:*:*)
|
||||
echo hppa-unknown-openbsd
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
@@ -490,11 +549,14 @@ EOF
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY*T3E:*:*:*)
|
||||
echo t3e-cray-unicosmk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
F300:UNIX_System_V:*:*)
|
||||
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
@@ -507,13 +569,22 @@ EOF
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sparc*:BSD/OS:*:*)
|
||||
echo sparc-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
*:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
if test -x /usr/bin/objformat; then
|
||||
if test "elf" = "`/usr/bin/objformat`"; then
|
||||
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:NetBSD:*:*)
|
||||
@@ -523,13 +594,22 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin32
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit 0 ;;
|
||||
i*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit 0 ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
# UNAME_MACHINE based on the output of uname instead of i386?
|
||||
echo i386-pc-interix
|
||||
exit 0 ;;
|
||||
i*:UWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin32
|
||||
echo powerpcle-unknown-cygwin
|
||||
exit 0 ;;
|
||||
prep*:SunOS:5.*:*)
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
@@ -541,12 +621,14 @@ EOF
|
||||
# uname on the ARM produces all sorts of strangeness, and we need to
|
||||
# filter it out.
|
||||
case "$UNAME_MACHINE" in
|
||||
armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
|
||||
arm* | sa110*) UNAME_MACHINE="arm" ;;
|
||||
esac
|
||||
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us.
|
||||
ld_help_string=`ld --help 2>&1`
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
ld_help_string=`cd /; ld --help 2>&1`
|
||||
ld_supported_emulations=`echo $ld_help_string \
|
||||
| sed -ne '/supported emulations:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
@@ -559,11 +641,40 @@ EOF
|
||||
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
|
||||
elf32ppc)
|
||||
# Determine Lib Version
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
#if defined(__GLIBC__)
|
||||
extern char __libc_version[];
|
||||
extern char __libc_release[];
|
||||
#endif
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#if defined(__GLIBC__)
|
||||
printf("%s %s\n", __libc_version, __libc_release);
|
||||
#else
|
||||
printf("unkown\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
LIBC=""
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy | grep 1\.99 > /dev/null
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
rm -f $dummy.c $dummy
|
||||
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
|
||||
esac
|
||||
|
||||
if test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
sed 's/^ //' <<EOF >dummy.s
|
||||
sed 's/^ //' <<EOF >$dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
@@ -581,9 +692,9 @@ EOF
|
||||
.end main
|
||||
EOF
|
||||
LIBC=""
|
||||
${CC-cc} dummy.s -o dummy 2>/dev/null
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./dummy
|
||||
./$dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
@@ -600,22 +711,23 @@ EOF
|
||||
16)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
objdump --private-headers dummy | \
|
||||
objdump --private-headers $dummy | \
|
||||
grep ld.so.1 > /dev/null
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
rm -f dummy.s dummy
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "mips" ; then
|
||||
cat >dummy.c <<EOF
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#ifdef __MIPSEB__
|
||||
printf ("%s-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
@@ -625,8 +737,8 @@ main(argc, argv)
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld)
|
||||
# or one that does not give us useful --help.
|
||||
@@ -645,12 +757,13 @@ EOF
|
||||
;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >dummy.c <<EOF
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
@@ -667,8 +780,8 @@ main(argc, argv)
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
fi ;;
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
||||
# are messed up and put the nodename in both sysname and nodename.
|
||||
@@ -690,6 +803,14 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:5:7*)
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
|
||||
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
@@ -699,18 +820,15 @@ EOF
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:UnixWare:*:*)
|
||||
if /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i386.
|
||||
@@ -752,7 +870,7 @@ EOF
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i?86:LynxOS:2.*:*)
|
||||
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
@@ -764,6 +882,9 @@ EOF
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
echo mips-dde-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:ReliantUNIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
RM*:SINIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
@@ -794,7 +915,7 @@ EOF
|
||||
news*:NEWS-OS:*:6*)
|
||||
echo mips-sony-newsos6
|
||||
exit 0 ;;
|
||||
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
|
||||
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
@@ -810,12 +931,24 @@ EOF
|
||||
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
|
||||
echo i586-pc-beos
|
||||
exit 0 ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SX-5:SUPER-UX:*:*)
|
||||
echo sx5-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:Rhapsody:*:*)
|
||||
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
cat >dummy.c <<EOF
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
@@ -853,7 +986,10 @@ main ()
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
if (version < 4)
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
else
|
||||
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
@@ -913,8 +1049,8 @@ main ()
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
|
||||
Vendored
+284
-24
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
@@ -98,11 +98,21 @@ case $os in
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-scout)
|
||||
;;
|
||||
-wrs)
|
||||
os=vxworks
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco5)
|
||||
os=sco3.2v5
|
||||
os=-sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
@@ -121,6 +131,9 @@ case $os in
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-udk*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
@@ -151,14 +164,21 @@ case $basic_machine in
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
|
||||
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
|
||||
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
|
||||
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
|
||||
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| sparc | sparclet | sparclite | sparc64 | v850)
|
||||
| 580 | i960 | h8300 \
|
||||
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
|
||||
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
|
||||
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
|
||||
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr5000 | miprs64vr5000el \
|
||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
|
||||
| thumb | d10v)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
@@ -174,24 +194,41 @@ case $basic_machine in
|
||||
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
|
||||
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
|
||||
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
|
||||
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||
| xmp-* | ymp-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
|
||||
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||
| clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| f301-*)
|
||||
| f301-* | armv*-* | t3e-* \
|
||||
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
386bsd)
|
||||
basic_machine=i386-unknown
|
||||
os=-bsd
|
||||
;;
|
||||
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
||||
basic_machine=m68000-att
|
||||
;;
|
||||
3b*)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
a29khif)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
adobe68k)
|
||||
basic_machine=m68010-adobe
|
||||
os=-scout
|
||||
;;
|
||||
alliant | fx80)
|
||||
basic_machine=fx80-alliant
|
||||
;;
|
||||
@@ -221,6 +258,10 @@ case $basic_machine in
|
||||
basic_machine=m68k-apollo
|
||||
os=-sysv
|
||||
;;
|
||||
apollo68bsd)
|
||||
basic_machine=m68k-apollo
|
||||
os=-bsd
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
@@ -297,6 +338,10 @@ case $basic_machine in
|
||||
encore | umax | mmax)
|
||||
basic_machine=ns32k-encore
|
||||
;;
|
||||
es1800 | OSE68k | ose68k | ose | OSE)
|
||||
basic_machine=m68k-ericsson
|
||||
os=-ose
|
||||
;;
|
||||
fx2800)
|
||||
basic_machine=i860-alliant
|
||||
;;
|
||||
@@ -315,6 +360,14 @@ case $basic_machine in
|
||||
basic_machine=h8300-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
h8300xray)
|
||||
basic_machine=h8300-hitachi
|
||||
os=-xray
|
||||
;;
|
||||
h8500hms)
|
||||
basic_machine=h8500-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
harris)
|
||||
basic_machine=m88k-harris
|
||||
os=-sysv3
|
||||
@@ -330,13 +383,30 @@ case $basic_machine in
|
||||
basic_machine=m68k-hp
|
||||
os=-hpux
|
||||
;;
|
||||
hp3k9[0-9][0-9] | hp9[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hp9k2[0-9][0-9] | hp9k31[0-9])
|
||||
basic_machine=m68000-hp
|
||||
;;
|
||||
hp9k3[2-9][0-9])
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
|
||||
hp9k6[0-9][0-9] | hp6[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hp9k7[0-79][0-9] | hp7[0-79][0-9])
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k78[0-9] | hp78[0-9])
|
||||
# FIXME: really hppa2.0-hp
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
|
||||
# FIXME: really hppa2.0-hp
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][13679] | hp8[0-9][13679])
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
@@ -345,6 +415,14 @@ case $basic_machine in
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
hppaosf)
|
||||
basic_machine=hppa1.1-hp
|
||||
os=-osf
|
||||
;;
|
||||
hppro)
|
||||
basic_machine=hppa1.1-hp
|
||||
os=-proelf
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
@@ -366,6 +444,22 @@ case $basic_machine in
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
i386mach)
|
||||
basic_machine=i386-mach
|
||||
os=-mach
|
||||
;;
|
||||
i386-vsta | vsta)
|
||||
basic_machine=i386-unknown
|
||||
os=-vsta
|
||||
;;
|
||||
i386-go32 | go32)
|
||||
basic_machine=i386-unknown
|
||||
os=-go32
|
||||
;;
|
||||
i386-mingw32 | mingw32)
|
||||
basic_machine=i386-unknown
|
||||
os=-mingw32
|
||||
;;
|
||||
iris | iris4d)
|
||||
basic_machine=mips-sgi
|
||||
case $os in
|
||||
@@ -394,6 +488,10 @@ case $basic_machine in
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
*mint | *MiNT)
|
||||
basic_machine=m68k-atari
|
||||
os=-mint
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux-gnu
|
||||
@@ -408,10 +506,26 @@ case $basic_machine in
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
monitor)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-unknown
|
||||
os=-msdos
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
;;
|
||||
netbsd386)
|
||||
basic_machine=i386-unknown
|
||||
os=-netbsd
|
||||
;;
|
||||
netwinder)
|
||||
basic_machine=armv4l-corel
|
||||
os=-linux
|
||||
;;
|
||||
news | news700 | news800 | news900)
|
||||
basic_machine=m68k-sony
|
||||
os=-newsos
|
||||
@@ -424,6 +538,10 @@ case $basic_machine in
|
||||
basic_machine=mips-sony
|
||||
os=-newsos
|
||||
;;
|
||||
necv70)
|
||||
basic_machine=v70-nec
|
||||
os=-sysv
|
||||
;;
|
||||
next | m*-next )
|
||||
basic_machine=m68k-next
|
||||
case $os in
|
||||
@@ -449,9 +567,25 @@ case $basic_machine in
|
||||
basic_machine=i960-intel
|
||||
os=-nindy
|
||||
;;
|
||||
mon960)
|
||||
basic_machine=i960-intel
|
||||
os=-mon960
|
||||
;;
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
op50n-* | op60c-*)
|
||||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
os=-ose
|
||||
;;
|
||||
os68k)
|
||||
basic_machine=m68k-none
|
||||
os=-os68k
|
||||
;;
|
||||
pa-hitachi)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
@@ -469,19 +603,19 @@ case $basic_machine in
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | nexen)
|
||||
pentium | p5 | k5 | k6 | nexen)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | k6 | 6x86)
|
||||
pentiumpro | p6 | 6x86)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | nexen-*)
|
||||
pentium-* | p5-* | k5-* | k6-* | nexen-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | k6-* | 6x86-*)
|
||||
pentiumpro-* | p6-* | 6x86-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
@@ -505,12 +639,20 @@ case $basic_machine in
|
||||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
rom68k)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
rm[46]00)
|
||||
basic_machine=mips-siemens
|
||||
;;
|
||||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
sa29200)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
@@ -518,6 +660,10 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sparclite-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
sps7)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv2
|
||||
@@ -525,6 +671,13 @@ case $basic_machine in
|
||||
spur)
|
||||
basic_machine=spur-unknown
|
||||
;;
|
||||
st2000)
|
||||
basic_machine=m68k-tandem
|
||||
;;
|
||||
stratus)
|
||||
basic_machine=i860-stratus
|
||||
os=-sysv4
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
@@ -569,6 +722,10 @@ case $basic_machine in
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
t3e)
|
||||
basic_machine=t3e-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
@@ -586,6 +743,10 @@ case $basic_machine in
|
||||
basic_machine=a29k-nyu
|
||||
os=-sym1
|
||||
;;
|
||||
v810 | necv810)
|
||||
basic_machine=v810-nec
|
||||
os=-none
|
||||
;;
|
||||
vaxv)
|
||||
basic_machine=vax-dec
|
||||
os=-sysv
|
||||
@@ -609,6 +770,14 @@ case $basic_machine in
|
||||
basic_machine=a29k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
w65*)
|
||||
basic_machine=w65-wdc
|
||||
os=-none
|
||||
;;
|
||||
w89k-*)
|
||||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
@@ -616,6 +785,10 @@ case $basic_machine in
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
z8k-*-coff)
|
||||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
@@ -623,6 +796,15 @@ case $basic_machine in
|
||||
|
||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||
# some cases the only manufacturer, in others, it is the most popular.
|
||||
w89k)
|
||||
basic_machine=hppa1.1-winbond
|
||||
;;
|
||||
op50n)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
op60c)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
mips)
|
||||
if [ x$os = x-linux-gnu ]; then
|
||||
basic_machine=mips-unknown
|
||||
@@ -645,7 +827,7 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sparc)
|
||||
sparc | sparcv9)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
@@ -657,6 +839,16 @@ case $basic_machine in
|
||||
orion105)
|
||||
basic_machine=clipper-highlevel
|
||||
;;
|
||||
mac | mpw | mac-mpw)
|
||||
basic_machine=m68k-apple
|
||||
;;
|
||||
pmac | pmac-mpw)
|
||||
basic_machine=powerpc-apple
|
||||
;;
|
||||
c4x*)
|
||||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
@@ -710,13 +902,21 @@ case $os in
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos*)
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
|
||||
;;
|
||||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
@@ -741,6 +941,9 @@ case $os in
|
||||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
@@ -772,9 +975,18 @@ case $os in
|
||||
# This must come after -sysvr4.
|
||||
-sysv*)
|
||||
;;
|
||||
-ose*)
|
||||
os=-ose
|
||||
;;
|
||||
-es1800*)
|
||||
os=-ose
|
||||
;;
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-*mint | -*MiNT)
|
||||
os=-mint
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
@@ -800,6 +1012,9 @@ case $basic_machine in
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
arm*-corel)
|
||||
os=-linux
|
||||
;;
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
@@ -821,6 +1036,15 @@ case $basic_machine in
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
@@ -833,6 +1057,15 @@ case $basic_machine in
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-wec)
|
||||
os=-proelf
|
||||
;;
|
||||
*-winbond)
|
||||
os=-proelf
|
||||
;;
|
||||
*-oki)
|
||||
os=-proelf
|
||||
;;
|
||||
*-hp)
|
||||
os=-hpux
|
||||
;;
|
||||
@@ -896,6 +1129,18 @@ case $basic_machine in
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*-rom68k)
|
||||
os=-coff
|
||||
;;
|
||||
*-*bug)
|
||||
os=-coff
|
||||
;;
|
||||
*-apple)
|
||||
os=-macos
|
||||
;;
|
||||
*-atari*)
|
||||
os=-mint
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
@@ -917,9 +1162,15 @@ case $basic_machine in
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-beos*)
|
||||
vendor=be
|
||||
;;
|
||||
-hpux*)
|
||||
vendor=hp
|
||||
;;
|
||||
-mpeix*)
|
||||
vendor=hp
|
||||
;;
|
||||
-hiux*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
@@ -947,6 +1198,15 @@ case $basic_machine in
|
||||
-aux*)
|
||||
vendor=apple
|
||||
;;
|
||||
-hms*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
-mpw* | -macos*)
|
||||
vendor=apple
|
||||
;;
|
||||
-*mint | -*MiNT)
|
||||
vendor=atari
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
|
||||
+42
-33
@@ -29,9 +29,9 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
|
||||
#
|
||||
GTK_MAJOR_VERSION=1
|
||||
GTK_MINOR_VERSION=2
|
||||
GTK_MICRO_VERSION=0
|
||||
GTK_INTERFACE_AGE=0
|
||||
GTK_BINARY_AGE=0
|
||||
GTK_MICRO_VERSION=6
|
||||
GTK_INTERFACE_AGE=1
|
||||
GTK_BINARY_AGE=6
|
||||
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
|
||||
dnl
|
||||
AC_DIVERT_POP()dnl
|
||||
@@ -95,6 +95,7 @@ AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
|
||||
, enable_xim="yes")
|
||||
AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
|
||||
, enable_xim_inst="maybe")
|
||||
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
|
||||
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
|
||||
|
||||
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
|
||||
@@ -143,6 +144,9 @@ if test "x$GCC" = "xyes"; then
|
||||
fi
|
||||
changequote([,])dnl
|
||||
|
||||
# Honor aclocal flags
|
||||
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
|
||||
|
||||
# define a MAINT-like variable REBUILD which is set if Perl
|
||||
# and awk are found, so autogenerated sources can be rebuilt
|
||||
|
||||
@@ -153,20 +157,32 @@ AC_CHECK_PROGS(PERL, perl5 perl)
|
||||
AC_CHECK_PROG(INDENT, indent, indent)
|
||||
|
||||
REBUILD=\#
|
||||
if test -n "$PERL" && perl -v | grep 'version 5.' > /dev/null ; then
|
||||
if test -n "$AWK" ; then
|
||||
REBUILD=
|
||||
fi
|
||||
if test "x$enable_rebuilds" = "xyes" && \
|
||||
test -n "$PERL" && \
|
||||
$PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
|
||||
test -n "$AWK" ; then
|
||||
REBUILD=
|
||||
fi
|
||||
AC_SUBST(REBUILD)
|
||||
|
||||
AC_MSG_CHECKING(whether make is GNU Make)
|
||||
STRIP_BEGIN=
|
||||
STRIP_END=
|
||||
if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
|
||||
STRIP_BEGIN='$(strip'
|
||||
STRIP_END=')'
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST(STRIP_BEGIN)
|
||||
AC_SUBST(STRIP_END)
|
||||
|
||||
# i18n stuff
|
||||
ALL_LINGUAS="cs de es fr hu it ja ko nl no pl pt ru sv"
|
||||
ALL_LINGUAS="ca cs da de el es et eu fi fr ga hr hu it ja ko nl no pl pt pt_BR ro ru sk sl sv uk wa zh_TW.Big5"
|
||||
AM_GTK_GNU_GETTEXT
|
||||
AC_CHECK_FUNC(gettext,
|
||||
,
|
||||
AC_CHECK_LIB(intl, gettext)
|
||||
)
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
|
||||
# AM_GTK_GNU_GETTEXT above substs $DATADIRNAME
|
||||
# this is the directory where the *.{mo,gmo} files are installed
|
||||
gtklocaledir='${prefix}/${DATADIRNAME}/locale'
|
||||
@@ -189,8 +205,10 @@ AC_TRY_RUN([#include <math.h>
|
||||
AC_MSG_RESULT()
|
||||
CFLAGS=$gtk_save_CFLAGS
|
||||
AC_MSG_WARN(
|
||||
[No ANSI prototypes found in library. (-std1 didn't work.)])
|
||||
)
|
||||
[No ANSI prototypes found in library. (-std1 didn't work.)]),
|
||||
true
|
||||
),
|
||||
AC_MSG_RESULT(none needed)
|
||||
)
|
||||
LIBS=$gtk_save_LIBS
|
||||
|
||||
@@ -214,9 +232,9 @@ fi
|
||||
if test x$with_glib = x ; then
|
||||
# Look for separately installed glib
|
||||
|
||||
AM_PATH_GLIB(1.2.0,,
|
||||
AM_PATH_GLIB(1.2.4,,
|
||||
AC_MSG_ERROR([
|
||||
*** GLIB 1.2.0 or better is required. The latest version of GLIB
|
||||
*** GLIB 1.2.4 or better is required. The latest version of GLIB
|
||||
*** is always available from ftp://ftp.gtk.org/.]),
|
||||
gmodule gthread)
|
||||
|
||||
@@ -256,7 +274,7 @@ else
|
||||
esac
|
||||
|
||||
GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule"
|
||||
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule.la"
|
||||
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule/libgmodule.la"
|
||||
GLIB_DEPLIBS=
|
||||
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
@@ -412,11 +430,12 @@ main ()
|
||||
return setlocale (LC_ALL, "${with_locale}") == NULL;
|
||||
}],
|
||||
need_x_locale=no,
|
||||
need_x_locale=yes)
|
||||
need_x_locale=yes,
|
||||
need_x_locale=no)
|
||||
AC_MSG_RESULT($need_x_locale)
|
||||
|
||||
if test $need_x_locale = yes; then
|
||||
GTK_LOCALE_CFLAGS="-DX_LOCALE"
|
||||
GTK_LOCALE_FLAGS="-DX_LOCALE"
|
||||
fi
|
||||
|
||||
# Checks for header files.
|
||||
@@ -448,28 +467,18 @@ fi
|
||||
|
||||
# Duplicate `widechar' tests from `glib'.
|
||||
# Check for wchar.h
|
||||
if test x = y; then
|
||||
# will not be executed
|
||||
# hack so as not to update `acconfig.h'
|
||||
AC_CHECK_HEADERS(wchar.h wctype.h)
|
||||
AC_CHECK_FUNCS(broken_wctype)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for wchar.h)
|
||||
AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
|
||||
if test $gtk_ok = yes; then
|
||||
ac_kludge=HAVE_WCHAR_H
|
||||
AC_DEFINE($ac_kludge)
|
||||
AC_DEFINE(HAVE_WCHAR_H,1,[Define if wchar.h exists])
|
||||
fi
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
|
||||
# Check for wctype.h (for iswalnum)
|
||||
|
||||
AC_MSG_CHECKING(for wctype.h)
|
||||
AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
|
||||
if test $gtk_ok = yes; then
|
||||
ac_kludge=HAVE_WCTYPE_H
|
||||
AC_DEFINE($ac_kludge)
|
||||
AC_DEFINE(HAVE_WCTYPE_H,1,[Define if wctype.h exists])
|
||||
fi
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
|
||||
@@ -498,8 +507,7 @@ iswalnum((wchar_t) 0);
|
||||
LIBS="$oLIBS"
|
||||
|
||||
if test $gtk_ok = no; then
|
||||
ac_kludge=HAVE_BROKEN_WCTYPE
|
||||
AC_DEFINE($ac_kludge)
|
||||
AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Define if the wctype function is broken])
|
||||
GDK_WLIBS=
|
||||
fi
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
@@ -511,6 +519,7 @@ AC_SUBST(GTK_LOCALE_FLAGS)
|
||||
|
||||
AC_OUTPUT([
|
||||
gtk+.spec
|
||||
docs/gtk-config.1
|
||||
Makefile
|
||||
gtk-config
|
||||
po/Makefile.in
|
||||
|
||||
@@ -18,3 +18,4 @@ Makefile.in
|
||||
*.vrs
|
||||
html
|
||||
text
|
||||
gtk-config.1
|
||||
|
||||
+34
-30
@@ -101,36 +101,7 @@ FAQ_FILES=html/gtkfaq.html \
|
||||
html/gtkfaq-7.html \
|
||||
text/gtkfaq.txt
|
||||
|
||||
EXTRA_DIST = \
|
||||
gtk-config.1 \
|
||||
texinfo.tex \
|
||||
macros.texi \
|
||||
gtkdocs_fix \
|
||||
gtkfaq.sgml \
|
||||
gtk-config.txt \
|
||||
gtk_tut.sgml \
|
||||
gtk_tut_it.sgml \
|
||||
gtk_tut_fr.sgml \
|
||||
debugging.txt \
|
||||
developers.txt \
|
||||
refcounting.txt \
|
||||
styles.txt \
|
||||
text_widget.txt \
|
||||
widget_system.txt \
|
||||
gtk_tut_packbox1.gif \
|
||||
gtk_tut_packbox2.gif \
|
||||
html/gtk_tut_table.gif \
|
||||
html/gtk_tut_packbox1.gif \
|
||||
html/gtk_tut_packbox2.gif \
|
||||
gtk_tut_table.gif \
|
||||
html/gdk.html \
|
||||
html/gdk_toc.html \
|
||||
html/gtk.html \
|
||||
html/gtk_toc.html \
|
||||
$(TUTORIAL_FILES) \
|
||||
$(TUTORIAL_FR_FILES) \
|
||||
$(TUTORIAL_IT_FILES) \
|
||||
$(FAQ_FILES)
|
||||
html/gtk_tut_table.gif: gdk.html gtk.html
|
||||
|
||||
.PHONY: html htmldir faq tutorial tutorial_it tutorial_fr files
|
||||
|
||||
@@ -195,3 +166,36 @@ files:
|
||||
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
|
||||
echo $$p; \
|
||||
done
|
||||
|
||||
EXTRA_DIST += \
|
||||
Changes-1.2.txt \
|
||||
debugging.txt \
|
||||
developers.txt \
|
||||
refcounting.txt \
|
||||
styles.txt \
|
||||
text_widget.txt \
|
||||
widget_system.txt \
|
||||
generation.txt \
|
||||
gtk-config.txt \
|
||||
gtk-config.1.in \
|
||||
texinfo.tex \
|
||||
macros.texi \
|
||||
gtkdocs_fix \
|
||||
gtkfaq.sgml \
|
||||
gtk_tut.sgml \
|
||||
gtk_tut_it.sgml \
|
||||
gtk_tut_fr.sgml \
|
||||
gtk_tut_packbox1.gif \
|
||||
gtk_tut_packbox2.gif \
|
||||
html/gtk_tut_table.gif \
|
||||
html/gtk_tut_packbox1.gif \
|
||||
html/gtk_tut_packbox2.gif \
|
||||
gtk_tut_table.gif \
|
||||
html/gdk.html \
|
||||
html/gdk_toc.html \
|
||||
html/gtk.html \
|
||||
html/gtk_toc.html \
|
||||
$(TUTORIAL_FILES) \
|
||||
$(TUTORIAL_FR_FILES) \
|
||||
$(TUTORIAL_IT_FILES) \
|
||||
$(FAQ_FILES)
|
||||
|
||||
+1437
-256
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,177 @@
|
||||
Overview:
|
||||
========
|
||||
|
||||
This file describes the way that autogeneration
|
||||
works within the GTK+ source code.
|
||||
|
||||
The following files in the gdk/ subdirectory
|
||||
are autogenerated:
|
||||
|
||||
gdkkeysyms.h
|
||||
gdkcursors.h
|
||||
|
||||
The following files in the gtk/ subdirectory
|
||||
are autogenerated:
|
||||
|
||||
gtk.defs
|
||||
Description of GTK+ types (and some functions) in a lisp-style
|
||||
format.
|
||||
gtktypebuiltins.h
|
||||
Header file including declarations for internal types
|
||||
gtktypebuiltins_vars.c
|
||||
Variables for type values for internal types.
|
||||
gtktypebuiltins_ids.c
|
||||
Arrays holding information about each internal type.
|
||||
gtktypebuiltins_evals.c
|
||||
Arrays holding mapping between enumeration values
|
||||
and strings.
|
||||
|
||||
gtkmarshal.c
|
||||
gtkmarshal.h
|
||||
Autogenerated signal marshallers
|
||||
|
||||
GDK
|
||||
===
|
||||
|
||||
gdkkeysyms.h and gdkcursors.h are generated from
|
||||
the corresponding header files
|
||||
|
||||
X11/cursorfont.h
|
||||
X11/keysymdef.h
|
||||
|
||||
by some simple sed scripts. These are not actually
|
||||
run automatically because we want all the keysyms
|
||||
even on systems with a limited set.
|
||||
So the Gdk rule to generate both files (X-derived-headers)
|
||||
only needs to be rerun for every new release of the X Window
|
||||
System.
|
||||
|
||||
GTK+ - type definitions
|
||||
=======================
|
||||
|
||||
The type definitions are generated from several sources:
|
||||
|
||||
gtk-boxed.defs - definitions for boxed types
|
||||
GTK+ header files
|
||||
GDK header files
|
||||
|
||||
The makeenums.pl script does a heuristic parse of
|
||||
the header files and extracts all enumerations declarations.
|
||||
It also recognizes a number of pseudo-comments in the
|
||||
header files:
|
||||
|
||||
Two of these apply to individual enumeration values:
|
||||
|
||||
/*< skip >*/
|
||||
|
||||
This enumeration value should be skipped.
|
||||
|
||||
/*< nick=NICK >*/
|
||||
|
||||
The nickname for this value should NICK instead of the
|
||||
normally guessed value. For instance:
|
||||
|
||||
typedef enum {
|
||||
GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
|
||||
GTK_TARGET_SAME_WIDGET = 1 << 1 /*< nick=same-widget >*/
|
||||
} GtkTargetFlags;
|
||||
|
||||
makes the nicks "same-app" and "same-widget", instead of
|
||||
"app" and "widget" that would normally be used.
|
||||
|
||||
The other two apply to entire enumeration declarations.
|
||||
|
||||
/*< prefix=PREFIX >*/
|
||||
|
||||
Specifies the prefix to be removed from the enumeration
|
||||
values to generate nicknames.
|
||||
|
||||
/*< flags >*/
|
||||
|
||||
Specifies that this enumeration is used as a bitfield.
|
||||
(makenums.pl normally guesses this from the presence of values
|
||||
with << operators). For instance:
|
||||
|
||||
typedef enum /*< flags >*/
|
||||
{
|
||||
GDK_IM_PREEDIT_AREA = 0x0001,
|
||||
GDK_IM_PREEDIT_CALLBACKS = 0x0002,
|
||||
[ ... ]
|
||||
} GdkIMStyle;
|
||||
|
||||
makeenums.pl can be run into two modes:
|
||||
|
||||
1) Generate the gtktypebuiltins_eval.c file (this
|
||||
contains arrays holding the mapping of
|
||||
string <=> enumeration value)
|
||||
|
||||
2) Generate the enumeration portion of gtk.defs.
|
||||
|
||||
The enumearation portion is added to the boxed type
|
||||
declarations in gtk-boxed.defs to create gtk.defs.
|
||||
|
||||
The makeetypes.awk program takes the gtk.defs file, and
|
||||
from that generates various files depending on the
|
||||
third parameter passed to it:
|
||||
|
||||
macros: gtktypebuiltins.h
|
||||
variables: gtktypebuiltins_vars.c
|
||||
entries: gtktypebuiltins_ids.c
|
||||
|
||||
GTK+ - marshallers
|
||||
==================
|
||||
|
||||
The files gtkmarshal.c and gtkmarshal.h include declarations
|
||||
and definitions for the marshallers needed inside of
|
||||
GTK+. The marshallers to be generated are listed in
|
||||
the file gtkmashal.list, which is processed
|
||||
by genmarshal.pl.
|
||||
|
||||
The format of this file is a list of lines:
|
||||
|
||||
<retval-type>:<arg1-type>,<arg2-type>,<arg3-type>
|
||||
|
||||
e.g.:
|
||||
|
||||
BOOL:POINTER,STRING,STRING,POINTER
|
||||
|
||||
A marshaller is generated for each line in the file.
|
||||
The possible types are:
|
||||
|
||||
NONE
|
||||
BOOL
|
||||
CHAR
|
||||
INT
|
||||
UINT
|
||||
LONG
|
||||
ULONG
|
||||
FLOAT
|
||||
DOUBLE
|
||||
STRING
|
||||
ENUM
|
||||
FLAGS
|
||||
BOXED
|
||||
POINTER
|
||||
OBJECT
|
||||
FOREIGN (gpointer data, GtkDestroyNotify notify)
|
||||
C_CALLBACK (GtkFunction func, gpointer func_data)
|
||||
SIGNAL (GtkSignalFunc f, gpointer data)
|
||||
ARGS (gint n_args, GtkArg *args)
|
||||
CALLBACK (GtkCallBackMarshal marshall,
|
||||
gpointer data,
|
||||
GtkDestroyNotify Notify)
|
||||
|
||||
Some of these types map to multiple return values - these
|
||||
are marked above with the return types in parantheses.
|
||||
|
||||
NOTES
|
||||
=====
|
||||
|
||||
When autogenerating GTK+ files, the autogenerated
|
||||
files are often rebuild resulting in the same result.
|
||||
|
||||
To prevent unecessary rebuilds of the entire directory, some files
|
||||
that multiple other source files depend on are not actually written
|
||||
to directly. Instead, an intermediate file is written, which
|
||||
is then compared to the old file, and only if it is different
|
||||
is it copied into the final location.
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH GTK+ 1 "25 October 1998" Version 1.2.0
|
||||
.TH GTK+ 1 "25 October 1998" Version @VERSION@
|
||||
.SH NAME
|
||||
gtk-config - script to get information about the installed version of GTK+
|
||||
.SH SYNOPSIS
|
||||
+1
-1
@@ -1109,7 +1109,7 @@ opaque.
|
||||
All widget creation routines in GTK return pointers to GtkWidget
|
||||
structures. In reality, all widget creation routines create structures
|
||||
that can be viewed as equivalent to the GtkWidget structure, but often
|
||||
have contain additional information. @xref{Object Implementation}
|
||||
have contain additional information. @xref{Object Implementation}.
|
||||
|
||||
The widgets available for use are implemented in a hierarchy. Several
|
||||
widgets exist solely as common bases for more specific widgets. For
|
||||
|
||||
+355
-21
@@ -12062,12 +12062,6 @@ to this, once you finish your widget, announce it to the world so
|
||||
other people can benefit. The best place to do this is probably the
|
||||
<tt>gtk-list</tt>.
|
||||
|
||||
Complete sources for the example widgets are available at the place you
|
||||
got this tutorial, or from:
|
||||
|
||||
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
|
||||
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
|
||||
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1> The Anatomy Of A Widget
|
||||
@@ -13910,13 +13904,7 @@ needs to be updated. X will eventually generate an expose event
|
||||
to copy the relevant portions to the screen.
|
||||
|
||||
We have now covered the entire drawing program except for a few
|
||||
mundane details like creating the main window. The complete
|
||||
source code is available from the location from which you got
|
||||
this tutorial, or from:
|
||||
|
||||
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
|
||||
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
|
||||
|
||||
mundane details like creating the main window.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1> Adding XInput support
|
||||
@@ -14234,13 +14222,7 @@ print_button_press (guint32 deviceid)
|
||||
}
|
||||
</verb></tscreen>
|
||||
|
||||
That completes the changes to `XInputize' our program. As with
|
||||
the first version, the complete source is available at the location
|
||||
from which you got this tutorial, or from:
|
||||
|
||||
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
|
||||
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
|
||||
|
||||
That completes the changes to `XInputize' our program.
|
||||
|
||||
<sect2> Further sophistications <label id="sec_Further_Sophistications">
|
||||
<p>
|
||||
@@ -16547,7 +16529,83 @@ gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment,
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1> Scribble
|
||||
<sect2> dial-test.c
|
||||
<p>
|
||||
<tscreen><verb>
|
||||
/* example-start gtkdial dial-test.c */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkdial.h"
|
||||
|
||||
void
|
||||
value_changed (GtkAdjustment *adjustment, GtkWidget *label)
|
||||
{
|
||||
char buffer[16];
|
||||
|
||||
sprintf(buffer,"%4.2f",adjustment->value);
|
||||
gtk_label_set (GTK_LABEL (label), buffer);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkAdjustment *adjustment;
|
||||
GtkWidget *dial;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *label;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Dial");
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (gtk_exit), NULL);
|
||||
|
||||
gtk_container_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_widget_show(vbox);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), frame, TRUE, TRUE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
adjustment = GTK_ADJUSTMENT(gtk_adjustment_new (0, -1.0, 1.0, 0.01, 0.1, 0));
|
||||
|
||||
dial = gtk_dial_new(adjustment);
|
||||
gtk_dial_set_update_policy (GTK_DIAL(dial), GTK_UPDATE_DELAYED);
|
||||
/* gtk_widget_set_usize (dial, 100, 100); */
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), dial);
|
||||
gtk_widget_show (dial);
|
||||
|
||||
label = gtk_label_new("0.00");
|
||||
gtk_box_pack_start (GTK_BOX(vbox), label, TRUE, TRUE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(adjustment), "value_changed",
|
||||
GTK_SIGNAL_FUNC (value_changed), label);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* example-end */
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Scribble
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect2> scribble-simple.c
|
||||
<p>
|
||||
<tscreen><verb>
|
||||
/* example-start scribble-simple scribble-simple.c */
|
||||
@@ -16732,6 +16790,282 @@ main (int argc, char *argv[])
|
||||
/* example-end */
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect2> scribble-xinput.c
|
||||
<p>
|
||||
<tscreen><verb>
|
||||
/* example-start scribble-xinput scribble-xinput.c */
|
||||
|
||||
/* GTK - The GIMP Toolkit
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Backing pixmap for drawing area */
|
||||
static GdkPixmap *pixmap = NULL;
|
||||
|
||||
/* Create a new backing pixmap of the appropriate size */
|
||||
static gint
|
||||
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
||||
{
|
||||
if (pixmap)
|
||||
gdk_pixmap_unref(pixmap);
|
||||
|
||||
pixmap = gdk_pixmap_new(widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
-1);
|
||||
gdk_draw_rectangle (pixmap,
|
||||
widget->style->white_gc,
|
||||
TRUE,
|
||||
0, 0,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Redraw the screen from the backing pixmap */
|
||||
static gint
|
||||
expose_event (GtkWidget *widget, GdkEventExpose *event)
|
||||
{
|
||||
gdk_draw_pixmap(widget->window,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
pixmap,
|
||||
event->area.x, event->area.y,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Draw a rectangle on the screen, size depending on pressure,
|
||||
and color on the type of device */
|
||||
static void
|
||||
draw_brush (GtkWidget *widget, GdkInputSource source,
|
||||
gdouble x, gdouble y, gdouble pressure)
|
||||
{
|
||||
GdkGC *gc;
|
||||
GdkRectangle update_rect;
|
||||
|
||||
switch (source)
|
||||
{
|
||||
case GDK_SOURCE_MOUSE:
|
||||
gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)];
|
||||
break;
|
||||
case GDK_SOURCE_PEN:
|
||||
gc = widget->style->black_gc;
|
||||
break;
|
||||
case GDK_SOURCE_ERASER:
|
||||
gc = widget->style->white_gc;
|
||||
break;
|
||||
default:
|
||||
gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)];
|
||||
}
|
||||
|
||||
update_rect.x = x - 10 * pressure;
|
||||
update_rect.y = y - 10 * pressure;
|
||||
update_rect.width = 20 * pressure;
|
||||
update_rect.height = 20 * pressure;
|
||||
gdk_draw_rectangle (pixmap, gc, TRUE,
|
||||
update_rect.x, update_rect.y,
|
||||
update_rect.width, update_rect.height);
|
||||
gtk_widget_draw (widget, &update_rect);
|
||||
}
|
||||
|
||||
static void
|
||||
print_button_press (guint32 deviceid)
|
||||
{
|
||||
GList *tmp_list;
|
||||
|
||||
/* gdk_input_list_devices returns an internal list, so we shouldn't
|
||||
free it afterwards */
|
||||
tmp_list = gdk_input_list_devices();
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data;
|
||||
|
||||
if (info->deviceid == deviceid)
|
||||
{
|
||||
g_print("Button press on device '%s'\n", info->name);
|
||||
return;
|
||||
}
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
button_press_event (GtkWidget *widget, GdkEventButton *event)
|
||||
{
|
||||
print_button_press (event->deviceid);
|
||||
|
||||
if (event->button == 1 && pixmap != NULL)
|
||||
draw_brush (widget, event->source, event->x, event->y, event->pressure);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
|
||||
{
|
||||
gdouble x, y;
|
||||
gdouble pressure;
|
||||
GdkModifierType state;
|
||||
|
||||
if (event->is_hint)
|
||||
gdk_input_window_get_pointer (event->window, event->deviceid,
|
||||
&x, &y, &pressure, NULL, NULL, &state);
|
||||
else
|
||||
{
|
||||
x = event->x;
|
||||
y = event->y;
|
||||
pressure = event->pressure;
|
||||
state = event->state;
|
||||
}
|
||||
|
||||
if (state & GDK_BUTTON1_MASK && pixmap != NULL)
|
||||
draw_brush (widget, event->source, x, y, pressure);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
input_dialog_destroy (GtkWidget *w, gpointer data)
|
||||
{
|
||||
*((GtkWidget **)data) = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
create_input_dialog ()
|
||||
{
|
||||
static GtkWidget *inputd = NULL;
|
||||
|
||||
if (!inputd)
|
||||
{
|
||||
inputd = gtk_input_dialog_new();
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(inputd), "destroy",
|
||||
(GtkSignalFunc)input_dialog_destroy, &inputd);
|
||||
gtk_signal_connect_object (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->close_button),
|
||||
"clicked",
|
||||
(GtkSignalFunc)gtk_widget_hide,
|
||||
GTK_OBJECT(inputd));
|
||||
gtk_widget_hide ( GTK_INPUT_DIALOG(inputd)->save_button);
|
||||
|
||||
gtk_widget_show (inputd);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GTK_WIDGET_MAPPED(inputd))
|
||||
gtk_widget_show(inputd);
|
||||
else
|
||||
gdk_window_raise(inputd->window);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quit ()
|
||||
{
|
||||
gtk_exit (0);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *drawing_area;
|
||||
GtkWidget *vbox;
|
||||
|
||||
GtkWidget *button;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_widget_set_name (window, "Test Input");
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (quit), NULL);
|
||||
|
||||
/* Create the drawing area */
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
|
||||
|
||||
gtk_widget_show (drawing_area);
|
||||
|
||||
/* Signals used to handle backing pixmap */
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
|
||||
(GtkSignalFunc) expose_event, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event",
|
||||
(GtkSignalFunc) configure_event, NULL);
|
||||
|
||||
/* Event signals */
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event",
|
||||
(GtkSignalFunc) motion_notify_event, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event",
|
||||
(GtkSignalFunc) button_press_event, NULL);
|
||||
|
||||
gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK
|
||||
| GDK_LEAVE_NOTIFY_MASK
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_POINTER_MOTION_HINT_MASK);
|
||||
|
||||
/* The following call enables tracking and processing of extension
|
||||
events for the drawing area */
|
||||
gtk_widget_set_extension_events (drawing_area, GDK_EXTENSION_EVENTS_CURSOR);
|
||||
|
||||
/* .. And some buttons */
|
||||
button = gtk_button_new_with_label ("Input Dialog");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (create_input_dialog), NULL);
|
||||
gtk_widget_show (button);
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (gtk_widget_destroy),
|
||||
GTK_OBJECT (window));
|
||||
gtk_widget_show (button);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* example-end */
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect> List Widget
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
+1437
-256
File diff suppressed because it is too large
Load Diff
@@ -240,7 +240,7 @@ Taking care of proper referencing
|
||||
---------------------------------
|
||||
|
||||
There are some cases where referencing of widgets from outside the toolkit
|
||||
(on the application side is needed).
|
||||
(on the application side) is needed.
|
||||
Once the application performes an operation on a widget that will cause
|
||||
its reference count to drop, if it wants to take further actions on the
|
||||
widget, it needs to hold a reference to it.
|
||||
|
||||
+355
-21
@@ -12062,12 +12062,6 @@ to this, once you finish your widget, announce it to the world so
|
||||
other people can benefit. The best place to do this is probably the
|
||||
<tt>gtk-list</tt>.
|
||||
|
||||
Complete sources for the example widgets are available at the place you
|
||||
got this tutorial, or from:
|
||||
|
||||
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
|
||||
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
|
||||
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1> The Anatomy Of A Widget
|
||||
@@ -13910,13 +13904,7 @@ needs to be updated. X will eventually generate an expose event
|
||||
to copy the relevant portions to the screen.
|
||||
|
||||
We have now covered the entire drawing program except for a few
|
||||
mundane details like creating the main window. The complete
|
||||
source code is available from the location from which you got
|
||||
this tutorial, or from:
|
||||
|
||||
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
|
||||
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
|
||||
|
||||
mundane details like creating the main window.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1> Adding XInput support
|
||||
@@ -14234,13 +14222,7 @@ print_button_press (guint32 deviceid)
|
||||
}
|
||||
</verb></tscreen>
|
||||
|
||||
That completes the changes to `XInputize' our program. As with
|
||||
the first version, the complete source is available at the location
|
||||
from which you got this tutorial, or from:
|
||||
|
||||
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
|
||||
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
|
||||
|
||||
That completes the changes to `XInputize' our program.
|
||||
|
||||
<sect2> Further sophistications <label id="sec_Further_Sophistications">
|
||||
<p>
|
||||
@@ -16547,7 +16529,83 @@ gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment,
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1> Scribble
|
||||
<sect2> dial-test.c
|
||||
<p>
|
||||
<tscreen><verb>
|
||||
/* example-start gtkdial dial-test.c */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkdial.h"
|
||||
|
||||
void
|
||||
value_changed (GtkAdjustment *adjustment, GtkWidget *label)
|
||||
{
|
||||
char buffer[16];
|
||||
|
||||
sprintf(buffer,"%4.2f",adjustment->value);
|
||||
gtk_label_set (GTK_LABEL (label), buffer);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkAdjustment *adjustment;
|
||||
GtkWidget *dial;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *label;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Dial");
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (gtk_exit), NULL);
|
||||
|
||||
gtk_container_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_widget_show(vbox);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), frame, TRUE, TRUE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
adjustment = GTK_ADJUSTMENT(gtk_adjustment_new (0, -1.0, 1.0, 0.01, 0.1, 0));
|
||||
|
||||
dial = gtk_dial_new(adjustment);
|
||||
gtk_dial_set_update_policy (GTK_DIAL(dial), GTK_UPDATE_DELAYED);
|
||||
/* gtk_widget_set_usize (dial, 100, 100); */
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), dial);
|
||||
gtk_widget_show (dial);
|
||||
|
||||
label = gtk_label_new("0.00");
|
||||
gtk_box_pack_start (GTK_BOX(vbox), label, TRUE, TRUE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(adjustment), "value_changed",
|
||||
GTK_SIGNAL_FUNC (value_changed), label);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* example-end */
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Scribble
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect2> scribble-simple.c
|
||||
<p>
|
||||
<tscreen><verb>
|
||||
/* example-start scribble-simple scribble-simple.c */
|
||||
@@ -16732,6 +16790,282 @@ main (int argc, char *argv[])
|
||||
/* example-end */
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect2> scribble-xinput.c
|
||||
<p>
|
||||
<tscreen><verb>
|
||||
/* example-start scribble-xinput scribble-xinput.c */
|
||||
|
||||
/* GTK - The GIMP Toolkit
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Backing pixmap for drawing area */
|
||||
static GdkPixmap *pixmap = NULL;
|
||||
|
||||
/* Create a new backing pixmap of the appropriate size */
|
||||
static gint
|
||||
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
||||
{
|
||||
if (pixmap)
|
||||
gdk_pixmap_unref(pixmap);
|
||||
|
||||
pixmap = gdk_pixmap_new(widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
-1);
|
||||
gdk_draw_rectangle (pixmap,
|
||||
widget->style->white_gc,
|
||||
TRUE,
|
||||
0, 0,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Redraw the screen from the backing pixmap */
|
||||
static gint
|
||||
expose_event (GtkWidget *widget, GdkEventExpose *event)
|
||||
{
|
||||
gdk_draw_pixmap(widget->window,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
pixmap,
|
||||
event->area.x, event->area.y,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Draw a rectangle on the screen, size depending on pressure,
|
||||
and color on the type of device */
|
||||
static void
|
||||
draw_brush (GtkWidget *widget, GdkInputSource source,
|
||||
gdouble x, gdouble y, gdouble pressure)
|
||||
{
|
||||
GdkGC *gc;
|
||||
GdkRectangle update_rect;
|
||||
|
||||
switch (source)
|
||||
{
|
||||
case GDK_SOURCE_MOUSE:
|
||||
gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)];
|
||||
break;
|
||||
case GDK_SOURCE_PEN:
|
||||
gc = widget->style->black_gc;
|
||||
break;
|
||||
case GDK_SOURCE_ERASER:
|
||||
gc = widget->style->white_gc;
|
||||
break;
|
||||
default:
|
||||
gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)];
|
||||
}
|
||||
|
||||
update_rect.x = x - 10 * pressure;
|
||||
update_rect.y = y - 10 * pressure;
|
||||
update_rect.width = 20 * pressure;
|
||||
update_rect.height = 20 * pressure;
|
||||
gdk_draw_rectangle (pixmap, gc, TRUE,
|
||||
update_rect.x, update_rect.y,
|
||||
update_rect.width, update_rect.height);
|
||||
gtk_widget_draw (widget, &update_rect);
|
||||
}
|
||||
|
||||
static void
|
||||
print_button_press (guint32 deviceid)
|
||||
{
|
||||
GList *tmp_list;
|
||||
|
||||
/* gdk_input_list_devices returns an internal list, so we shouldn't
|
||||
free it afterwards */
|
||||
tmp_list = gdk_input_list_devices();
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data;
|
||||
|
||||
if (info->deviceid == deviceid)
|
||||
{
|
||||
g_print("Button press on device '%s'\n", info->name);
|
||||
return;
|
||||
}
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
button_press_event (GtkWidget *widget, GdkEventButton *event)
|
||||
{
|
||||
print_button_press (event->deviceid);
|
||||
|
||||
if (event->button == 1 && pixmap != NULL)
|
||||
draw_brush (widget, event->source, event->x, event->y, event->pressure);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
|
||||
{
|
||||
gdouble x, y;
|
||||
gdouble pressure;
|
||||
GdkModifierType state;
|
||||
|
||||
if (event->is_hint)
|
||||
gdk_input_window_get_pointer (event->window, event->deviceid,
|
||||
&x, &y, &pressure, NULL, NULL, &state);
|
||||
else
|
||||
{
|
||||
x = event->x;
|
||||
y = event->y;
|
||||
pressure = event->pressure;
|
||||
state = event->state;
|
||||
}
|
||||
|
||||
if (state & GDK_BUTTON1_MASK && pixmap != NULL)
|
||||
draw_brush (widget, event->source, x, y, pressure);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
input_dialog_destroy (GtkWidget *w, gpointer data)
|
||||
{
|
||||
*((GtkWidget **)data) = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
create_input_dialog ()
|
||||
{
|
||||
static GtkWidget *inputd = NULL;
|
||||
|
||||
if (!inputd)
|
||||
{
|
||||
inputd = gtk_input_dialog_new();
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(inputd), "destroy",
|
||||
(GtkSignalFunc)input_dialog_destroy, &inputd);
|
||||
gtk_signal_connect_object (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->close_button),
|
||||
"clicked",
|
||||
(GtkSignalFunc)gtk_widget_hide,
|
||||
GTK_OBJECT(inputd));
|
||||
gtk_widget_hide ( GTK_INPUT_DIALOG(inputd)->save_button);
|
||||
|
||||
gtk_widget_show (inputd);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GTK_WIDGET_MAPPED(inputd))
|
||||
gtk_widget_show(inputd);
|
||||
else
|
||||
gdk_window_raise(inputd->window);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quit ()
|
||||
{
|
||||
gtk_exit (0);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *drawing_area;
|
||||
GtkWidget *vbox;
|
||||
|
||||
GtkWidget *button;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_widget_set_name (window, "Test Input");
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (quit), NULL);
|
||||
|
||||
/* Create the drawing area */
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
|
||||
|
||||
gtk_widget_show (drawing_area);
|
||||
|
||||
/* Signals used to handle backing pixmap */
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
|
||||
(GtkSignalFunc) expose_event, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event",
|
||||
(GtkSignalFunc) configure_event, NULL);
|
||||
|
||||
/* Event signals */
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event",
|
||||
(GtkSignalFunc) motion_notify_event, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event",
|
||||
(GtkSignalFunc) button_press_event, NULL);
|
||||
|
||||
gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK
|
||||
| GDK_LEAVE_NOTIFY_MASK
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_POINTER_MOTION_HINT_MASK);
|
||||
|
||||
/* The following call enables tracking and processing of extension
|
||||
events for the drawing area */
|
||||
gtk_widget_set_extension_events (drawing_area, GDK_EXTENSION_EVENTS_CURSOR);
|
||||
|
||||
/* .. And some buttons */
|
||||
button = gtk_button_new_with_label ("Input Dialog");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (create_input_dialog), NULL);
|
||||
gtk_widget_show (button);
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (gtk_widget_destroy),
|
||||
GTK_OBJECT (window));
|
||||
gtk_widget_show (button);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* example-end */
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect> List Widget
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -81,7 +81,7 @@ main (int argv, char **argc)
|
||||
|
||||
info = g_malloc(sizeof(Info));
|
||||
|
||||
window = gtk_window_new(GTK_TOPLEVEL);
|
||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (destroy), NULL);
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
lib_LTLIBRARIES = \
|
||||
libgdk-pixbuf.la \
|
||||
libpixbuf-png.la
|
||||
|
||||
#
|
||||
# The GdkPixBuf library
|
||||
#
|
||||
libgdk_pixbufincludedir = $(includedir)/gdk-pixbuf
|
||||
|
||||
libgdk_pixbuf_la_SOURCES = \
|
||||
gdk-pixbuf.c \
|
||||
gdk-pixbuf-io.c
|
||||
|
||||
libgdk_pixbufinclude_HEADERS = \
|
||||
gdk-pixbuf.h
|
||||
|
||||
#
|
||||
# The PNG plugin.
|
||||
#
|
||||
libpixbuf_png_la_SOURCES = \
|
||||
io-png.c
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef _GDK_PIXBUF_CACHE_H_
|
||||
#define _GDK_PIXBUF_CACHE_H_
|
||||
|
||||
/* The optional cache interface */
|
||||
typedef struct {
|
||||
int dummy;
|
||||
} GdkPixBufCache;
|
||||
|
||||
GdkPixBufCache *gdk_pixbuf_cache_new (long image_cache_limit,
|
||||
long pixmap_bitmap_cache_limit);
|
||||
void gdk_pixbuf_cache_destroy (GdkPixBufCache *cache);
|
||||
|
||||
GdkPixBuf *gdk_pixbuf_cache_load_image (GdkPixBufCache *cache,
|
||||
const char *file);
|
||||
#endif
|
||||
@@ -1,199 +0,0 @@
|
||||
/*
|
||||
* gdk-pixbuf-io.c: Code to load images into GdkPixBufs
|
||||
*
|
||||
* Author:
|
||||
* Miguel de Icaza (miguel@gnu.org)
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include "gdk-pixbuf.h"
|
||||
|
||||
static gboolean
|
||||
pixbuf_check_png (unsigned char *buffer, int size)
|
||||
{
|
||||
if (size < 28)
|
||||
return FALSE;
|
||||
|
||||
if (buffer [0] != 0x89 ||
|
||||
buffer [1] != 'P' ||
|
||||
buffer [2] != 'N' ||
|
||||
buffer [3] != 'G' ||
|
||||
buffer [4] != 0x0d ||
|
||||
buffer [5] != 0x0a ||
|
||||
buffer [6] != 0x1a ||
|
||||
buffer [7] != 0x0a)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pixbuf_check_jpeg (unsigned char *buffer, int size)
|
||||
{
|
||||
if (size < 10)
|
||||
return FALSE;
|
||||
|
||||
if (buffer [0] != 0xff || buffer [1] != 0xd8)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pixbuf_check_tiff (unsigned char *buffer, int size)
|
||||
{
|
||||
if (size < 10)
|
||||
return FALSE;
|
||||
|
||||
if (buffer [0] == 'M' && buffer [1] == 'M' && buffer [2] == 0 && buffer [3] == 0x2a)
|
||||
return TRUE;
|
||||
|
||||
if (buffer [0] == 'I' && buffer [1] == 'I' && buffer [2] == 0x2a && buffer [3] == 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pixbuf_check_gif (unsigned char *buffer, int size)
|
||||
{
|
||||
if (size < 20)
|
||||
return FALSE;
|
||||
|
||||
if (strncmp (buffer, "GIF8", 4) == 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pixbuf_check_xpm (unsigned char *buffer, int size)
|
||||
{
|
||||
if (size < 20)
|
||||
return FALSE;
|
||||
|
||||
if (strncmp (buffer, "/* XPM */", 9) == 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pixbuf_check_bmp (unsigned char *buffer, int size)
|
||||
{
|
||||
if (size < 20)
|
||||
return FALSE;
|
||||
|
||||
if (buffer [0] != 'B' || buffer [1] != 'M')
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pixbuf_check_ppm (unsigned char *buffer, int size)
|
||||
{
|
||||
if (size < 20)
|
||||
return FALSE;
|
||||
|
||||
if (buffer [0] == 'P'){
|
||||
if (buffer [1] == '1' ||
|
||||
buffer [1] == '2' ||
|
||||
buffer [1] == '3' ||
|
||||
buffer [1] == '4' ||
|
||||
buffer [1] == '5' ||
|
||||
buffer [1] == '6')
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static struct {
|
||||
char *module_name;
|
||||
gboolean (*format_check)(unsigned char *buffer, int size);
|
||||
GModule *module;
|
||||
GdkPixBuf *(*load)(FILE *f)
|
||||
int (*save)(char *filename, ...);
|
||||
} file_formats [] = {
|
||||
{ "png", pixbuf_check_png, NULL, NULL, NULL },
|
||||
{ "jpeg", pixbuf_check_jpeg, NULL, NULL, NULL },
|
||||
{ "tiff", pixbuf_check_tiff, NULL, NULL, NULL },
|
||||
{ "gif", pixbuf_check_gif, NULL, NULL, NULL },
|
||||
{ "xpm", pixbuf_check_xpm, NULL, NULL, NULL }
|
||||
{ "bmp", pixbuf_check_bmp, NULL, NULL, NULL },
|
||||
{ "ppm", pixbuf_check_ppm, NULL, NULL, NULL },
|
||||
{ NULL, NULL, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
static int
|
||||
image_file_format (const char *file)
|
||||
{
|
||||
FILE *f = fopen (file);
|
||||
|
||||
if (!f)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
image_handler_load (int idx)
|
||||
{
|
||||
char *module_name = g_strconcat ("pixbuf-", file_formats [idx].module_name, NULL);
|
||||
char *path;
|
||||
GModule *module;
|
||||
void *load_sym, *save_sym;
|
||||
|
||||
path = g_module_build_path (PIXBUF_LIBDIR, module_name);
|
||||
g_free (module_name);
|
||||
|
||||
module = g_module_open (path, G_MODULE_BIND_LAZY);
|
||||
if (!module)
|
||||
return;
|
||||
|
||||
file_formats [idx].module = module;
|
||||
|
||||
if (g_module_symbol (module, "image_load", &load_sym))
|
||||
file_formats [idx].load = load_sym;
|
||||
|
||||
if (g_module_symbol (module, "image_save", &save_sym))
|
||||
file_formats [idx].save = save_sym;
|
||||
}
|
||||
|
||||
GdkPixBuf *
|
||||
gdk_pixbuf_load_image (const char *file)
|
||||
{
|
||||
GdkPixBuf *pixbuf;
|
||||
FormatLoader format_loader;
|
||||
FILE *f;
|
||||
char buffer [128];
|
||||
|
||||
f = fopen (file);
|
||||
if (!f)
|
||||
return NULL;
|
||||
n = fread (&buffer, 1, sizeof (buffer), f);
|
||||
|
||||
if (n == 0){
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; file_formats [i].module_name; i++){
|
||||
if ((*file_formats [i].format_check)(buffer, n)){
|
||||
if (!file_formats [i].load)
|
||||
image_handler_load (i);
|
||||
|
||||
if (!file_formats [i].load){
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rewind (f);
|
||||
pixbuf = (*file_formats [i].load)(f);
|
||||
fclose (f);
|
||||
return pixbuf;
|
||||
}
|
||||
}
|
||||
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* gdk-pixbuf.c: Resource management.
|
||||
*
|
||||
* Author:
|
||||
* Miguel de Icaza (miguel@gnu.org)
|
||||
*/
|
||||
#include <config.h>
|
||||
#include "gdk-pixbuf.h"
|
||||
|
||||
|
||||
static void
|
||||
gdk_pixbuf_destroy (GdkPixBuf *pixbuf)
|
||||
{
|
||||
art_pixbuf_free (pixbuf->art_pixbuf);
|
||||
g_free (pixbuf);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_pixbuf_ref (GdkPixBuf *pixbuf)
|
||||
{
|
||||
g_return_if_fail (pixbuf != NULL);
|
||||
|
||||
pixbuf->ref_count++;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_pixbuf_unref (GdkPixBuf *pixbuf)
|
||||
{
|
||||
g_return_if_fail (pixbuf != NULL);
|
||||
g_return_if_fail (pixbuf->ref_count == 0);
|
||||
|
||||
pixbuf->ref_count--;
|
||||
if (pixbuf->ref_count)
|
||||
gdk_pixbuf_destroy (pixbuf);
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef _GDK_PIXBUF_H_
|
||||
#define _GDK_PIXBUF_H_
|
||||
|
||||
#include <libart_lgpl/art_misc.h>
|
||||
#include <libart_lgpl/art_pixbuf.h>
|
||||
|
||||
typedef struct {
|
||||
int ref_count;
|
||||
ArtPixBuf *art_pixbuf;
|
||||
void (*unref_func)(void *gdkpixbuf);
|
||||
} GdkPixBuf;
|
||||
|
||||
GdkPixBuf *gdk_pixbuf_load_image (const char *file);
|
||||
void gdk_pixbuf_save_image (const char *format_id, const char *file, ...);
|
||||
void gdk_pixbuf_ref (GdkPixBuf *pixbuf);
|
||||
void gdk_pixbuf_unref (GdkPixBuf *pixbuf);
|
||||
GdkPixBuf gdk_pixbuf_duplicate (GdkPixBuf *pixbuf);
|
||||
|
||||
#endif /* _GDK_PIXBUF_H_ */
|
||||
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* io-png.c: GdkPixBuf image loader for PNG files.
|
||||
*
|
||||
* Author:
|
||||
* Miguel de Icaza (miguel@gnu.org)
|
||||
*
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include "gdk-pixbuf.h"
|
||||
#include "gdk-pixbuf-io.h"
|
||||
#include <png.h>
|
||||
|
||||
/* Shared library entry point */
|
||||
GdkPixBuf *
|
||||
image_load (FILE *f);
|
||||
{
|
||||
png_structp png;
|
||||
png_infop info_ptr, end_info;
|
||||
int width, height, depth, color_type, interlace_type;
|
||||
int have_alpha, number_passes;
|
||||
art_u8 *data;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
|
||||
png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
if (png)
|
||||
return NULL;
|
||||
|
||||
info_ptr = png_create_info_struct (png);
|
||||
if (!info_ptr){
|
||||
png_destroy_read_struct (&png, NULL, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
end_info = png_create_info_struct (png);
|
||||
if (!end_info){
|
||||
png_destroy_read_struct (&png, &info_ptr, NULL);
|
||||
return NULL:
|
||||
}
|
||||
|
||||
if (setjmp (png->jmpbuf)){
|
||||
png_destroy_read_struct (&png, &info_ptr, &end_info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
png_init_io (pngptr, f);
|
||||
|
||||
png_read_info (png, info_ptr);
|
||||
png_get_IHDR (png, info_ptr, &width, &height, &depth, &color_type, &interlace_type, NULL, NULL);
|
||||
|
||||
if (color_type == color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
png_set_expand (png);
|
||||
|
||||
/*
|
||||
* Strip 16 bit information to 8 bit
|
||||
*/
|
||||
png_set_strip_16 (png);
|
||||
|
||||
/*
|
||||
* Extract multiple pixels with bit depths 1, 2 and 4 from a single
|
||||
* byte into separate bytes
|
||||
*/
|
||||
png_set_packing (png);
|
||||
|
||||
/*
|
||||
* Makes the PNG file to be rendered into RGB or RGBA
|
||||
* modes (no matter of the bit depth nor the image
|
||||
* mode
|
||||
*/
|
||||
png_set_expand (png);
|
||||
|
||||
/*
|
||||
* Simplify loading by always having 4 bytes
|
||||
*/
|
||||
png_set_filler (png, 0xff, PNG_FILLER_AFTER);
|
||||
|
||||
if (color_type & PNG_COLOR_MASK_ALPHA)
|
||||
have_alpha = 1
|
||||
else
|
||||
have_alpha = 0;
|
||||
|
||||
data = art_alloc (width * height * (3 + have_alpha));
|
||||
if (!data){
|
||||
png_destroy_read_struct (&png, &info_ptr, &end_info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
number_passes = png_set_interlace_handling (png);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#ifndef _GDK_PIXBUF_H_
|
||||
#define _GDK_PIXBUF_H_
|
||||
|
||||
#include <libart_lgpl/art_pixbuf.h>
|
||||
|
||||
typedef struct {
|
||||
int ref_count;
|
||||
ArtPixBuf *pixbuf;
|
||||
void (*unref_func)(void *gdkpixbuf);
|
||||
} GdkPixBuf;
|
||||
|
||||
GdkPixBuf *gdk_pixbuf_load_image (const char *file);
|
||||
void gdk_pixbuf_save_image (const char *format_id, const char *file, ...);
|
||||
void gdk_pixbuf_ref (GdkPixBuf *pixbuf);
|
||||
void gdk_pixbuf_unref (GdkPixBuf *pixbuf);
|
||||
GdkPixBuf gdk_pixbuf_duplicate (GdkPixBuf *pixbuf);
|
||||
|
||||
#endif /* _GDK_PIXBUF_H_ */
|
||||
+504
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
+66
-42
@@ -1,19 +1,47 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
## Makefile.am for gtk+/gdk
|
||||
|
||||
gdkincludedir = $(includedir)/gdk
|
||||
|
||||
lib_LTLIBRARIES = libgdk.la
|
||||
|
||||
INCLUDES = \
|
||||
INCLUDES = @STRIP_BEGIN@ \
|
||||
-DG_LOG_DOMAIN=\"Gdk\" \
|
||||
-I$(top_srcdir) \
|
||||
@GTK_DEBUG_FLAGS@ \
|
||||
@GTK_XIM_FLAGS@ \
|
||||
@GTK_LOCALE_FLAGS@ \
|
||||
@GLIB_CFLAGS@ \
|
||||
@x_cflags@
|
||||
@x_cflags@ \
|
||||
@STRIP_END@
|
||||
|
||||
libgdk_la_SOURCES = \
|
||||
#
|
||||
# libraries to compile and install
|
||||
#
|
||||
lib_LTLIBRARIES = libgdk.la
|
||||
|
||||
# libtool stuff: set version and export symbols for resolving
|
||||
libgdkincludedir = $(includedir)/gdk
|
||||
libgdk_la_LDFLAGS = @STRIP_BEGIN@ \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
-release $(LT_RELEASE) \
|
||||
-export-dynamic \
|
||||
@GLIB_DEPLIBS@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
|
||||
#
|
||||
# setup source file variables
|
||||
#
|
||||
# GDK header files for public installation (non-generated)
|
||||
gdk_public_h_sources = @STRIP_BEGIN@ \
|
||||
gdk.h \
|
||||
gdkcursors.h \
|
||||
gdkrgb.h \
|
||||
gdki18n.h \
|
||||
gdkkeysyms.h \
|
||||
gdkprivate.h \
|
||||
gdktypes.h \
|
||||
gdkx.h \
|
||||
@STRIP_END@
|
||||
gdk_c_sources = @STRIP_BEGIN@ \
|
||||
gdk.c \
|
||||
gdkcc.c \
|
||||
gdkcolor.c \
|
||||
@@ -44,42 +72,23 @@ libgdk_la_SOURCES = \
|
||||
MwmUtil.h \
|
||||
gxid_lib.h \
|
||||
gxid_proto.h \
|
||||
gxid_lib.c
|
||||
## this last one is ifdef'd out unless XINPUT_GXI is defined
|
||||
## It's easier than trying to get automake to handle compiling
|
||||
## it conditionally
|
||||
gxid_lib.c \
|
||||
@STRIP_END@
|
||||
|
||||
gdkinclude_HEADERS = \
|
||||
gdk.h \
|
||||
gdkcursors.h \
|
||||
gdkrgb.h \
|
||||
gdki18n.h \
|
||||
gdkkeysyms.h \
|
||||
gdkprivate.h \
|
||||
gdktypes.h \
|
||||
gdkx.h
|
||||
|
||||
LDADDS = \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
@GLIB_LIBS@ \
|
||||
-lm
|
||||
|
||||
libgdk_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) \
|
||||
@GLIB_DEPLIBS@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
-lm
|
||||
|
||||
EXTRA_PROGRAMS = gxid
|
||||
|
||||
bin_PROGRAMS = @xinput_progs@
|
||||
|
||||
gxid_SOURCES = gxid.c
|
||||
|
||||
gxid_LDADD = $(LDADDS)
|
||||
#
|
||||
# setup GDK sources and their dependancies
|
||||
#
|
||||
libgdkinclude_HEADERS = $(gdk_public_h_sources)
|
||||
libgdk_la_SOURCES = $(gdk_c_sources)
|
||||
MAINTAINERCLEANFILES +=
|
||||
EXTRA_HEADERS +=
|
||||
EXTRA_DIST +=
|
||||
EXTRA_DIST +=
|
||||
|
||||
#
|
||||
# rules to generate built sources
|
||||
#
|
||||
# we only need to remake these headers once a new X version is released
|
||||
X-derived-headers:
|
||||
sed -e 's/^#define[ ]*XC\([^ ]*\)[ ]*\([^ ]*\)[ ]*.*$$/GDK\1 = \2,/' \
|
||||
-e 'tb' -e 'd' -e ':b' \
|
||||
@@ -89,6 +98,21 @@ X-derived-headers:
|
||||
-e 'tb' -e 'd' -e ':b' -e 's/ 0X/ 0x/' \
|
||||
< @x_includes@/X11/keysymdef.h > gdkkeysyms.h
|
||||
|
||||
#
|
||||
# extra programs
|
||||
#
|
||||
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)
|
||||
|
||||
|
||||
.PHONY: files
|
||||
|
||||
files:
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
@@ -48,6 +49,7 @@
|
||||
#include "gdkinput.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdki18n.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
#ifndef X_GETTIMEOFDAY
|
||||
#define X_GETTIMEOFDAY(tv) gettimeofday (tv, NULL)
|
||||
@@ -333,6 +335,7 @@ gdk_init_check (int *argc,
|
||||
gdk_im_set_best_style (GDK_IM_PREEDIT_POSITION);
|
||||
else if (strcmp ("callbacks", (*argv)[i]) == 0)
|
||||
gdk_im_set_best_style (GDK_IM_PREEDIT_CALLBACKS);
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
}
|
||||
else if (strcmp ("--xim-status", (*argv)[i]) == 0)
|
||||
@@ -348,6 +351,7 @@ gdk_init_check (int *argc,
|
||||
gdk_im_set_best_style (GDK_IM_STATUS_AREA);
|
||||
else if (strcmp ("callbacks", (*argv)[i]) == 0)
|
||||
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -406,9 +410,9 @@ gdk_init_check (int *argc,
|
||||
g_free(argv_orig[i]);
|
||||
g_free(argv_orig);
|
||||
|
||||
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", True);
|
||||
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", True);
|
||||
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", True);
|
||||
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", False);
|
||||
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", False);
|
||||
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", False);
|
||||
gdk_wm_window_protocols[0] = gdk_wm_delete_window;
|
||||
gdk_wm_window_protocols[1] = gdk_wm_take_focus;
|
||||
gdk_selection_property = XInternAtom (gdk_display, "GDK_SELECTION", False);
|
||||
@@ -1032,20 +1036,35 @@ static int
|
||||
gdk_x_error (Display *display,
|
||||
XErrorEvent *error)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
if (gdk_error_warnings)
|
||||
if (error->error_code)
|
||||
{
|
||||
XGetErrorText (display, error->error_code, buf, 63);
|
||||
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
|
||||
buf,
|
||||
error->serial,
|
||||
error->error_code,
|
||||
error->request_code,
|
||||
error->minor_code);
|
||||
if (gdk_error_warnings)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
XGetErrorText (display, error->error_code, buf, 63);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
|
||||
buf,
|
||||
error->serial,
|
||||
error->error_code,
|
||||
error->request_code,
|
||||
error->minor_code);
|
||||
#else /* !G_ENABLE_DEBUG */
|
||||
fprintf (stderr, "Gdk-ERROR **: %s\n serial %ld error_code %d request_code %d minor_code %d\n",
|
||||
buf,
|
||||
error->serial,
|
||||
error->error_code,
|
||||
error->request_code,
|
||||
error->minor_code);
|
||||
|
||||
exit(1);
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
}
|
||||
gdk_error_code = error->error_code;
|
||||
}
|
||||
|
||||
gdk_error_code = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1071,8 +1090,27 @@ gdk_x_error (Display *display,
|
||||
static int
|
||||
gdk_x_io_error (Display *display)
|
||||
{
|
||||
g_error ("an x io error occurred");
|
||||
return 0;
|
||||
/* This is basically modelled after the code in XLib. We need
|
||||
* an explicit error handler here, so we can disable our atexit()
|
||||
* which would otherwise cause a nice segfault.
|
||||
* We fprintf(stderr, instead of g_warning() because g_warning()
|
||||
* could possibly be redirected to a dialog
|
||||
*/
|
||||
if (errno == EPIPE)
|
||||
{
|
||||
fprintf (stderr, "Gdk-ERROR **: X connection to %s broken (explicit kill or server shutdown).\n", gdk_display ? DisplayString (gdk_display) : gdk_get_display());
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "Gdk-ERROR **: Fatal IO error %d (%s) on X server %s.\n",
|
||||
errno, g_strerror (errno),
|
||||
gdk_display ? DisplayString (gdk_display) : gdk_get_display());
|
||||
}
|
||||
|
||||
/* Disable the atexit shutdown for GDK */
|
||||
gdk_initialized = 0;
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
gchar *
|
||||
@@ -1104,7 +1142,7 @@ gdk_error_trap_push (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
node = g_slist_alloc();
|
||||
node = g_slist_alloc ();
|
||||
node->data = g_new (GdkErrorTrap, 1);
|
||||
}
|
||||
|
||||
@@ -1166,7 +1204,7 @@ gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
|
||||
XSync (gdk_display, False);
|
||||
gdk_error_warnings = old_warnings;
|
||||
|
||||
return result && (gdk_error_code != -1);
|
||||
return result && !gdk_error_code;
|
||||
}
|
||||
|
||||
#ifndef HAVE_XCONVERTCASE
|
||||
|
||||
@@ -479,8 +479,8 @@ 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,
|
||||
GdkPixmap* gdk_pixmap_colormap_create_from_xpm (
|
||||
GdkWindow *window,
|
||||
GdkColormap *colormap,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
@@ -489,8 +489,8 @@ 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,
|
||||
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d (
|
||||
GdkWindow *window,
|
||||
GdkColormap *colormap,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
@@ -529,67 +529,66 @@ void gdk_image_destroy (GdkImage *image);
|
||||
|
||||
/* Color
|
||||
*/
|
||||
GdkColormap* gdk_colormap_new (GdkVisual *visual,
|
||||
gint allocate);
|
||||
GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
|
||||
void gdk_colormap_unref (GdkColormap *cmap);
|
||||
GdkColormap* gdk_colormap_new (GdkVisual *visual,
|
||||
gint 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);
|
||||
GdkColormap* gdk_colormap_get_system (void);
|
||||
gint gdk_colormap_get_system_size (void);
|
||||
|
||||
void gdk_colormap_change (GdkColormap *colormap,
|
||||
gint ncolors);
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
|
||||
|
||||
GdkColor *gdk_color_copy (GdkColor *color);
|
||||
void gdk_color_free (GdkColor *color);
|
||||
GdkColor* gdk_color_copy (GdkColor *color);
|
||||
void gdk_color_free (GdkColor *color);
|
||||
|
||||
gint gdk_color_parse (const gchar *spec,
|
||||
GdkColor *color);
|
||||
guint gdk_color_hash (const GdkColor *colora,
|
||||
const GdkColor *colorb);
|
||||
gint gdk_color_equal (const GdkColor *colora,
|
||||
const GdkColor *colorb);
|
||||
gboolean gdk_color_parse (const gchar *spec,
|
||||
GdkColor *color);
|
||||
guint gdk_color_hash (const GdkColor *colora,
|
||||
const GdkColor *colorb);
|
||||
gint 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,
|
||||
gint 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);
|
||||
void gdk_colors_store (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors);
|
||||
gboolean gdk_colors_alloc (GdkColormap *colormap,
|
||||
gint 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
|
||||
|
||||
+16
-34
@@ -491,10 +491,11 @@ init_palette (GdkColorContext *cc)
|
||||
|
||||
if (cc->color_hash)
|
||||
{
|
||||
/* XXX: quick-and-dirty way to remove everything */
|
||||
|
||||
g_hash_table_foreach (cc->color_hash,
|
||||
free_hash_entry,
|
||||
NULL);
|
||||
g_hash_table_destroy (cc->color_hash);
|
||||
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
|
||||
cc->color_hash = NULL;
|
||||
}
|
||||
|
||||
cc->palette = NULL;
|
||||
@@ -618,11 +619,6 @@ gdk_color_context_new (GdkVisual *visual,
|
||||
g_message ("gdk_color_context_new: screen depth is %i, no. of colors is %i\n",
|
||||
cc->visual->depth, cc->num_colors));
|
||||
|
||||
/* check if we need to initialize a hash table */
|
||||
|
||||
if ((cc->mode == GDK_CC_MODE_STD_CMAP) || (cc->mode == GDK_CC_MODE_UNDEFINED))
|
||||
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
|
||||
|
||||
return (GdkColorContext *) cc;
|
||||
}
|
||||
|
||||
@@ -677,17 +673,9 @@ gdk_color_context_free (GdkColorContext *cc)
|
||||
gdk_colormap_unref (cc->colormap);
|
||||
|
||||
/* free any palette that has been associated with this GdkColorContext */
|
||||
|
||||
|
||||
init_palette (cc);
|
||||
|
||||
if (cc->color_hash)
|
||||
{
|
||||
g_hash_table_foreach (cc->color_hash,
|
||||
free_hash_entry,
|
||||
NULL);
|
||||
g_hash_table_destroy (cc->color_hash);
|
||||
}
|
||||
|
||||
g_free (cc);
|
||||
}
|
||||
|
||||
@@ -780,13 +768,14 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
|
||||
default:
|
||||
{
|
||||
GdkColor color;
|
||||
GdkColor *result;
|
||||
GdkColor *result = NULL;
|
||||
|
||||
color.red = red;
|
||||
color.green = green;
|
||||
color.blue = blue;
|
||||
|
||||
result = g_hash_table_lookup (cc->color_hash, &color);
|
||||
|
||||
if (cc->color_hash)
|
||||
result = g_hash_table_lookup (cc->color_hash, &color);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -831,6 +820,9 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
|
||||
|
||||
cnew = g_new (GdkColor, 1);
|
||||
*cnew = color;
|
||||
|
||||
if (!cc->color_hash)
|
||||
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
|
||||
g_hash_table_insert (cc->color_hash, cnew, cnew);
|
||||
|
||||
cc->clut[cc->num_allocated] = color.pixel;
|
||||
@@ -1489,20 +1481,7 @@ gdk_color_context_add_palette (GdkColorContext *cc,
|
||||
/* restore previous mode if we aren't adding a new palette */
|
||||
|
||||
if (num_palette == 0)
|
||||
{
|
||||
/* GDK_CC_MODE_STD_CMAP uses a hash table, so we'd better initialize one */
|
||||
|
||||
/* XXX: here, the hash table is already initialized */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize a hash table for this palette (we need one for allocating
|
||||
* the pixels in the palette using the current settings)
|
||||
*/
|
||||
|
||||
if (cc->color_hash == NULL)
|
||||
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
|
||||
return 0;
|
||||
|
||||
/* copy incoming palette */
|
||||
|
||||
@@ -1549,6 +1528,9 @@ gdk_color_context_add_palette (GdkColorContext *cc,
|
||||
|
||||
if (cc->color_hash)
|
||||
{
|
||||
g_hash_table_foreach (cc->color_hash,
|
||||
free_hash_entry,
|
||||
NULL);
|
||||
g_hash_table_destroy (cc->color_hash);
|
||||
cc->color_hash = NULL;
|
||||
}
|
||||
|
||||
+104
-102
@@ -70,7 +70,7 @@ gdk_colormap_new (GdkVisual *visual,
|
||||
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
|
||||
|
||||
colormap->size = visual->colormap_size;
|
||||
colormap->colors = g_new (GdkColor, colormap->size);
|
||||
colormap->colors = NULL;
|
||||
|
||||
switch (visual->type)
|
||||
{
|
||||
@@ -117,6 +117,7 @@ gdk_colormap_new (GdkVisual *visual,
|
||||
private->private_val = TRUE;
|
||||
private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window,
|
||||
xvisual, AllocAll);
|
||||
colormap->colors = g_new (GdkColor, colormap->size);
|
||||
|
||||
size = 1 << visual->red_prec;
|
||||
for (i = 0; i < size; i++)
|
||||
@@ -429,56 +430,7 @@ gdk_colors_alloc (GdkColormap *colormap,
|
||||
}
|
||||
}
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
||||
/* This is almost identical to gdk_colormap_free_colors.
|
||||
* Keep them in sync!
|
||||
*/
|
||||
void
|
||||
gdk_colors_free (GdkColormap *colormap,
|
||||
gulong *in_pixels,
|
||||
gint in_npixels,
|
||||
gulong planes)
|
||||
{
|
||||
GdkColormapPrivate *private;
|
||||
gulong *pixels;
|
||||
gint npixels = 0;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (in_pixels != NULL);
|
||||
|
||||
private = (GdkColormapPrivate*) colormap;
|
||||
|
||||
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
|
||||
(private->visual->type != GDK_VISUAL_GRAYSCALE))
|
||||
return;
|
||||
|
||||
pixels = g_new (gulong, in_npixels);
|
||||
|
||||
for (i=0; i<in_npixels; i++)
|
||||
{
|
||||
gulong pixel = in_pixels[i];
|
||||
|
||||
if (private->info[pixel].ref_count)
|
||||
{
|
||||
private->info[pixel].ref_count--;
|
||||
|
||||
if (private->info[pixel].ref_count == 0)
|
||||
{
|
||||
pixels[npixels++] = pixel;
|
||||
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
|
||||
g_hash_table_remove (private->hash, &colormap->colors[in_pixels[i]]);
|
||||
private->info[pixel].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npixels)
|
||||
XFreeColors (private->xdisplay, private->xcolormap,
|
||||
pixels, npixels, planes);
|
||||
g_free (pixels);
|
||||
return return_val != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -537,7 +489,7 @@ gdk_color_free (GdkColor *color)
|
||||
g_mem_chunk_free (color_chunk, color);
|
||||
}
|
||||
|
||||
gint
|
||||
gboolean
|
||||
gdk_color_white (GdkColormap *colormap,
|
||||
GdkColor *color)
|
||||
{
|
||||
@@ -560,7 +512,7 @@ gdk_color_white (GdkColormap *colormap,
|
||||
return return_val;
|
||||
}
|
||||
|
||||
gint
|
||||
gboolean
|
||||
gdk_color_black (GdkColormap *colormap,
|
||||
GdkColor *color)
|
||||
{
|
||||
@@ -609,6 +561,104 @@ gdk_color_parse (const gchar *spec,
|
||||
return return_val;
|
||||
}
|
||||
|
||||
/* This is almost identical to gdk_colormap_free_colors.
|
||||
* Keep them in sync!
|
||||
*/
|
||||
void
|
||||
gdk_colors_free (GdkColormap *colormap,
|
||||
gulong *in_pixels,
|
||||
gint in_npixels,
|
||||
gulong planes)
|
||||
{
|
||||
GdkColormapPrivate *private;
|
||||
gulong *pixels;
|
||||
gint npixels = 0;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (in_pixels != NULL);
|
||||
|
||||
private = (GdkColormapPrivate*) colormap;
|
||||
|
||||
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
|
||||
(private->visual->type != GDK_VISUAL_GRAYSCALE))
|
||||
return;
|
||||
|
||||
pixels = g_new (gulong, in_npixels);
|
||||
|
||||
for (i=0; i<in_npixels; i++)
|
||||
{
|
||||
gulong pixel = in_pixels[i];
|
||||
|
||||
if (private->info[pixel].ref_count)
|
||||
{
|
||||
private->info[pixel].ref_count--;
|
||||
|
||||
if (private->info[pixel].ref_count == 0)
|
||||
{
|
||||
pixels[npixels++] = pixel;
|
||||
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
|
||||
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
|
||||
private->info[pixel].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npixels)
|
||||
XFreeColors (private->xdisplay, private->xcolormap,
|
||||
pixels, npixels, planes);
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
/* This is almost identical to gdk_colors_free.
|
||||
* Keep them in sync!
|
||||
*/
|
||||
void
|
||||
gdk_colormap_free_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors)
|
||||
{
|
||||
GdkColormapPrivate *private;
|
||||
gulong *pixels;
|
||||
gint npixels = 0;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (colors != NULL);
|
||||
|
||||
private = (GdkColormapPrivate*) colormap;
|
||||
|
||||
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
|
||||
(private->visual->type != GDK_VISUAL_GRAYSCALE))
|
||||
return;
|
||||
|
||||
pixels = g_new (gulong, ncolors);
|
||||
|
||||
for (i=0; i<ncolors; i++)
|
||||
{
|
||||
gulong pixel = colors[i].pixel;
|
||||
|
||||
if (private->info[pixel].ref_count)
|
||||
{
|
||||
private->info[pixel].ref_count--;
|
||||
|
||||
if (private->info[pixel].ref_count == 0)
|
||||
{
|
||||
pixels[npixels++] = pixel;
|
||||
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
|
||||
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
|
||||
private->info[pixel].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npixels)
|
||||
XFreeColors (private->xdisplay, private->xcolormap,
|
||||
pixels, npixels, 0);
|
||||
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
/********************
|
||||
* Color allocation *
|
||||
********************/
|
||||
@@ -649,6 +699,7 @@ gdk_colormap_alloc1 (GdkColormap *colormap,
|
||||
else
|
||||
{
|
||||
colormap->colors[ret->pixel] = *color;
|
||||
colormap->colors[ret->pixel].pixel = ret->pixel;
|
||||
private->info[ret->pixel].ref_count = 1;
|
||||
|
||||
g_hash_table_insert (private->hash,
|
||||
@@ -1026,55 +1077,6 @@ gdk_colormap_alloc_color (GdkColormap *colormap,
|
||||
return success;
|
||||
}
|
||||
|
||||
/* This is almost identical to gdk_colors_free.
|
||||
* Keep them in sync!
|
||||
*/
|
||||
void
|
||||
gdk_colormap_free_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors)
|
||||
{
|
||||
GdkColormapPrivate *private;
|
||||
gulong *pixels;
|
||||
gint npixels = 0;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (colors != NULL);
|
||||
|
||||
private = (GdkColormapPrivate*) colormap;
|
||||
|
||||
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
|
||||
(private->visual->type != GDK_VISUAL_GRAYSCALE))
|
||||
return;
|
||||
|
||||
pixels = g_new (gulong, ncolors);
|
||||
|
||||
for (i=0; i<ncolors; i++)
|
||||
{
|
||||
gulong pixel = colors[i].pixel;
|
||||
|
||||
if (private->info[pixel].ref_count)
|
||||
{
|
||||
private->info[pixel].ref_count--;
|
||||
|
||||
if (private->info[pixel].ref_count == 0)
|
||||
{
|
||||
pixels[npixels++] = pixel;
|
||||
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
|
||||
g_hash_table_remove (private->hash, &colors[i]);
|
||||
private->info[pixel].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npixels)
|
||||
XFreeColors (private->xdisplay, private->xcolormap,
|
||||
pixels, npixels, 0);
|
||||
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_color_alloc (GdkColormap *colormap,
|
||||
GdkColor *color)
|
||||
|
||||
+38
-38
@@ -31,8 +31,6 @@
|
||||
#include "gdk/gdkprivate.h"
|
||||
#include "gdk.h"
|
||||
|
||||
#define NEW_DRAGS
|
||||
|
||||
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
|
||||
|
||||
typedef enum {
|
||||
@@ -70,7 +68,8 @@ struct _GdkDragContextPrivate {
|
||||
GdkDragAction old_actions; /* The last actions we sent to the source */
|
||||
GdkDragAction xdnd_actions; /* What is currently set in XdndActionList */
|
||||
|
||||
Window dest_xid;
|
||||
Window dest_xid; /* The last window we looked up */
|
||||
Window drop_xid; /* The (non-proxied) window that is receiving drops */
|
||||
guint xdnd_targets_set : 1; /* Whether we've already set XdndTypeList */
|
||||
guint xdnd_actions_set : 1; /* Whether we've already set XdndActionList */
|
||||
guint xdnd_have_actions : 1; /* Whether an XdndActionList was provided */
|
||||
@@ -151,6 +150,7 @@ gdk_drag_context_unref (GdkDragContext *context)
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
g_return_if_fail (context != NULL);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count--;
|
||||
|
||||
@@ -196,8 +196,8 @@ gdk_drag_context_find (gboolean is_source,
|
||||
private = (GdkDragContextPrivate *)context;
|
||||
|
||||
context_dest_xid = context->dest_window ?
|
||||
(private->dest_xid ?
|
||||
private->dest_xid :
|
||||
(private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)) :
|
||||
None;
|
||||
|
||||
@@ -387,7 +387,7 @@ gdk_window_cache_new (void)
|
||||
xwa.x, xwa.y, xwa.width, xwa.height,
|
||||
xwa.map_state != IsUnmapped);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
gdk_error_code = 0;
|
||||
else
|
||||
{
|
||||
@@ -441,9 +441,10 @@ get_client_window_at_coords_recurse (Window win,
|
||||
wm_state_atom, 0, 0, False, AnyPropertyType,
|
||||
&type, &format, &nitems, &after, &data);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -458,9 +459,10 @@ get_client_window_at_coords_recurse (Window win,
|
||||
XTranslateCoordinates (gdk_display, gdk_root_window, win,
|
||||
x_root, y_root, &dest_x, &dest_y, &child);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -469,7 +471,7 @@ get_client_window_at_coords_recurse (Window win,
|
||||
&root, &tmp_parent, &children, &nchildren) == 0)
|
||||
return 0;
|
||||
|
||||
if (gdk_error_code == 0)
|
||||
if (!gdk_error_code)
|
||||
{
|
||||
for (i = nchildren - 1; (i >= 0) && (child == None); i--)
|
||||
{
|
||||
@@ -477,7 +479,7 @@ get_client_window_at_coords_recurse (Window win,
|
||||
|
||||
XGetWindowAttributes (gdk_display, children[i], &xwa);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
gdk_error_code = 0;
|
||||
else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
|
||||
(x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
|
||||
@@ -566,9 +568,10 @@ get_client_window_at_coords_recurse (Window win,
|
||||
wm_state_atom, 0, 0, False, AnyPropertyType,
|
||||
&type, &format, &nitems, &after, &data);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -581,9 +584,10 @@ get_client_window_at_coords_recurse (Window win,
|
||||
XTranslateCoordinates (gdk_display, gdk_root_window, win,
|
||||
x_root, y_root, &dest_x, &dest_y, &child);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -620,7 +624,7 @@ get_client_window_at_coords (Window ignore,
|
||||
|
||||
XGetWindowAttributes (gdk_display, children[i], &xwa);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
gdk_error_code = 0;
|
||||
else if ((xwa.map_state == IsViewable) &&
|
||||
(x_root >= xwa.x) && (x_root < xwa.x + (gint)xwa.width) &&
|
||||
@@ -869,7 +873,7 @@ motif_find_drag_window (gboolean create)
|
||||
|
||||
Display *display;
|
||||
XSetWindowAttributes attr;
|
||||
display = XOpenDisplay (NULL);
|
||||
display = XOpenDisplay (gdk_display_name);
|
||||
XSetCloseDownMode (display, RetainPermanent);
|
||||
|
||||
XGrabServer (display);
|
||||
@@ -2027,6 +2031,8 @@ xdnd_set_targets (GdkDragContext *context)
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(guchar *)atomlist, n_atoms);
|
||||
|
||||
g_free (atomlist);
|
||||
|
||||
private->xdnd_targets_set = 1;
|
||||
}
|
||||
|
||||
@@ -2073,6 +2079,8 @@ xdnd_set_actions (GdkDragContext *context)
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(guchar *)atomlist, n_atoms);
|
||||
|
||||
g_free (atomlist);
|
||||
|
||||
private->xdnd_actions_set = 1;
|
||||
private->xdnd_actions = context->actions;
|
||||
}
|
||||
@@ -2106,13 +2114,9 @@ xdnd_send_enter (GdkDragContext *context)
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
#ifdef NEW_DRAGS
|
||||
xev.xclient.window = private->dest_xid ?
|
||||
private->dest_xid :
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#else
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#endif
|
||||
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;
|
||||
@@ -2162,13 +2166,9 @@ xdnd_send_leave (GdkDragContext *context)
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
#ifdef NEW_DRAGS
|
||||
xev.xclient.window = private->dest_xid ?
|
||||
private->dest_xid :
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#else
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#endif
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = 0;
|
||||
@@ -2195,13 +2195,9 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
#ifdef NEW_DRAGS
|
||||
xev.xclient.window = private->dest_xid ?
|
||||
private->dest_xid :
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#else
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#endif
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = time;
|
||||
@@ -2232,13 +2228,9 @@ xdnd_send_motion (GdkDragContext *context,
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
#ifdef NEW_DRAGS
|
||||
xev.xclient.window = private->dest_xid ?
|
||||
private->dest_xid :
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#else
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#endif
|
||||
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;
|
||||
@@ -2859,6 +2851,12 @@ gdk_drag_find_window (GdkDragContext *context,
|
||||
|
||||
/* Check if new destination accepts drags, and which protocol */
|
||||
|
||||
/* There is some ugliness here. We actually need to pass
|
||||
* _three_ pieces of information to drag_motion - dest_window,
|
||||
* protocol, and the XID of the unproxied window. The first
|
||||
* two are passed explicitely, the third implicitly through
|
||||
* protocol->dest_xid.
|
||||
*/
|
||||
if ((recipient = gdk_drag_get_protocol (dest, protocol)))
|
||||
{
|
||||
*dest_window = gdk_window_lookup (recipient);
|
||||
@@ -2917,6 +2915,7 @@ gdk_drag_motion (GdkDragContext *context,
|
||||
if (dest_window)
|
||||
{
|
||||
context->dest_window = dest_window;
|
||||
private->drop_xid = private->dest_xid;
|
||||
gdk_window_ref (context->dest_window);
|
||||
context->protocol = protocol;
|
||||
|
||||
@@ -2941,6 +2940,7 @@ gdk_drag_motion (GdkDragContext *context,
|
||||
else
|
||||
{
|
||||
context->dest_window = NULL;
|
||||
private->drop_xid = None;
|
||||
context->action = 0;
|
||||
}
|
||||
|
||||
|
||||
+7
-5
@@ -501,12 +501,14 @@ gdk_draw_lines (GdkDrawable *drawable,
|
||||
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);
|
||||
drawable_private->xwindow,
|
||||
gc_private->xgc,
|
||||
(XPoint *) points,
|
||||
npoints,
|
||||
CoordModeOrigin);
|
||||
}
|
||||
|
||||
+112
-65
@@ -27,7 +27,6 @@
|
||||
#include "gdk.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkinput.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
@@ -37,6 +36,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "gdkinput.h"
|
||||
|
||||
typedef struct _GdkIOClosure GdkIOClosure;
|
||||
typedef struct _GdkEventPrivate GdkEventPrivate;
|
||||
@@ -88,9 +88,11 @@ static GdkEvent* gdk_event_unqueue (void);
|
||||
|
||||
static gboolean gdk_event_prepare (gpointer source_data,
|
||||
GTimeVal *current_time,
|
||||
gint *timeout);
|
||||
gint *timeout,
|
||||
gpointer user_data);
|
||||
static gboolean gdk_event_check (gpointer source_data,
|
||||
GTimeVal *current_time);
|
||||
GTimeVal *current_time,
|
||||
gpointer user_data);
|
||||
static gboolean gdk_event_dispatch (gpointer source_data,
|
||||
GTimeVal *current_time,
|
||||
gpointer user_data);
|
||||
@@ -434,6 +436,10 @@ gdk_compress_exposures (XEvent *xevent,
|
||||
rect1.width = xevent->xexpose.width;
|
||||
rect1.height = xevent->xexpose.height;
|
||||
|
||||
event.any.type = GDK_EXPOSE;
|
||||
event.any.window = None;
|
||||
event.any.send_event = FALSE;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (count == 0)
|
||||
@@ -449,6 +455,8 @@ gdk_compress_exposures (XEvent *xevent,
|
||||
&tmp_event,
|
||||
expose_predicate,
|
||||
(XPointer)&info);
|
||||
|
||||
event.any.window = window;
|
||||
|
||||
/* We apply filters here, and if it was filtered, completely
|
||||
* ignore the return
|
||||
@@ -849,6 +857,12 @@ gdk_io_destroy (gpointer data)
|
||||
g_free (closure);
|
||||
}
|
||||
|
||||
/* What do we do with G_IO_NVAL?
|
||||
*/
|
||||
#define READ_CONDITION (G_IO_IN | G_IO_HUP | G_IO_ERR)
|
||||
#define WRITE_CONDITION (G_IO_OUT | G_IO_ERR)
|
||||
#define EXCEPTION_CONDITION (G_IO_PRI)
|
||||
|
||||
static gboolean
|
||||
gdk_io_invoke (GIOChannel *source,
|
||||
GIOCondition condition,
|
||||
@@ -857,11 +871,11 @@ gdk_io_invoke (GIOChannel *source,
|
||||
GdkIOClosure *closure = data;
|
||||
GdkInputCondition gdk_cond = 0;
|
||||
|
||||
if (condition & (G_IO_IN | G_IO_PRI))
|
||||
if (condition & READ_CONDITION)
|
||||
gdk_cond |= GDK_INPUT_READ;
|
||||
if (condition & G_IO_OUT)
|
||||
if (condition & WRITE_CONDITION)
|
||||
gdk_cond |= GDK_INPUT_WRITE;
|
||||
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
|
||||
if (condition & EXCEPTION_CONDITION)
|
||||
gdk_cond |= GDK_INPUT_EXCEPTION;
|
||||
|
||||
if (closure->condition & gdk_cond)
|
||||
@@ -888,11 +902,11 @@ gdk_input_add_full (gint source,
|
||||
closure->data = data;
|
||||
|
||||
if (condition & GDK_INPUT_READ)
|
||||
cond |= (G_IO_IN | G_IO_PRI);
|
||||
cond |= READ_CONDITION;
|
||||
if (condition & GDK_INPUT_WRITE)
|
||||
cond |= G_IO_OUT;
|
||||
cond |= WRITE_CONDITION;
|
||||
if (condition & GDK_INPUT_EXCEPTION)
|
||||
cond |= G_IO_ERR|G_IO_HUP|G_IO_NVAL;
|
||||
cond |= EXCEPTION_CONDITION;
|
||||
|
||||
channel = g_io_channel_unix_new (source);
|
||||
result = g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, cond,
|
||||
@@ -923,7 +937,6 @@ gdk_event_apply_filters (XEvent *xevent,
|
||||
GdkEvent *event,
|
||||
GList *filters)
|
||||
{
|
||||
GdkEventFilter *filter;
|
||||
GList *tmp_list;
|
||||
GdkFilterReturn result;
|
||||
|
||||
@@ -931,13 +944,12 @@ gdk_event_apply_filters (XEvent *xevent,
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
filter = (GdkEventFilter*) tmp_list->data;
|
||||
|
||||
result = (*filter->function) (xevent, event, filter->data);
|
||||
if (result != GDK_FILTER_CONTINUE)
|
||||
return result;
|
||||
GdkEventFilter *filter = (GdkEventFilter*) tmp_list->data;
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
result = filter->function (xevent, event, filter->data);
|
||||
if (result != GDK_FILTER_CONTINUE)
|
||||
return result;
|
||||
}
|
||||
|
||||
return GDK_FILTER_CONTINUE;
|
||||
@@ -1002,7 +1014,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
gdk_window_ref (window);
|
||||
|
||||
event->any.window = window;
|
||||
event->any.send_event = xevent->xany.send_event;
|
||||
event->any.send_event = xevent->xany.send_event ? TRUE : FALSE;
|
||||
|
||||
if (window_private && window_private->destroyed)
|
||||
{
|
||||
@@ -1057,9 +1069,6 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (window == NULL)
|
||||
g_message ("Got event for unknown window: %#lx\n", xevent->xany.window);
|
||||
|
||||
/* We do a "manual" conversion of the XEvent to a
|
||||
* GdkEvent. The structures are mostly the same so
|
||||
* the conversion is fairly straightforward. We also
|
||||
@@ -1513,10 +1522,11 @@ gdk_event_translate (GdkEvent *event,
|
||||
/* Print debugging info.
|
||||
*/
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d",
|
||||
g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d%s",
|
||||
xevent->xexpose.window, xevent->xexpose.count,
|
||||
xevent->xexpose.x, xevent->xexpose.y,
|
||||
xevent->xexpose.width, xevent->xexpose.height));
|
||||
xevent->xexpose.width, xevent->xexpose.height,
|
||||
event->any.send_event ? " (send)" : ""));
|
||||
gdk_compress_exposures (xevent, window);
|
||||
|
||||
event->expose.type = GDK_EXPOSE;
|
||||
@@ -1601,7 +1611,17 @@ gdk_event_translate (GdkEvent *event,
|
||||
break;
|
||||
|
||||
case CreateNotify:
|
||||
/* Not currently handled */
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("create notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d parent: %ld ovr: %d",
|
||||
xevent->xcreatewindow.window,
|
||||
xevent->xcreatewindow.x,
|
||||
xevent->xcreatewindow.y,
|
||||
xevent->xcreatewindow.width,
|
||||
xevent->xcreatewindow.height,
|
||||
xevent->xcreatewindow.border_width,
|
||||
xevent->xcreatewindow.parent,
|
||||
xevent->xcreatewindow.override_redirect));
|
||||
/* not really handled */
|
||||
break;
|
||||
|
||||
case DestroyNotify:
|
||||
@@ -1616,7 +1636,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
return_val = window_private && !window_private->destroyed;
|
||||
|
||||
if(window && window_private->xwindow != GDK_ROOT_WINDOW())
|
||||
if (window && window_private->xwindow != GDK_ROOT_WINDOW())
|
||||
gdk_window_destroy_notify (window);
|
||||
break;
|
||||
|
||||
@@ -1651,8 +1671,12 @@ gdk_event_translate (GdkEvent *event,
|
||||
/* Print debugging info.
|
||||
*/
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("reparent notify:\twindow: %ld",
|
||||
xevent->xreparent.window));
|
||||
g_message ("reparent notify:\twindow: %ld x,y: %d %d parent: %ld ovr: %d",
|
||||
xevent->xreparent.window,
|
||||
xevent->xreparent.x,
|
||||
xevent->xreparent.y,
|
||||
xevent->xreparent.parent,
|
||||
xevent->xreparent.override_redirect));
|
||||
|
||||
/* Not currently handled */
|
||||
return_val = FALSE;
|
||||
@@ -1661,9 +1685,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
case ConfigureNotify:
|
||||
/* Print debugging info.
|
||||
*/
|
||||
while ((XPending (gdk_display) > 0) &&
|
||||
XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
|
||||
ConfigureNotify, xevent))
|
||||
while (0 && /* don't reorder ConfigureNotify events at all */
|
||||
XPending (gdk_display) > 0 &&
|
||||
XCheckTypedWindowEvent (gdk_display, xevent->xany.window,
|
||||
ConfigureNotify, xevent))
|
||||
{
|
||||
GdkFilterReturn result;
|
||||
|
||||
@@ -1690,7 +1715,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d",
|
||||
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s",
|
||||
xevent->xconfigure.window,
|
||||
xevent->xconfigure.x,
|
||||
xevent->xconfigure.y,
|
||||
@@ -1698,14 +1723,19 @@ gdk_event_translate (GdkEvent *event,
|
||||
xevent->xconfigure.height,
|
||||
xevent->xconfigure.border_width,
|
||||
xevent->xconfigure.above,
|
||||
xevent->xconfigure.override_redirect));
|
||||
|
||||
if (!window_private->destroyed &&
|
||||
xevent->xconfigure.override_redirect,
|
||||
!window
|
||||
? " (discarding)"
|
||||
: window_private->window_type == GDK_WINDOW_CHILD
|
||||
? " (discarding child)"
|
||||
: ""));
|
||||
if (window &&
|
||||
!window_private->destroyed &&
|
||||
(window_private->extension_events != 0) &&
|
||||
gdk_input_vtable.configure_event)
|
||||
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
|
||||
|
||||
if (window_private->window_type == GDK_WINDOW_CHILD)
|
||||
if (!window || window_private->window_type == GDK_WINDOW_CHILD)
|
||||
return_val = FALSE;
|
||||
else
|
||||
{
|
||||
@@ -1721,17 +1751,23 @@ gdk_event_translate (GdkEvent *event,
|
||||
gint tx = 0;
|
||||
gint ty = 0;
|
||||
Window child_window = 0;
|
||||
|
||||
if (!XTranslateCoordinates (window_private->xdisplay,
|
||||
window_private->xwindow,
|
||||
gdk_root_window,
|
||||
0, 0,
|
||||
&tx, &ty,
|
||||
&child_window))
|
||||
g_warning ("GdkWindow %ld doesn't share root windows display?",
|
||||
window_private->xwindow);
|
||||
event->configure.x = tx;
|
||||
event->configure.y = ty;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
if (XTranslateCoordinates (window_private->xdisplay,
|
||||
window_private->xwindow,
|
||||
gdk_root_window,
|
||||
0, 0,
|
||||
&tx, &ty,
|
||||
&child_window))
|
||||
{
|
||||
if (!gdk_error_trap_pop ())
|
||||
{
|
||||
event->configure.x = tx;
|
||||
event->configure.y = ty;
|
||||
}
|
||||
}
|
||||
else
|
||||
gdk_error_trap_pop ();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1751,8 +1787,14 @@ gdk_event_translate (GdkEvent *event,
|
||||
/* Print debugging info.
|
||||
*/
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("property notify:\twindow: %ld",
|
||||
xevent->xproperty.window));
|
||||
gchar *atom = gdk_atom_name (xevent->xproperty.atom);
|
||||
g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s",
|
||||
xevent->xproperty.window,
|
||||
xevent->xproperty.atom,
|
||||
atom ? "\"" : "",
|
||||
atom ? atom : "unknown",
|
||||
atom ? "\"" : "");
|
||||
);
|
||||
|
||||
event->property.type = GDK_PROPERTY_NOTIFY;
|
||||
event->property.window = window;
|
||||
@@ -1910,8 +1952,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
GdkFilterReturn
|
||||
gdk_wm_protocols_filter (GdkXEvent *xev,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
XEvent *xevent = (XEvent *)xev;
|
||||
|
||||
@@ -1993,8 +2035,7 @@ gdk_events_queue (void)
|
||||
|
||||
event->any.type = GDK_NOTHING;
|
||||
event->any.window = NULL;
|
||||
event->any.send_event = FALSE;
|
||||
event->any.send_event = xevent.xany.send_event;
|
||||
event->any.send_event = xevent.xany.send_event ? TRUE : FALSE;
|
||||
|
||||
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
|
||||
|
||||
@@ -2017,7 +2058,8 @@ gdk_events_queue (void)
|
||||
static gboolean
|
||||
gdk_event_prepare (gpointer source_data,
|
||||
GTimeVal *current_time,
|
||||
gint *timeout)
|
||||
gint *timeout,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean retval;
|
||||
|
||||
@@ -2034,7 +2076,8 @@ gdk_event_prepare (gpointer source_data,
|
||||
|
||||
static gboolean
|
||||
gdk_event_check (gpointer source_data,
|
||||
GTimeVal *current_time)
|
||||
GTimeVal *current_time,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean retval;
|
||||
|
||||
@@ -2133,29 +2176,29 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
|
||||
guint level)
|
||||
{
|
||||
static GdkAtom wm_state_atom = GDK_NONE;
|
||||
|
||||
Atom type = None;
|
||||
int format;
|
||||
unsigned long nitems, after;
|
||||
unsigned char *data;
|
||||
|
||||
Window *ret_children, ret_root, ret_parent;
|
||||
unsigned int ret_nchildren;
|
||||
int i;
|
||||
|
||||
gint old_warnings = gdk_error_warnings;
|
||||
gboolean send = FALSE;
|
||||
gboolean found = FALSE;
|
||||
int i;
|
||||
|
||||
if (!wm_state_atom)
|
||||
wm_state_atom = gdk_atom_intern ("WM_STATE", FALSE);
|
||||
|
||||
gdk_error_warnings = FALSE;
|
||||
gdk_error_code = 0;
|
||||
XGetWindowProperty (gdk_display, xid, wm_state_atom, 0, 0, False, AnyPropertyType,
|
||||
&type, &format, &nitems, &after, &data);
|
||||
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
gdk_error_warnings = old_warnings;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2167,18 +2210,20 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
|
||||
else
|
||||
{
|
||||
/* OK, we're all set, now let's find some windows to send this to */
|
||||
if (XQueryTree(gdk_display, xid, &ret_root, &ret_parent,
|
||||
&ret_children, &ret_nchildren) != True)
|
||||
return FALSE;
|
||||
|
||||
if (gdk_error_code)
|
||||
return FALSE;
|
||||
if (XQueryTree (gdk_display, xid, &ret_root, &ret_parent,
|
||||
&ret_children, &ret_nchildren) != True ||
|
||||
gdk_error_code)
|
||||
{
|
||||
gdk_error_warnings = old_warnings;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for(i = 0; i < ret_nchildren; i++)
|
||||
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
|
||||
if (gdk_event_send_client_message_to_all_recurse (xev, ret_children[i], level + 1))
|
||||
found = TRUE;
|
||||
|
||||
XFree(ret_children);
|
||||
XFree (ret_children);
|
||||
}
|
||||
|
||||
if (send || (!found && (level == 1)))
|
||||
@@ -2187,6 +2232,8 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
|
||||
gdk_send_xevent (xid, False, NoEventMask, xev);
|
||||
}
|
||||
|
||||
gdk_error_warnings = old_warnings;
|
||||
|
||||
return (send || found);
|
||||
}
|
||||
|
||||
|
||||
+119
-18
@@ -29,32 +29,106 @@
|
||||
#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;
|
||||
|
||||
private = g_new (GdkFontPrivate, 1);
|
||||
font = (GdkFont*) private;
|
||||
g_return_val_if_fail (font_name != NULL, NULL);
|
||||
|
||||
private->xdisplay = gdk_display;
|
||||
private->xfont = XLoadQueryFont (private->xdisplay, font_name);
|
||||
private->ref_count = 1;
|
||||
font = gdk_font_hash_lookup (GDK_FONT_FONT, font_name);
|
||||
if (font)
|
||||
return font;
|
||||
|
||||
if (!private->xfont)
|
||||
xfont = XLoadQueryFont (gdk_display, font_name);
|
||||
if (xfont == NULL)
|
||||
return NULL;
|
||||
|
||||
font = gdk_font_lookup (xfont->fid);
|
||||
if (font != NULL)
|
||||
{
|
||||
g_free (font);
|
||||
return 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 = ((XFontStruct *) private->xfont)->ascent;
|
||||
font->descent = ((XFontStruct *) private->xfont)->descent;
|
||||
font->ascent = xfont->ascent;
|
||||
font->descent = xfont->descent;
|
||||
|
||||
gdk_xid_table_insert (&xfont->fid, font);
|
||||
}
|
||||
|
||||
gdk_xid_table_insert (&((XFontStruct *) private->xfont)->fid, font);
|
||||
gdk_font_hash_insert (GDK_FONT_FONT, font, font_name);
|
||||
|
||||
return font;
|
||||
}
|
||||
@@ -69,6 +143,10 @@ gdk_fontset_load (gchar *fontset_name)
|
||||
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;
|
||||
|
||||
@@ -111,8 +189,12 @@ gdk_fontset_load (gchar *fontset_name)
|
||||
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;
|
||||
}
|
||||
return font;
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
@@ -131,14 +213,16 @@ void
|
||||
gdk_font_unref (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
gdk_font_hash_remove (font->type, font);
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
@@ -195,8 +279,12 @@ gdk_font_equal (const GdkFont *fonta,
|
||||
}
|
||||
else if (fonta->type == GDK_FONT_FONTSET && fontb->type == GDK_FONT_FONTSET)
|
||||
{
|
||||
/* how to compare two fontsets ?? by basename or XFontSet ?? */
|
||||
return (((XFontSet) privatea->xfont) == ((XFontSet) privateb->xfont));
|
||||
gchar *namea, *nameb;
|
||||
|
||||
namea = XBaseFontNameListOfFontSet((XFontSet) privatea->xfont);
|
||||
nameb = XBaseFontNameListOfFontSet((XFontSet) privateb->xfont);
|
||||
|
||||
return (strcmp(namea, nameb) == 0);
|
||||
}
|
||||
else
|
||||
/* fontset != font */
|
||||
@@ -568,7 +656,20 @@ gdk_text_extents_wc (GdkFont *font,
|
||||
}
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
XwcTextExtents (fontset, text, text_length, &ink, &logical);
|
||||
|
||||
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)
|
||||
@@ -642,7 +743,7 @@ gdk_text_measure (GdkFont *font,
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
XmbTextExtents (fontset, text, text_length, &ink, &log);
|
||||
width = log.width;
|
||||
width = ink.x + ink.width;
|
||||
break;
|
||||
default:
|
||||
width = 0;
|
||||
|
||||
@@ -286,6 +286,7 @@ gdk_gc_unref (GdkGC *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;
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ GdkDndGlobals gdk_dnd = {None,None,None,
|
||||
{0,0}, {0,0},
|
||||
{0,0,0,0}, NULL, None, 0};
|
||||
gchar *gdk_progclass = NULL;
|
||||
gint gdk_error_code;
|
||||
gint gdk_error_code = 0;
|
||||
gint gdk_error_warnings = TRUE;
|
||||
gint gdk_null_window_warnings = TRUE;
|
||||
GList *gdk_default_filters = NULL;
|
||||
|
||||
+19
-11
@@ -386,7 +386,7 @@ gdk_im_real_open (void)
|
||||
|
||||
destroy_cb.callback = gdk_im_destroy_cb;
|
||||
destroy_cb.client_data = NULL;
|
||||
if (NULL != XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
|
||||
if (NULL != (void *) XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
|
||||
GDK_NOTE (XIM, g_warning ("Could not set destroy callback to IM. Be careful to not destroy your input method."));
|
||||
#endif
|
||||
|
||||
@@ -469,7 +469,7 @@ gdk_ic_real_new (GdkIC *ic)
|
||||
mask |= GDK_IC_PREEDIT_AREA_REQ;
|
||||
|
||||
preedit_area.x = attr->preedit_area.x;
|
||||
preedit_area.y = attr->preedit_area.x;
|
||||
preedit_area.y = attr->preedit_area.y;
|
||||
preedit_area.width = attr->preedit_area.width;
|
||||
preedit_area.height = attr->preedit_area.height;
|
||||
|
||||
@@ -484,7 +484,7 @@ gdk_ic_real_new (GdkIC *ic)
|
||||
mask |= GDK_IC_PREEDIT_POSITION_REQ;
|
||||
|
||||
preedit_area.x = attr->preedit_area.x;
|
||||
preedit_area.y = attr->preedit_area.x;
|
||||
preedit_area.y = attr->preedit_area.y;
|
||||
preedit_area.width = attr->preedit_area.width;
|
||||
preedit_area.height = attr->preedit_area.height;
|
||||
|
||||
@@ -506,7 +506,7 @@ gdk_ic_real_new (GdkIC *ic)
|
||||
mask |= GDK_IC_STATUS_AREA_REQ;
|
||||
|
||||
status_area.x = attr->status_area.x;
|
||||
status_area.y = attr->status_area.x;
|
||||
status_area.y = attr->status_area.y;
|
||||
status_area.width = attr->status_area.width;
|
||||
status_area.height = attr->status_area.height;
|
||||
|
||||
@@ -518,6 +518,12 @@ gdk_ic_real_new (GdkIC *ic)
|
||||
break;
|
||||
}
|
||||
|
||||
/* We have to ensure that the client window is actually created on
|
||||
* the X server, or XCreateIC fails because the XIM server can't get
|
||||
* information about the client window.
|
||||
*/
|
||||
gdk_flush();
|
||||
|
||||
if (preedit_attr != NULL && status_attr != NULL)
|
||||
private->xic = XCreateIC (xim_im,
|
||||
XNInputStyle,
|
||||
@@ -871,7 +877,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNFontSet;
|
||||
arg->value = (gpointer) GDK_FONT_XFONT(attr->status_fontset);
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_FONTSET;
|
||||
}
|
||||
|
||||
@@ -887,7 +893,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNArea;
|
||||
arg->value = (gpointer) ▭
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_AREA;
|
||||
}
|
||||
|
||||
@@ -903,7 +909,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNArea;
|
||||
arg->value = (gpointer) ▭
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_AREA_NEEDED;
|
||||
else
|
||||
private->mask &= ~GDK_IC_STATUS_AREA_NEEDED;
|
||||
@@ -914,7 +920,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNForeground;
|
||||
arg->value = (gpointer) attr->status_foreground.pixel;
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_FOREGROUND;
|
||||
}
|
||||
|
||||
@@ -923,7 +929,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNBackground;
|
||||
arg->value = (gpointer) attr->status_background.pixel;
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_BACKGROUND;
|
||||
}
|
||||
|
||||
@@ -932,7 +938,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNBackgroundPixmap;
|
||||
arg->value = (gpointer) GDK_WINDOW_XWINDOW(attr->status_pixmap);
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_PIXMAP;
|
||||
}
|
||||
|
||||
@@ -941,7 +947,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNColormap;
|
||||
arg->value = (gpointer) GDK_COLORMAP_XCOLORMAP(attr->status_colormap);
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_COLORMAP;
|
||||
}
|
||||
|
||||
@@ -1565,8 +1571,10 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
|
||||
!= Success)
|
||||
{
|
||||
/* InvalidChar */
|
||||
XFree(tpr.value);
|
||||
return -1;
|
||||
}
|
||||
XFree(tpr.value);
|
||||
if (num_wstrs == 0)
|
||||
return 0;
|
||||
wstr_src = wstrs[0];
|
||||
|
||||
+4
-20
@@ -251,14 +251,12 @@ gdk_image_new (GdkImageType type,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdk_error_code = 0;
|
||||
gdk_error_warnings = 0;
|
||||
gdk_error_trap_push ();
|
||||
|
||||
XShmAttach (private->xdisplay, x_shm_info);
|
||||
XSync (private->xdisplay, False);
|
||||
|
||||
gdk_error_warnings = 1;
|
||||
if (gdk_error_code == -1)
|
||||
if (gdk_error_trap_pop ())
|
||||
{
|
||||
/* this is the common failure case so omit warning */
|
||||
XDestroyImage (private->ximage);
|
||||
@@ -269,6 +267,7 @@ gdk_image_new (GdkImageType type,
|
||||
g_free (image);
|
||||
|
||||
gdk_use_xshm = False;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -315,22 +314,7 @@ gdk_image_new (GdkImageType type,
|
||||
image->byte_order = private->ximage->byte_order;
|
||||
image->mem = private->ximage->data;
|
||||
image->bpl = private->ximage->bytes_per_line;
|
||||
|
||||
switch (private->ximage->bits_per_pixel)
|
||||
{
|
||||
case 8:
|
||||
image->bpp = 1;
|
||||
break;
|
||||
case 16:
|
||||
image->bpp = 2;
|
||||
break;
|
||||
case 24:
|
||||
image->bpp = 3;
|
||||
break;
|
||||
case 32:
|
||||
image->bpp = 4;
|
||||
break;
|
||||
}
|
||||
image->bpp = (private->ximage->bits_per_pixel + 7) / 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,6 +169,7 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
|
||||
gdkdev->info.num_axes = 0;
|
||||
gdkdev->info.num_keys = 0;
|
||||
gdkdev->info.axes = NULL;
|
||||
gdkdev->info.keys = NULL;
|
||||
gdkdev->axes = 0;
|
||||
gdkdev->info.has_cursor = 0;
|
||||
@@ -260,6 +261,8 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
g_free(gdkdev->axes);
|
||||
if (gdkdev->info.keys)
|
||||
g_free(gdkdev->info.keys);
|
||||
if (gdkdev->info.axes)
|
||||
g_free (gdkdev->info.axes);
|
||||
g_free(gdkdev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+3
-2
@@ -518,7 +518,7 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
|
||||
color_name = gdk_pixmap_extract_color (buffer);
|
||||
|
||||
if (color_name == NULL ||
|
||||
if (color_name == NULL || g_strcasecmp (color_name, "None") == 0 ||
|
||||
gdk_color_parse (color_name, &color->color) == FALSE)
|
||||
{
|
||||
color->color = *transparent_color;
|
||||
@@ -817,7 +817,8 @@ void
|
||||
gdk_pixmap_unref (GdkPixmap *pixmap)
|
||||
{
|
||||
GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
|
||||
g_return_if_fail(pixmap != NULL);
|
||||
g_return_if_fail (pixmap != NULL);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
|
||||
@@ -146,6 +146,8 @@ struct _GdkFontPrivate
|
||||
gpointer xfont;
|
||||
Display *xdisplay;
|
||||
guint ref_count;
|
||||
|
||||
GSList *names;
|
||||
};
|
||||
|
||||
struct _GdkCursorPrivate
|
||||
|
||||
+8
-7
@@ -45,15 +45,16 @@ gdk_atom_intern (const gchar *atom_name,
|
||||
{
|
||||
retval = XInternAtom (gdk_display, atom_name, only_if_exists);
|
||||
|
||||
g_hash_table_insert (atom_hash,
|
||||
g_strdup (atom_name),
|
||||
GUINT_TO_POINTER (retval));
|
||||
if (retval != None)
|
||||
g_hash_table_insert (atom_hash,
|
||||
g_strdup (atom_name),
|
||||
GUINT_TO_POINTER (retval));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gchar*
|
||||
gdk_atom_name (GdkAtom atom)
|
||||
{
|
||||
gchar *t;
|
||||
@@ -69,7 +70,7 @@ gdk_atom_name (GdkAtom atom)
|
||||
t = XGetAtomName (gdk_display, atom);
|
||||
gdk_error_warnings = old_error_warnings;
|
||||
|
||||
if (gdk_error_code == -1)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
if (t)
|
||||
XFree (t);
|
||||
@@ -162,10 +163,10 @@ gdk_property_get (GdkWindow *window,
|
||||
ret_length = ret_nitems;
|
||||
break;
|
||||
case 16:
|
||||
ret_length = 2 * ret_nitems;
|
||||
ret_length = sizeof(short) * ret_nitems;
|
||||
break;
|
||||
case 32:
|
||||
ret_length = 4 * ret_nitems;
|
||||
ret_length = sizeof(long) * ret_nitems;
|
||||
break;
|
||||
default:
|
||||
g_warning ("unknown property return format: %d", ret_format);
|
||||
|
||||
+9
-6
@@ -482,27 +482,30 @@ gdk_rgb_score_visual (GdkVisual *visual)
|
||||
static void
|
||||
gdk_rgb_choose_visual (void)
|
||||
{
|
||||
GList *visuals;
|
||||
GList *visuals, *tmp_list;
|
||||
guint32 score, best_score;
|
||||
GdkVisual *visual, *best_visual;
|
||||
|
||||
visuals = gdk_list_visuals ();
|
||||
tmp_list = visuals;
|
||||
|
||||
best_visual = visuals->data;
|
||||
best_visual = tmp_list->data;
|
||||
best_score = gdk_rgb_score_visual (best_visual);
|
||||
visuals = visuals->next;
|
||||
while (visuals)
|
||||
tmp_list = tmp_list->next;
|
||||
while (tmp_list)
|
||||
{
|
||||
visual = visuals->data;
|
||||
visual = tmp_list->data;
|
||||
score = gdk_rgb_score_visual (visual);
|
||||
if (score > best_score)
|
||||
{
|
||||
best_score = score;
|
||||
best_visual = visual;
|
||||
}
|
||||
visuals = visuals->next;
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
g_list_free (visuals);
|
||||
|
||||
image_info->visual = best_visual;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -105,11 +105,11 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
gulong length;
|
||||
GdkAtom prop_type;
|
||||
gint prop_format;
|
||||
guchar *t;
|
||||
guchar *t = NULL;
|
||||
|
||||
g_return_val_if_fail (requestor != NULL, 0);
|
||||
|
||||
/* If retrieved chunks are typically small, (and the ICCM says the
|
||||
/* 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 */
|
||||
|
||||
@@ -133,11 +133,11 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
*data = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (t)
|
||||
{
|
||||
t = NULL;
|
||||
XFree (t);
|
||||
t = NULL;
|
||||
}
|
||||
|
||||
/* Add on an extra byte to handle null termination. X guarantees
|
||||
@@ -188,7 +188,7 @@ gdk_selection_send_notify (guint32 requestor,
|
||||
xevent.property = property;
|
||||
xevent.time = time;
|
||||
|
||||
XSendEvent (gdk_display, requestor, False, NoEventMask, (XEvent*) &xevent);
|
||||
gdk_send_xevent (requestor, False, NoEventMask, (XEvent*) &xevent);
|
||||
}
|
||||
|
||||
gint
|
||||
|
||||
+34
-29
@@ -34,17 +34,9 @@
|
||||
#include "gdkprivate.h"
|
||||
#include "MwmUtil.h"
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
# if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# endif
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#ifdef HAVE_SHAPE_EXT
|
||||
@@ -707,10 +699,10 @@ gdk_window_destroy_notify (GdkWindow *window)
|
||||
|
||||
if (!private->destroyed)
|
||||
{
|
||||
if (private->window_type == GDK_WINDOW_FOREIGN)
|
||||
gdk_window_internal_destroy (window, FALSE, FALSE);
|
||||
else
|
||||
if (private->window_type != GDK_WINDOW_FOREIGN)
|
||||
g_warning ("GdkWindow %#lx unexpectedly destroyed", private->xwindow);
|
||||
|
||||
gdk_window_internal_destroy (window, FALSE, FALSE);
|
||||
}
|
||||
|
||||
gdk_xid_table_remove (private->xwindow);
|
||||
@@ -732,6 +724,7 @@ gdk_window_unref (GdkWindow *window)
|
||||
{
|
||||
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
@@ -1089,8 +1082,10 @@ gdk_window_set_hints (GdkWindow *window,
|
||||
size_hints.max_height = max_height;
|
||||
}
|
||||
|
||||
if (flags)
|
||||
XSetWMNormalHints (private->xdisplay, private->xwindow, &size_hints);
|
||||
/* FIXME: Would it be better to delete this property of
|
||||
* flags == 0? It would save space on the server
|
||||
*/
|
||||
XSetWMNormalHints (private->xdisplay, private->xwindow, &size_hints);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1110,7 +1105,15 @@ gdk_window_set_geometry_hints (GdkWindow *window,
|
||||
size_hints.flags = 0;
|
||||
|
||||
if (geom_mask & GDK_HINT_POS)
|
||||
size_hints.flags |= PPosition;
|
||||
{
|
||||
size_hints.flags |= PPosition;
|
||||
/* We need to initialize the following obsolete fields because KWM
|
||||
* apparently uses these fields if they are non-zero.
|
||||
* #@#!#!$!.
|
||||
*/
|
||||
size_hints.x = 0;
|
||||
size_hints.y = 0;
|
||||
}
|
||||
|
||||
if (geom_mask & GDK_HINT_MIN_SIZE)
|
||||
{
|
||||
@@ -1145,28 +1148,30 @@ gdk_window_set_geometry_hints (GdkWindow *window,
|
||||
size_hints.flags |= PAspect;
|
||||
if (geometry->min_aspect <= 1)
|
||||
{
|
||||
size_hints.min_aspect.x = G_MAXINT * geometry->min_aspect;
|
||||
size_hints.min_aspect.y = G_MAXINT;
|
||||
size_hints.min_aspect.x = 65536 * geometry->min_aspect;
|
||||
size_hints.min_aspect.y = 65536;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_hints.min_aspect.x = G_MAXINT;
|
||||
size_hints.min_aspect.y = G_MAXINT / geometry->min_aspect;;
|
||||
size_hints.min_aspect.x = 65536;
|
||||
size_hints.min_aspect.y = 65536 / geometry->min_aspect;;
|
||||
}
|
||||
if (geometry->max_aspect <= 1)
|
||||
{
|
||||
size_hints.max_aspect.x = G_MAXINT * geometry->max_aspect;
|
||||
size_hints.max_aspect.y = G_MAXINT;
|
||||
size_hints.max_aspect.x = 65536 * geometry->max_aspect;
|
||||
size_hints.max_aspect.y = 65536;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_hints.max_aspect.x = G_MAXINT;
|
||||
size_hints.max_aspect.y = G_MAXINT / geometry->max_aspect;;
|
||||
size_hints.max_aspect.x = 65536;
|
||||
size_hints.max_aspect.y = 65536 / geometry->max_aspect;;
|
||||
}
|
||||
}
|
||||
|
||||
if (geom_mask)
|
||||
XSetWMNormalHints (private->xdisplay, private->xwindow, &size_hints);
|
||||
|
||||
/* FIXME: Would it be better to delete this property of
|
||||
* geom_mask == 0? It would save space on the server
|
||||
*/
|
||||
XSetWMNormalHints (private->xdisplay, private->xwindow, &size_hints);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1988,7 +1993,7 @@ gdk_window_remove_filter (GdkWindow *window,
|
||||
if (private)
|
||||
private->filters = g_list_remove_link (private->filters, node);
|
||||
else
|
||||
gdk_default_filters = g_list_remove_link (gdk_default_filters, tmp_list);
|
||||
gdk_default_filters = g_list_remove_link (gdk_default_filters, node);
|
||||
g_list_free_1 (node);
|
||||
g_free (filter);
|
||||
|
||||
|
||||
+16
-34
@@ -491,10 +491,11 @@ init_palette (GdkColorContext *cc)
|
||||
|
||||
if (cc->color_hash)
|
||||
{
|
||||
/* XXX: quick-and-dirty way to remove everything */
|
||||
|
||||
g_hash_table_foreach (cc->color_hash,
|
||||
free_hash_entry,
|
||||
NULL);
|
||||
g_hash_table_destroy (cc->color_hash);
|
||||
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
|
||||
cc->color_hash = NULL;
|
||||
}
|
||||
|
||||
cc->palette = NULL;
|
||||
@@ -618,11 +619,6 @@ gdk_color_context_new (GdkVisual *visual,
|
||||
g_message ("gdk_color_context_new: screen depth is %i, no. of colors is %i\n",
|
||||
cc->visual->depth, cc->num_colors));
|
||||
|
||||
/* check if we need to initialize a hash table */
|
||||
|
||||
if ((cc->mode == GDK_CC_MODE_STD_CMAP) || (cc->mode == GDK_CC_MODE_UNDEFINED))
|
||||
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
|
||||
|
||||
return (GdkColorContext *) cc;
|
||||
}
|
||||
|
||||
@@ -677,17 +673,9 @@ gdk_color_context_free (GdkColorContext *cc)
|
||||
gdk_colormap_unref (cc->colormap);
|
||||
|
||||
/* free any palette that has been associated with this GdkColorContext */
|
||||
|
||||
|
||||
init_palette (cc);
|
||||
|
||||
if (cc->color_hash)
|
||||
{
|
||||
g_hash_table_foreach (cc->color_hash,
|
||||
free_hash_entry,
|
||||
NULL);
|
||||
g_hash_table_destroy (cc->color_hash);
|
||||
}
|
||||
|
||||
g_free (cc);
|
||||
}
|
||||
|
||||
@@ -780,13 +768,14 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
|
||||
default:
|
||||
{
|
||||
GdkColor color;
|
||||
GdkColor *result;
|
||||
GdkColor *result = NULL;
|
||||
|
||||
color.red = red;
|
||||
color.green = green;
|
||||
color.blue = blue;
|
||||
|
||||
result = g_hash_table_lookup (cc->color_hash, &color);
|
||||
|
||||
if (cc->color_hash)
|
||||
result = g_hash_table_lookup (cc->color_hash, &color);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -831,6 +820,9 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
|
||||
|
||||
cnew = g_new (GdkColor, 1);
|
||||
*cnew = color;
|
||||
|
||||
if (!cc->color_hash)
|
||||
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
|
||||
g_hash_table_insert (cc->color_hash, cnew, cnew);
|
||||
|
||||
cc->clut[cc->num_allocated] = color.pixel;
|
||||
@@ -1489,20 +1481,7 @@ gdk_color_context_add_palette (GdkColorContext *cc,
|
||||
/* restore previous mode if we aren't adding a new palette */
|
||||
|
||||
if (num_palette == 0)
|
||||
{
|
||||
/* GDK_CC_MODE_STD_CMAP uses a hash table, so we'd better initialize one */
|
||||
|
||||
/* XXX: here, the hash table is already initialized */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize a hash table for this palette (we need one for allocating
|
||||
* the pixels in the palette using the current settings)
|
||||
*/
|
||||
|
||||
if (cc->color_hash == NULL)
|
||||
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
|
||||
return 0;
|
||||
|
||||
/* copy incoming palette */
|
||||
|
||||
@@ -1549,6 +1528,9 @@ gdk_color_context_add_palette (GdkColorContext *cc,
|
||||
|
||||
if (cc->color_hash)
|
||||
{
|
||||
g_hash_table_foreach (cc->color_hash,
|
||||
free_hash_entry,
|
||||
NULL);
|
||||
g_hash_table_destroy (cc->color_hash);
|
||||
cc->color_hash = NULL;
|
||||
}
|
||||
|
||||
+104
-102
@@ -70,7 +70,7 @@ gdk_colormap_new (GdkVisual *visual,
|
||||
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
|
||||
|
||||
colormap->size = visual->colormap_size;
|
||||
colormap->colors = g_new (GdkColor, colormap->size);
|
||||
colormap->colors = NULL;
|
||||
|
||||
switch (visual->type)
|
||||
{
|
||||
@@ -117,6 +117,7 @@ gdk_colormap_new (GdkVisual *visual,
|
||||
private->private_val = TRUE;
|
||||
private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window,
|
||||
xvisual, AllocAll);
|
||||
colormap->colors = g_new (GdkColor, colormap->size);
|
||||
|
||||
size = 1 << visual->red_prec;
|
||||
for (i = 0; i < size; i++)
|
||||
@@ -429,56 +430,7 @@ gdk_colors_alloc (GdkColormap *colormap,
|
||||
}
|
||||
}
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
||||
/* This is almost identical to gdk_colormap_free_colors.
|
||||
* Keep them in sync!
|
||||
*/
|
||||
void
|
||||
gdk_colors_free (GdkColormap *colormap,
|
||||
gulong *in_pixels,
|
||||
gint in_npixels,
|
||||
gulong planes)
|
||||
{
|
||||
GdkColormapPrivate *private;
|
||||
gulong *pixels;
|
||||
gint npixels = 0;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (in_pixels != NULL);
|
||||
|
||||
private = (GdkColormapPrivate*) colormap;
|
||||
|
||||
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
|
||||
(private->visual->type != GDK_VISUAL_GRAYSCALE))
|
||||
return;
|
||||
|
||||
pixels = g_new (gulong, in_npixels);
|
||||
|
||||
for (i=0; i<in_npixels; i++)
|
||||
{
|
||||
gulong pixel = in_pixels[i];
|
||||
|
||||
if (private->info[pixel].ref_count)
|
||||
{
|
||||
private->info[pixel].ref_count--;
|
||||
|
||||
if (private->info[pixel].ref_count == 0)
|
||||
{
|
||||
pixels[npixels++] = pixel;
|
||||
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
|
||||
g_hash_table_remove (private->hash, &colormap->colors[in_pixels[i]]);
|
||||
private->info[pixel].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npixels)
|
||||
XFreeColors (private->xdisplay, private->xcolormap,
|
||||
pixels, npixels, planes);
|
||||
g_free (pixels);
|
||||
return return_val != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -537,7 +489,7 @@ gdk_color_free (GdkColor *color)
|
||||
g_mem_chunk_free (color_chunk, color);
|
||||
}
|
||||
|
||||
gint
|
||||
gboolean
|
||||
gdk_color_white (GdkColormap *colormap,
|
||||
GdkColor *color)
|
||||
{
|
||||
@@ -560,7 +512,7 @@ gdk_color_white (GdkColormap *colormap,
|
||||
return return_val;
|
||||
}
|
||||
|
||||
gint
|
||||
gboolean
|
||||
gdk_color_black (GdkColormap *colormap,
|
||||
GdkColor *color)
|
||||
{
|
||||
@@ -609,6 +561,104 @@ gdk_color_parse (const gchar *spec,
|
||||
return return_val;
|
||||
}
|
||||
|
||||
/* This is almost identical to gdk_colormap_free_colors.
|
||||
* Keep them in sync!
|
||||
*/
|
||||
void
|
||||
gdk_colors_free (GdkColormap *colormap,
|
||||
gulong *in_pixels,
|
||||
gint in_npixels,
|
||||
gulong planes)
|
||||
{
|
||||
GdkColormapPrivate *private;
|
||||
gulong *pixels;
|
||||
gint npixels = 0;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (in_pixels != NULL);
|
||||
|
||||
private = (GdkColormapPrivate*) colormap;
|
||||
|
||||
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
|
||||
(private->visual->type != GDK_VISUAL_GRAYSCALE))
|
||||
return;
|
||||
|
||||
pixels = g_new (gulong, in_npixels);
|
||||
|
||||
for (i=0; i<in_npixels; i++)
|
||||
{
|
||||
gulong pixel = in_pixels[i];
|
||||
|
||||
if (private->info[pixel].ref_count)
|
||||
{
|
||||
private->info[pixel].ref_count--;
|
||||
|
||||
if (private->info[pixel].ref_count == 0)
|
||||
{
|
||||
pixels[npixels++] = pixel;
|
||||
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
|
||||
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
|
||||
private->info[pixel].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npixels)
|
||||
XFreeColors (private->xdisplay, private->xcolormap,
|
||||
pixels, npixels, planes);
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
/* This is almost identical to gdk_colors_free.
|
||||
* Keep them in sync!
|
||||
*/
|
||||
void
|
||||
gdk_colormap_free_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors)
|
||||
{
|
||||
GdkColormapPrivate *private;
|
||||
gulong *pixels;
|
||||
gint npixels = 0;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (colors != NULL);
|
||||
|
||||
private = (GdkColormapPrivate*) colormap;
|
||||
|
||||
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
|
||||
(private->visual->type != GDK_VISUAL_GRAYSCALE))
|
||||
return;
|
||||
|
||||
pixels = g_new (gulong, ncolors);
|
||||
|
||||
for (i=0; i<ncolors; i++)
|
||||
{
|
||||
gulong pixel = colors[i].pixel;
|
||||
|
||||
if (private->info[pixel].ref_count)
|
||||
{
|
||||
private->info[pixel].ref_count--;
|
||||
|
||||
if (private->info[pixel].ref_count == 0)
|
||||
{
|
||||
pixels[npixels++] = pixel;
|
||||
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
|
||||
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
|
||||
private->info[pixel].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npixels)
|
||||
XFreeColors (private->xdisplay, private->xcolormap,
|
||||
pixels, npixels, 0);
|
||||
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
/********************
|
||||
* Color allocation *
|
||||
********************/
|
||||
@@ -649,6 +699,7 @@ gdk_colormap_alloc1 (GdkColormap *colormap,
|
||||
else
|
||||
{
|
||||
colormap->colors[ret->pixel] = *color;
|
||||
colormap->colors[ret->pixel].pixel = ret->pixel;
|
||||
private->info[ret->pixel].ref_count = 1;
|
||||
|
||||
g_hash_table_insert (private->hash,
|
||||
@@ -1026,55 +1077,6 @@ gdk_colormap_alloc_color (GdkColormap *colormap,
|
||||
return success;
|
||||
}
|
||||
|
||||
/* This is almost identical to gdk_colors_free.
|
||||
* Keep them in sync!
|
||||
*/
|
||||
void
|
||||
gdk_colormap_free_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors)
|
||||
{
|
||||
GdkColormapPrivate *private;
|
||||
gulong *pixels;
|
||||
gint npixels = 0;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (colors != NULL);
|
||||
|
||||
private = (GdkColormapPrivate*) colormap;
|
||||
|
||||
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
|
||||
(private->visual->type != GDK_VISUAL_GRAYSCALE))
|
||||
return;
|
||||
|
||||
pixels = g_new (gulong, ncolors);
|
||||
|
||||
for (i=0; i<ncolors; i++)
|
||||
{
|
||||
gulong pixel = colors[i].pixel;
|
||||
|
||||
if (private->info[pixel].ref_count)
|
||||
{
|
||||
private->info[pixel].ref_count--;
|
||||
|
||||
if (private->info[pixel].ref_count == 0)
|
||||
{
|
||||
pixels[npixels++] = pixel;
|
||||
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
|
||||
g_hash_table_remove (private->hash, &colors[i]);
|
||||
private->info[pixel].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npixels)
|
||||
XFreeColors (private->xdisplay, private->xcolormap,
|
||||
pixels, npixels, 0);
|
||||
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_color_alloc (GdkColormap *colormap,
|
||||
GdkColor *color)
|
||||
|
||||
+38
-38
@@ -31,8 +31,6 @@
|
||||
#include "gdk/gdkprivate.h"
|
||||
#include "gdk.h"
|
||||
|
||||
#define NEW_DRAGS
|
||||
|
||||
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
|
||||
|
||||
typedef enum {
|
||||
@@ -70,7 +68,8 @@ struct _GdkDragContextPrivate {
|
||||
GdkDragAction old_actions; /* The last actions we sent to the source */
|
||||
GdkDragAction xdnd_actions; /* What is currently set in XdndActionList */
|
||||
|
||||
Window dest_xid;
|
||||
Window dest_xid; /* The last window we looked up */
|
||||
Window drop_xid; /* The (non-proxied) window that is receiving drops */
|
||||
guint xdnd_targets_set : 1; /* Whether we've already set XdndTypeList */
|
||||
guint xdnd_actions_set : 1; /* Whether we've already set XdndActionList */
|
||||
guint xdnd_have_actions : 1; /* Whether an XdndActionList was provided */
|
||||
@@ -151,6 +150,7 @@ gdk_drag_context_unref (GdkDragContext *context)
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
|
||||
|
||||
g_return_if_fail (context != NULL);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count--;
|
||||
|
||||
@@ -196,8 +196,8 @@ gdk_drag_context_find (gboolean is_source,
|
||||
private = (GdkDragContextPrivate *)context;
|
||||
|
||||
context_dest_xid = context->dest_window ?
|
||||
(private->dest_xid ?
|
||||
private->dest_xid :
|
||||
(private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window)) :
|
||||
None;
|
||||
|
||||
@@ -387,7 +387,7 @@ gdk_window_cache_new (void)
|
||||
xwa.x, xwa.y, xwa.width, xwa.height,
|
||||
xwa.map_state != IsUnmapped);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
gdk_error_code = 0;
|
||||
else
|
||||
{
|
||||
@@ -441,9 +441,10 @@ get_client_window_at_coords_recurse (Window win,
|
||||
wm_state_atom, 0, 0, False, AnyPropertyType,
|
||||
&type, &format, &nitems, &after, &data);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -458,9 +459,10 @@ get_client_window_at_coords_recurse (Window win,
|
||||
XTranslateCoordinates (gdk_display, gdk_root_window, win,
|
||||
x_root, y_root, &dest_x, &dest_y, &child);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -469,7 +471,7 @@ get_client_window_at_coords_recurse (Window win,
|
||||
&root, &tmp_parent, &children, &nchildren) == 0)
|
||||
return 0;
|
||||
|
||||
if (gdk_error_code == 0)
|
||||
if (!gdk_error_code)
|
||||
{
|
||||
for (i = nchildren - 1; (i >= 0) && (child == None); i--)
|
||||
{
|
||||
@@ -477,7 +479,7 @@ get_client_window_at_coords_recurse (Window win,
|
||||
|
||||
XGetWindowAttributes (gdk_display, children[i], &xwa);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
gdk_error_code = 0;
|
||||
else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
|
||||
(x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
|
||||
@@ -566,9 +568,10 @@ get_client_window_at_coords_recurse (Window win,
|
||||
wm_state_atom, 0, 0, False, AnyPropertyType,
|
||||
&type, &format, &nitems, &after, &data);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -581,9 +584,10 @@ get_client_window_at_coords_recurse (Window win,
|
||||
XTranslateCoordinates (gdk_display, gdk_root_window, win,
|
||||
x_root, y_root, &dest_x, &dest_y, &child);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -620,7 +624,7 @@ get_client_window_at_coords (Window ignore,
|
||||
|
||||
XGetWindowAttributes (gdk_display, children[i], &xwa);
|
||||
|
||||
if (gdk_error_code != 0)
|
||||
if (gdk_error_code)
|
||||
gdk_error_code = 0;
|
||||
else if ((xwa.map_state == IsViewable) &&
|
||||
(x_root >= xwa.x) && (x_root < xwa.x + (gint)xwa.width) &&
|
||||
@@ -869,7 +873,7 @@ motif_find_drag_window (gboolean create)
|
||||
|
||||
Display *display;
|
||||
XSetWindowAttributes attr;
|
||||
display = XOpenDisplay (NULL);
|
||||
display = XOpenDisplay (gdk_display_name);
|
||||
XSetCloseDownMode (display, RetainPermanent);
|
||||
|
||||
XGrabServer (display);
|
||||
@@ -2027,6 +2031,8 @@ xdnd_set_targets (GdkDragContext *context)
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(guchar *)atomlist, n_atoms);
|
||||
|
||||
g_free (atomlist);
|
||||
|
||||
private->xdnd_targets_set = 1;
|
||||
}
|
||||
|
||||
@@ -2073,6 +2079,8 @@ xdnd_set_actions (GdkDragContext *context)
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(guchar *)atomlist, n_atoms);
|
||||
|
||||
g_free (atomlist);
|
||||
|
||||
private->xdnd_actions_set = 1;
|
||||
private->xdnd_actions = context->actions;
|
||||
}
|
||||
@@ -2106,13 +2114,9 @@ xdnd_send_enter (GdkDragContext *context)
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
#ifdef NEW_DRAGS
|
||||
xev.xclient.window = private->dest_xid ?
|
||||
private->dest_xid :
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#else
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#endif
|
||||
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;
|
||||
@@ -2162,13 +2166,9 @@ xdnd_send_leave (GdkDragContext *context)
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
#ifdef NEW_DRAGS
|
||||
xev.xclient.window = private->dest_xid ?
|
||||
private->dest_xid :
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#else
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#endif
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = 0;
|
||||
@@ -2195,13 +2195,9 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
#ifdef NEW_DRAGS
|
||||
xev.xclient.window = private->dest_xid ?
|
||||
private->dest_xid :
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#else
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#endif
|
||||
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = time;
|
||||
@@ -2232,13 +2228,9 @@ xdnd_send_motion (GdkDragContext *context,
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
|
||||
xev.xclient.format = 32;
|
||||
#ifdef NEW_DRAGS
|
||||
xev.xclient.window = private->dest_xid ?
|
||||
private->dest_xid :
|
||||
xev.xclient.window = private->drop_xid ?
|
||||
private->drop_xid :
|
||||
GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#else
|
||||
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
|
||||
#endif
|
||||
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;
|
||||
@@ -2859,6 +2851,12 @@ gdk_drag_find_window (GdkDragContext *context,
|
||||
|
||||
/* Check if new destination accepts drags, and which protocol */
|
||||
|
||||
/* There is some ugliness here. We actually need to pass
|
||||
* _three_ pieces of information to drag_motion - dest_window,
|
||||
* protocol, and the XID of the unproxied window. The first
|
||||
* two are passed explicitely, the third implicitly through
|
||||
* protocol->dest_xid.
|
||||
*/
|
||||
if ((recipient = gdk_drag_get_protocol (dest, protocol)))
|
||||
{
|
||||
*dest_window = gdk_window_lookup (recipient);
|
||||
@@ -2917,6 +2915,7 @@ gdk_drag_motion (GdkDragContext *context,
|
||||
if (dest_window)
|
||||
{
|
||||
context->dest_window = dest_window;
|
||||
private->drop_xid = private->dest_xid;
|
||||
gdk_window_ref (context->dest_window);
|
||||
context->protocol = protocol;
|
||||
|
||||
@@ -2941,6 +2940,7 @@ gdk_drag_motion (GdkDragContext *context,
|
||||
else
|
||||
{
|
||||
context->dest_window = NULL;
|
||||
private->drop_xid = None;
|
||||
context->action = 0;
|
||||
}
|
||||
|
||||
|
||||
+112
-65
@@ -27,7 +27,6 @@
|
||||
#include "gdk.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkinput.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
@@ -37,6 +36,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "gdkinput.h"
|
||||
|
||||
typedef struct _GdkIOClosure GdkIOClosure;
|
||||
typedef struct _GdkEventPrivate GdkEventPrivate;
|
||||
@@ -88,9 +88,11 @@ static GdkEvent* gdk_event_unqueue (void);
|
||||
|
||||
static gboolean gdk_event_prepare (gpointer source_data,
|
||||
GTimeVal *current_time,
|
||||
gint *timeout);
|
||||
gint *timeout,
|
||||
gpointer user_data);
|
||||
static gboolean gdk_event_check (gpointer source_data,
|
||||
GTimeVal *current_time);
|
||||
GTimeVal *current_time,
|
||||
gpointer user_data);
|
||||
static gboolean gdk_event_dispatch (gpointer source_data,
|
||||
GTimeVal *current_time,
|
||||
gpointer user_data);
|
||||
@@ -434,6 +436,10 @@ gdk_compress_exposures (XEvent *xevent,
|
||||
rect1.width = xevent->xexpose.width;
|
||||
rect1.height = xevent->xexpose.height;
|
||||
|
||||
event.any.type = GDK_EXPOSE;
|
||||
event.any.window = None;
|
||||
event.any.send_event = FALSE;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (count == 0)
|
||||
@@ -449,6 +455,8 @@ gdk_compress_exposures (XEvent *xevent,
|
||||
&tmp_event,
|
||||
expose_predicate,
|
||||
(XPointer)&info);
|
||||
|
||||
event.any.window = window;
|
||||
|
||||
/* We apply filters here, and if it was filtered, completely
|
||||
* ignore the return
|
||||
@@ -849,6 +857,12 @@ gdk_io_destroy (gpointer data)
|
||||
g_free (closure);
|
||||
}
|
||||
|
||||
/* What do we do with G_IO_NVAL?
|
||||
*/
|
||||
#define READ_CONDITION (G_IO_IN | G_IO_HUP | G_IO_ERR)
|
||||
#define WRITE_CONDITION (G_IO_OUT | G_IO_ERR)
|
||||
#define EXCEPTION_CONDITION (G_IO_PRI)
|
||||
|
||||
static gboolean
|
||||
gdk_io_invoke (GIOChannel *source,
|
||||
GIOCondition condition,
|
||||
@@ -857,11 +871,11 @@ gdk_io_invoke (GIOChannel *source,
|
||||
GdkIOClosure *closure = data;
|
||||
GdkInputCondition gdk_cond = 0;
|
||||
|
||||
if (condition & (G_IO_IN | G_IO_PRI))
|
||||
if (condition & READ_CONDITION)
|
||||
gdk_cond |= GDK_INPUT_READ;
|
||||
if (condition & G_IO_OUT)
|
||||
if (condition & WRITE_CONDITION)
|
||||
gdk_cond |= GDK_INPUT_WRITE;
|
||||
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
|
||||
if (condition & EXCEPTION_CONDITION)
|
||||
gdk_cond |= GDK_INPUT_EXCEPTION;
|
||||
|
||||
if (closure->condition & gdk_cond)
|
||||
@@ -888,11 +902,11 @@ gdk_input_add_full (gint source,
|
||||
closure->data = data;
|
||||
|
||||
if (condition & GDK_INPUT_READ)
|
||||
cond |= (G_IO_IN | G_IO_PRI);
|
||||
cond |= READ_CONDITION;
|
||||
if (condition & GDK_INPUT_WRITE)
|
||||
cond |= G_IO_OUT;
|
||||
cond |= WRITE_CONDITION;
|
||||
if (condition & GDK_INPUT_EXCEPTION)
|
||||
cond |= G_IO_ERR|G_IO_HUP|G_IO_NVAL;
|
||||
cond |= EXCEPTION_CONDITION;
|
||||
|
||||
channel = g_io_channel_unix_new (source);
|
||||
result = g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, cond,
|
||||
@@ -923,7 +937,6 @@ gdk_event_apply_filters (XEvent *xevent,
|
||||
GdkEvent *event,
|
||||
GList *filters)
|
||||
{
|
||||
GdkEventFilter *filter;
|
||||
GList *tmp_list;
|
||||
GdkFilterReturn result;
|
||||
|
||||
@@ -931,13 +944,12 @@ gdk_event_apply_filters (XEvent *xevent,
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
filter = (GdkEventFilter*) tmp_list->data;
|
||||
|
||||
result = (*filter->function) (xevent, event, filter->data);
|
||||
if (result != GDK_FILTER_CONTINUE)
|
||||
return result;
|
||||
GdkEventFilter *filter = (GdkEventFilter*) tmp_list->data;
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
result = filter->function (xevent, event, filter->data);
|
||||
if (result != GDK_FILTER_CONTINUE)
|
||||
return result;
|
||||
}
|
||||
|
||||
return GDK_FILTER_CONTINUE;
|
||||
@@ -1002,7 +1014,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
gdk_window_ref (window);
|
||||
|
||||
event->any.window = window;
|
||||
event->any.send_event = xevent->xany.send_event;
|
||||
event->any.send_event = xevent->xany.send_event ? TRUE : FALSE;
|
||||
|
||||
if (window_private && window_private->destroyed)
|
||||
{
|
||||
@@ -1057,9 +1069,6 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (window == NULL)
|
||||
g_message ("Got event for unknown window: %#lx\n", xevent->xany.window);
|
||||
|
||||
/* We do a "manual" conversion of the XEvent to a
|
||||
* GdkEvent. The structures are mostly the same so
|
||||
* the conversion is fairly straightforward. We also
|
||||
@@ -1513,10 +1522,11 @@ gdk_event_translate (GdkEvent *event,
|
||||
/* Print debugging info.
|
||||
*/
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d",
|
||||
g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d%s",
|
||||
xevent->xexpose.window, xevent->xexpose.count,
|
||||
xevent->xexpose.x, xevent->xexpose.y,
|
||||
xevent->xexpose.width, xevent->xexpose.height));
|
||||
xevent->xexpose.width, xevent->xexpose.height,
|
||||
event->any.send_event ? " (send)" : ""));
|
||||
gdk_compress_exposures (xevent, window);
|
||||
|
||||
event->expose.type = GDK_EXPOSE;
|
||||
@@ -1601,7 +1611,17 @@ gdk_event_translate (GdkEvent *event,
|
||||
break;
|
||||
|
||||
case CreateNotify:
|
||||
/* Not currently handled */
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("create notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d parent: %ld ovr: %d",
|
||||
xevent->xcreatewindow.window,
|
||||
xevent->xcreatewindow.x,
|
||||
xevent->xcreatewindow.y,
|
||||
xevent->xcreatewindow.width,
|
||||
xevent->xcreatewindow.height,
|
||||
xevent->xcreatewindow.border_width,
|
||||
xevent->xcreatewindow.parent,
|
||||
xevent->xcreatewindow.override_redirect));
|
||||
/* not really handled */
|
||||
break;
|
||||
|
||||
case DestroyNotify:
|
||||
@@ -1616,7 +1636,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
return_val = window_private && !window_private->destroyed;
|
||||
|
||||
if(window && window_private->xwindow != GDK_ROOT_WINDOW())
|
||||
if (window && window_private->xwindow != GDK_ROOT_WINDOW())
|
||||
gdk_window_destroy_notify (window);
|
||||
break;
|
||||
|
||||
@@ -1651,8 +1671,12 @@ gdk_event_translate (GdkEvent *event,
|
||||
/* Print debugging info.
|
||||
*/
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("reparent notify:\twindow: %ld",
|
||||
xevent->xreparent.window));
|
||||
g_message ("reparent notify:\twindow: %ld x,y: %d %d parent: %ld ovr: %d",
|
||||
xevent->xreparent.window,
|
||||
xevent->xreparent.x,
|
||||
xevent->xreparent.y,
|
||||
xevent->xreparent.parent,
|
||||
xevent->xreparent.override_redirect));
|
||||
|
||||
/* Not currently handled */
|
||||
return_val = FALSE;
|
||||
@@ -1661,9 +1685,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
case ConfigureNotify:
|
||||
/* Print debugging info.
|
||||
*/
|
||||
while ((XPending (gdk_display) > 0) &&
|
||||
XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
|
||||
ConfigureNotify, xevent))
|
||||
while (0 && /* don't reorder ConfigureNotify events at all */
|
||||
XPending (gdk_display) > 0 &&
|
||||
XCheckTypedWindowEvent (gdk_display, xevent->xany.window,
|
||||
ConfigureNotify, xevent))
|
||||
{
|
||||
GdkFilterReturn result;
|
||||
|
||||
@@ -1690,7 +1715,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d",
|
||||
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s",
|
||||
xevent->xconfigure.window,
|
||||
xevent->xconfigure.x,
|
||||
xevent->xconfigure.y,
|
||||
@@ -1698,14 +1723,19 @@ gdk_event_translate (GdkEvent *event,
|
||||
xevent->xconfigure.height,
|
||||
xevent->xconfigure.border_width,
|
||||
xevent->xconfigure.above,
|
||||
xevent->xconfigure.override_redirect));
|
||||
|
||||
if (!window_private->destroyed &&
|
||||
xevent->xconfigure.override_redirect,
|
||||
!window
|
||||
? " (discarding)"
|
||||
: window_private->window_type == GDK_WINDOW_CHILD
|
||||
? " (discarding child)"
|
||||
: ""));
|
||||
if (window &&
|
||||
!window_private->destroyed &&
|
||||
(window_private->extension_events != 0) &&
|
||||
gdk_input_vtable.configure_event)
|
||||
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
|
||||
|
||||
if (window_private->window_type == GDK_WINDOW_CHILD)
|
||||
if (!window || window_private->window_type == GDK_WINDOW_CHILD)
|
||||
return_val = FALSE;
|
||||
else
|
||||
{
|
||||
@@ -1721,17 +1751,23 @@ gdk_event_translate (GdkEvent *event,
|
||||
gint tx = 0;
|
||||
gint ty = 0;
|
||||
Window child_window = 0;
|
||||
|
||||
if (!XTranslateCoordinates (window_private->xdisplay,
|
||||
window_private->xwindow,
|
||||
gdk_root_window,
|
||||
0, 0,
|
||||
&tx, &ty,
|
||||
&child_window))
|
||||
g_warning ("GdkWindow %ld doesn't share root windows display?",
|
||||
window_private->xwindow);
|
||||
event->configure.x = tx;
|
||||
event->configure.y = ty;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
if (XTranslateCoordinates (window_private->xdisplay,
|
||||
window_private->xwindow,
|
||||
gdk_root_window,
|
||||
0, 0,
|
||||
&tx, &ty,
|
||||
&child_window))
|
||||
{
|
||||
if (!gdk_error_trap_pop ())
|
||||
{
|
||||
event->configure.x = tx;
|
||||
event->configure.y = ty;
|
||||
}
|
||||
}
|
||||
else
|
||||
gdk_error_trap_pop ();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1751,8 +1787,14 @@ gdk_event_translate (GdkEvent *event,
|
||||
/* Print debugging info.
|
||||
*/
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("property notify:\twindow: %ld",
|
||||
xevent->xproperty.window));
|
||||
gchar *atom = gdk_atom_name (xevent->xproperty.atom);
|
||||
g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s",
|
||||
xevent->xproperty.window,
|
||||
xevent->xproperty.atom,
|
||||
atom ? "\"" : "",
|
||||
atom ? atom : "unknown",
|
||||
atom ? "\"" : "");
|
||||
);
|
||||
|
||||
event->property.type = GDK_PROPERTY_NOTIFY;
|
||||
event->property.window = window;
|
||||
@@ -1910,8 +1952,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
GdkFilterReturn
|
||||
gdk_wm_protocols_filter (GdkXEvent *xev,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
XEvent *xevent = (XEvent *)xev;
|
||||
|
||||
@@ -1993,8 +2035,7 @@ gdk_events_queue (void)
|
||||
|
||||
event->any.type = GDK_NOTHING;
|
||||
event->any.window = NULL;
|
||||
event->any.send_event = FALSE;
|
||||
event->any.send_event = xevent.xany.send_event;
|
||||
event->any.send_event = xevent.xany.send_event ? TRUE : FALSE;
|
||||
|
||||
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
|
||||
|
||||
@@ -2017,7 +2058,8 @@ gdk_events_queue (void)
|
||||
static gboolean
|
||||
gdk_event_prepare (gpointer source_data,
|
||||
GTimeVal *current_time,
|
||||
gint *timeout)
|
||||
gint *timeout,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean retval;
|
||||
|
||||
@@ -2034,7 +2076,8 @@ gdk_event_prepare (gpointer source_data,
|
||||
|
||||
static gboolean
|
||||
gdk_event_check (gpointer source_data,
|
||||
GTimeVal *current_time)
|
||||
GTimeVal *current_time,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean retval;
|
||||
|
||||
@@ -2133,29 +2176,29 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
|
||||
guint level)
|
||||
{
|
||||
static GdkAtom wm_state_atom = GDK_NONE;
|
||||
|
||||
Atom type = None;
|
||||
int format;
|
||||
unsigned long nitems, after;
|
||||
unsigned char *data;
|
||||
|
||||
Window *ret_children, ret_root, ret_parent;
|
||||
unsigned int ret_nchildren;
|
||||
int i;
|
||||
|
||||
gint old_warnings = gdk_error_warnings;
|
||||
gboolean send = FALSE;
|
||||
gboolean found = FALSE;
|
||||
int i;
|
||||
|
||||
if (!wm_state_atom)
|
||||
wm_state_atom = gdk_atom_intern ("WM_STATE", FALSE);
|
||||
|
||||
gdk_error_warnings = FALSE;
|
||||
gdk_error_code = 0;
|
||||
XGetWindowProperty (gdk_display, xid, wm_state_atom, 0, 0, False, AnyPropertyType,
|
||||
&type, &format, &nitems, &after, &data);
|
||||
|
||||
if (gdk_error_code)
|
||||
{
|
||||
gdk_error_code = 0;
|
||||
gdk_error_warnings = old_warnings;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2167,18 +2210,20 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
|
||||
else
|
||||
{
|
||||
/* OK, we're all set, now let's find some windows to send this to */
|
||||
if (XQueryTree(gdk_display, xid, &ret_root, &ret_parent,
|
||||
&ret_children, &ret_nchildren) != True)
|
||||
return FALSE;
|
||||
|
||||
if (gdk_error_code)
|
||||
return FALSE;
|
||||
if (XQueryTree (gdk_display, xid, &ret_root, &ret_parent,
|
||||
&ret_children, &ret_nchildren) != True ||
|
||||
gdk_error_code)
|
||||
{
|
||||
gdk_error_warnings = old_warnings;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for(i = 0; i < ret_nchildren; i++)
|
||||
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
|
||||
if (gdk_event_send_client_message_to_all_recurse (xev, ret_children[i], level + 1))
|
||||
found = TRUE;
|
||||
|
||||
XFree(ret_children);
|
||||
XFree (ret_children);
|
||||
}
|
||||
|
||||
if (send || (!found && (level == 1)))
|
||||
@@ -2187,6 +2232,8 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
|
||||
gdk_send_xevent (xid, False, NoEventMask, xev);
|
||||
}
|
||||
|
||||
gdk_error_warnings = old_warnings;
|
||||
|
||||
return (send || found);
|
||||
}
|
||||
|
||||
|
||||
+119
-18
@@ -29,32 +29,106 @@
|
||||
#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;
|
||||
|
||||
private = g_new (GdkFontPrivate, 1);
|
||||
font = (GdkFont*) private;
|
||||
g_return_val_if_fail (font_name != NULL, NULL);
|
||||
|
||||
private->xdisplay = gdk_display;
|
||||
private->xfont = XLoadQueryFont (private->xdisplay, font_name);
|
||||
private->ref_count = 1;
|
||||
font = gdk_font_hash_lookup (GDK_FONT_FONT, font_name);
|
||||
if (font)
|
||||
return font;
|
||||
|
||||
if (!private->xfont)
|
||||
xfont = XLoadQueryFont (gdk_display, font_name);
|
||||
if (xfont == NULL)
|
||||
return NULL;
|
||||
|
||||
font = gdk_font_lookup (xfont->fid);
|
||||
if (font != NULL)
|
||||
{
|
||||
g_free (font);
|
||||
return 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 = ((XFontStruct *) private->xfont)->ascent;
|
||||
font->descent = ((XFontStruct *) private->xfont)->descent;
|
||||
font->ascent = xfont->ascent;
|
||||
font->descent = xfont->descent;
|
||||
|
||||
gdk_xid_table_insert (&xfont->fid, font);
|
||||
}
|
||||
|
||||
gdk_xid_table_insert (&((XFontStruct *) private->xfont)->fid, font);
|
||||
gdk_font_hash_insert (GDK_FONT_FONT, font, font_name);
|
||||
|
||||
return font;
|
||||
}
|
||||
@@ -69,6 +143,10 @@ gdk_fontset_load (gchar *fontset_name)
|
||||
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;
|
||||
|
||||
@@ -111,8 +189,12 @@ gdk_fontset_load (gchar *fontset_name)
|
||||
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;
|
||||
}
|
||||
return font;
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
@@ -131,14 +213,16 @@ void
|
||||
gdk_font_unref (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
gdk_font_hash_remove (font->type, font);
|
||||
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
@@ -195,8 +279,12 @@ gdk_font_equal (const GdkFont *fonta,
|
||||
}
|
||||
else if (fonta->type == GDK_FONT_FONTSET && fontb->type == GDK_FONT_FONTSET)
|
||||
{
|
||||
/* how to compare two fontsets ?? by basename or XFontSet ?? */
|
||||
return (((XFontSet) privatea->xfont) == ((XFontSet) privateb->xfont));
|
||||
gchar *namea, *nameb;
|
||||
|
||||
namea = XBaseFontNameListOfFontSet((XFontSet) privatea->xfont);
|
||||
nameb = XBaseFontNameListOfFontSet((XFontSet) privateb->xfont);
|
||||
|
||||
return (strcmp(namea, nameb) == 0);
|
||||
}
|
||||
else
|
||||
/* fontset != font */
|
||||
@@ -568,7 +656,20 @@ gdk_text_extents_wc (GdkFont *font,
|
||||
}
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
XwcTextExtents (fontset, text, text_length, &ink, &logical);
|
||||
|
||||
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)
|
||||
@@ -642,7 +743,7 @@ gdk_text_measure (GdkFont *font,
|
||||
case GDK_FONT_FONTSET:
|
||||
fontset = (XFontSet) private->xfont;
|
||||
XmbTextExtents (fontset, text, text_length, &ink, &log);
|
||||
width = log.width;
|
||||
width = ink.x + ink.width;
|
||||
break;
|
||||
default:
|
||||
width = 0;
|
||||
|
||||
@@ -57,7 +57,7 @@ GdkDndGlobals gdk_dnd = {None,None,None,
|
||||
{0,0}, {0,0},
|
||||
{0,0,0,0}, NULL, None, 0};
|
||||
gchar *gdk_progclass = NULL;
|
||||
gint gdk_error_code;
|
||||
gint gdk_error_code = 0;
|
||||
gint gdk_error_warnings = TRUE;
|
||||
gint gdk_null_window_warnings = TRUE;
|
||||
GList *gdk_default_filters = NULL;
|
||||
|
||||
+19
-11
@@ -386,7 +386,7 @@ gdk_im_real_open (void)
|
||||
|
||||
destroy_cb.callback = gdk_im_destroy_cb;
|
||||
destroy_cb.client_data = NULL;
|
||||
if (NULL != XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
|
||||
if (NULL != (void *) XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
|
||||
GDK_NOTE (XIM, g_warning ("Could not set destroy callback to IM. Be careful to not destroy your input method."));
|
||||
#endif
|
||||
|
||||
@@ -469,7 +469,7 @@ gdk_ic_real_new (GdkIC *ic)
|
||||
mask |= GDK_IC_PREEDIT_AREA_REQ;
|
||||
|
||||
preedit_area.x = attr->preedit_area.x;
|
||||
preedit_area.y = attr->preedit_area.x;
|
||||
preedit_area.y = attr->preedit_area.y;
|
||||
preedit_area.width = attr->preedit_area.width;
|
||||
preedit_area.height = attr->preedit_area.height;
|
||||
|
||||
@@ -484,7 +484,7 @@ gdk_ic_real_new (GdkIC *ic)
|
||||
mask |= GDK_IC_PREEDIT_POSITION_REQ;
|
||||
|
||||
preedit_area.x = attr->preedit_area.x;
|
||||
preedit_area.y = attr->preedit_area.x;
|
||||
preedit_area.y = attr->preedit_area.y;
|
||||
preedit_area.width = attr->preedit_area.width;
|
||||
preedit_area.height = attr->preedit_area.height;
|
||||
|
||||
@@ -506,7 +506,7 @@ gdk_ic_real_new (GdkIC *ic)
|
||||
mask |= GDK_IC_STATUS_AREA_REQ;
|
||||
|
||||
status_area.x = attr->status_area.x;
|
||||
status_area.y = attr->status_area.x;
|
||||
status_area.y = attr->status_area.y;
|
||||
status_area.width = attr->status_area.width;
|
||||
status_area.height = attr->status_area.height;
|
||||
|
||||
@@ -518,6 +518,12 @@ gdk_ic_real_new (GdkIC *ic)
|
||||
break;
|
||||
}
|
||||
|
||||
/* We have to ensure that the client window is actually created on
|
||||
* the X server, or XCreateIC fails because the XIM server can't get
|
||||
* information about the client window.
|
||||
*/
|
||||
gdk_flush();
|
||||
|
||||
if (preedit_attr != NULL && status_attr != NULL)
|
||||
private->xic = XCreateIC (xim_im,
|
||||
XNInputStyle,
|
||||
@@ -871,7 +877,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNFontSet;
|
||||
arg->value = (gpointer) GDK_FONT_XFONT(attr->status_fontset);
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_FONTSET;
|
||||
}
|
||||
|
||||
@@ -887,7 +893,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNArea;
|
||||
arg->value = (gpointer) ▭
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_AREA;
|
||||
}
|
||||
|
||||
@@ -903,7 +909,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNArea;
|
||||
arg->value = (gpointer) ▭
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_AREA_NEEDED;
|
||||
else
|
||||
private->mask &= ~GDK_IC_STATUS_AREA_NEEDED;
|
||||
@@ -914,7 +920,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNForeground;
|
||||
arg->value = (gpointer) attr->status_foreground.pixel;
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_FOREGROUND;
|
||||
}
|
||||
|
||||
@@ -923,7 +929,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNBackground;
|
||||
arg->value = (gpointer) attr->status_background.pixel;
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_BACKGROUND;
|
||||
}
|
||||
|
||||
@@ -932,7 +938,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNBackgroundPixmap;
|
||||
arg->value = (gpointer) GDK_WINDOW_XWINDOW(attr->status_pixmap);
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_PIXMAP;
|
||||
}
|
||||
|
||||
@@ -941,7 +947,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
|
||||
arg->name = XNColormap;
|
||||
arg->value = (gpointer) GDK_COLORMAP_XCOLORMAP(attr->status_colormap);
|
||||
|
||||
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
|
||||
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
|
||||
error |= GDK_IC_STATUS_COLORMAP;
|
||||
}
|
||||
|
||||
@@ -1565,8 +1571,10 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
|
||||
!= Success)
|
||||
{
|
||||
/* InvalidChar */
|
||||
XFree(tpr.value);
|
||||
return -1;
|
||||
}
|
||||
XFree(tpr.value);
|
||||
if (num_wstrs == 0)
|
||||
return 0;
|
||||
wstr_src = wstrs[0];
|
||||
|
||||
+4
-20
@@ -251,14 +251,12 @@ gdk_image_new (GdkImageType type,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gdk_error_code = 0;
|
||||
gdk_error_warnings = 0;
|
||||
gdk_error_trap_push ();
|
||||
|
||||
XShmAttach (private->xdisplay, x_shm_info);
|
||||
XSync (private->xdisplay, False);
|
||||
|
||||
gdk_error_warnings = 1;
|
||||
if (gdk_error_code == -1)
|
||||
if (gdk_error_trap_pop ())
|
||||
{
|
||||
/* this is the common failure case so omit warning */
|
||||
XDestroyImage (private->ximage);
|
||||
@@ -269,6 +267,7 @@ gdk_image_new (GdkImageType type,
|
||||
g_free (image);
|
||||
|
||||
gdk_use_xshm = False;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -315,22 +314,7 @@ gdk_image_new (GdkImageType type,
|
||||
image->byte_order = private->ximage->byte_order;
|
||||
image->mem = private->ximage->data;
|
||||
image->bpl = private->ximage->bytes_per_line;
|
||||
|
||||
switch (private->ximage->bits_per_pixel)
|
||||
{
|
||||
case 8:
|
||||
image->bpp = 1;
|
||||
break;
|
||||
case 16:
|
||||
image->bpp = 2;
|
||||
break;
|
||||
case 24:
|
||||
image->bpp = 3;
|
||||
break;
|
||||
case 32:
|
||||
image->bpp = 4;
|
||||
break;
|
||||
}
|
||||
image->bpp = (private->ximage->bits_per_pixel + 7) / 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,6 +169,7 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
|
||||
gdkdev->info.num_axes = 0;
|
||||
gdkdev->info.num_keys = 0;
|
||||
gdkdev->info.axes = NULL;
|
||||
gdkdev->info.keys = NULL;
|
||||
gdkdev->axes = 0;
|
||||
gdkdev->info.has_cursor = 0;
|
||||
@@ -260,6 +261,8 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
g_free(gdkdev->axes);
|
||||
if (gdkdev->info.keys)
|
||||
g_free(gdkdev->info.keys);
|
||||
if (gdkdev->info.axes)
|
||||
g_free (gdkdev->info.axes);
|
||||
g_free(gdkdev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+56
-18
@@ -31,6 +31,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
@@ -48,6 +49,7 @@
|
||||
#include "gdkinput.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdki18n.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
#ifndef X_GETTIMEOFDAY
|
||||
#define X_GETTIMEOFDAY(tv) gettimeofday (tv, NULL)
|
||||
@@ -333,6 +335,7 @@ gdk_init_check (int *argc,
|
||||
gdk_im_set_best_style (GDK_IM_PREEDIT_POSITION);
|
||||
else if (strcmp ("callbacks", (*argv)[i]) == 0)
|
||||
gdk_im_set_best_style (GDK_IM_PREEDIT_CALLBACKS);
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
}
|
||||
else if (strcmp ("--xim-status", (*argv)[i]) == 0)
|
||||
@@ -348,6 +351,7 @@ gdk_init_check (int *argc,
|
||||
gdk_im_set_best_style (GDK_IM_STATUS_AREA);
|
||||
else if (strcmp ("callbacks", (*argv)[i]) == 0)
|
||||
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -406,9 +410,9 @@ gdk_init_check (int *argc,
|
||||
g_free(argv_orig[i]);
|
||||
g_free(argv_orig);
|
||||
|
||||
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", True);
|
||||
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", True);
|
||||
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", True);
|
||||
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", False);
|
||||
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", False);
|
||||
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", False);
|
||||
gdk_wm_window_protocols[0] = gdk_wm_delete_window;
|
||||
gdk_wm_window_protocols[1] = gdk_wm_take_focus;
|
||||
gdk_selection_property = XInternAtom (gdk_display, "GDK_SELECTION", False);
|
||||
@@ -1032,20 +1036,35 @@ static int
|
||||
gdk_x_error (Display *display,
|
||||
XErrorEvent *error)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
if (gdk_error_warnings)
|
||||
if (error->error_code)
|
||||
{
|
||||
XGetErrorText (display, error->error_code, buf, 63);
|
||||
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
|
||||
buf,
|
||||
error->serial,
|
||||
error->error_code,
|
||||
error->request_code,
|
||||
error->minor_code);
|
||||
if (gdk_error_warnings)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
XGetErrorText (display, error->error_code, buf, 63);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
|
||||
buf,
|
||||
error->serial,
|
||||
error->error_code,
|
||||
error->request_code,
|
||||
error->minor_code);
|
||||
#else /* !G_ENABLE_DEBUG */
|
||||
fprintf (stderr, "Gdk-ERROR **: %s\n serial %ld error_code %d request_code %d minor_code %d\n",
|
||||
buf,
|
||||
error->serial,
|
||||
error->error_code,
|
||||
error->request_code,
|
||||
error->minor_code);
|
||||
|
||||
exit(1);
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
}
|
||||
gdk_error_code = error->error_code;
|
||||
}
|
||||
|
||||
gdk_error_code = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1071,8 +1090,27 @@ gdk_x_error (Display *display,
|
||||
static int
|
||||
gdk_x_io_error (Display *display)
|
||||
{
|
||||
g_error ("an x io error occurred");
|
||||
return 0;
|
||||
/* This is basically modelled after the code in XLib. We need
|
||||
* an explicit error handler here, so we can disable our atexit()
|
||||
* which would otherwise cause a nice segfault.
|
||||
* We fprintf(stderr, instead of g_warning() because g_warning()
|
||||
* could possibly be redirected to a dialog
|
||||
*/
|
||||
if (errno == EPIPE)
|
||||
{
|
||||
fprintf (stderr, "Gdk-ERROR **: X connection to %s broken (explicit kill or server shutdown).\n", gdk_display ? DisplayString (gdk_display) : gdk_get_display());
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "Gdk-ERROR **: Fatal IO error %d (%s) on X server %s.\n",
|
||||
errno, g_strerror (errno),
|
||||
gdk_display ? DisplayString (gdk_display) : gdk_get_display());
|
||||
}
|
||||
|
||||
/* Disable the atexit shutdown for GDK */
|
||||
gdk_initialized = 0;
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
gchar *
|
||||
@@ -1104,7 +1142,7 @@ gdk_error_trap_push (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
node = g_slist_alloc();
|
||||
node = g_slist_alloc ();
|
||||
node->data = g_new (GdkErrorTrap, 1);
|
||||
}
|
||||
|
||||
@@ -1166,7 +1204,7 @@ gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
|
||||
XSync (gdk_display, False);
|
||||
gdk_error_warnings = old_warnings;
|
||||
|
||||
return result && (gdk_error_code != -1);
|
||||
return result && !gdk_error_code;
|
||||
}
|
||||
|
||||
#ifndef HAVE_XCONVERTCASE
|
||||
|
||||
@@ -518,7 +518,7 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
|
||||
color_name = gdk_pixmap_extract_color (buffer);
|
||||
|
||||
if (color_name == NULL ||
|
||||
if (color_name == NULL || g_strcasecmp (color_name, "None") == 0 ||
|
||||
gdk_color_parse (color_name, &color->color) == FALSE)
|
||||
{
|
||||
color->color = *transparent_color;
|
||||
@@ -817,7 +817,8 @@ void
|
||||
gdk_pixmap_unref (GdkPixmap *pixmap)
|
||||
{
|
||||
GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
|
||||
g_return_if_fail(pixmap != NULL);
|
||||
g_return_if_fail (pixmap != NULL);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
|
||||
@@ -45,15 +45,16 @@ gdk_atom_intern (const gchar *atom_name,
|
||||
{
|
||||
retval = XInternAtom (gdk_display, atom_name, only_if_exists);
|
||||
|
||||
g_hash_table_insert (atom_hash,
|
||||
g_strdup (atom_name),
|
||||
GUINT_TO_POINTER (retval));
|
||||
if (retval != None)
|
||||
g_hash_table_insert (atom_hash,
|
||||
g_strdup (atom_name),
|
||||
GUINT_TO_POINTER (retval));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gchar*
|
||||
gdk_atom_name (GdkAtom atom)
|
||||
{
|
||||
gchar *t;
|
||||
@@ -69,7 +70,7 @@ gdk_atom_name (GdkAtom atom)
|
||||
t = XGetAtomName (gdk_display, atom);
|
||||
gdk_error_warnings = old_error_warnings;
|
||||
|
||||
if (gdk_error_code == -1)
|
||||
if (gdk_error_code)
|
||||
{
|
||||
if (t)
|
||||
XFree (t);
|
||||
@@ -162,10 +163,10 @@ gdk_property_get (GdkWindow *window,
|
||||
ret_length = ret_nitems;
|
||||
break;
|
||||
case 16:
|
||||
ret_length = 2 * ret_nitems;
|
||||
ret_length = sizeof(short) * ret_nitems;
|
||||
break;
|
||||
case 32:
|
||||
ret_length = 4 * ret_nitems;
|
||||
ret_length = sizeof(long) * ret_nitems;
|
||||
break;
|
||||
default:
|
||||
g_warning ("unknown property return format: %d", ret_format);
|
||||
|
||||
@@ -105,11 +105,11 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
gulong length;
|
||||
GdkAtom prop_type;
|
||||
gint prop_format;
|
||||
guchar *t;
|
||||
guchar *t = NULL;
|
||||
|
||||
g_return_val_if_fail (requestor != NULL, 0);
|
||||
|
||||
/* If retrieved chunks are typically small, (and the ICCM says the
|
||||
/* 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 */
|
||||
|
||||
@@ -133,11 +133,11 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
*data = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (t)
|
||||
{
|
||||
t = NULL;
|
||||
XFree (t);
|
||||
t = NULL;
|
||||
}
|
||||
|
||||
/* Add on an extra byte to handle null termination. X guarantees
|
||||
@@ -188,7 +188,7 @@ gdk_selection_send_notify (guint32 requestor,
|
||||
xevent.property = property;
|
||||
xevent.time = time;
|
||||
|
||||
XSendEvent (gdk_display, requestor, False, NoEventMask, (XEvent*) &xevent);
|
||||
gdk_send_xevent (requestor, False, NoEventMask, (XEvent*) &xevent);
|
||||
}
|
||||
|
||||
gint
|
||||
|
||||
+34
-29
@@ -34,17 +34,9 @@
|
||||
#include "gdkprivate.h"
|
||||
#include "MwmUtil.h"
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
# if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# endif
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#ifdef HAVE_SHAPE_EXT
|
||||
@@ -707,10 +699,10 @@ gdk_window_destroy_notify (GdkWindow *window)
|
||||
|
||||
if (!private->destroyed)
|
||||
{
|
||||
if (private->window_type == GDK_WINDOW_FOREIGN)
|
||||
gdk_window_internal_destroy (window, FALSE, FALSE);
|
||||
else
|
||||
if (private->window_type != GDK_WINDOW_FOREIGN)
|
||||
g_warning ("GdkWindow %#lx unexpectedly destroyed", private->xwindow);
|
||||
|
||||
gdk_window_internal_destroy (window, FALSE, FALSE);
|
||||
}
|
||||
|
||||
gdk_xid_table_remove (private->xwindow);
|
||||
@@ -732,6 +724,7 @@ gdk_window_unref (GdkWindow *window)
|
||||
{
|
||||
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
@@ -1089,8 +1082,10 @@ gdk_window_set_hints (GdkWindow *window,
|
||||
size_hints.max_height = max_height;
|
||||
}
|
||||
|
||||
if (flags)
|
||||
XSetWMNormalHints (private->xdisplay, private->xwindow, &size_hints);
|
||||
/* FIXME: Would it be better to delete this property of
|
||||
* flags == 0? It would save space on the server
|
||||
*/
|
||||
XSetWMNormalHints (private->xdisplay, private->xwindow, &size_hints);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1110,7 +1105,15 @@ gdk_window_set_geometry_hints (GdkWindow *window,
|
||||
size_hints.flags = 0;
|
||||
|
||||
if (geom_mask & GDK_HINT_POS)
|
||||
size_hints.flags |= PPosition;
|
||||
{
|
||||
size_hints.flags |= PPosition;
|
||||
/* We need to initialize the following obsolete fields because KWM
|
||||
* apparently uses these fields if they are non-zero.
|
||||
* #@#!#!$!.
|
||||
*/
|
||||
size_hints.x = 0;
|
||||
size_hints.y = 0;
|
||||
}
|
||||
|
||||
if (geom_mask & GDK_HINT_MIN_SIZE)
|
||||
{
|
||||
@@ -1145,28 +1148,30 @@ gdk_window_set_geometry_hints (GdkWindow *window,
|
||||
size_hints.flags |= PAspect;
|
||||
if (geometry->min_aspect <= 1)
|
||||
{
|
||||
size_hints.min_aspect.x = G_MAXINT * geometry->min_aspect;
|
||||
size_hints.min_aspect.y = G_MAXINT;
|
||||
size_hints.min_aspect.x = 65536 * geometry->min_aspect;
|
||||
size_hints.min_aspect.y = 65536;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_hints.min_aspect.x = G_MAXINT;
|
||||
size_hints.min_aspect.y = G_MAXINT / geometry->min_aspect;;
|
||||
size_hints.min_aspect.x = 65536;
|
||||
size_hints.min_aspect.y = 65536 / geometry->min_aspect;;
|
||||
}
|
||||
if (geometry->max_aspect <= 1)
|
||||
{
|
||||
size_hints.max_aspect.x = G_MAXINT * geometry->max_aspect;
|
||||
size_hints.max_aspect.y = G_MAXINT;
|
||||
size_hints.max_aspect.x = 65536 * geometry->max_aspect;
|
||||
size_hints.max_aspect.y = 65536;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_hints.max_aspect.x = G_MAXINT;
|
||||
size_hints.max_aspect.y = G_MAXINT / geometry->max_aspect;;
|
||||
size_hints.max_aspect.x = 65536;
|
||||
size_hints.max_aspect.y = 65536 / geometry->max_aspect;;
|
||||
}
|
||||
}
|
||||
|
||||
if (geom_mask)
|
||||
XSetWMNormalHints (private->xdisplay, private->xwindow, &size_hints);
|
||||
|
||||
/* FIXME: Would it be better to delete this property of
|
||||
* geom_mask == 0? It would save space on the server
|
||||
*/
|
||||
XSetWMNormalHints (private->xdisplay, private->xwindow, &size_hints);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1988,7 +1993,7 @@ gdk_window_remove_filter (GdkWindow *window,
|
||||
if (private)
|
||||
private->filters = g_list_remove_link (private->filters, node);
|
||||
else
|
||||
gdk_default_filters = g_list_remove_link (gdk_default_filters, tmp_list);
|
||||
gdk_default_filters = g_list_remove_link (gdk_default_filters, node);
|
||||
g_list_free_1 (node);
|
||||
g_free (filter);
|
||||
|
||||
|
||||
+6
-5
@@ -1,6 +1,7 @@
|
||||
# Note that this is NOT a relocatable package
|
||||
%define ver @VERSION@
|
||||
%define rel SNAP
|
||||
%define RELEASE 1
|
||||
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
|
||||
%define prefix /usr
|
||||
|
||||
Summary: The Gimp Toolkit
|
||||
@@ -148,10 +149,10 @@ fi
|
||||
%defattr(-, root, root)
|
||||
|
||||
%doc AUTHORS COPYING ChangeLog NEWS README TODO
|
||||
%{prefix}/lib/libgtk-1.1.so.*
|
||||
%{prefix}/lib/libgdk-1.1.so.*
|
||||
{prefix}/share/themes/Default
|
||||
+%{prefix}/share/locale/*/*/*
|
||||
%{prefix}/lib/libgtk-1.2.so.*
|
||||
%{prefix}/lib/libgdk-1.2.so.*
|
||||
%{prefix}/share/themes/Default
|
||||
%{prefix}/share/locale/*/*/*
|
||||
|
||||
|
||||
%files devel
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ while test $# -gt 0; do
|
||||
echo_exec_prefix=yes
|
||||
;;
|
||||
--version)
|
||||
echo @GTK_VERSION@
|
||||
echo @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@
|
||||
;;
|
||||
--cflags)
|
||||
echo_cflags=yes
|
||||
|
||||
+3
-4
@@ -22,7 +22,6 @@ gtktypebuiltins_vars.c
|
||||
gtktypebuiltins_evals.c
|
||||
gtk.defs
|
||||
testdnd
|
||||
stamp-d
|
||||
stamp-t
|
||||
stamp-m
|
||||
s-*
|
||||
stamp-gtktypebuiltins.h
|
||||
stamp-gtkmarshal.h
|
||||
stamp-gtk.defs
|
||||
|
||||
+504
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
+318
-267
@@ -1,124 +1,45 @@
|
||||
### Process this file with automake to produce Makefile.in
|
||||
## Makefile.am for gtk+/gtk
|
||||
|
||||
gtkincludedir = $(includedir)/gtk
|
||||
INCLUDES = @STRIP_BEGIN@ \
|
||||
-DG_LOG_DOMAIN=\"Gtk\" \
|
||||
-DGTK_DISABLE_COMPAT_H \
|
||||
-DGTK_EXE_PREFIX=\"$(exec_prefix)\" \
|
||||
-DGTK_DATA_PREFIX=\"$(prefix)\" \
|
||||
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DGTK_LOCALEDIR=\"$(gtklocaledir)\" \
|
||||
-I$(top_srcdir) \
|
||||
@GTK_DEBUG_FLAGS@ \
|
||||
@GTK_XIM_FLAGS@ \
|
||||
@GTK_LOCALE_FLAGS@ \
|
||||
@GLIB_CFLAGS@ \
|
||||
@x_cflags@ \
|
||||
@STRIP_END@
|
||||
|
||||
|
||||
#
|
||||
# libraries to compile and install
|
||||
#
|
||||
lib_LTLIBRARIES = libgtk.la
|
||||
|
||||
static_SOURCES = \
|
||||
gtkaccelgroup.c \
|
||||
gtkaccellabel.c \
|
||||
gtkadjustment.c \
|
||||
gtkalignment.c \
|
||||
gtkarg.c \
|
||||
gtkarrow.c \
|
||||
gtkaspectframe.c \
|
||||
gtkbin.c \
|
||||
gtkbindings.c \
|
||||
gtkbbox.c \
|
||||
gtkbox.c \
|
||||
gtkbutton.c \
|
||||
gtkcalendar.c \
|
||||
gtkcheckbutton.c \
|
||||
gtkcheckmenuitem.c \
|
||||
gtkclist.c \
|
||||
gtkcolorsel.c \
|
||||
gtkcombo.c \
|
||||
gtkcontainer.c \
|
||||
gtkctree.c \
|
||||
gtkcurve.c \
|
||||
gtkdata.c \
|
||||
gtkdialog.c \
|
||||
gtkdnd.c \
|
||||
gtkdrawingarea.c \
|
||||
gtkeditable.c \
|
||||
gtkentry.c \
|
||||
gtkeventbox.c \
|
||||
gtkfilesel.c \
|
||||
gtkfixed.c \
|
||||
gtkfontsel.c \
|
||||
gtkframe.c \
|
||||
gtkgamma.c \
|
||||
gtkgc.c \
|
||||
gtkhandlebox.c \
|
||||
gtkhbbox.c \
|
||||
gtkhbox.c \
|
||||
gtkhpaned.c \
|
||||
gtkhruler.c \
|
||||
gtkhscale.c \
|
||||
gtkhscrollbar.c \
|
||||
gtkhseparator.c \
|
||||
gtkimage.c \
|
||||
gtkinputdialog.c \
|
||||
gtkintl.h \
|
||||
gtkinvisible.c \
|
||||
gtkitem.c \
|
||||
gtkitemfactory.c \
|
||||
gtklabel.c \
|
||||
gtklayout.c \
|
||||
gtklist.c \
|
||||
gtklistitem.c \
|
||||
gtkmain.c \
|
||||
gtkmenu.c \
|
||||
gtkmenubar.c \
|
||||
gtkmenufactory.c \
|
||||
gtkmenuitem.c \
|
||||
gtkmenushell.c \
|
||||
gtkmisc.c \
|
||||
gtknotebook.c \
|
||||
gtkobject.c \
|
||||
gtkoptionmenu.c \
|
||||
gtkpacker.c \
|
||||
gtkpaned.c \
|
||||
gtkpixmap.c \
|
||||
gtkplug.c \
|
||||
gtkpreview.c \
|
||||
gtkprogress.c \
|
||||
gtkprogressbar.c \
|
||||
gtkradiobutton.c \
|
||||
gtkradiomenuitem.c \
|
||||
gtkrange.c \
|
||||
gtkrc.c \
|
||||
gtkruler.c \
|
||||
gtkscale.c \
|
||||
gtkscrollbar.c \
|
||||
gtkscrolledwindow.c \
|
||||
gtkselection.c \
|
||||
gtkseparator.c \
|
||||
gtksignal.c \
|
||||
gtksocket.c \
|
||||
gtkspinbutton.c \
|
||||
gtkstyle.c \
|
||||
gtkstatusbar.c \
|
||||
gtktable.c \
|
||||
gtktearoffmenuitem.c \
|
||||
gtktext.c \
|
||||
gtkthemes.c \
|
||||
gtktipsquery.c \
|
||||
gtktogglebutton.c \
|
||||
gtktoolbar.c \
|
||||
gtktooltips.c \
|
||||
gtktree.c \
|
||||
gtktreeitem.c \
|
||||
gtktypeutils.c \
|
||||
gtkvbbox.c \
|
||||
gtkvbox.c \
|
||||
gtkviewport.c \
|
||||
gtkvpaned.c \
|
||||
gtkvruler.c \
|
||||
gtkvscale.c \
|
||||
gtkvscrollbar.c \
|
||||
gtkvseparator.c \
|
||||
gtkwidget.c \
|
||||
gtkwindow.c \
|
||||
fnmatch.c \
|
||||
fnmatch.h
|
||||
# libtool stuff: set version and export symbols for resolving
|
||||
libgtkincludedir = $(includedir)/gtk
|
||||
libgtk_la_LDFLAGS = @STRIP_BEGIN@ \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
-release $(LT_RELEASE) \
|
||||
-export-dynamic \
|
||||
@GLIB_DEPLIBS@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
# $(top_builddir)/gdk/libgdk.la
|
||||
|
||||
libgtk_la_SOURCES = \
|
||||
$(static_SOURCES) \
|
||||
gtkmarshal.c
|
||||
|
||||
# Source headers which are non-autogenerated headers
|
||||
source_headers = \
|
||||
#
|
||||
# setup source file variables
|
||||
#
|
||||
# GTK+ header files for public installation (non-generated)
|
||||
gtk_public_h_sources = @STRIP_BEGIN@ \
|
||||
gtk.h \
|
||||
gtkaccelgroup.h \
|
||||
gtkaccellabel.h \
|
||||
@@ -151,6 +72,7 @@ source_headers = \
|
||||
gtkentry.h \
|
||||
gtkenums.h \
|
||||
gtkeventbox.h \
|
||||
gtkfeatures.h \
|
||||
gtkfilesel.h \
|
||||
gtkfixed.h \
|
||||
gtkfontsel.h \
|
||||
@@ -227,185 +149,291 @@ source_headers = \
|
||||
gtkvscrollbar.h \
|
||||
gtkvseparator.h \
|
||||
gtkwidget.h \
|
||||
gtkwindow.h
|
||||
|
||||
gtkinclude_HEADERS = \
|
||||
$(source_headers) \
|
||||
gtkfeatures.h \
|
||||
gtkwindow.h \
|
||||
@STRIP_END@
|
||||
# GTK+ header files that don't get installed
|
||||
gtk_private_h_sources = @STRIP_BEGIN@ \
|
||||
@STRIP_END@
|
||||
# GTK+ C sources to build the library from
|
||||
gtk_c_sources = @STRIP_BEGIN@ \
|
||||
gtkaccelgroup.c \
|
||||
gtkaccellabel.c \
|
||||
gtkadjustment.c \
|
||||
gtkalignment.c \
|
||||
gtkarg.c \
|
||||
gtkarrow.c \
|
||||
gtkaspectframe.c \
|
||||
gtkbin.c \
|
||||
gtkbindings.c \
|
||||
gtkbbox.c \
|
||||
gtkbox.c \
|
||||
gtkbutton.c \
|
||||
gtkcalendar.c \
|
||||
gtkcheckbutton.c \
|
||||
gtkcheckmenuitem.c \
|
||||
gtkclist.c \
|
||||
gtkcolorsel.c \
|
||||
gtkcombo.c \
|
||||
gtkcontainer.c \
|
||||
gtkctree.c \
|
||||
gtkcurve.c \
|
||||
gtkdata.c \
|
||||
gtkdialog.c \
|
||||
gtkdnd.c \
|
||||
gtkdrawingarea.c \
|
||||
gtkeditable.c \
|
||||
gtkentry.c \
|
||||
gtkeventbox.c \
|
||||
gtkfilesel.c \
|
||||
gtkfixed.c \
|
||||
gtkfontsel.c \
|
||||
gtkframe.c \
|
||||
gtkgamma.c \
|
||||
gtkgc.c \
|
||||
gtkhandlebox.c \
|
||||
gtkhbbox.c \
|
||||
gtkhbox.c \
|
||||
gtkhpaned.c \
|
||||
gtkhruler.c \
|
||||
gtkhscale.c \
|
||||
gtkhscrollbar.c \
|
||||
gtkhseparator.c \
|
||||
gtkimage.c \
|
||||
gtkinputdialog.c \
|
||||
gtkintl.h \
|
||||
gtkinvisible.c \
|
||||
gtkitem.c \
|
||||
gtkitemfactory.c \
|
||||
gtklabel.c \
|
||||
gtklayout.c \
|
||||
gtklist.c \
|
||||
gtklistitem.c \
|
||||
gtkmain.c \
|
||||
gtkmarshal.c \
|
||||
gtkmenu.c \
|
||||
gtkmenubar.c \
|
||||
gtkmenufactory.c \
|
||||
gtkmenuitem.c \
|
||||
gtkmenushell.c \
|
||||
gtkmisc.c \
|
||||
gtknotebook.c \
|
||||
gtkobject.c \
|
||||
gtkoptionmenu.c \
|
||||
gtkpacker.c \
|
||||
gtkpaned.c \
|
||||
gtkpixmap.c \
|
||||
gtkplug.c \
|
||||
gtkpreview.c \
|
||||
gtkprogress.c \
|
||||
gtkprogressbar.c \
|
||||
gtkradiobutton.c \
|
||||
gtkradiomenuitem.c \
|
||||
gtkrange.c \
|
||||
gtkrc.c \
|
||||
gtkruler.c \
|
||||
gtkscale.c \
|
||||
gtkscrollbar.c \
|
||||
gtkscrolledwindow.c \
|
||||
gtkselection.c \
|
||||
gtkseparator.c \
|
||||
gtksignal.c \
|
||||
gtksocket.c \
|
||||
gtkspinbutton.c \
|
||||
gtkstyle.c \
|
||||
gtkstatusbar.c \
|
||||
gtktable.c \
|
||||
gtktearoffmenuitem.c \
|
||||
gtktext.c \
|
||||
gtkthemes.c \
|
||||
gtktipsquery.c \
|
||||
gtktogglebutton.c \
|
||||
gtktoolbar.c \
|
||||
gtktooltips.c \
|
||||
gtktree.c \
|
||||
gtktreeitem.c \
|
||||
gtktypeutils.c \
|
||||
gtkvbbox.c \
|
||||
gtkvbox.c \
|
||||
gtkviewport.c \
|
||||
gtkvpaned.c \
|
||||
gtkvruler.c \
|
||||
gtkvscale.c \
|
||||
gtkvscrollbar.c \
|
||||
gtkvseparator.c \
|
||||
gtkwidget.c \
|
||||
gtkwindow.c \
|
||||
fnmatch.c \
|
||||
fnmatch.h \
|
||||
@STRIP_END@
|
||||
# we use our own built_sources variable rules to avoid automake's
|
||||
# BUILT_SOURCES oddities
|
||||
# we generate frequently rebuild files piggyback on a stamp file, so sources
|
||||
# depending on them only get rebuild when the built source actually changed
|
||||
# content
|
||||
#
|
||||
# built sources that don't get installed
|
||||
gtk_built_sources = @STRIP_BEGIN@ \
|
||||
stamp-gtk.defs \
|
||||
stamp-gtktypebuiltins.h \
|
||||
stamp-gtkmarshal.h \
|
||||
gtktypebuiltins_vars.c \
|
||||
gtktypebuiltins_ids.c \
|
||||
gtktypebuiltins_evals.c \
|
||||
gtkmarshal.c \
|
||||
gtk.defs \
|
||||
@STRIP_END@
|
||||
# built sources that get installed with the header files
|
||||
gtk_built_public_sources = @STRIP_BEGIN@ \
|
||||
gtkmarshal.h \
|
||||
gtktypebuiltins.h
|
||||
|
||||
# note gtk.defs, gtktypebuiltin* and gtkmarshal.[ch] aren't here, but
|
||||
# their stamps are. Another trick is to use the temporary output files as
|
||||
# the stamp files.
|
||||
BUILT_SOURCES = \
|
||||
s-gd s-gtb s-gtbv s-gtbi s-gtbe \
|
||||
stamp-m
|
||||
|
||||
# cause the built sources to be rebuild when possible, even with --include-deps
|
||||
$(static_sources): $(BUILT_SOURCES)
|
||||
|
||||
# More headers to use when autogenerating.
|
||||
gdk_headers = \
|
||||
../gdk/gdktypes.h \
|
||||
../gdk/gdkrgb.h
|
||||
|
||||
# generate gtk.defs file from gtk-boxed.defs and *.h
|
||||
gtk.defs: @REBUILD@ s-gd
|
||||
@:
|
||||
s-gd: @REBUILD@ makeenums.pl gtk-boxed.defs $(source_headers) $(gdk_headers)
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) makeenums.pl defs $(source_headers) $(gdk_headers) > s-gd \
|
||||
&& cat gtk-boxed.defs >> s-gd \
|
||||
&& (cmp -s s-gd gtk.defs || cp s-gd gtk.defs)
|
||||
|
||||
# generate type identifier header (GTK_TYPE_WIDGET_FLAGS)
|
||||
gtktypebuiltins.h: @REBUILD@ s-gtb
|
||||
@:
|
||||
s-gtb: @REBUILD@ s-gd maketypes.awk
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs macros > s-gtb \
|
||||
&& (cmp -s s-gtb gtktypebuiltins.h || cp s-gtb gtktypebuiltins.h)
|
||||
|
||||
# generate type identifier variables (GTK_TYPE_WIDGET_FLAGS)
|
||||
gtktypebuiltins_vars.c: @REBUILD@ s-gtbv
|
||||
@:
|
||||
s-gtbv: @REBUILD@ s-gd maketypes.awk
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs variables > s-gtbv \
|
||||
&& (cmp -s s-gtbv gtktypebuiltins_vars.c || cp s-gtbv gtktypebuiltins_vars.c)
|
||||
|
||||
# generate type entries for type-id registration
|
||||
gtktypebuiltins_ids.c: @REBUILD@ s-gtbi
|
||||
@:
|
||||
s-gtbi: @REBUILD@ s-gd maketypes.awk
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs entries > s-gtbi \
|
||||
&& (cmp -s s-gtbi gtktypebuiltins_ids.c || cp s-gtbi gtktypebuiltins_ids.c)
|
||||
|
||||
# generate enum value arrays
|
||||
gtktypebuiltins_evals.c: @REBUILD@ s-gtbe
|
||||
@:
|
||||
s-gtbe: @REBUILD@ makeenums.pl s-gd
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) makeenums.pl arrays $(source_headers) $(gdk_headers) > \
|
||||
s-gtbe \
|
||||
&& (cmp -s s-gtbe gtktypebuiltins_evals.c || cp s-gtbe gtktypebuiltins_evals.c)
|
||||
|
||||
$(srcdir)/gtkmarshal.c $(srcdir)/gtkmarshal.h: @REBUILD@ stamp-m
|
||||
@:
|
||||
stamp-m: @REBUILD@ $(srcdir)/gtkmarshal.list $(srcdir)/genmarshal.pl
|
||||
(srcdir=$(srcdir) INDENT=$(INDENT) $(PERL) $(srcdir)/genmarshal.pl \
|
||||
&& (cmp -s s-gmc gtkmarshal.c || mv s-gmc gtkmarshal.c) \
|
||||
&& rm -f s-gmc \
|
||||
&& (cmp -s s-gmh gtkmarshal.h || mv s-gmh gtkmarshal.h) \
|
||||
&& rm -f s-gmh) \
|
||||
&& echo timestamp > stamp-m
|
||||
|
||||
libgtk_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
-release $(LT_RELEASE) \
|
||||
@GLIB_DEPLIBS@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
-lm
|
||||
# $(top_builddir)/gdk/libgdk.la
|
||||
|
||||
gtkconfdir = $(sysconfdir)/gtk
|
||||
gtkconf_DATA = gtkrc gtkrc.ja gtkrc.ko gtkrc.ru
|
||||
|
||||
gtkrc:
|
||||
:
|
||||
|
||||
# We create a dummy theme for the default GTK+ theme
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk
|
||||
echo "# Empty gtkrc for default theme" > \
|
||||
$(DESTDIR)$(datadir)/themes/Default/gtk/gtkrc
|
||||
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)$(datadir)/themes/Default/gtkrc
|
||||
|
||||
EXTRA_DIST = \
|
||||
line-arrow.xbm \
|
||||
line-wrap.xbm \
|
||||
testgtk.1 \
|
||||
testgtkrc \
|
||||
testgtkrc2 \
|
||||
gtktypebuiltins.h \
|
||||
@STRIP_END@
|
||||
# non-header sources (headers should be specified in the above variables)
|
||||
# that don't serve as direct make target sources, i.e. they don't have
|
||||
# their own .lo rules and don't get publically installed
|
||||
gtk_extra_sources = @STRIP_BEGIN@ \
|
||||
gtkfeatures.h.in \
|
||||
makeenums.pl \
|
||||
makeenums.awk \
|
||||
maketypes.awk \
|
||||
makeenums.h \
|
||||
gtkargcollector.c \
|
||||
gtktypebuiltins_vars.c \
|
||||
gtktypebuiltins_ids.c \
|
||||
gtktypebuiltins_evals.c \
|
||||
gtk-boxed.defs \
|
||||
gtk.defs \
|
||||
genmarshal.pl \
|
||||
gtkmarshal.list \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
test.xpm \
|
||||
marble.xpm \
|
||||
3DRings.xpm \
|
||||
FilesQueue.xpm \
|
||||
Modeller.xpm \
|
||||
tree_plus.xpm \
|
||||
tree_minus.xpm \
|
||||
tree_plus.xbm \
|
||||
tree_minus.xbm \
|
||||
circles.xbm \
|
||||
gtkrc.ja \
|
||||
gtkrc.ko \
|
||||
gtkrc.ru
|
||||
@STRIP_END@
|
||||
# Extra headers that are used for enum type array/id generation
|
||||
gdk_headers = @STRIP_BEGIN@ \
|
||||
../gdk/gdktypes.h \
|
||||
../gdk/gdkrgb.h \
|
||||
@STRIP_END@
|
||||
|
||||
INCLUDES = \
|
||||
-DGTK_DISABLE_COMPAT_H \
|
||||
-DG_LOG_DOMAIN=\"Gtk\" \
|
||||
-DGTK_EXE_PREFIX=\"$(exec_prefix)\" \
|
||||
-DGTK_DATA_PREFIX=\"$(prefix)\" \
|
||||
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DGTK_LOCALEDIR=\"$(gtklocaledir)\" \
|
||||
-I$(top_srcdir) \
|
||||
@GTK_DEBUG_FLAGS@ \
|
||||
@GTK_XIM_FLAGS@ \
|
||||
@GTK_LOCALE_FLAGS@ \
|
||||
@GLIB_CFLAGS@ \
|
||||
@x_cflags@
|
||||
#
|
||||
# setup GTK+ sources and their dependancies
|
||||
#
|
||||
libgtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_built_public_sources)
|
||||
libgtk_la_SOURCES = $(gtk_c_sources)
|
||||
MAINTAINERCLEANFILES += $(gtk_built_public_sources) $(gtk_built_sources)
|
||||
EXTRA_HEADERS +=
|
||||
EXTRA_DIST += $(gtk_private_h_sources)
|
||||
EXTRA_DIST += $(gtk_built_sources) $(gtk_built_public_sources) $(gtk_extra_sources)
|
||||
|
||||
noinst_PROGRAMS = testgtk testinput testselection testrgb testdnd simple
|
||||
# testthreads
|
||||
#
|
||||
# rules to generate built sources
|
||||
#
|
||||
# setup autogeneration dependancies
|
||||
gen_sources = xgen-gdef xgen-gtbh xgen-gtbvc xgen-gtbic xgen-gtbec xgen-gmh xgen-gmc
|
||||
CLEANFILES += $(gen_sources)
|
||||
COPYING: $(gtk_built_public_sources) $(gtk_built_sources)
|
||||
$(OBJECTS): COPYING # this is our oldest-source-stamp
|
||||
# initial creation of the real stamp-* files
|
||||
gtk.defs gtkmarshal.h gtktypebuiltins.h: # never add deps here
|
||||
test -f "$(srcdir)/$@" || touch $(srcdir)/$@
|
||||
# normal autogeneration rules
|
||||
stamp-gtk.defs: @REBUILD@ makeenums.pl gtk.defs gtk-boxed.defs $(gtk_public_h_sources) $(gdk_headers)
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) makeenums.pl defs $(gtk_public_h_sources) $(gdk_headers) > xgen-gdef \
|
||||
&& cat gtk-boxed.defs >> xgen-gdef \
|
||||
&& (cmp -s xgen-gdef gtk.defs || cp xgen-gdef gtk.defs) \
|
||||
&& rm -f xgen-gdef \
|
||||
&& echo timestamp > $@
|
||||
gtkmarshal.c: stamp-gtkmarshal.h
|
||||
gtkmarshal.c stamp-gtkmarshal.h: @REBUILD@ genmarshal.pl gtkmarshal.list gtkmarshal.h
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) genmarshal.pl gtkmarshal.list xgen-gmh xgen-gmc \
|
||||
&& (test -z "$(INDENT)" || $(INDENT) xgen-gmh) \
|
||||
&& (test -z "$(INDENT)" || $(INDENT) xgen-gmc) \
|
||||
&& cp xgen-gmc gtkmarshal.c \
|
||||
&& (cmp -s xgen-gmh gtkmarshal.h || cp xgen-gmh gtkmarshal.h) \
|
||||
&& rm -f xgen-gmh xgen-gmc xgen-gmh~ xgen-gmc~ \
|
||||
&& echo timestamp > stamp-gtkmarshal.h
|
||||
stamp-gtktypebuiltins.h: @REBUILD@ maketypes.awk stamp-gtk.defs gtktypebuiltins.h
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs macros > xgen-gtbh \
|
||||
&& (cmp -s xgen-gtbh gtktypebuiltins.h || cp xgen-gtbh gtktypebuiltins.h) \
|
||||
&& rm -f xgen-gtbh \
|
||||
&& echo timestamp > $@
|
||||
gtktypebuiltins_vars.c: @REBUILD@ maketypes.awk stamp-gtk.defs
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs variables > xgen-gtbvc \
|
||||
&& cp xgen-gtbvc $@ \
|
||||
&& rm -f xgen-gtbvc
|
||||
gtktypebuiltins_ids.c: @REBUILD@ maketypes.awk stamp-gtk.defs
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs entries > xgen-gtbic \
|
||||
&& cp xgen-gtbic $@ \
|
||||
&& rm -f xgen-gtbic
|
||||
gtktypebuiltins_evals.c: @REBUILD@ makeenums.pl $(gtk_public_h_sources) $(gdk_headers)
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) makeenums.pl arrays $(gtk_public_h_sources) $(gdk_headers) > xgen-gtbec \
|
||||
&& cp xgen-gtbec $@ \
|
||||
&& rm -f xgen-gtbec
|
||||
|
||||
DEPS = \
|
||||
libgtk.la \
|
||||
$(top_builddir)/gdk/libgdk.la
|
||||
|
||||
LDADDS = \
|
||||
libgtk.la \
|
||||
$(top_builddir)/gdk/libgdk.la \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
@GLIB_LIBS@ \
|
||||
-lm
|
||||
gtkconfdir = $(sysconfdir)/gtk
|
||||
gtkconf_DATA = gtkrc.bg gtkrc.el gtkrc.eo gtkrc.he gtkrc.hy gtkrc.ja \
|
||||
gtkrc.ko gtkrc.ru gtkrc.tr gtkrc.th gtkrc.uk gtkrc.iso-8859-2 \
|
||||
gtkrc.iso-8859-5 gtkrc.iso-8859-13 gtkrc.iso-8859-14 \
|
||||
gtkrc.iso-8859-15 gtkrc.zh_CN gtkrc.zh_TW.Big5 \
|
||||
gtkrc.ka_GE.georgianacademy gtkrc.ka_GE.georgianps \
|
||||
gtkrc.vi_VN.tcvn gtkrc.vi_VN.viscii
|
||||
|
||||
# We create a dummy theme for the default GTK+ theme
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk
|
||||
echo "# Empty gtkrc for default theme" > \
|
||||
$(DESTDIR)$(datadir)/themes/Default/gtk/gtkrc
|
||||
$(mkinstalldirs) $(DESTDIR)$(gtkconfdir)
|
||||
cd $(DESTDIR)$(gtkconfdir) && \
|
||||
for i in cs hr hu pl ro sk sl sq ; do \
|
||||
rm -f gtkrc.$$i ; \
|
||||
ln -s gtkrc.iso-8859-2 gtkrc.$$i ; \
|
||||
done ; \
|
||||
for i in bg_BG.ISO-8859-5 mk sr ru_RU.ISO-8859-5 ; do \
|
||||
rm -f gtkrc.$$i ; \
|
||||
ln -s gtkrc.iso-8859-5 gtkrc.$$i ; \
|
||||
done ; \
|
||||
rm -f gtkrc.lt gtkrc.cy gtkrc.ga gtkrc.et gtkrc.ka \
|
||||
gtkrc.vi_VN.viscii111 gtkrc.vi_VN.tcvn5712 gtkrc.vi ; \
|
||||
ln -s gtkrc.iso-8859-13 gtkrc.lt ; \
|
||||
ln -s gtkrc.iso-8859-14 gtkrc.cy ; \
|
||||
ln -s gtkrc.iso-8859-14 gtkrc.ga ; \
|
||||
ln -s gtkrc.iso-8859-15 gtkrc.et ; \
|
||||
ln -s gtkrc.ka_GE.georgianacademy gtkrc.ka ; \
|
||||
ln -s gtkrc.vi_VN.viscii gtkrc.vi_VN.viscii111 ; \
|
||||
ln -s gtkrc.vi_VN.tcvn gtkrc.vi_VN.tcvn5712 ; \
|
||||
ln -s gtkrc.vi_VN.tcvn5712 gtkrc.vi
|
||||
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)$(datadir)/themes/Default/gtkrc
|
||||
|
||||
#
|
||||
# test programs, not to be installed
|
||||
#
|
||||
noinst_PROGRAMS = testgtk testinput testselection testrgb testdnd simple # testthreads
|
||||
DEPS = libgtk.la $(top_builddir)/gdk/libgdk.la
|
||||
LDADDS = @STRIP_BEGIN@ \
|
||||
libgtk.la \
|
||||
$(top_builddir)/gdk/libgdk.la \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
@GDK_WLIBS@ \
|
||||
@GLIB_LIBS@ \
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
testgtk_DEPENDENCIES = $(DEPS)
|
||||
testinput_DEPENDENCIES = $(DEPS)
|
||||
#testthreads_DEPENDENCIES = $(DEPS)
|
||||
testselection_DEPENDENCIES = $(DEPS)
|
||||
testrgb_DEPENDENCIES = $(DEPS)
|
||||
testdnd_DEPENDENCIES = $(DEPS)
|
||||
simple_DEPENDENCIES = $(DEPS)
|
||||
|
||||
#testthreads_DEPENDENCIES = $(DEPS)
|
||||
testgtk_LDADD = $(LDADDS)
|
||||
testinput_LDADD = $(LDADDS)
|
||||
#testthreads_LDADD = $(LDADDS)
|
||||
testselection_LDADD = $(LDADDS)
|
||||
testrgb_LDADD = $(LDADDS)
|
||||
testdnd_LDADD = $(LDADDS)
|
||||
simple_LDADD = $(LDADDS)
|
||||
#testthreads_LDADD = $(LDADDS)
|
||||
|
||||
.PHONY: files test test-debug
|
||||
|
||||
@@ -424,3 +452,26 @@ test-debug: testgtk
|
||||
cd $$builddir; cd $(srcdir); \
|
||||
$(SHELL) $$top_builddir/libtool --mode=execute gdb $$builddir/testgtk
|
||||
|
||||
EXTRA_DIST += @STRIP_BEGIN@ \
|
||||
testgtk.1 \
|
||||
testgtkrc \
|
||||
testgtkrc2 \
|
||||
circles.xbm \
|
||||
line-arrow.xbm \
|
||||
line-wrap.xbm \
|
||||
tree_plus.xbm \
|
||||
tree_minus.xbm \
|
||||
3DRings.xpm \
|
||||
FilesQueue.xpm \
|
||||
Modeller.xpm \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
marble.xpm \
|
||||
tree_minus.xpm \
|
||||
tree_plus.xpm \
|
||||
test.xpm \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
test.xpm \
|
||||
$(gtkconf_DATA) \
|
||||
@STRIP_END@
|
||||
|
||||
+8
-19
@@ -20,25 +20,17 @@
|
||||
"CALLBACK"=>"CALLBACK"
|
||||
);
|
||||
|
||||
$srcdir = $ENV{'srcdir'} || '.';
|
||||
$indent = $ENV{'INDENT'};
|
||||
|
||||
sub indent {
|
||||
my $filename = shift;
|
||||
if (defined($indent) && $indent ne "") {
|
||||
system($indent, $filename);
|
||||
# we try the most likely names for backup files
|
||||
system("rm", "-f", "$filename.bak", "$filename~");
|
||||
}
|
||||
if ($#ARGV != 2) {
|
||||
die ("Wrong number of arguments given, need <source> <target.h> <target.c>");
|
||||
}
|
||||
|
||||
open(IL, "<$srcdir/gtkmarshal.list") || die("Open failed: $!");
|
||||
open(OH, ">s-gmh") || die("Open failed: $!");
|
||||
open(OS, ">s-gmc") || die("Open failed: $!");
|
||||
open(IL, "<" . $ARGV[0]) || die ("Open failed: $!");
|
||||
open(OH, ">" . $ARGV[1]) || die ("Open failed: $!");
|
||||
open(OS, ">" . $ARGV[2]) || die ("Open failed: $!");
|
||||
|
||||
print OH <<EOT;
|
||||
#ifndef __GTKMARSHAL_H__
|
||||
#define __GTKMARSHAL_H__ 1
|
||||
#ifndef __GTK_MARSHAL_H__
|
||||
#define __GTK_MARSHAL_H__
|
||||
|
||||
#include <gtk/gtktypeutils.h>
|
||||
#include <gtk/gtkobject.h>
|
||||
@@ -196,10 +188,7 @@ print OH <<EOT;
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GTKMARSHAL_H__ */
|
||||
#endif /* __GTK_MARSHAL_H__ */
|
||||
EOT
|
||||
|
||||
close(IL); close(OH); close(OS);
|
||||
|
||||
indent("s-gmh");
|
||||
indent("s-gmc");
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <strings.h>
|
||||
#include <string.h>
|
||||
#include "gtkaccelgroup.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
#include "gtksignal.h"
|
||||
|
||||
+23
-20
@@ -83,26 +83,42 @@ struct _GtkAccelEntry
|
||||
};
|
||||
|
||||
|
||||
/* Accelerators
|
||||
*/
|
||||
gboolean gtk_accelerator_valid (guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
void gtk_accelerator_parse (const gchar *accelerator,
|
||||
guint *accelerator_key,
|
||||
GdkModifierType *accelerator_mods);
|
||||
gchar* gtk_accelerator_name (guint accelerator_key,
|
||||
GdkModifierType accelerator_mods);
|
||||
void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
|
||||
guint gtk_accelerator_get_default_mod_mask (void);
|
||||
|
||||
|
||||
/* Accelerator Groups
|
||||
*/
|
||||
GtkAccelGroup* gtk_accel_group_new (void);
|
||||
GtkAccelGroup* gtk_accel_group_get_default (void);
|
||||
GtkAccelGroup* gtk_accel_group_ref (GtkAccelGroup *accel_group);
|
||||
void gtk_accel_group_unref (GtkAccelGroup *accel_group);
|
||||
gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
|
||||
void gtk_accel_group_lock (GtkAccelGroup *accel_group);
|
||||
void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
|
||||
gboolean gtk_accel_groups_activate (GtkObject *object,
|
||||
guint accel_key,
|
||||
GdkModifierType accel_mods);
|
||||
gboolean gtk_accel_groups_activate (GtkObject *object,
|
||||
|
||||
/* internal functions
|
||||
*/
|
||||
gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
|
||||
guint accel_key,
|
||||
GdkModifierType accel_mods);
|
||||
void gtk_accel_group_attach (GtkAccelGroup *accel_group,
|
||||
GtkObject *object);
|
||||
void gtk_accel_group_detach (GtkAccelGroup *accel_group,
|
||||
GtkObject *object);
|
||||
void gtk_accel_group_lock (GtkAccelGroup *accel_group);
|
||||
void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
|
||||
|
||||
/* Accelerator Group Entries
|
||||
/* Accelerator Group Entries (internal)
|
||||
*/
|
||||
GtkAccelEntry* gtk_accel_group_get_entry (GtkAccelGroup *accel_group,
|
||||
guint accel_key,
|
||||
@@ -124,7 +140,7 @@ void gtk_accel_group_remove (GtkAccelGroup *accel_group,
|
||||
GdkModifierType accel_mods,
|
||||
GtkObject *object);
|
||||
|
||||
/* Accelerator Signals
|
||||
/* Accelerator Signals (internal)
|
||||
*/
|
||||
void gtk_accel_group_handle_add (GtkObject *object,
|
||||
guint accel_signal_id,
|
||||
@@ -151,25 +167,12 @@ void gtk_accel_group_marshal_remove (GtkObject *object,
|
||||
gpointer func_data,
|
||||
GtkArg *args);
|
||||
|
||||
/* Miscellaneous
|
||||
/* Miscellaneous (internal)
|
||||
*/
|
||||
GSList* gtk_accel_groups_from_object (GtkObject *object);
|
||||
GSList* gtk_accel_group_entries_from_object (GtkObject *object);
|
||||
|
||||
|
||||
/* Accelerators
|
||||
*/
|
||||
gboolean gtk_accelerator_valid (guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
void gtk_accelerator_parse (const gchar *accelerator,
|
||||
guint *accelerator_key,
|
||||
GdkModifierType *accelerator_mods);
|
||||
gchar* gtk_accelerator_name (guint accelerator_key,
|
||||
GdkModifierType accelerator_mods);
|
||||
void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
|
||||
guint gtk_accelerator_get_default_mod_mask (void);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+220
-5
@@ -422,17 +422,40 @@ gtk_arg_copy (GtkArg *src_arg,
|
||||
}
|
||||
|
||||
void
|
||||
gtk_arg_free (GtkArg *arg,
|
||||
gboolean free_contents)
|
||||
gtk_arg_free (GtkArg *arg,
|
||||
gboolean free_contents)
|
||||
{
|
||||
g_return_if_fail (arg != NULL);
|
||||
|
||||
if (free_contents &&
|
||||
GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_STRING)
|
||||
g_free (GTK_VALUE_STRING (*arg));
|
||||
if (free_contents)
|
||||
gtk_arg_reset (arg);
|
||||
g_free (arg);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_arg_reset (GtkArg *arg)
|
||||
{
|
||||
GtkType fundamental_type;
|
||||
|
||||
g_return_if_fail (arg != NULL);
|
||||
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
|
||||
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
|
||||
{
|
||||
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
|
||||
if (!fundamental_type)
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
|
||||
}
|
||||
|
||||
if (fundamental_type == GTK_TYPE_STRING)
|
||||
{
|
||||
g_free (GTK_VALUE_STRING (*arg));
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
}
|
||||
else if (arg->type != GTK_TYPE_INVALID)
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
}
|
||||
|
||||
gint
|
||||
gtk_arg_info_equal (gconstpointer arg_info_1,
|
||||
gconstpointer arg_info_2)
|
||||
@@ -466,3 +489,195 @@ gtk_arg_info_hash (gconstpointer arg_info)
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_arg_values_equal (const GtkArg *arg1,
|
||||
const GtkArg *arg2)
|
||||
{
|
||||
GtkType fundamental_type;
|
||||
gboolean equal;
|
||||
|
||||
g_return_val_if_fail (arg1 != NULL, FALSE);
|
||||
g_return_val_if_fail (arg2 != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_FUNDAMENTAL_TYPE (arg1->type) ==
|
||||
GTK_FUNDAMENTAL_TYPE (arg2->type), FALSE);
|
||||
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg1->type);
|
||||
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
|
||||
{
|
||||
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
|
||||
if (!fundamental_type)
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg1->type);
|
||||
}
|
||||
|
||||
switch (fundamental_type)
|
||||
{
|
||||
case GTK_TYPE_INVALID:
|
||||
equal = TRUE;
|
||||
break;
|
||||
case GTK_TYPE_CHAR:
|
||||
equal = GTK_VALUE_CHAR (*arg1) == GTK_VALUE_CHAR (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_BOOL:
|
||||
equal = (GTK_VALUE_BOOL (*arg1) != FALSE) == (GTK_VALUE_BOOL (*arg2) != FALSE);
|
||||
break;
|
||||
case GTK_TYPE_INT:
|
||||
equal = GTK_VALUE_INT (*arg1) == GTK_VALUE_INT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_UINT:
|
||||
equal = GTK_VALUE_UINT (*arg1) == GTK_VALUE_UINT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_LONG:
|
||||
equal = GTK_VALUE_LONG (*arg1) == GTK_VALUE_LONG (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_ULONG:
|
||||
equal = GTK_VALUE_ULONG (*arg1) == GTK_VALUE_ULONG (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_FLOAT:
|
||||
equal = GTK_VALUE_FLOAT (*arg1) == GTK_VALUE_FLOAT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_DOUBLE:
|
||||
equal = GTK_VALUE_DOUBLE (*arg1) == GTK_VALUE_DOUBLE (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_STRING:
|
||||
if (!GTK_VALUE_STRING (*arg1) ||
|
||||
!GTK_VALUE_STRING (*arg2))
|
||||
equal = GTK_VALUE_STRING (*arg1) == GTK_VALUE_STRING (*arg2);
|
||||
else
|
||||
equal = g_str_equal (GTK_VALUE_STRING (*arg1), GTK_VALUE_STRING (*arg2));
|
||||
break;
|
||||
case GTK_TYPE_ENUM:
|
||||
equal = GTK_VALUE_ENUM (*arg1) == GTK_VALUE_ENUM (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_FLAGS:
|
||||
equal = GTK_VALUE_FLAGS (*arg1) == GTK_VALUE_FLAGS (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_BOXED:
|
||||
equal = GTK_VALUE_BOXED (*arg1) == GTK_VALUE_BOXED (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_FOREIGN:
|
||||
equal = (GTK_VALUE_FOREIGN (*arg1).data == GTK_VALUE_FOREIGN (*arg2).data &&
|
||||
GTK_VALUE_FOREIGN (*arg1).notify == GTK_VALUE_FOREIGN (*arg2).notify);
|
||||
break;
|
||||
case GTK_TYPE_CALLBACK:
|
||||
equal = (GTK_VALUE_CALLBACK (*arg1).marshal == GTK_VALUE_CALLBACK (*arg2).marshal &&
|
||||
GTK_VALUE_CALLBACK (*arg1).data == GTK_VALUE_CALLBACK (*arg2).data &&
|
||||
GTK_VALUE_CALLBACK (*arg1).notify == GTK_VALUE_CALLBACK (*arg2).notify);
|
||||
break;
|
||||
case GTK_TYPE_ARGS:
|
||||
equal = (GTK_VALUE_ARGS (*arg1).n_args == GTK_VALUE_ARGS (*arg2).n_args &&
|
||||
GTK_VALUE_ARGS (*arg1).args == GTK_VALUE_ARGS (*arg2).args);
|
||||
break;
|
||||
case GTK_TYPE_OBJECT:
|
||||
equal = GTK_VALUE_OBJECT (*arg1) == GTK_VALUE_OBJECT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_POINTER:
|
||||
equal = GTK_VALUE_POINTER (*arg1) == GTK_VALUE_POINTER (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_SIGNAL:
|
||||
equal = (GTK_VALUE_SIGNAL (*arg1).f == GTK_VALUE_SIGNAL (*arg2).f &&
|
||||
GTK_VALUE_SIGNAL (*arg1).d == GTK_VALUE_SIGNAL (*arg2).d);
|
||||
break;
|
||||
case GTK_TYPE_C_CALLBACK:
|
||||
equal = (GTK_VALUE_C_CALLBACK (*arg1).func == GTK_VALUE_C_CALLBACK (*arg2).func &&
|
||||
GTK_VALUE_C_CALLBACK (*arg1).func_data == GTK_VALUE_C_CALLBACK (*arg2).func_data);
|
||||
break;
|
||||
default:
|
||||
g_warning ("gtk_arg_values_equal() used with unknown type `%s'", gtk_type_name (arg1->type));
|
||||
equal = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
return equal;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_arg_to_valueloc (GtkArg *arg,
|
||||
gpointer value_pointer)
|
||||
{
|
||||
GtkType fundamental_type;
|
||||
|
||||
g_return_if_fail (arg != NULL);
|
||||
g_return_if_fail (value_pointer != NULL);
|
||||
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
|
||||
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
|
||||
{
|
||||
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
|
||||
if (!fundamental_type)
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
|
||||
}
|
||||
|
||||
switch (fundamental_type)
|
||||
{
|
||||
gchar *p_char;
|
||||
guchar *p_uchar;
|
||||
gboolean *p_boolean;
|
||||
gint *p_int;
|
||||
guint *p_uint;
|
||||
glong *p_long;
|
||||
gulong *p_ulong;
|
||||
gfloat *p_float;
|
||||
gdouble *p_double;
|
||||
gpointer *p_pointer;
|
||||
case GTK_TYPE_CHAR:
|
||||
p_char = value_pointer;
|
||||
*p_char = GTK_VALUE_CHAR (*arg);
|
||||
break;
|
||||
case GTK_TYPE_UCHAR:
|
||||
p_uchar = value_pointer;
|
||||
*p_uchar = GTK_VALUE_UCHAR (*arg);
|
||||
break;
|
||||
case GTK_TYPE_BOOL:
|
||||
p_boolean = value_pointer;
|
||||
*p_boolean = GTK_VALUE_BOOL (*arg);
|
||||
break;
|
||||
case GTK_TYPE_INT:
|
||||
case GTK_TYPE_ENUM:
|
||||
p_int = value_pointer;
|
||||
*p_int = GTK_VALUE_INT (*arg);
|
||||
break;
|
||||
case GTK_TYPE_UINT:
|
||||
case GTK_TYPE_FLAGS:
|
||||
p_uint = value_pointer;
|
||||
*p_uint = GTK_VALUE_UINT (*arg);
|
||||
break;
|
||||
case GTK_TYPE_LONG:
|
||||
p_long = value_pointer;
|
||||
*p_long = GTK_VALUE_LONG (*arg);
|
||||
break;
|
||||
case GTK_TYPE_ULONG:
|
||||
p_ulong = value_pointer;
|
||||
*p_ulong = GTK_VALUE_ULONG (*arg);
|
||||
break;
|
||||
case GTK_TYPE_FLOAT:
|
||||
p_float = value_pointer;
|
||||
*p_float = GTK_VALUE_FLOAT (*arg);
|
||||
break;
|
||||
case GTK_TYPE_DOUBLE:
|
||||
p_double = value_pointer;
|
||||
*p_double = GTK_VALUE_DOUBLE (*arg);
|
||||
break;
|
||||
case GTK_TYPE_STRING:
|
||||
case GTK_TYPE_POINTER:
|
||||
case GTK_TYPE_BOXED:
|
||||
case GTK_TYPE_OBJECT:
|
||||
p_pointer = value_pointer;
|
||||
*p_pointer = GTK_VALUE_POINTER (*arg);
|
||||
break;
|
||||
case GTK_TYPE_SIGNAL:
|
||||
case GTK_TYPE_ARGS:
|
||||
case GTK_TYPE_FOREIGN:
|
||||
case GTK_TYPE_CALLBACK:
|
||||
case GTK_TYPE_C_CALLBACK:
|
||||
case GTK_TYPE_NONE:
|
||||
case GTK_TYPE_INVALID:
|
||||
/* it doesn't make much sense to retrive these values,
|
||||
* they either are always read-only args, or require
|
||||
* multiple pointers.
|
||||
*/
|
||||
g_warning ("gtk_arg_fill_retloc(): unsupported argument type `%s'",
|
||||
gtk_type_name (arg->type));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+9
-4
@@ -63,6 +63,9 @@ GtkArg* gtk_arg_copy (GtkArg *src_arg,
|
||||
GtkArg *dest_arg);
|
||||
void gtk_arg_free (GtkArg *arg,
|
||||
gboolean free_contents);
|
||||
void gtk_arg_reset (GtkArg *arg);
|
||||
gboolean gtk_arg_values_equal (const GtkArg *arg1,
|
||||
const GtkArg *arg2);
|
||||
gchar* gtk_args_collect (GtkType object_type,
|
||||
GHashTable *arg_info_hash_table,
|
||||
GSList **arg_list_p,
|
||||
@@ -87,10 +90,12 @@ GtkArg* gtk_args_query (GtkType class_type,
|
||||
guint32 **arg_flags,
|
||||
guint *n_args_p);
|
||||
gchar* gtk_arg_name_strip_type (const gchar *arg_name);
|
||||
gint gtk_arg_info_equal (gconstpointer arg_info_1,
|
||||
gconstpointer arg_info_2);
|
||||
guint gtk_arg_info_hash (gconstpointer arg_info);
|
||||
|
||||
gint gtk_arg_info_equal (gconstpointer arg_info_1,
|
||||
gconstpointer arg_info_2);
|
||||
guint gtk_arg_info_hash (gconstpointer arg_info);
|
||||
void gtk_arg_to_valueloc (GtkArg *arg,
|
||||
gpointer value_pointer);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+130
-33
@@ -31,8 +31,22 @@
|
||||
|
||||
#include "gtkaspectframe.h"
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_XALIGN,
|
||||
ARG_YALIGN,
|
||||
ARG_RATIO,
|
||||
ARG_OBEY_CHILD
|
||||
};
|
||||
|
||||
static void gtk_aspect_frame_class_init (GtkAspectFrameClass *klass);
|
||||
static void gtk_aspect_frame_init (GtkAspectFrame *aspect_frame);
|
||||
static void gtk_aspect_frame_init (GtkAspectFrame *aspect_frame);
|
||||
static void gtk_aspect_frame_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_aspect_frame_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_aspect_frame_draw (GtkWidget *widget,
|
||||
GdkRectangle *area);
|
||||
static void gtk_aspect_frame_paint (GtkWidget *widget,
|
||||
@@ -49,7 +63,7 @@ GtkType
|
||||
gtk_aspect_frame_get_type (void)
|
||||
{
|
||||
static GtkType aspect_frame_type = 0;
|
||||
|
||||
|
||||
if (!aspect_frame_type)
|
||||
{
|
||||
static const GtkTypeInfo aspect_frame_info =
|
||||
@@ -63,23 +77,37 @@ gtk_aspect_frame_get_type (void)
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
aspect_frame_type = gtk_type_unique (gtk_frame_get_type (), &aspect_frame_info);
|
||||
|
||||
aspect_frame_type = gtk_type_unique (GTK_TYPE_FRAME, &aspect_frame_info);
|
||||
}
|
||||
|
||||
|
||||
return aspect_frame_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_aspect_frame_class_init (GtkAspectFrameClass *class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (class);
|
||||
widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
object_class->set_arg = gtk_aspect_frame_set_arg;
|
||||
object_class->get_arg = gtk_aspect_frame_get_arg;
|
||||
|
||||
widget_class->draw = gtk_aspect_frame_draw;
|
||||
widget_class->expose_event = gtk_aspect_frame_expose;
|
||||
widget_class->size_allocate = gtk_aspect_frame_size_allocate;
|
||||
|
||||
gtk_object_add_arg_type ("GtkAspectFrame::xalign", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_XALIGN);
|
||||
gtk_object_add_arg_type ("GtkAspectFrame::yalign", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_YALIGN);
|
||||
gtk_object_add_arg_type ("GtkAspectFrame::ratio", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_RATIO);
|
||||
gtk_object_add_arg_type ("GtkAspectFrame::obey_child", GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE, ARG_OBEY_CHILD);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -88,19 +116,86 @@ gtk_aspect_frame_init (GtkAspectFrame *aspect_frame)
|
||||
aspect_frame->xalign = 0.5;
|
||||
aspect_frame->yalign = 0.5;
|
||||
aspect_frame->ratio = 1.0;
|
||||
aspect_frame->obey_child = 1;
|
||||
aspect_frame->obey_child = TRUE;
|
||||
aspect_frame->center_allocation.x = -1;
|
||||
aspect_frame->center_allocation.y = -1;
|
||||
aspect_frame->center_allocation.width = 1;
|
||||
aspect_frame->center_allocation.height = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_aspect_frame_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_XALIGN:
|
||||
gtk_aspect_frame_set (aspect_frame,
|
||||
GTK_VALUE_FLOAT (*arg),
|
||||
aspect_frame->yalign,
|
||||
aspect_frame->ratio,
|
||||
aspect_frame->obey_child);
|
||||
break;
|
||||
case ARG_YALIGN:
|
||||
gtk_aspect_frame_set (aspect_frame,
|
||||
aspect_frame->xalign,
|
||||
GTK_VALUE_FLOAT (*arg),
|
||||
aspect_frame->ratio,
|
||||
aspect_frame->obey_child);
|
||||
break;
|
||||
case ARG_RATIO:
|
||||
gtk_aspect_frame_set (aspect_frame,
|
||||
aspect_frame->xalign,
|
||||
aspect_frame->yalign,
|
||||
GTK_VALUE_FLOAT (*arg),
|
||||
aspect_frame->obey_child);
|
||||
break;
|
||||
case ARG_OBEY_CHILD:
|
||||
gtk_aspect_frame_set (aspect_frame,
|
||||
aspect_frame->xalign,
|
||||
aspect_frame->yalign,
|
||||
aspect_frame->ratio,
|
||||
GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_aspect_frame_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_XALIGN:
|
||||
GTK_VALUE_FLOAT (*arg) = aspect_frame->xalign;
|
||||
break;
|
||||
case ARG_YALIGN:
|
||||
GTK_VALUE_FLOAT (*arg) = aspect_frame->yalign;
|
||||
break;
|
||||
case ARG_RATIO:
|
||||
GTK_VALUE_FLOAT (*arg) = aspect_frame->ratio;
|
||||
break;
|
||||
case ARG_OBEY_CHILD:
|
||||
GTK_VALUE_BOOL (*arg) = aspect_frame->obey_child;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_aspect_frame_new (const gchar *label,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gint obey_child)
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gboolean obey_child)
|
||||
{
|
||||
GtkAspectFrame *aspect_frame;
|
||||
|
||||
@@ -109,7 +204,7 @@ gtk_aspect_frame_new (const gchar *label,
|
||||
aspect_frame->xalign = CLAMP (xalign, 0.0, 1.0);
|
||||
aspect_frame->yalign = CLAMP (yalign, 0.0, 1.0);
|
||||
aspect_frame->ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO);
|
||||
aspect_frame->obey_child = obey_child;
|
||||
aspect_frame->obey_child = obey_child != FALSE;
|
||||
|
||||
gtk_frame_set_label (GTK_FRAME(aspect_frame), label);
|
||||
|
||||
@@ -118,33 +213,34 @@ gtk_aspect_frame_new (const gchar *label,
|
||||
|
||||
void
|
||||
gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gint obey_child)
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gboolean obey_child)
|
||||
{
|
||||
g_return_if_fail (aspect_frame != NULL);
|
||||
g_return_if_fail (GTK_IS_ASPECT_FRAME (aspect_frame));
|
||||
|
||||
|
||||
xalign = CLAMP (xalign, 0.0, 1.0);
|
||||
yalign = CLAMP (yalign, 0.0, 1.0);
|
||||
ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO);
|
||||
|
||||
obey_child = obey_child != FALSE;
|
||||
|
||||
if ((aspect_frame->xalign != xalign) ||
|
||||
(aspect_frame->yalign != yalign) ||
|
||||
(aspect_frame->ratio != ratio) ||
|
||||
(aspect_frame->obey_child != obey_child))
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET(aspect_frame);
|
||||
|
||||
|
||||
aspect_frame->xalign = xalign;
|
||||
aspect_frame->yalign = yalign;
|
||||
aspect_frame->ratio = ratio;
|
||||
aspect_frame->obey_child = obey_child;
|
||||
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE(widget))
|
||||
gtk_widget_queue_clear (widget);
|
||||
|
||||
|
||||
gtk_widget_queue_resize (widget);
|
||||
}
|
||||
}
|
||||
@@ -308,9 +404,10 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
|
||||
gtk_widget_get_child_requisition (bin->child, &child_requisition);
|
||||
if (child_requisition.height != 0)
|
||||
{
|
||||
ratio = (gdouble)child_requisition.width /
|
||||
child_requisition.height;
|
||||
if (ratio < MIN_RATIO) ratio = MIN_RATIO;
|
||||
ratio = ((gdouble) child_requisition.width /
|
||||
child_requisition.height);
|
||||
if (ratio < MIN_RATIO)
|
||||
ratio = MIN_RATIO;
|
||||
}
|
||||
else if (child_requisition.width != 0)
|
||||
ratio = MAX_RATIO;
|
||||
@@ -319,22 +416,22 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
else
|
||||
ratio = aspect_frame->ratio;
|
||||
|
||||
|
||||
x = (GTK_CONTAINER (frame)->border_width +
|
||||
GTK_WIDGET (frame)->style->klass->xthickness);
|
||||
width = allocation->width - x * 2;
|
||||
|
||||
|
||||
y = (GTK_CONTAINER (frame)->border_width +
|
||||
MAX (frame->label_height, GTK_WIDGET (frame)->style->klass->ythickness));
|
||||
MAX (frame->label_height, GTK_WIDGET (frame)->style->klass->ythickness));
|
||||
height = (allocation->height - y -
|
||||
GTK_CONTAINER (frame)->border_width -
|
||||
GTK_WIDGET (frame)->style->klass->ythickness);
|
||||
|
||||
GTK_CONTAINER (frame)->border_width -
|
||||
GTK_WIDGET (frame)->style->klass->ythickness);
|
||||
|
||||
/* make sure we don't allocate a negative width or height,
|
||||
* since that will be cast to a (very big) guint16 */
|
||||
width = MAX (1, width);
|
||||
height = MAX (1, height);
|
||||
|
||||
|
||||
if (ratio * height > width)
|
||||
{
|
||||
child_allocation.width = width;
|
||||
@@ -345,7 +442,7 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
|
||||
child_allocation.width = ratio*height + 0.5;
|
||||
child_allocation.height = height;
|
||||
}
|
||||
|
||||
|
||||
child_allocation.x = aspect_frame->xalign * (width - child_allocation.width) + allocation->x + x;
|
||||
child_allocation.y = aspect_frame->yalign * (height - child_allocation.height) + allocation->y + y;
|
||||
|
||||
|
||||
+10
-10
@@ -67,16 +67,16 @@ struct _GtkAspectFrameClass
|
||||
|
||||
|
||||
GtkType gtk_aspect_frame_get_type (void);
|
||||
GtkWidget* gtk_aspect_frame_new (const gchar *label,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gint obey_child);
|
||||
void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gint obey_child);
|
||||
GtkWidget* gtk_aspect_frame_new (const gchar *label,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gint obey_child);
|
||||
void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gboolean obey_child);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+15
-15
@@ -167,10 +167,13 @@ gtk_bin_draw (GtkWidget *widget,
|
||||
g_return_if_fail (GTK_IS_BIN (widget));
|
||||
|
||||
bin = GTK_BIN (widget);
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child) &&
|
||||
gtk_widget_intersect (bin->child, area, &child_area))
|
||||
gtk_widget_draw (bin->child, &child_area);
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (bin))
|
||||
{
|
||||
if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
|
||||
gtk_widget_intersect (bin->child, area, &child_area))
|
||||
gtk_widget_draw (bin->child, &child_area);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -189,7 +192,7 @@ gtk_bin_expose (GtkWidget *widget,
|
||||
bin = GTK_BIN (widget);
|
||||
|
||||
child_event = *event;
|
||||
if (bin->child &&
|
||||
if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
|
||||
GTK_WIDGET_NO_WINDOW (bin->child) &&
|
||||
gtk_widget_intersect (bin->child, &event->area, &child_event.area))
|
||||
gtk_widget_event (bin->child, (GdkEvent*) &child_event);
|
||||
@@ -216,19 +219,16 @@ gtk_bin_add (GtkContainer *container,
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (bin));
|
||||
bin->child = child;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child->parent))
|
||||
if (GTK_WIDGET_REALIZED (child->parent))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (child->parent) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (child->parent) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
if (GTK_WIDGET_MAPPED (child->parent))
|
||||
gtk_widget_map (child);
|
||||
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (container))
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+2
-1
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <strings.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include "gtkbindings.h"
|
||||
#include "gtksignal.h"
|
||||
@@ -1136,6 +1136,7 @@ gtk_pattern_spec_init (GtkPatternSpec *pspec,
|
||||
t = pspec->pattern_reversed;
|
||||
pspec->pattern_reversed = g_strdup (p);
|
||||
g_free (t);
|
||||
g_free (pspec->pattern);
|
||||
pspec->pattern = g_strdup (pspec->pattern_reversed);
|
||||
g_strreverse (pspec->pattern);
|
||||
pspec->pattern_length = strlen (pspec->pattern);
|
||||
|
||||
+18
-22
@@ -341,20 +341,17 @@ gtk_box_pack_start (GtkBox *box,
|
||||
box->children = g_list_append (box->children, child_info);
|
||||
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (box));
|
||||
|
||||
if (GTK_WIDGET_REALIZED (box))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (box)))
|
||||
if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (GTK_WIDGET (box)) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (GTK_WIDGET (box)) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
if (GTK_WIDGET_MAPPED (box))
|
||||
gtk_widget_map (child);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
|
||||
gtk_widget_queue_resize (child);
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -382,19 +379,16 @@ gtk_box_pack_end (GtkBox *box,
|
||||
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (box));
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (box)))
|
||||
if (GTK_WIDGET_REALIZED (box))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (GTK_WIDGET (box)) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (GTK_WIDGET (box)) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
if (GTK_WIDGET_MAPPED (box))
|
||||
gtk_widget_map (child);
|
||||
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -660,7 +654,8 @@ gtk_box_draw (GtkWidget *widget,
|
||||
child = children->data;
|
||||
children = children->next;
|
||||
|
||||
if (gtk_widget_intersect (child->widget, area, &child_area))
|
||||
if (GTK_WIDGET_DRAWABLE (child->widget) &&
|
||||
gtk_widget_intersect (child->widget, area, &child_area))
|
||||
gtk_widget_draw (child->widget, &child_area);
|
||||
}
|
||||
}
|
||||
@@ -691,7 +686,8 @@ gtk_box_expose (GtkWidget *widget,
|
||||
child = children->data;
|
||||
children = children->next;
|
||||
|
||||
if (GTK_WIDGET_NO_WINDOW (child->widget) &&
|
||||
if (GTK_WIDGET_DRAWABLE (child->widget) &&
|
||||
GTK_WIDGET_NO_WINDOW (child->widget) &&
|
||||
gtk_widget_intersect (child->widget, &event->area, &child_event.area))
|
||||
gtk_widget_event (child->widget, (GdkEvent*) &child_event);
|
||||
}
|
||||
|
||||
+1
-1
@@ -646,7 +646,7 @@ static gint
|
||||
gtk_button_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkButton *bin;
|
||||
GtkBin *bin;
|
||||
GdkEventExpose child_event;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
|
||||
+35
-37
@@ -74,16 +74,49 @@ gtk_check_menu_item_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
check_menu_item_type = gtk_type_unique (gtk_menu_item_get_type (), &check_menu_item_info);
|
||||
check_menu_item_type = gtk_type_unique (GTK_TYPE_MENU_ITEM, &check_menu_item_info);
|
||||
}
|
||||
|
||||
return check_menu_item_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkMenuItemClass *menu_item_class;
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
menu_item_class = (GtkMenuItemClass*) klass;
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_MENU_ITEM);
|
||||
|
||||
widget_class->draw = gtk_check_menu_item_draw;
|
||||
widget_class->expose_event = gtk_check_menu_item_expose;
|
||||
|
||||
menu_item_class->activate = gtk_check_menu_item_activate;
|
||||
menu_item_class->toggle_size = 12;
|
||||
menu_item_class->hide_on_activate = FALSE;
|
||||
|
||||
klass->toggled = NULL;
|
||||
klass->draw_indicator = gtk_real_check_menu_item_draw_indicator;
|
||||
|
||||
check_menu_item_signals[TOGGLED] =
|
||||
gtk_signal_new ("toggled",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkCheckMenuItemClass, toggled),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
gtk_object_class_add_signals (object_class, check_menu_item_signals, LAST_SIGNAL);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_check_menu_item_new (void)
|
||||
{
|
||||
return GTK_WIDGET (gtk_type_new (gtk_check_menu_item_get_type ()));
|
||||
return GTK_WIDGET (gtk_type_new (GTK_TYPE_CHECK_MENU_ITEM));
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
@@ -132,41 +165,6 @@ gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item)
|
||||
gtk_signal_emit (GTK_OBJECT (check_menu_item), check_menu_item_signals[TOGGLED]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkMenuItemClass *menu_item_class;
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
menu_item_class = (GtkMenuItemClass*) klass;
|
||||
|
||||
parent_class = gtk_type_class (gtk_menu_item_get_type ());
|
||||
|
||||
check_menu_item_signals[TOGGLED] =
|
||||
gtk_signal_new ("toggled",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkCheckMenuItemClass, toggled),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, check_menu_item_signals, LAST_SIGNAL);
|
||||
|
||||
widget_class->draw = gtk_check_menu_item_draw;
|
||||
widget_class->expose_event = gtk_check_menu_item_expose;
|
||||
|
||||
menu_item_class->activate = gtk_check_menu_item_activate;
|
||||
menu_item_class->toggle_size = 12;
|
||||
|
||||
menu_item_class->hide_on_activate = FALSE;
|
||||
|
||||
klass->toggled = NULL;
|
||||
klass->draw_indicator = gtk_real_check_menu_item_draw_indicator;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
|
||||
{
|
||||
|
||||
+295
-227
@@ -39,7 +39,7 @@
|
||||
#define MAX_BUTTON 5
|
||||
|
||||
/* the number rows memchunk expands at a time */
|
||||
#define CLIST_OPTIMUM_SIZE 512
|
||||
#define CLIST_OPTIMUM_SIZE 64
|
||||
|
||||
/* the width of the column resize windows */
|
||||
#define DRAG_WIDTH 6
|
||||
@@ -134,8 +134,7 @@ LIST_WIDTH (GtkCList * clist)
|
||||
|
||||
|
||||
/* Signals */
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
SELECT_ROW,
|
||||
UNSELECT_ROW,
|
||||
ROW_MOVE,
|
||||
@@ -155,8 +154,7 @@ enum
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
SYNC_REMOVE,
|
||||
SYNC_INSERT
|
||||
};
|
||||
@@ -169,7 +167,8 @@ enum {
|
||||
ARG_ROW_HEIGHT,
|
||||
ARG_TITLES_ACTIVE,
|
||||
ARG_REORDERABLE,
|
||||
ARG_USE_DRAG_ICONS
|
||||
ARG_USE_DRAG_ICONS,
|
||||
ARG_SORT_TYPE
|
||||
};
|
||||
|
||||
/* GtkCList Methods */
|
||||
@@ -438,11 +437,18 @@ static GList *gtk_clist_mergesort (GtkCList *clist,
|
||||
GList *list,
|
||||
gint num);
|
||||
/* Misc */
|
||||
static gboolean title_focus (GtkCList *clist,
|
||||
gint dir);
|
||||
static void real_row_move (GtkCList *clist,
|
||||
gint source_row,
|
||||
gint dest_row);
|
||||
static gboolean title_focus (GtkCList *clist,
|
||||
gint dir);
|
||||
static void real_row_move (GtkCList *clist,
|
||||
gint source_row,
|
||||
gint dest_row);
|
||||
static gint column_title_passive_func (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
static void drag_dest_cell (GtkCList *clist,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkCListDestInfo *dest_info);
|
||||
|
||||
|
||||
|
||||
@@ -518,7 +524,10 @@ gtk_clist_class_init (GtkCListClass *klass)
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_USE_DRAG_ICONS);
|
||||
|
||||
gtk_object_add_arg_type ("GtkCList::sort_type",
|
||||
GTK_TYPE_SORT_TYPE,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_SORT_TYPE);
|
||||
object_class->set_arg = gtk_clist_set_arg;
|
||||
object_class->get_arg = gtk_clist_get_arg;
|
||||
object_class->destroy = gtk_clist_destroy;
|
||||
@@ -847,7 +856,8 @@ gtk_clist_set_arg (GtkObject *object,
|
||||
case ARG_USE_DRAG_ICONS:
|
||||
gtk_clist_set_use_drag_icons (clist, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
default:
|
||||
case ARG_SORT_TYPE:
|
||||
gtk_clist_set_sort_type (clist, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -893,6 +903,9 @@ gtk_clist_get_arg (GtkObject *object,
|
||||
case ARG_USE_DRAG_ICONS:
|
||||
GTK_VALUE_BOOL (*arg) = GTK_CLIST_USE_DRAG_ICONS (clist);
|
||||
break;
|
||||
case ARG_SORT_TYPE:
|
||||
GTK_VALUE_ENUM (*arg) = clist->sort_type;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
@@ -1296,39 +1309,49 @@ gtk_clist_column_title_active (GtkCList *clist,
|
||||
|
||||
if (column < 0 || column >= clist->columns)
|
||||
return;
|
||||
if (!clist->column[column].button)
|
||||
if (!clist->column[column].button || !clist->column[column].button_passive)
|
||||
return;
|
||||
|
||||
if (!GTK_WIDGET_SENSITIVE (clist->column[column].button) ||
|
||||
!GTK_WIDGET_CAN_FOCUS (clist->column[column].button))
|
||||
{
|
||||
GTK_WIDGET_SET_FLAGS (clist->column[column].button,
|
||||
GTK_SENSITIVE | GTK_CAN_FOCUS);
|
||||
if (GTK_WIDGET_VISIBLE (clist))
|
||||
gtk_widget_queue_draw (clist->column[column].button);
|
||||
}
|
||||
clist->column[column].button_passive = FALSE;
|
||||
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (clist->column[column].button),
|
||||
(GtkSignalFunc) column_title_passive_func,
|
||||
NULL);
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
|
||||
if (GTK_WIDGET_VISIBLE (clist))
|
||||
gtk_widget_queue_draw (clist->column[column].button);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_clist_column_title_passive (GtkCList *clist,
|
||||
gint column)
|
||||
{
|
||||
GtkButton *button;
|
||||
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CLIST (clist));
|
||||
|
||||
if (column < 0 || column >= clist->columns)
|
||||
return;
|
||||
if (!clist->column[column].button)
|
||||
if (!clist->column[column].button || clist->column[column].button_passive)
|
||||
return;
|
||||
|
||||
if (GTK_WIDGET_SENSITIVE (clist->column[column].button) ||
|
||||
GTK_WIDGET_CAN_FOCUS (clist->column[column].button))
|
||||
{
|
||||
GTK_WIDGET_UNSET_FLAGS (clist->column[column].button,
|
||||
GTK_SENSITIVE | GTK_CAN_FOCUS);
|
||||
if (GTK_WIDGET_VISIBLE (clist))
|
||||
gtk_widget_queue_draw (clist->column[column].button);
|
||||
}
|
||||
button = GTK_BUTTON (clist->column[column].button);
|
||||
|
||||
clist->column[column].button_passive = TRUE;
|
||||
|
||||
if (button->button_down)
|
||||
gtk_button_released (button);
|
||||
if (button->in_button)
|
||||
gtk_button_leave (button);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (clist->column[column].button), "event",
|
||||
(GtkSignalFunc) column_title_passive_func, NULL);
|
||||
|
||||
GTK_WIDGET_UNSET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
|
||||
if (GTK_WIDGET_VISIBLE (clist))
|
||||
gtk_widget_queue_draw (clist->column[column].button);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1589,7 +1612,7 @@ gtk_clist_set_column_visibility (GtkCList *clist,
|
||||
void
|
||||
gtk_clist_set_column_resizeable (GtkCList *clist,
|
||||
gint column,
|
||||
gint resizeable)
|
||||
gboolean resizeable)
|
||||
{
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CLIST (clist));
|
||||
@@ -1764,6 +1787,7 @@ gtk_clist_set_column_max_width (GtkCList *clist,
|
||||
* new_column_width
|
||||
* column_button_create
|
||||
* column_button_clicked
|
||||
* column_title_passive_func
|
||||
*/
|
||||
static void
|
||||
column_auto_resize (GtkCList *clist,
|
||||
@@ -2079,7 +2103,6 @@ column_button_create (GtkCList *clist,
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
(GtkSignalFunc) column_button_clicked,
|
||||
(gpointer) clist);
|
||||
|
||||
gtk_widget_show (button);
|
||||
}
|
||||
|
||||
@@ -2103,84 +2126,29 @@ column_button_clicked (GtkWidget *widget,
|
||||
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[CLICK_COLUMN], i);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_clist_set_row_height (GtkCList *clist,
|
||||
guint height)
|
||||
static gint
|
||||
column_title_passive_func (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CLIST (clist));
|
||||
|
||||
widget = GTK_WIDGET (clist);
|
||||
|
||||
if (height > 0)
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
clist->row_height = height;
|
||||
GTK_CLIST_SET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
|
||||
case GDK_MOTION_NOTIFY:
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_2BUTTON_PRESS:
|
||||
case GDK_3BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
case GDK_ENTER_NOTIFY:
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
return TRUE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
GTK_CLIST_UNSET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
|
||||
clist->row_height = 0;
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_REALIZED (clist))
|
||||
{
|
||||
if (!GTK_CLIST_ROW_HEIGHT_SET(clist))
|
||||
{
|
||||
clist->row_height = (widget->style->font->ascent +
|
||||
widget->style->font->descent + 1);
|
||||
clist->row_center_offset = widget->style->font->ascent + 1.5;
|
||||
}
|
||||
else
|
||||
clist->row_center_offset = 1.5 + (clist->row_height +
|
||||
widget->style->font->ascent -
|
||||
widget->style->font->descent - 1) / 2;
|
||||
}
|
||||
|
||||
CLIST_REFRESH (clist);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_clist_moveto (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
gfloat row_align,
|
||||
gfloat col_align)
|
||||
{
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CLIST (clist));
|
||||
|
||||
if (row < -1 || row >= clist->rows)
|
||||
return;
|
||||
if (column < -1 || column >= clist->columns)
|
||||
return;
|
||||
|
||||
row_align = CLAMP (row_align, 0, 1);
|
||||
col_align = CLAMP (col_align, 0, 1);
|
||||
|
||||
/* adjust horizontal scrollbar */
|
||||
if (clist->hadjustment && column >= 0)
|
||||
{
|
||||
gint x;
|
||||
|
||||
x = (COLUMN_LEFT (clist, column) - CELL_SPACING - COLUMN_INSET -
|
||||
(col_align * (clist->clist_window_width - 2 * COLUMN_INSET -
|
||||
CELL_SPACING - clist->column[column].area.width)));
|
||||
if (x < 0)
|
||||
gtk_adjustment_set_value (clist->hadjustment, 0.0);
|
||||
else if (x > LIST_WIDTH (clist) - clist->clist_window_width)
|
||||
gtk_adjustment_set_value
|
||||
(clist->hadjustment, LIST_WIDTH (clist) - clist->clist_window_width);
|
||||
else
|
||||
gtk_adjustment_set_value (clist->hadjustment, x);
|
||||
}
|
||||
|
||||
/* adjust vertical scrollbar */
|
||||
if (clist->vadjustment && row >= 0)
|
||||
move_vertical (clist, row, row_align);
|
||||
}
|
||||
|
||||
/* PUBLIC CELL FUNCTIONS
|
||||
* gtk_clist_get_cell_type
|
||||
@@ -2413,7 +2381,7 @@ gtk_clist_set_shift (GtkCList *clist,
|
||||
gint vertical,
|
||||
gint horizontal)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
GtkRequisition requisition = { 0 };
|
||||
GtkCListRow *clist_row;
|
||||
|
||||
g_return_if_fail (clist != NULL);
|
||||
@@ -2774,8 +2742,7 @@ real_remove_row (GtkCList *clist,
|
||||
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
||||
row, -1, NULL);
|
||||
|
||||
/* reset the row end pointer if we're removing at the
|
||||
* end of the list */
|
||||
/* reset the row end pointer if we're removing at the end of the list */
|
||||
clist->rows--;
|
||||
if (clist->row_list == list)
|
||||
clist->row_list = g_list_next (list);
|
||||
@@ -2934,6 +2901,8 @@ real_row_move (GtkCList *clist,
|
||||
}
|
||||
|
||||
/* PUBLIC ROW FUNCTIONS
|
||||
* gtk_clist_moveto
|
||||
* gtk_clist_set_row_height
|
||||
* gtk_clist_set_row_data
|
||||
* gtk_clist_set_row_data_full
|
||||
* gtk_clist_get_row_data
|
||||
@@ -2944,6 +2913,85 @@ real_row_move (GtkCList *clist,
|
||||
* gtk_clist_set_foreground
|
||||
* gtk_clist_set_background
|
||||
*/
|
||||
void
|
||||
gtk_clist_moveto (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
gfloat row_align,
|
||||
gfloat col_align)
|
||||
{
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CLIST (clist));
|
||||
|
||||
if (row < -1 || row >= clist->rows)
|
||||
return;
|
||||
if (column < -1 || column >= clist->columns)
|
||||
return;
|
||||
|
||||
row_align = CLAMP (row_align, 0, 1);
|
||||
col_align = CLAMP (col_align, 0, 1);
|
||||
|
||||
/* adjust horizontal scrollbar */
|
||||
if (clist->hadjustment && column >= 0)
|
||||
{
|
||||
gint x;
|
||||
|
||||
x = (COLUMN_LEFT (clist, column) - CELL_SPACING - COLUMN_INSET -
|
||||
(col_align * (clist->clist_window_width - 2 * COLUMN_INSET -
|
||||
CELL_SPACING - clist->column[column].area.width)));
|
||||
if (x < 0)
|
||||
gtk_adjustment_set_value (clist->hadjustment, 0.0);
|
||||
else if (x > LIST_WIDTH (clist) - clist->clist_window_width)
|
||||
gtk_adjustment_set_value
|
||||
(clist->hadjustment, LIST_WIDTH (clist) - clist->clist_window_width);
|
||||
else
|
||||
gtk_adjustment_set_value (clist->hadjustment, x);
|
||||
}
|
||||
|
||||
/* adjust vertical scrollbar */
|
||||
if (clist->vadjustment && row >= 0)
|
||||
move_vertical (clist, row, row_align);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_clist_set_row_height (GtkCList *clist,
|
||||
guint height)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CLIST (clist));
|
||||
|
||||
widget = GTK_WIDGET (clist);
|
||||
|
||||
if (height > 0)
|
||||
{
|
||||
clist->row_height = height;
|
||||
GTK_CLIST_SET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
|
||||
}
|
||||
else
|
||||
{
|
||||
GTK_CLIST_UNSET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
|
||||
clist->row_height = 0;
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_REALIZED (clist))
|
||||
{
|
||||
if (!GTK_CLIST_ROW_HEIGHT_SET(clist))
|
||||
{
|
||||
clist->row_height = (widget->style->font->ascent +
|
||||
widget->style->font->descent + 1);
|
||||
clist->row_center_offset = widget->style->font->ascent + 1.5;
|
||||
}
|
||||
else
|
||||
clist->row_center_offset = 1.5 + (clist->row_height +
|
||||
widget->style->font->ascent -
|
||||
widget->style->font->descent - 1) / 2;
|
||||
}
|
||||
|
||||
CLIST_REFRESH (clist);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_clist_set_row_data (GtkCList *clist,
|
||||
gint row,
|
||||
@@ -3152,7 +3200,7 @@ gtk_clist_set_cell_style (GtkCList *clist,
|
||||
gint column,
|
||||
GtkStyle *style)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
GtkRequisition requisition = { 0 };
|
||||
GtkCListRow *clist_row;
|
||||
|
||||
g_return_if_fail (clist != NULL);
|
||||
@@ -3827,8 +3875,11 @@ real_undo_selection (GtkCList *clist)
|
||||
GPOINTER_TO_INT (work->data), -1, NULL);
|
||||
|
||||
for (work = clist->undo_unselection; work; work = work->next)
|
||||
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
||||
GPOINTER_TO_INT (work->data), -1, NULL);
|
||||
{
|
||||
g_print ("unselect %d\n",GPOINTER_TO_INT (work->data));
|
||||
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
||||
GPOINTER_TO_INT (work->data), -1, NULL);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_HAS_FOCUS(clist) && clist->focus_row != clist->undo_anchor)
|
||||
{
|
||||
@@ -3984,9 +4035,9 @@ resync_selection (GtkCList *clist,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (list = g_list_reverse (clist->undo_unselection); list;
|
||||
list = list->next)
|
||||
|
||||
clist->undo_unselection = g_list_reverse (clist->undo_unselection);
|
||||
for (list = clist->undo_unselection; list; list = list->next)
|
||||
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
||||
GPOINTER_TO_INT (list->data), -1, event);
|
||||
|
||||
@@ -4465,7 +4516,8 @@ gtk_clist_realize (GtkWidget *widget)
|
||||
/* We'll use this gc to do scrolling as well */
|
||||
gdk_gc_set_exposures (clist->fg_gc, TRUE);
|
||||
|
||||
values.foreground = widget->style->white;
|
||||
values.foreground = (widget->style->white.pixel==0 ?
|
||||
widget->style->black:widget->style->white);
|
||||
values.function = GDK_XOR;
|
||||
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
|
||||
clist->xor_gc = gdk_gc_new_with_values (widget->window,
|
||||
@@ -4517,8 +4569,12 @@ gtk_clist_unrealize (GtkWidget *widget)
|
||||
/* freeze the list */
|
||||
clist->freeze_count++;
|
||||
|
||||
/* detach optional row/cell styles */
|
||||
if (GTK_WIDGET_MAPPED (widget))
|
||||
gtk_clist_unmap (widget);
|
||||
|
||||
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
|
||||
|
||||
/* detach optional row/cell styles */
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
{
|
||||
GtkCListRow *clist_row;
|
||||
@@ -4545,12 +4601,16 @@ gtk_clist_unrealize (GtkWidget *widget)
|
||||
gdk_gc_destroy (clist->bg_gc);
|
||||
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
if (clist->column[i].window)
|
||||
{
|
||||
gdk_window_set_user_data (clist->column[i].window, NULL);
|
||||
gdk_window_destroy (clist->column[i].window);
|
||||
clist->column[i].window = NULL;
|
||||
}
|
||||
{
|
||||
if (clist->column[i].button)
|
||||
gtk_widget_unrealize (clist->column[i].button);
|
||||
if (clist->column[i].window)
|
||||
{
|
||||
gdk_window_set_user_data (clist->column[i].window, NULL);
|
||||
gdk_window_destroy (clist->column[i].window);
|
||||
clist->column[i].window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gdk_window_set_user_data (clist->clist_window, NULL);
|
||||
gdk_window_destroy (clist->clist_window);
|
||||
@@ -4586,10 +4646,12 @@ gtk_clist_map (GtkWidget *widget)
|
||||
|
||||
/* map column buttons */
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
if (clist->column[i].button &&
|
||||
GTK_WIDGET_VISIBLE (clist->column[i].button) &&
|
||||
!GTK_WIDGET_MAPPED (clist->column[i].button))
|
||||
gtk_widget_map (clist->column[i].button);
|
||||
{
|
||||
if (clist->column[i].button &&
|
||||
GTK_WIDGET_VISIBLE (clist->column[i].button) &&
|
||||
!GTK_WIDGET_MAPPED (clist->column[i].button))
|
||||
gtk_widget_map (clist->column[i].button);
|
||||
}
|
||||
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
if (clist->column[i].window && clist->column[i].button)
|
||||
@@ -4699,7 +4761,7 @@ gtk_clist_draw (GtkWidget *widget,
|
||||
(2 * widget->style->klass->ythickness) +
|
||||
clist->column_title_area.height);
|
||||
|
||||
gdk_window_clear_area (clist->clist_window, 0, 0, -1, -1);
|
||||
gdk_window_clear_area (clist->clist_window, 0, 0, 0, 0);
|
||||
draw_rows (clist, NULL);
|
||||
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
@@ -5107,6 +5169,7 @@ gtk_clist_button_release (GtkWidget *widget,
|
||||
{
|
||||
case GTK_SELECTION_EXTENDED:
|
||||
if (!(event->state & GDK_SHIFT_MASK) ||
|
||||
!GTK_WIDGET_CAN_FOCUS (widget) ||
|
||||
event->x < 0 || event->x >= clist->clist_window_width ||
|
||||
event->y < 0 || event->y >= clist->clist_window_height)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection
|
||||
@@ -5891,8 +5954,8 @@ draw_rows (GtkCList *clist,
|
||||
}
|
||||
|
||||
if (!area)
|
||||
gdk_window_clear_area (clist->clist_window,
|
||||
0, ROW_TOP_YPIXEL (clist, i), -1, -1);
|
||||
gdk_window_clear_area (clist->clist_window, 0,
|
||||
ROW_TOP_YPIXEL (clist, i), 0, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -5992,7 +6055,8 @@ adjust_adjustments (GtkCList *clist,
|
||||
clist->vadjustment->lower = 0;
|
||||
clist->vadjustment->upper = LIST_HEIGHT (clist);
|
||||
|
||||
if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist))
|
||||
if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist) ||
|
||||
(clist->voffset + (gint)clist->vadjustment->value) != 0)
|
||||
{
|
||||
clist->vadjustment->value = MAX (0, (LIST_HEIGHT (clist) -
|
||||
clist->clist_window_height));
|
||||
@@ -6010,7 +6074,8 @@ adjust_adjustments (GtkCList *clist,
|
||||
clist->hadjustment->lower = 0;
|
||||
clist->hadjustment->upper = LIST_WIDTH (clist);
|
||||
|
||||
if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist))
|
||||
if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist) ||
|
||||
(clist->hoffset + (gint)clist->hadjustment->value) != 0)
|
||||
{
|
||||
clist->hadjustment->value = MAX (0, (LIST_WIDTH (clist) -
|
||||
clist->clist_window_width));
|
||||
@@ -6356,6 +6421,7 @@ columns_new (GtkCList *clist)
|
||||
column[i].width_set = FALSE;
|
||||
column[i].resizeable = TRUE;
|
||||
column[i].auto_resize = FALSE;
|
||||
column[i].button_passive = FALSE;
|
||||
column[i].justification = GTK_JUSTIFY_LEFT;
|
||||
}
|
||||
|
||||
@@ -7038,19 +7104,14 @@ move_vertical (GtkCList *clist,
|
||||
static gint
|
||||
horizontal_timeout (GtkCList *clist)
|
||||
{
|
||||
gint x, y;
|
||||
GdkEventMotion event;
|
||||
GdkModifierType mask;
|
||||
GdkEventMotion event = { 0 };
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
clist->htimer = 0;
|
||||
gdk_window_get_pointer (clist->clist_window, &x, &y, &mask);
|
||||
|
||||
event.is_hint = 0;
|
||||
event.x = x;
|
||||
event.y = y;
|
||||
event.state = mask;
|
||||
event.type = GDK_MOTION_NOTIFY;
|
||||
event.send_event = TRUE;
|
||||
|
||||
gtk_clist_motion (GTK_WIDGET (clist), &event);
|
||||
|
||||
@@ -7062,19 +7123,14 @@ horizontal_timeout (GtkCList *clist)
|
||||
static gint
|
||||
vertical_timeout (GtkCList *clist)
|
||||
{
|
||||
gint x, y;
|
||||
GdkEventMotion event;
|
||||
GdkModifierType mask;
|
||||
GdkEventMotion event = { 0 };
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
clist->vtimer = 0;
|
||||
gdk_window_get_pointer (clist->clist_window, &x, &y, &mask);
|
||||
|
||||
event.is_hint = 0;
|
||||
event.x = x;
|
||||
event.y = y;
|
||||
event.state = mask;
|
||||
event.type = GDK_MOTION_NOTIFY;
|
||||
event.send_event = TRUE;
|
||||
|
||||
gtk_clist_motion (GTK_WIDGET (clist), &event);
|
||||
|
||||
@@ -7369,6 +7425,62 @@ drag_dest_info_destroy (gpointer data)
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
static void
|
||||
drag_dest_cell (GtkCList *clist,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkCListDestInfo *dest_info)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = GTK_WIDGET (clist);
|
||||
|
||||
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
|
||||
|
||||
y -= (GTK_CONTAINER (clist)->border_width +
|
||||
widget->style->klass->ythickness +
|
||||
clist->column_title_area.height);
|
||||
|
||||
dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
|
||||
if (dest_info->cell.row >= clist->rows)
|
||||
{
|
||||
dest_info->cell.row = clist->rows - 1;
|
||||
y = ROW_TOP_YPIXEL (clist, dest_info->cell.row) + clist->row_height;
|
||||
}
|
||||
if (dest_info->cell.row < -1)
|
||||
dest_info->cell.row = -1;
|
||||
|
||||
x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
|
||||
dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
|
||||
|
||||
if (dest_info->cell.row >= 0)
|
||||
{
|
||||
gint y_delta;
|
||||
gint h = 0;
|
||||
|
||||
y_delta = y - ROW_TOP_YPIXEL (clist, dest_info->cell.row);
|
||||
|
||||
if (GTK_CLIST_DRAW_DRAG_RECT(clist))
|
||||
{
|
||||
dest_info->insert_pos = GTK_CLIST_DRAG_INTO;
|
||||
h = clist->row_height / 4;
|
||||
}
|
||||
else if (GTK_CLIST_DRAW_DRAG_LINE(clist))
|
||||
{
|
||||
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
|
||||
h = clist->row_height / 2;
|
||||
}
|
||||
|
||||
if (GTK_CLIST_DRAW_DRAG_LINE(clist))
|
||||
{
|
||||
if (y_delta < h)
|
||||
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
|
||||
else if (clist->row_height - y_delta < h)
|
||||
dest_info->insert_pos = GTK_CLIST_DRAG_AFTER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_clist_drag_begin (GtkWidget *widget,
|
||||
GdkDragContext *context)
|
||||
@@ -7486,56 +7598,14 @@ gtk_clist_drag_motion (GtkWidget *widget,
|
||||
guint time)
|
||||
{
|
||||
GtkCList *clist;
|
||||
gint row, column;
|
||||
GtkCListDestInfo new_info;
|
||||
GtkCListDestInfo *dest_info;
|
||||
gint h = 0;
|
||||
gint insert_pos = GTK_CLIST_DRAG_NONE;
|
||||
gint y_delta;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
||||
|
||||
clist = GTK_CLIST (widget);
|
||||
|
||||
y -= (GTK_CONTAINER (widget)->border_width +
|
||||
widget->style->klass->ythickness + clist->column_title_area.height);
|
||||
row = ROW_FROM_YPIXEL (clist, y);
|
||||
|
||||
if (row >= clist->rows)
|
||||
{
|
||||
row = clist->rows - 1;
|
||||
y = ROW_TOP_YPIXEL (clist, row) + clist->row_height;
|
||||
}
|
||||
if (row < -1)
|
||||
row = -1;
|
||||
|
||||
x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
|
||||
column = COLUMN_FROM_XPIXEL (clist, x);
|
||||
|
||||
if (row >= 0)
|
||||
{
|
||||
y_delta = y - ROW_TOP_YPIXEL (clist, row);
|
||||
|
||||
if (GTK_CLIST_DRAW_DRAG_RECT(clist))
|
||||
{
|
||||
insert_pos = GTK_CLIST_DRAG_INTO;
|
||||
h = clist->row_height / 4;
|
||||
}
|
||||
else if (GTK_CLIST_DRAW_DRAG_LINE(clist))
|
||||
{
|
||||
insert_pos = GTK_CLIST_DRAG_BEFORE;
|
||||
h = clist->row_height / 2;
|
||||
}
|
||||
|
||||
if (GTK_CLIST_DRAW_DRAG_LINE(clist))
|
||||
{
|
||||
if (y_delta < h)
|
||||
insert_pos = GTK_CLIST_DRAG_BEFORE;
|
||||
else if (clist->row_height - y_delta < h)
|
||||
insert_pos = GTK_CLIST_DRAG_AFTER;
|
||||
}
|
||||
}
|
||||
|
||||
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
|
||||
|
||||
if (!dest_info)
|
||||
@@ -7550,6 +7620,8 @@ gtk_clist_drag_motion (GtkWidget *widget,
|
||||
drag_dest_info_destroy);
|
||||
}
|
||||
|
||||
drag_dest_cell (clist, x, y, &new_info);
|
||||
|
||||
if (GTK_CLIST_REORDERABLE (clist))
|
||||
{
|
||||
GList *list;
|
||||
@@ -7566,12 +7638,12 @@ gtk_clist_drag_motion (GtkWidget *widget,
|
||||
if (list)
|
||||
{
|
||||
if (gtk_drag_get_source_widget (context) != widget ||
|
||||
insert_pos == GTK_CLIST_DRAG_NONE ||
|
||||
row == clist->click_cell.row ||
|
||||
(row == clist->click_cell.row - 1 &&
|
||||
insert_pos == GTK_CLIST_DRAG_AFTER) ||
|
||||
(row == clist->click_cell.row + 1 &&
|
||||
insert_pos == GTK_CLIST_DRAG_BEFORE))
|
||||
new_info.insert_pos == GTK_CLIST_DRAG_NONE ||
|
||||
new_info.cell.row == clist->click_cell.row ||
|
||||
(new_info.cell.row == clist->click_cell.row - 1 &&
|
||||
new_info.insert_pos == GTK_CLIST_DRAG_AFTER) ||
|
||||
(new_info.cell.row == clist->click_cell.row + 1 &&
|
||||
new_info.insert_pos == GTK_CLIST_DRAG_BEFORE))
|
||||
{
|
||||
if (dest_info->cell.row < 0)
|
||||
{
|
||||
@@ -7581,9 +7653,9 @@ gtk_clist_drag_motion (GtkWidget *widget,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (row != dest_info->cell.row ||
|
||||
(row == dest_info->cell.row &&
|
||||
dest_info->insert_pos != insert_pos))
|
||||
if (new_info.cell.row != dest_info->cell.row ||
|
||||
(new_info.cell.row == dest_info->cell.row &&
|
||||
dest_info->insert_pos != new_info.insert_pos))
|
||||
{
|
||||
if (dest_info->cell.row >= 0)
|
||||
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
|
||||
@@ -7591,9 +7663,9 @@ gtk_clist_drag_motion (GtkWidget *widget,
|
||||
dest_info->cell.row)->data,
|
||||
dest_info->cell.row, dest_info->insert_pos);
|
||||
|
||||
dest_info->insert_pos = insert_pos;
|
||||
dest_info->cell.row = row;
|
||||
dest_info->cell.column = column;
|
||||
dest_info->insert_pos = new_info.insert_pos;
|
||||
dest_info->cell.row = new_info.cell.row;
|
||||
dest_info->cell.column = new_info.cell.column;
|
||||
|
||||
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
|
||||
(clist, g_list_nth (clist->row_list,
|
||||
@@ -7606,9 +7678,9 @@ gtk_clist_drag_motion (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
dest_info->insert_pos = insert_pos;
|
||||
dest_info->cell.row = row;
|
||||
dest_info->cell.column = column;
|
||||
dest_info->insert_pos = new_info.insert_pos;
|
||||
dest_info->cell.row = new_info.cell.row;
|
||||
dest_info->cell.column = new_info.cell.column;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -7666,22 +7738,21 @@ gtk_clist_drag_data_received (GtkWidget *widget,
|
||||
selection_data->length == sizeof (GtkCListCellInfo))
|
||||
{
|
||||
GtkCListCellInfo *source_info;
|
||||
GtkCListDestInfo *dest_info;
|
||||
|
||||
source_info = (GtkCListCellInfo *)(selection_data->data);
|
||||
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
|
||||
|
||||
if (dest_info && source_info)
|
||||
if (source_info)
|
||||
{
|
||||
if (dest_info->insert_pos == GTK_CLIST_DRAG_AFTER)
|
||||
dest_info->cell.row++;
|
||||
if (source_info->row < dest_info->cell.row)
|
||||
dest_info->cell.row--;
|
||||
GtkCListDestInfo dest_info;
|
||||
|
||||
drag_dest_cell (clist, x, y, &dest_info);
|
||||
|
||||
if (dest_info.insert_pos == GTK_CLIST_DRAG_AFTER)
|
||||
dest_info.cell.row++;
|
||||
if (source_info->row < dest_info.cell.row)
|
||||
dest_info.cell.row--;
|
||||
if (dest_info.cell.row != source_info->row)
|
||||
gtk_clist_row_move (clist, source_info->row, dest_info.cell.row);
|
||||
|
||||
if (dest_info->cell.row != source_info->row)
|
||||
gtk_clist_row_move (GTK_CLIST (widget),
|
||||
source_info->row,
|
||||
dest_info->cell.row);
|
||||
g_dataset_remove_data (context, "gtk-clist-drag-dest");
|
||||
}
|
||||
}
|
||||
@@ -7708,21 +7779,18 @@ gtk_clist_drag_data_get (GtkWidget *widget,
|
||||
|
||||
if (info)
|
||||
{
|
||||
GtkCListCellInfo *ret_info;
|
||||
GtkCListCellInfo ret_info;
|
||||
|
||||
ret_info = g_new (GtkCListCellInfo, 1);
|
||||
ret_info->row = info->row;
|
||||
ret_info->column = info->column;
|
||||
ret_info.row = info->row;
|
||||
ret_info.column = info->column;
|
||||
|
||||
gtk_selection_data_set (selection_data,
|
||||
selection_data->target,
|
||||
GTK_TYPE_POINTER,
|
||||
(guchar *) ret_info,
|
||||
gtk_selection_data_set (selection_data, selection_data->target,
|
||||
GTK_TYPE_POINTER, (guchar *) &ret_info,
|
||||
sizeof (GtkCListCellInfo));
|
||||
}
|
||||
else
|
||||
gtk_selection_data_set (selection_data, selection_data->target,
|
||||
GTK_TYPE_POINTER, NULL, 0);
|
||||
GTK_TYPE_POINTER, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -42,8 +42,7 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* clist flags */
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
GTK_CLIST_IN_DRAG = 1 << 0,
|
||||
GTK_CLIST_ROW_HEIGHT_SET = 1 << 1,
|
||||
GTK_CLIST_SHOW_TITLES = 1 << 2,
|
||||
@@ -330,10 +329,11 @@ struct _GtkCListColumn
|
||||
gint max_width;
|
||||
GtkJustification justification;
|
||||
|
||||
guint visible : 1;
|
||||
guint width_set : 1;
|
||||
guint resizeable : 1;
|
||||
guint auto_resize : 1;
|
||||
guint visible : 1;
|
||||
guint width_set : 1;
|
||||
guint resizeable : 1;
|
||||
guint auto_resize : 1;
|
||||
guint button_passive : 1;
|
||||
};
|
||||
|
||||
struct _GtkCListRow
|
||||
|
||||
+84
-25
@@ -62,32 +62,34 @@
|
||||
#define SAMPLE_HEIGHT 28
|
||||
|
||||
static void gtk_color_selection_class_init (GtkColorSelectionClass *klass);
|
||||
static void gtk_color_selection_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_color_selection_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_color_selection_init (GtkColorSelection *colorsel);
|
||||
static void gtk_color_selection_dialog_class_init(GtkColorSelectionDialogClass *klass);
|
||||
static void gtk_color_selection_dialog_init(GtkColorSelectionDialog *colorseldiag);
|
||||
static void gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass);
|
||||
static void gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag);
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
COLOR_CHANGED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
RGB_INPUTS = 1 << 0,
|
||||
HSV_INPUTS = 1 << 1,
|
||||
OPACITY_INPUTS = 1 << 2
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
SCALE,
|
||||
ENTRY,
|
||||
BOTH
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
HUE,
|
||||
SATURATION,
|
||||
VALUE,
|
||||
@@ -98,6 +100,12 @@ enum
|
||||
NUM_CHANNELS
|
||||
};
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_UPDATE_POLICY,
|
||||
ARG_USE_OPACITY
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gchar *label;
|
||||
@@ -219,10 +227,10 @@ static const scale_val_type scale_vals[NUM_CHANNELS] =
|
||||
{N_("Opacity:"), 0.0, 1.0, 0.01, 0.01, (SF) gtk_color_selection_opacity_updater}
|
||||
};
|
||||
|
||||
guint
|
||||
GtkType
|
||||
gtk_color_selection_get_type (void)
|
||||
{
|
||||
static guint color_selection_type = 0;
|
||||
static GtkType color_selection_type = 0;
|
||||
|
||||
if (!color_selection_type)
|
||||
{
|
||||
@@ -238,7 +246,7 @@ gtk_color_selection_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
color_selection_type = gtk_type_unique (gtk_vbox_get_type (), &colorsel_info);
|
||||
color_selection_type = gtk_type_unique (GTK_TYPE_VBOX, &colorsel_info);
|
||||
}
|
||||
|
||||
return color_selection_type;
|
||||
@@ -255,8 +263,13 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
container_class = (GtkContainerClass*) klass;
|
||||
|
||||
color_selection_parent_class = gtk_type_class (gtk_vbox_get_type ());
|
||||
|
||||
color_selection_parent_class = gtk_type_class (GTK_TYPE_VBOX);
|
||||
|
||||
gtk_object_add_arg_type ("GtkColorSelection::policy", GTK_TYPE_UPDATE_TYPE,
|
||||
GTK_ARG_READWRITE, ARG_UPDATE_POLICY);
|
||||
gtk_object_add_arg_type ("GtkColorSelection::use_opacity", GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE, ARG_USE_OPACITY);
|
||||
|
||||
color_selection_signals[COLOR_CHANGED] =
|
||||
gtk_signal_new ("color_changed",
|
||||
GTK_RUN_FIRST,
|
||||
@@ -266,6 +279,8 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
|
||||
|
||||
gtk_object_class_add_signals (object_class, color_selection_signals, LAST_SIGNAL);
|
||||
|
||||
object_class->set_arg = gtk_color_selection_set_arg;
|
||||
object_class->get_arg = gtk_color_selection_get_arg;
|
||||
object_class->finalize = gtk_color_selection_finalize;
|
||||
|
||||
widget_class->realize = gtk_color_selection_realize;
|
||||
@@ -440,17 +455,57 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
}
|
||||
|
||||
colorsel->opacity_label = label;
|
||||
|
||||
|
||||
gtk_widget_show (table);
|
||||
gtk_widget_show (hbox);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
static void
|
||||
gtk_color_selection_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkColorSelection *color_selection = GTK_COLOR_SELECTION (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_UPDATE_POLICY:
|
||||
gtk_color_selection_set_update_policy (color_selection, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
case ARG_USE_OPACITY:
|
||||
gtk_color_selection_set_opacity (color_selection, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_selection_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkColorSelection *color_selection;
|
||||
|
||||
color_selection = GTK_COLOR_SELECTION (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_UPDATE_POLICY:
|
||||
GTK_VALUE_ENUM (*arg) = color_selection->policy;
|
||||
break;
|
||||
case ARG_USE_OPACITY:
|
||||
GTK_VALUE_BOOL (*arg) = color_selection->use_opacity;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_color_selection_new (void)
|
||||
{
|
||||
GtkColorSelection *colorsel;
|
||||
|
||||
colorsel = gtk_type_new (gtk_color_selection_get_type ());
|
||||
colorsel = gtk_type_new (GTK_TYPE_COLOR_SELECTION);
|
||||
|
||||
return GTK_WIDGET (colorsel);
|
||||
}
|
||||
@@ -1145,10 +1200,14 @@ gtk_color_selection_wheel_timeout (GtkColorSelection *colorsel)
|
||||
{
|
||||
gint x, y;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
gdk_window_get_pointer (colorsel->wheel_area->window, &x, &y, NULL);
|
||||
gtk_color_selection_update_wheel (colorsel, x, y);
|
||||
gtk_color_selection_color_changed (colorsel);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
@@ -1255,7 +1314,7 @@ gtk_color_selection_draw_value_bar (GtkColorSelection *colorsel,
|
||||
}
|
||||
|
||||
v = 1.0;
|
||||
sv = 1.0 / (gdouble) (heig - 1);
|
||||
sv = 1.0 / (gdouble) MAX (heig - 1, 0);
|
||||
|
||||
for (y = 0; y < heig; y++)
|
||||
{
|
||||
@@ -1599,10 +1658,10 @@ gtk_color_selection_rgb_to_hsv (gdouble r, gdouble g, gdouble b,
|
||||
/* GtkColorSelectionDialog */
|
||||
/***************************/
|
||||
|
||||
guint
|
||||
GtkType
|
||||
gtk_color_selection_dialog_get_type (void)
|
||||
{
|
||||
static guint color_selection_dialog_type = 0;
|
||||
static GtkType color_selection_dialog_type = 0;
|
||||
|
||||
if (!color_selection_dialog_type)
|
||||
{
|
||||
@@ -1618,7 +1677,7 @@ gtk_color_selection_dialog_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
color_selection_dialog_type = gtk_type_unique (gtk_window_get_type (), &colorsel_diag_info);
|
||||
color_selection_dialog_type = gtk_type_unique (GTK_TYPE_WINDOW, &colorsel_diag_info);
|
||||
}
|
||||
|
||||
return color_selection_dialog_type;
|
||||
@@ -1631,7 +1690,7 @@ gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
|
||||
color_selection_dialog_parent_class = gtk_type_class (gtk_window_get_type ());
|
||||
color_selection_dialog_parent_class = gtk_type_class (GTK_TYPE_WINDOW);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1685,12 +1744,12 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
|
||||
gtk_widget_pop_visual ();
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
GtkWidget*
|
||||
gtk_color_selection_dialog_new (const gchar *title)
|
||||
{
|
||||
GtkColorSelectionDialog *colorseldiag;
|
||||
|
||||
colorseldiag = gtk_type_new (gtk_color_selection_dialog_get_type ());
|
||||
colorseldiag = gtk_type_new (GTK_TYPE_COLOR_SELECTION_DIALOG);
|
||||
gtk_window_set_title (GTK_WINDOW (colorseldiag), title);
|
||||
|
||||
return GTK_WIDGET (colorseldiag);
|
||||
|
||||
+12
-9
@@ -50,14 +50,17 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_COLOR_SELECTION(obj) GTK_CHECK_CAST (obj, gtk_color_selection_get_type (), GtkColorSelection)
|
||||
#define GTK_COLOR_SELECTION_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_color_selection_get_type (), GtkColorSelectionClass)
|
||||
#define GTK_IS_COLOR_SELECTION(obj) GTK_CHECK_TYPE (obj, gtk_color_selection_get_type ())
|
||||
|
||||
#define GTK_COLOR_SELECTION_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_color_selection_dialog_get_type (), GtkColorSelectionDialog)
|
||||
#define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_color_selection_dialog_get_type (), GtkColorSelectionDialogClass)
|
||||
#define GTK_IS_COLOR_SELECTION_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_color_selection_dialog_get_type ())
|
||||
#define GTK_TYPE_COLOR_SELECTION (gtk_color_selection_get_type ())
|
||||
#define GTK_COLOR_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection))
|
||||
#define GTK_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
|
||||
#define GTK_IS_COLOR_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION))
|
||||
#define GTK_IS_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION))
|
||||
|
||||
#define GTK_TYPE_COLOR_SELECTION_DIALOG (gtk_color_selection_dialog_get_type ())
|
||||
#define GTK_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialog))
|
||||
#define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialogClass))
|
||||
#define GTK_IS_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG))
|
||||
#define GTK_IS_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG))
|
||||
|
||||
typedef struct _GtkColorSelection GtkColorSelection;
|
||||
typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
|
||||
@@ -122,7 +125,7 @@ struct _GtkColorSelectionDialogClass
|
||||
|
||||
/* ColorSelection */
|
||||
|
||||
guint gtk_color_selection_get_type (void);
|
||||
GtkType gtk_color_selection_get_type (void);
|
||||
|
||||
GtkWidget* gtk_color_selection_new (void);
|
||||
|
||||
@@ -140,7 +143,7 @@ void gtk_color_selection_get_color (GtkColorSelection *colorse
|
||||
|
||||
/* ColorSelectionDialog */
|
||||
|
||||
guint gtk_color_selection_dialog_get_type (void);
|
||||
GtkType gtk_color_selection_dialog_get_type (void);
|
||||
|
||||
GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
|
||||
|
||||
|
||||
+62
-39
@@ -44,7 +44,8 @@ enum {
|
||||
ARG_0,
|
||||
ARG_BORDER_WIDTH,
|
||||
ARG_RESIZE_MODE,
|
||||
ARG_CHILD
|
||||
ARG_CHILD,
|
||||
ARG_REALLOCATE_REDRAWS
|
||||
};
|
||||
|
||||
typedef struct _GtkChildArgInfo GtkChildArgInfo;
|
||||
@@ -167,6 +168,7 @@ gtk_container_class_init (GtkContainerClass *class)
|
||||
gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_ULONG, GTK_ARG_READWRITE, ARG_BORDER_WIDTH);
|
||||
gtk_object_add_arg_type ("GtkContainer::resize_mode", GTK_TYPE_RESIZE_MODE, GTK_ARG_READWRITE, ARG_RESIZE_MODE);
|
||||
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET, GTK_ARG_WRITABLE, ARG_CHILD);
|
||||
gtk_object_add_arg_type ("GtkContainer::reallocate_redraws", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_REALLOCATE_REDRAWS);
|
||||
|
||||
container_signals[ADD] =
|
||||
gtk_signal_new ("add",
|
||||
@@ -264,6 +266,8 @@ gtk_container_add_with_args (GtkContainer *container,
|
||||
gtk_widget_ref (GTK_WIDGET (container));
|
||||
gtk_widget_ref (widget);
|
||||
|
||||
if (!GTK_OBJECT_CONSTRUCTED (widget))
|
||||
gtk_object_default_construct (GTK_OBJECT (widget));
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[ADD], widget);
|
||||
|
||||
if (widget->parent)
|
||||
@@ -322,6 +326,8 @@ gtk_container_addv (GtkContainer *container,
|
||||
gtk_widget_ref (GTK_WIDGET (container));
|
||||
gtk_widget_ref (widget);
|
||||
|
||||
if (!GTK_OBJECT_CONSTRUCTED (widget))
|
||||
gtk_object_default_construct (GTK_OBJECT (widget));
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[ADD], widget);
|
||||
|
||||
if (widget->parent)
|
||||
@@ -603,6 +609,7 @@ gtk_container_init (GtkContainer *container)
|
||||
container->border_width = 0;
|
||||
container->need_resize = FALSE;
|
||||
container->resize_mode = GTK_RESIZE_PARENT;
|
||||
container->reallocate_redraws = FALSE;
|
||||
container->resize_widgets = NULL;
|
||||
}
|
||||
|
||||
@@ -617,11 +624,9 @@ gtk_container_destroy (GtkObject *object)
|
||||
container = GTK_CONTAINER (object);
|
||||
|
||||
if (GTK_CONTAINER_RESIZE_PENDING (container))
|
||||
{
|
||||
container_resize_queue = g_slist_remove (container_resize_queue, container);
|
||||
GTK_PRIVATE_UNSET_FLAG (container, GTK_RESIZE_PENDING);
|
||||
}
|
||||
gtk_container_clear_resize_widgets (container);
|
||||
gtk_container_dequeue_resize_handler (container);
|
||||
if (container->resize_widgets)
|
||||
gtk_container_clear_resize_widgets (container);
|
||||
|
||||
gtk_container_foreach (container, (GtkCallback) gtk_widget_destroy, NULL);
|
||||
|
||||
@@ -646,6 +651,9 @@ gtk_container_set_arg (GtkObject *object,
|
||||
case ARG_RESIZE_MODE:
|
||||
gtk_container_set_resize_mode (container, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
case ARG_REALLOCATE_REDRAWS:
|
||||
gtk_container_set_reallocate_redraws (container, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
case ARG_CHILD:
|
||||
gtk_container_add (container, GTK_WIDGET (GTK_VALUE_OBJECT (*arg)));
|
||||
break;
|
||||
@@ -671,6 +679,9 @@ gtk_container_get_arg (GtkObject *object,
|
||||
case ARG_RESIZE_MODE:
|
||||
GTK_VALUE_ENUM (*arg) = container->resize_mode;
|
||||
break;
|
||||
case ARG_REALLOCATE_REDRAWS:
|
||||
GTK_VALUE_BOOL (*arg) = container->reallocate_redraws;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
@@ -703,6 +714,8 @@ gtk_container_add (GtkContainer *container,
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
g_return_if_fail (widget->parent == NULL);
|
||||
|
||||
if (!GTK_OBJECT_CONSTRUCTED (widget))
|
||||
gtk_object_default_construct (GTK_OBJECT (widget));
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[ADD], widget);
|
||||
}
|
||||
|
||||
@@ -719,6 +732,16 @@ gtk_container_remove (GtkContainer *container,
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[REMOVE], widget);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_dequeue_resize_handler (GtkContainer *container)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
g_return_if_fail (GTK_CONTAINER_RESIZE_PENDING (container));
|
||||
|
||||
container_resize_queue = g_slist_remove (container_resize_queue, container);
|
||||
GTK_PRIVATE_UNSET_FLAG (container, GTK_RESIZE_PENDING);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_clear_resize_widgets (GtkContainer *container)
|
||||
{
|
||||
@@ -729,11 +752,6 @@ gtk_container_clear_resize_widgets (GtkContainer *container)
|
||||
|
||||
node = container->resize_widgets;
|
||||
|
||||
if (node)
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (container),
|
||||
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
|
||||
NULL);
|
||||
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *widget = node->data;
|
||||
@@ -772,6 +790,21 @@ gtk_container_set_resize_mode (GtkContainer *container,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_set_reallocate_redraws (GtkContainer *container,
|
||||
gboolean needs_redraws)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
|
||||
needs_redraws = needs_redraws ? TRUE : FALSE;
|
||||
if (needs_redraws != container->reallocate_redraws)
|
||||
{
|
||||
container->reallocate_redraws = needs_redraws;
|
||||
if (container->reallocate_redraws)
|
||||
gtk_widget_queue_draw (GTK_WIDGET (container));
|
||||
}
|
||||
}
|
||||
|
||||
static GtkContainer*
|
||||
gtk_container_get_resize_container (GtkContainer *container)
|
||||
{
|
||||
@@ -827,18 +860,23 @@ gtk_container_queue_resize (GtkContainer *container)
|
||||
g_return_if_fail (container != NULL);
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
|
||||
/* clear resize widgets for resize containers
|
||||
* before aborting prematurely. this is especially
|
||||
* important for toplevels which may need imemdiate
|
||||
* processing or their resize handler to be queued.
|
||||
*/
|
||||
if (GTK_IS_RESIZE_CONTAINER (container))
|
||||
gtk_container_clear_resize_widgets (container);
|
||||
if (GTK_OBJECT_DESTROYED (container) ||
|
||||
GTK_WIDGET_RESIZE_NEEDED (container))
|
||||
return;
|
||||
|
||||
if (GTK_IS_RESIZE_CONTAINER (container))
|
||||
gtk_container_clear_resize_widgets (container);
|
||||
|
||||
|
||||
resize_container = gtk_container_get_resize_container (container);
|
||||
|
||||
|
||||
if (resize_container)
|
||||
{
|
||||
if (GTK_WIDGET_VISIBLE (resize_container))
|
||||
if (GTK_WIDGET_VISIBLE (resize_container) &&
|
||||
(GTK_WIDGET_TOPLEVEL (resize_container) || GTK_WIDGET_DRAWABLE (resize_container)))
|
||||
{
|
||||
switch (resize_container->resize_mode)
|
||||
{
|
||||
@@ -854,40 +892,29 @@ gtk_container_queue_resize (GtkContainer *container)
|
||||
}
|
||||
|
||||
GTK_PRIVATE_SET_FLAG (container, GTK_RESIZE_NEEDED);
|
||||
if (!resize_container->resize_widgets)
|
||||
gtk_signal_connect (GTK_OBJECT (resize_container),
|
||||
"size_allocate",
|
||||
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
|
||||
NULL);
|
||||
resize_container->resize_widgets =
|
||||
g_slist_prepend (resize_container->resize_widgets, container);
|
||||
break;
|
||||
|
||||
case GTK_RESIZE_IMMEDIATE:
|
||||
GTK_PRIVATE_SET_FLAG (container, GTK_RESIZE_NEEDED);
|
||||
if (!resize_container->resize_widgets)
|
||||
gtk_signal_connect (GTK_OBJECT (resize_container),
|
||||
"size_allocate",
|
||||
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
|
||||
NULL);
|
||||
resize_container->resize_widgets =
|
||||
g_slist_prepend (resize_container->resize_widgets, container);
|
||||
gtk_container_check_resize (resize_container);
|
||||
break;
|
||||
|
||||
case GTK_RESIZE_PARENT:
|
||||
/* Ignore */
|
||||
/* Ignore, should not be reached */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We need to let hidden toplevels know that something
|
||||
* changed while they where hidden. For other resize containers,
|
||||
* they will get resized when they are shown.
|
||||
/* we need to let hidden resize containers know that something
|
||||
* changed while they where hidden (currently only evaluated by
|
||||
* toplevels).
|
||||
*/
|
||||
if (GTK_WIDGET_TOPLEVEL (resize_container))
|
||||
gtk_container_check_resize (resize_container);
|
||||
resize_container->need_resize = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -897,7 +924,7 @@ gtk_container_check_resize (GtkContainer *container)
|
||||
{
|
||||
g_return_if_fail (container != NULL);
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[CHECK_RESIZE]);
|
||||
}
|
||||
|
||||
@@ -970,7 +997,7 @@ gtk_container_resize_children (GtkContainer *container)
|
||||
* which is not the case if we got another container queued for
|
||||
* a resize in our anchestry. also we can skip the whole
|
||||
* resize_widgets checks if we are a toplevel and NEED_RESIZE.
|
||||
* this code implies that our allocation is sufficient for our
|
||||
* this code assumes that our allocation is sufficient for our
|
||||
* requisition, since otherwise we would NEED_RESIZE.
|
||||
*/
|
||||
resize_container = GTK_WIDGET (container);
|
||||
@@ -1000,10 +1027,6 @@ gtk_container_resize_children (GtkContainer *container)
|
||||
* is insufficient, since we don't need to reallocate below that.
|
||||
*/
|
||||
resize_widgets = container->resize_widgets;
|
||||
if (resize_widgets)
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (container),
|
||||
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
|
||||
NULL);
|
||||
container->resize_widgets = NULL;
|
||||
for (node = resize_widgets; node; node = node->next)
|
||||
{
|
||||
|
||||
+28
-26
@@ -60,7 +60,7 @@ struct _GtkContainer
|
||||
guint border_width : 16;
|
||||
guint need_resize : 1;
|
||||
guint resize_mode : 2;
|
||||
|
||||
guint reallocate_redraws : 1;
|
||||
|
||||
/* The list of children that requested a resize
|
||||
*/
|
||||
@@ -132,6 +132,8 @@ gint gtk_container_focus (GtkContainer *container,
|
||||
|
||||
/* Widget-level methods */
|
||||
|
||||
void gtk_container_set_reallocate_redraws (GtkContainer *container,
|
||||
gboolean needs_redraws);
|
||||
void gtk_container_set_focus_child (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
void gtk_container_set_focus_vadjustment (GtkContainer *container,
|
||||
@@ -140,7 +142,7 @@ void gtk_container_set_focus_hadjustment (GtkContainer *container,
|
||||
GtkAdjustment *adjustment);
|
||||
void gtk_container_register_toplevel (GtkContainer *container);
|
||||
void gtk_container_unregister_toplevel (GtkContainer *container);
|
||||
GList * gtk_container_get_toplevels (void);
|
||||
GList* gtk_container_get_toplevels (void);
|
||||
|
||||
void gtk_container_resize_children (GtkContainer *container);
|
||||
|
||||
@@ -200,30 +202,30 @@ void gtk_container_child_set (GtkContainer *container,
|
||||
|
||||
/* Non-public methods */
|
||||
|
||||
void gtk_container_queue_resize (GtkContainer *container);
|
||||
void gtk_container_clear_resize_widgets (GtkContainer *container);
|
||||
void gtk_container_arg_set (GtkContainer *container,
|
||||
GtkWidget *child,
|
||||
GtkArg *arg,
|
||||
GtkArgInfo *info);
|
||||
void gtk_container_arg_get (GtkContainer *container,
|
||||
GtkWidget *child,
|
||||
GtkArg *arg,
|
||||
GtkArgInfo *info);
|
||||
gchar* gtk_container_child_args_collect (GtkType object_type,
|
||||
GSList **arg_list_p,
|
||||
GSList **info_list_p,
|
||||
const gchar *first_arg_name,
|
||||
va_list args);
|
||||
gchar* gtk_container_child_arg_get_info (GtkType object_type,
|
||||
const gchar *arg_name,
|
||||
GtkArgInfo **info_p);
|
||||
void gtk_container_forall (GtkContainer *container,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
gchar* gtk_container_child_composite_name (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
|
||||
void gtk_container_queue_resize (GtkContainer *container);
|
||||
void gtk_container_clear_resize_widgets (GtkContainer *container);
|
||||
void gtk_container_arg_set (GtkContainer *container,
|
||||
GtkWidget *child,
|
||||
GtkArg *arg,
|
||||
GtkArgInfo *info);
|
||||
void gtk_container_arg_get (GtkContainer *container,
|
||||
GtkWidget *child,
|
||||
GtkArg *arg,
|
||||
GtkArgInfo *info);
|
||||
gchar* gtk_container_child_args_collect (GtkType object_type,
|
||||
GSList **arg_list_p,
|
||||
GSList **info_list_p,
|
||||
const gchar *first_arg_name,
|
||||
va_list args);
|
||||
gchar* gtk_container_child_arg_get_info (GtkType object_type,
|
||||
const gchar *arg_name,
|
||||
GtkArgInfo **info_p);
|
||||
void gtk_container_forall (GtkContainer *container,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
gchar* gtk_container_child_composite_name (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
void gtk_container_dequeue_resize_handler (GtkContainer *container);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user