GTK is a multi-platform toolkit for creating graphical user interfaces.
Go to file
Kristian Rietveld a86bbf759f Improve enter/motion notify semantics
On X11 we receive enter notify and motion notify events for a window
regardless of its focus state.  On Mac OS X this is not the case.  This
commit improves the semantics to overcome this difference.  It improves
on my earlier patch that sent a motion notify event when a window became
main.

Instead of sending a motion notify when a window becomes main, we now
send one when a window becomes key, which comes closest to a window
getting focus in X11.  This motion notify is needed because Mac OS X does
not send motion events when an application is inactive (none of its
windows have focus), these events are sent in X11.  This dummy motion
notify event (with current coordinates of the mouse cursor) allows an
application to get its prelight and other state right when it gets focus
and thus user attention.

Another change is to send an enter notify event when updating the
tracking rectangle of a GdkQuartView and the mouse cursor is currently in
this rectangle.  This rectangle is at least updated on window creation.
This enter notify event is important for the case where a new window
appears right below the mouse cursor.  The window has to receive an enter
notify event for the subsequent events to be processed correctly.  Mac
OS X does not send one in this case, so we generate it ourselves.

Both of these synthesized events have to go through
_gdk_windowing_got_event() for updating statekeeping, etc.
append_event() has a boolean flag now to make this convenient.
2010-04-03 20:55:29 -04:00
contrib Fix some compilation warnings 2009-11-03 00:04:49 +01:00
debian Revert name change 2008-07-01 22:57:50 +00:00
demos Fix some compilation warnings 2010-04-03 20:55:22 -04:00
docs [docs] Fix GtkOffscreenWindow documentation 2010-04-03 20:55:27 -04:00
examples Do not use static GTypeInfo and GInterfaceInfo 2009-11-06 01:21:09 +01:00
gdk Improve enter/motion notify semantics 2010-04-03 20:55:29 -04:00
gdk-pixbuf Remove the destination file if trying to save a pixbuf failed 2010-04-03 20:55:24 -04:00
gtk Remove existing signal connections in gtk_drag_dest_unset(). 2010-04-03 20:55:29 -04:00
m4 2.19.2 2010-04-03 20:53:42 -04:00
m4macros Fix a typo 2009-11-07 02:18:05 +01:00
modules Bug #608410. Set cursor position after inserting text. 2010-04-03 20:55:28 -04:00
perf Deprecate flag macros for toplevel, state, no window and composite child 2010-04-03 20:55:07 -04:00
po Updated Spanish translation 2010-04-03 20:55:29 -04:00
po-properties Updated Spanish translation 2010-04-03 20:55:29 -04:00
tests [test] Fix some typos 2010-04-03 20:55:23 -04:00
acinclude.m4
AUTHORS
autogen.sh Add an m4 directory and a introspection.m4 2010-04-03 20:51:52 -04:00
ChangeLog.gtk-async-file-chooser
ChangeLog.gtk-printing
ChangeLog.pre-1-0
ChangeLog.pre-1-2
ChangeLog.pre-2-0
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-14 updated version number to 2.15.0 for development. 2008-09-18 14:55:35 +00:00
ChangeLog.pre-2-16 Rename ChangeLog to ChangeLog.pre-2-20 2009-04-03 01:48:22 -04:00
config.h.win32.in Undef USE_MMX for msvc build 2009-07-04 12:19:07 +02:00
configure.in Bump version 2010-04-03 20:55:27 -04:00
COPYING
gail-uninstalled.pc.in Bug #536430. Add libgailutil.la into gail-uninstalled.pc.in. 2008-07-03 08:48:24 +00:00
gail.pc.in
gdk-2.0-uninstalled.pc.in Bug 540529 – Remove all GIMP references 2008-07-03 05:47:22 +00:00
gdk-2.0.pc.in Bug 540529 – Remove all GIMP references 2008-07-03 05:47:22 +00:00
gdk-pixbuf-2.0-uninstalled.pc.in
gdk-pixbuf-2.0.pc.in
git.mk Add git.mk to generate .gitignore files 2009-05-04 14:29:21 -04:00
gtk-config-2.0.in
gtk-engine-check-abi.sh
gtk-zip.sh.in Include all of share/man, lib/pkgconfig, share/aclocal and share/gtk-doc 2008-09-24 09:22:58 +00:00
gtk+-2.0-uninstalled.pc.in Bug 540529 – Remove all GIMP references 2008-07-03 05:47:22 +00:00
gtk+-2.0.pc.in Bug 540529 – Remove all GIMP references 2008-07-03 05:47:22 +00:00
gtk+-unix-print-2.0.pc.in Bug 540529 – Remove all GIMP references 2008-07-03 05:47:22 +00:00
gtk+.spec.in Revert name change 2008-07-01 22:57:50 +00:00
HACKING Point to better place for git documentation 2009-05-03 23:44:01 -04:00
INSTALL.in Update dependency information 2010-04-03 20:53:48 -04:00
MAINTAINERS
makecopyright Revert name change 2008-07-01 22:57:50 +00:00
Makefile.am Make sure dist check includes introspection 2010-04-03 20:51:54 -04:00
Makefile.decl Fix make check 2009-01-01 21:14:07 +00:00
makefile.msc
NEWS Updates 2010-04-03 20:55:24 -04:00
NEWS.pre-1-0
README.commits Update README files to refer to git 2009-03-31 19:34:23 -04:00
README.in Add a release note about virtual modifiers 2010-04-03 20:53:37 -04:00
README.win32 Update README.win32 2009-08-24 10:08:53 +03:00
sanitize-la.sh
sanity_check

The Win32 backend in GTK+ is not as stable or correct as the X11 one.

For prebuilt runtime and developer packages see
http://ftp.gnome.org/pub/gnome/binaries/win32/

Building GTK+ on Win32
======================

First you obviously need developer packages for the compile-time
dependencies: Pango, atk, glib, gettext-runtime, libiconv, libpng,
zlib, libtiff at least. See
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .

After installing the dependencies, there are two ways to build GTK+
for win32.

1) GNU tools, ./configure && make install
-----------------------------------------

This requires you have mingw and MSYS.

Use the configure script, and the resulting Makefiles (which use
libtool and gcc to do the compilation). I use this myself, but it can
be hard to setup correctly.

The full script I run to build GTK+ 2.16 unpacked from a source
distribution is as below. This is from bulding GTK+ 2.16.5. I don't
use any script like this to build the development branch, as I don't
distribute any binaries from development branches.

# This is a shell script that calls functions and scripts from
# tml@iki.fi's personal work envíronment. It is not expected to be
# usable unmodified by others, and is included only for reference.

MOD=gtk+
VER=2.16.5
REV=1
ARCH=win32

THIS=${MOD}_${VER}-${REV}_${ARCH}

RUNZIP=${MOD}_${VER}-${REV}_${ARCH}.zip
DEVZIP=${MOD}-dev_${VER}-${REV}_${ARCH}.zip

HEX=`echo $THIS | md5sum | cut -d' ' -f1`
TARGET=c:/devel/target/$HEX

usedev
usemsvs6

(

set -x

DEPS=`latest --arch=${ARCH} glib atk cairo pango libpng zlib libtiff jpeg`
PROXY_LIBINTL=`latest --arch=${ARCH} proxy-libintl`

PKG_CONFIG_PATH=
for D in $DEPS; do
    PATH=/devel/dist/${ARCH}/$D/bin:$PATH
    [ -d /devel/dist/${ARCH}/$D/lib/pkgconfig ] && PKG_CONFIG_PATH=/devel/dist/${ARCH}/$D/lib/pkgconfig:$PKG_CONFIG_PATH
done

LIBPNG=`latest --arch=${ARCH} libpng`
ZLIB=`latest --arch=${ARCH} zlib`
LIBTIFF=`latest --arch=${ARCH} libtiff`
JPEG=`latest --arch=${ARCH} jpeg`

patch -p0 <<'EOF'
EOF

lt_cv_deplibs_check_method='pass_all' \
CC='gcc -mtune=pentium3 -mthreads' \
CPPFLAGS="-I/devel/dist/${ARCH}/${LIBPNG}/include \
-I/devel/dist/${ARCH}/${ZLIB}/include \
-I/devel/dist/${ARCH}/${LIBTIFF}/include \
-I/devel/dist/${ARCH}/${JPEG}/include \
-I/devel/dist/${ARCH}/${PROXY_LIBINTL}/include" \
LDFLAGS="-L/devel/dist/${ARCH}/${LIBPNG}/lib \
-L/devel/dist/${ARCH}/${ZLIB}/lib \
-L/devel/dist/${ARCH}/${LIBTIFF}/lib \
-L/devel/dist/${ARCH}/${JPEG}/lib \
-L/devel/dist/${ARCH}/${PROXY_LIBINTL}/lib -Wl,--exclude-libs=libintl.a \
-Wl,--enable-auto-image-base" \
LIBS=-lintl \
CFLAGS=-O2 \
./configure \
--with-gdktarget=win32 \
--disable-gdiplus \
--with-included-immodules \
--without-libjasper \
--enable-debug=yes \
--enable-explicit-deps=no \
--disable-gtk-doc \
--disable-static \
--prefix=$TARGET &&

libtoolcacheize &&
rm gtk/gtk.def &&
(PATH="$PWD/gdk-pixbuf/.libs:/devel/target/$HEX/bin:$PATH" make -j3 install || (rm .libtool-cache* && PATH="/devel/target/$HEX/bin:$PATH" make -j3 install)) &&

PATH="/devel/target/$HEX/bin:$PATH" gdk-pixbuf-query-loaders >/devel/target/$HEX/etc/gtk-2.0/gdk-pixbuf.loaders &&

grep -v -E 'Automatically generated|Created by|LoaderDir =' <$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp &&
    mv $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&
grep -v -E 'Automatically generated|Created by|ModulesPath =' <$TARGET/etc/gtk-2.0/gtk.immodules >$TARGET/etc/gtk-2.0/gtk.immodules.temp &&
    mv $TARGET/etc/gtk-2.0/gtk.immodules.temp $TARGET/etc/gtk-2.0/gtk.immodules &&

./gtk-zip.sh &&

mv /tmp/${MOD}-${VER}.zip /tmp/$RUNZIP &&
mv /tmp/${MOD}-dev-${VER}.zip /tmp/$DEVZIP

) 2>&1 | tee /devel/src/tml/packaging/$THIS.log

(cd /devel && zip /tmp/$DEVZIP src/tml/packaging/$THIS.{sh,log}) &&
manifestify /tmp/$RUNZIP /tmp/$DEVZIP

You should not just copy the above blindly. There are some things in
the script that are very specific to *my* build setup on *my* current
machine. For instance the "latest" command, the "usedev" and
"usemsvs6" shell functions, the /devel/dist folder. The above script
is really just meant for reference, to give an idea. You really need
to understand what things like PKG_CONFIG_PATH are and set them up
properly after installing the dependencies before building GTK+.

As you see above, after running configure, one can just say "make
install", like on Unix. A post-build fix is needed, running
gdk-pixbuf-query-loaders once more to get a correct gdk-pixbuf.loaders
file.

For a 64-bit build you need to remove the gtk/gtk.def file and let it
be regenerated by the makefilery. This is because the 64-bit GTK dll
has a slightly different list of exported function names. This is on
purpose and not a bug. The API is the same at the source level, and
the same #defines of some function names to actually have a _utf8
suffix is used (just to keep the header simpler). But the
corresponding non-suffixed function to maintain ABI stability are not
needed in the 64-bit case (because there are no older EXEs around that
would require such for ABI stability).


2) Microsoft's tools
--------------------

Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
makefile.msc in gdk and gtk. Be prepared to manually edit various
makefile.msc files, and the makefile snippets in build/win32.

Alternative 1 also generates Microsoft import libraries (.lib), if you
have lib.exe available. It might also work for cross-compilation from
Unix.

I use method 1 myself. Hans Breuer has been taking care of the MSVC
makefiles. At times, we disagree a bit about various issues, and for
instance the makefile.msc files might not produce identically named
DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.

Using GTK+ on Win32
===================

To use GTK+ on Win32, you also need either one of the above mentioned
compilers. Other compilers might work, but don't count on it. Look for
prebuilt developer packages (DLLs, import libraries, headers) on the
above website.

Multi-threaded use of GTK+ on Win32
===================================

Multi-threaded GTK+ programs might work on Windows in special simple
cases, but not in general. Sorry. If you have all GTK+ and GDK calls
in the same thread, it might work. Otherwise, probably not at
all. Possible ways to fix this are being investigated.

Wintab
======

The tablet support uses the Wintab API. The Wintab development kit is
no longer required. The wintab.h header file is bundled with GTK+
sources. Unfortunately it seems that only Wacom tablets come with
support for the Wintab API nowadays.

--Tor Lillqvist <tml@iki.fi>, <tml@novell.com>