Merge branch 'master' into toolpalette

This commit is contained in:
Johannes Schmid 2009-10-28 10:57:46 +01:00
commit c229306a18
520 changed files with 151829 additions and 127333 deletions

421
NEWS
View File

@ -1,3 +1,424 @@
Overview of Changes from GTK+ 2.18.1 to 2.18.2
==============================================
* GTK+ now ignores SIGPIPE in gtk_init(). Previously
this was done deep in the lpr printbackend.
* Fix compilation of the DirectFB backend.
* Bugs fixed:
597386 Cannot click buttons more than once...
588059 sometimes notification icons are not visible with csw
* Updated translations:
Italian
Japanese
Serbian
Overview of Changes from GTK+ 2.18.0 to 2.18.1
==============================================
* Client-side Windows:
- Fix a problem with the F-Spot screensaver
- Request native events that are necessary for grab emulation
- Fixes for input device and extended input event handling
- Allow up to 255 buttons in extended input events
* OS X:
- Improve handling of multi-monitor setups
- Basic DND works
- Other improvements
* Filechooser:
- Support Tracker 0.7 in the search code
* Bugs fixed:
596423 Landscape pages are the wrong way around
588449 DnD doesn't work on GDK/Quartz
596080 Mention "gtk-tooltip" in gtk_widget_set_tooltip_window
596580 Blank rows in entry autocompletion
588649 extended input events sent to widgets that didn't...
596081 Update tracker support for version 0.7
596345 clicking empty space in backgrounds...
596494 New property "cursor" in 2.18's GdkWindow with wrong...
596012 popup menu position is horribly off on gdk quartz...
596250 Gdkcursor-quartz.c doesn't implement GDK_BLANK_CURSOR
586207 Printing dialog with a CUPS printer connected...
* Translation updates:
Assamese
British English
Czech
Estonian
French
Galician
German
Hungarian
Slovenian
Spanish
Swedish
Overview of Changes from GTK+ 2.17.11 to 2.18.0
===============================================
* Add GtkTreeModelFilter testsuite and fix multiple bugs
* Client-side windows:
- Fix issues around recursion and gdk_window_process_updates
- Fix issues with grabs and cursors
- Handle window hierarchy and geometry changes in expose handlers
- New function, gdk_window_flush, that may be needed in certain
situations
- Automatically flush windows when doing non-double-buffered exposes
* Quartz backend:
- Fix various 'stuck UI' issues
- Fix the size of the root window
* Bugs fixed:
588455 run application broken when setting background color...
346800 Rework sort/filter models to use indices to parents
593678 select "Manage Custom Sizes" from print dialog hangs gedit
594652 gtk printer dialog does not understand boolean printer options
594668 Add new Xorg keysyms
591583 Padre (a wxPerl+Gtk IDE) hangs when editing Perl code...
594600 Windows only allows 64-character system-tray tooltips
594679 Fix warning in testwindows.c
594880 Drawing issues in ExoIconView
593507 AbiWord's main drawing area not exposed properly
594913 is_composited race ...
594738 Windows often do not respond to events on dual-head
503776 crash when trying to print to non-existent lpr printer
595599 Don't focus unmapped radio buttons
595790 Segfault in gtkiconfactory.c on NULL GError
588649 extended input events sent to widgets that didn't...
550939 GtkFileChooser listbox does not refresh selection
* New deprecation:
gdk_event_get_graphics_exposes has been deprecated
* Updated translations:
Afrikaans
Assamese
Bengali India
Brazilian Portuguese
British English
Catalan
Danish
Dutch
German
Greek
Gujarati
Hindi
Italian
Japanese
Lithuanian
Maithili
Malayalam
Marathi
Norwegian bokmål
Oriya
Polish
Romanian
Simplified Chinese
Slovenian
Traditional Chinese
Ukrainian
Overview of Changes from GTK+ 2.17.10 to 2.17.11
================================================
* Client-side windows:
- Add gdk_cairo_reset_clip that lets you get back the original
drawable clip
- Add gdk_window_restack to more conveniently restack child windows
- Add gdk_window_is_destroyed as a replacement for GDK_WINDOW_DESTROYED
- Deprecated GDK_WINDOW_OBJECT and GdkWindowObject
* GSEAL:
- Add gtk_widget_set_receives_default and gtk_widget_get_receives_default
accessors for GTK_RECEIVES_DEFAULT
* GtkTreeView:
- Correctly propagate insensitive state to cell renderers
* GtkTextView:
- Merge a number of scrolling-related fixes from Maemo
* Bugs fixed:
564160 gtk_combo_box_entry_set_text_column too restrictive
593868 gtk_im_multicontext_set_client_window recreate a new slave...
593644 gdk_x11_screen_get_window_manager_name should not cache...
594178 gdk-pixbuf-query-loaders segfault in write_loader_info
567124 proposal to delay doing something related to immodule...
588788 GTK+ compilation should work with automake1.10
584638 Build of gtkupdateiconcache without NLS breaks
593788 misprint in the returning value of gdk_selection_property_get
593606 Missing include in gtk/gtkcellrendereraccel.c
593877 Undefined symbols while compilation
* Translation updates:
French
Hebrew
Hungarian
Norwegian bokmål
Overview of Changes from GTK+ 2.17.9 to 2.17.10
===============================================
* Client-side windows:
- Regression fixes continue
- Multiple clipping issues have been fixed
- gdk_window_beep() works again
- gtk-demo now has a few offscreen window demos
* GSEAL:
- Several more getters and setters have been added:
gtk_widget_is_toplevel(), gtk_widget_is_drawable(), gtk_widget_set_window()
* Bugs fixed:
592752 aisleriot card drag start makes card appear behind...
592901 Crash in JPEG pixbuf loader instead of error
592263 redraw problem in text view
593011 Cannot move applet with middle click
592624 BadAccess from gdk_window_x11_set_events
592606 Activate the default button in a respose-request callback
593249 emacs and acroread don't work properly
592883 Spin cell rendererer problem with double click
588199 GtkTreeView rendering glitch while using a default...
543310 set_enable_tree_lines doesn't work when a cellrenderer...
589636 csw broke DND from panel menus
593595 broken clip handling in GtkLabel
590921 NULL should not be a valid return value for gdk_window_new()
590861 cups_printer_create_cairo_surface() sets a fallback resolution...
544724 delete new line requires two keystrokes
593001 Emit 'update-custom-widget' on page setup change
593317 gtkwindow leaks startup ID
593080 mem leak
593481 GtkEntryCompletion action-activated signal is emitted...
593135 gtk_entry_set_icon_from_pixbuf only works one time
593012 configure doesn't handle --enable-{cups,papi} correctly
592862 There is a misprint on the returning value of gdk_pixmap_lookup()
586466 GtkPrintOperation printing fails if it is the only event source
434318 printer detail acquisition needs events
593712 configure fails to to check properly for cups...
* Translation updates:
Asturian
Basque
Bengali India
Czech
Finnish
Hindi
Kannada
Oriya
Polish
Serbian
Tamil
Telugu
Overview of Changes from GTK+ 2.17.8 to 2.17.9
==============================================
* Client-side windows:
- Add a compatibility mode that falls back to always using native windows,
triggered by the GDK_NATIVE_WINDOWS environment variable
* Bugs fixed:
589367 gedit crashed with SIGSEGV in IA__g_list_last()
478519 GtkTooltip segfaults on NULL gdk-display-current-tooltip.
592461 preserve errno and use g_strerror
592403 crash when close the second terminal...
591549 Default printer in a network
526149 GtkCellRendererAccel editing conflicts with mnemonics
528283 Problems when using PageUp & PageDown to navigate Playlists pane
* Updated translations:
Bengali
Brazilian Portuguese
Breton
Bulgarian
Catalan
Estonian
Galician
Irish
Korean
Norwegian bokmål
Portuguese
Punjabi
Spanish
Swedish
Thai
Overview of Changes from GTK+ 2.17.7 to 2.17.8
==============================================
* Client-side windows:
- various fixes to expose handling
- fix memory leaks
* Minor API additions:
- New setter as part of the GSEAL effort: gtk_widget_set_allocation
* Bugs fixed:
585211 Add accessor function for GtkWidget->allocation
588437 gtk 2.17.3 causes dragging in firefox bookmarks sidebar t...
589367 gedit crashed with SIGSEGV in IA__g_list_last()
589877 Client side windows leak gdk regions
590959 Set child_has_focus flag properly
591432 There is incomplete information on the returning value of...
591434 firefox-3.5 crashed with SIGSEGV in _gdk_window_process_u...
591526 Accelerator keys with <super> modifier also triggered by ...
591751 bad memory access with duplicated id
591998 Support silent build rules with automake 1.11
592003 Shift+click should always modify selection
* Updated translations:
Brazilian
Bulgarian
Irish
Swedish
Overview of Changes from GTK+ 2.17.6 to 2.17.7
==============================================
* Client-side windows: a number of regressions related to embedding
have been fixed
* Printing: The file backend supports SVG output
* Minor API additions:
- GtkIconView gained an icon-padding property that can be used to fine-tune
how much space each column needs
- GtkTreeViewColumn grew a sort-column-id property that can be used to set
up sort columns in GtkBuilder files
- GdkWindow gained a cursor property and associated getter
- GtkFileChooser has a create-folders property to allow disabling the
"New Folder" button
- gtk_print_operation_get_n_pages_to_print: returns the number of pages
that are being printed
- New getters and setters as part of the GSEAL effort:
gtk_widget_get_allocation, gtk_widget_get_visible, gtk_widget_set_visible
* Bugs fixed:
589336 Add GtkTreeViewColumn:sort-column-id property
534462 Disable interactive search in the file chooser's shortcuts pane
161489 n the file chooser, let the left/right arrow keys switch focus...
514260 Better filtering for "Recently Used" files
509650 ATK_STATE_SHOWING state is not set properly on menu items
586374 code does not follow documentation (-> carshes when using...
590442 csw broke gvim x11 embedding
498010 gtk_tree_view_set_cursor fails if model!=NULL
555109 Synthesized crossing events should have proper coordinates
570516 Can't disable folder creation
573321 additional check in gtk_tree_model_filter_convert_child_i...
576601 Double clicking prints to the wrong printer
586100 ITEM_PADDING breaks vertical icon views
588438 awn uses 100% cpu with gtk+ 2.17.3 (csw)
589732 behavior change of gdk_window_get_type_hint
589745 Apply message in GtkAssistant
590084 print to FILE with multiple pages per sheet has bad results
590086 configure.in is broken on non-X platforms
590309 Default cover pages for CUPS printers incorrectly set
590448 [win32] build fails because gdk-pixbuf manges a path
590959 Set child_has_focus flag properly
591288 compat problem with draw_drawable being NULL
539377 Unnecessary warnings when GtkTreeView is not realized.
546005 priv->tree is not created for unrealized (I think) treeview
564695 Pressing enter key in print to file "Name" box does not p...
591218 Remove some unused variables
357655 "Print to SVG file" for GtkPrintOperation
591462 gdk_window_set_cursor doesn't work on the root window
* Updated translations:
Basque
Brazilian Portuguese
Breton
Estonian
Galician
Hebrew
Norwegian bokmål
Spanish
Swedish
Overview of Changes from GTK+ 2.17.5 to 2.17.6
==============================================
* Client-side windows:
- Several optimizations, such as client-side tracking of
viewable windows
- Clipping for drawing pixbufs on windows has been fixed
- Rendering to large subwindows has been fixed
* Changes that are relevant for translators:
- Markup has been removed from several strings
* Bugs fixed:
588398 Leak with testgtk::preview_(color|gray) and more
588943 set correct selection before emitting cursor-changed...
588076 Gnumeric fonts stopped working on upgrading gtk+ 2.17.2 -...
574674 GtkMenuItem gets Selected and Focused states when SelectC...
582674 Menu item and menu accessibles retain "showing" state aft...
588553 [csw] gdk_draw_pixbuf doesnt draw outside expose events s...
588897 Strange include x11/gdkx.h
588958 Typo in startup-id window property
589035 Context needed for a propoer translation
589275 [csw] Trying to destroy NULL regions
588964 Remove markup from translatable string in gtkfilechooserd...
587337 Suggest to use Glade instead gtk-builder-convert script
* Updated translations:
Estonian
French
Spanish
Swedish
Thai
Overview of Changes from GTK+ 2.17.4 to 2.17.5
==============================================
* Client-side windows:
- Quite a few fixes have happened for the win32 and directfb backends
* GSEAL:
- Accessors have been added for sealed members in GtkCellRenderer and
GtkWidget
* Changes that are relevant for distributors:
- The jpeg2000 pixbuf loader is now optional. Pass --with-libjasper
to configure to build it
* Bugs fixed
588373 Menus broken by client-side-windows
588379 testgtk::panes does not change the cursor on mouse over
588388 shape rendering is back
588461 gtk_editable_get_chars() behaviour change in 2.17.4
588666 Incorrect clamping of max_length
588665 insert-text signal is not emitted
588395 Crash when opening a GtkBuilder file
524066 Mandatory jpeg2000?
527583 GtkAssistant should set buttons as default widget
588694 Missing % in C code
588484 Iconview DnD fails when Destination is empty
583522 Trivial error in GtkBuilder migration documentation
150951 collapsed save dialog needs to indicate filesystem...
* Updated translations:
Brazilian Portuguese
Norwegian bokmål
Spanish
Traditional Chinese
Overview of Changes from GTK+ 2.17.3 to 2.17.4
==============================================

View File

@ -34,6 +34,21 @@ Release notes for 2.18
old custom_widget. Custom_widget does not get destroyed when the
tooltip goes away.
* JPEG2000 support is no longer enabled by default. It must be
explicitly turned on, by passing --with-libjasper to configure.
* GDK has been reworked to implement 'client-side windows'. This offers
exciting new possibilities, such as transformed, offscreen rendering,
but it breaks some long-standing assumptions that applications may
have about GDK windows. Setting the environment variable
GDK_NATIVE_WINDOWS makes GDK create a native X11 window for each
GDK window, which might make problematic applications work better.
* GTK+ calls signal (SIGPIPE, SIG_IGN) during initialization, to ignore
SIGPIPE signals, since these are almost never wanted in graphical
applications. If you do need to handle SIGPIPE for some reason, reset
the handler after gtk_init(), but notice that other libraries (e.g.
libdbus or gvfs) might do similar things.
Release notes for 2.16
======================

View File

@ -1,117 +1,184 @@
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.10 unpacked from a source
distribution is as below. This is from bulding GTK+ 2.10.9, slightly
edited to make it match this 2.11 development branch. Actually I don't
use any script like this to build the development branch, as I don't
distribute any binaries from development branches.
MOD=gtk+
VER=2.10.9
THIS=$MOD-$VER
HEX=`echo $THIS | md5sum | cut -d' ' -f1`
TARGET=c:/devel/target/$HEX
DEPS="`/devel/src/tml/latest.sh glib atk cairo pango`"
sed -e 's/need_relink=yes/need_relink=no # no way --tml/' <ltmain.sh >ltmain.temp && mv ltmain.temp ltmain.sh
usedev
usemsvs6
MY_PKG_CONFIG_PATH=""
for D in $DEPS; do
PATH=/devel/dist/$D/bin:$PATH
MY_PKG_CONFIG_PATH=/devel/dist/$D/lib/pkgconfig:$MY_PKG_CONFIG_PATH
done
PKG_CONFIG_PATH=$MY_PKG_CONFIG_PATH:$PKG_CONFIG_PATH CC='gcc -mtune=pentium3 -mthreads' CPPFLAGS='-I/opt/gnu/include -I/opt/gnuwin32/include -I/opt/misc/include' LDFLAGS='-L/opt/gnu/lib -L/opt/gnuwin32/lib -L/opt/misc/lib -Wl,--enable-auto-image-base' LIBS=-lintl CFLAGS=-O2 ./configure --with-gdktarget=win32 --enable-debug=yes --disable-gtk-doc --disable-static --prefix=$TARGET &&
libtoolcacheize &&
unset MY_PKG_CONFIG_PATH &&
PATH=/devel/target/$HEX/bin:.libs:$PATH make install &&
(cd $TARGET/bin; strip --strip-unneeded *.dll *.exe) &&
(cd $TARGET/lib/gtk-2.0/2.10.0/loaders; strip --strip-unneeded *.dll) &&
(cd $TARGET/lib/gtk-2.0/2.10.0/immodules; strip --strip-unneeded *.dll) &&
(cd $TARGET/lib/gtk-2.0/2.10.0/engines; strip --strip-unneeded *.dll) &&
PATH=$TARGET/bin:$PATH gdk-pixbuf-query-loaders >$TARGET/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 &&
(cd /devel/src/tml && zip /tmp/$MOD-dev-$VER.zip make/$THIS.make) &&
manifestify /tmp/$MOD*-$VER.zip
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.sh" script, 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.
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>
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>

View File

@ -14,7 +14,10 @@ DIE=0
have_libtool=false
if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
libtool_version=`libtoolize --version |
head -1 |
sed -e 's/^\(.*\)([^)]*)\(.*\)$/\1\2/g' \
-e 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
case $libtool_version in
1.4*|1.5*|2.2*)
have_libtool=true
@ -45,16 +48,24 @@ fi
DIE=1
}
if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-1.11
ACLOCAL=aclocal-1.11
else if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-1.10
ACLOCAL=aclocal-1.10
else if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-1.7
ACLOCAL=aclocal-1.7
else
echo
echo "You must have automake 1.7.x installed to compile $PROJECT."
echo "You must have automake 1.7.x, 1,10.x or 1.11.x installed to compile $PROJECT."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
DIE=1
fi
fi
fi
if test "$DIE" -eq 1; then
exit 1

View File

@ -11,8 +11,8 @@ AC_PREREQ(2.54)
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [17])
m4_define([gtk_micro_version], [5])
m4_define([gtk_minor_version], [19])
m4_define([gtk_micro_version], [0])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@ -49,6 +49,11 @@ cflags_set=${CFLAGS+set}
AM_INIT_AUTOMAKE(no-define)
AM_CONFIG_HEADER(config.h)
# Support silent build rules, requires at least automake-1.11. Enable
# by either passing --enable-silent-rules to configure or passing V=0
# to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
#
# For each of the libraries we build, we define the following
@ -302,6 +307,7 @@ AM_SANITY_CHECK
# Checks for programs.
AC_ISC_POSIX
AM_PROG_CC_STDC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MAKE_SET
@ -825,12 +831,13 @@ AC_ARG_WITH(libtiff,
[AC_HELP_STRING([--without-libtiff],
[disable TIFF loader for gdk-pixbuf])])
AC_ARG_WITH(libjasper,
[AC_HELP_STRING([--without-libjasper],
[disable JPEG2000 loader for gdk-pixbuf])])
[AC_HELP_STRING([--with-libjasper],
[enable JPEG2000 loader for gdk-pixbuf])])
AC_ARG_ENABLE(gdiplus,
[AC_HELP_STRING([--disable-gdiplus],
[disable GDI+ loaders for gdk-pixbuf])])
[AC_HELP_STRING([--enable-gdiplus],
[enble GDI+ loaders for gdk-pixbuf (currently known to be broken)])],,
[enable_gdiplus=no])
AM_CONDITIONAL(BUILD_GDIPLUS_LOADERS, [ test x$os_win32 = xyes && test x$enable_gdiplus != xno ])
@ -940,11 +947,11 @@ dnl Test for libpng
fi
dnl Test for libjasper
if test x$with_libjasper != xno && test -z "$LIBJASPER"; then
if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
AC_CHECK_LIB(jasper, jas_init, LIBJASPER=-ljasper, [], -ljpeg)
fi
if test x$with_libjasper != xno && test -z "$LIBJASPER"; then
if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
AC_MSG_ERROR([
*** Checks for JPEG2000 loader failed. You can build without it by passing
*** --without-libjasper to configure])
@ -983,7 +990,7 @@ fi
# because some important apps like GIMP need to read and write
# arbitrary tEXt chunks which doesn't seem to be possible through GDI+
all_loaders="ani,icns,pcx,ras,tga,png,pnm,wbmp,xbm,xpm"
all_loaders="ani,icns,pcx,ras,tga,png,pnm,wbmp,xbm,xpm,qtif"
if test x$with_libjasper != xno; then
all_loaders="$all_loaders,jasper"
fi
@ -1054,6 +1061,7 @@ AM_CONDITIONAL(INCLUDE_TGA, [test x"$INCLUDE_tga" = xyes])
AM_CONDITIONAL(INCLUDE_PCX, [test x"$INCLUDE_pcx" = xyes])
AM_CONDITIONAL(INCLUDE_ICNS, [test x"$INCLUDE_icns" = xyes])
AM_CONDITIONAL(INCLUDE_JASPER, [test x"$INCLUDE_jasper" = xyes])
AM_CONDITIONAL(INCLUDE_QTIF, [test x"$INCLUDE_qtif" = xyes])
# As all GDI+ loaders are either built-in or not, arbitrarily just
# check one of the variables here
AM_CONDITIONAL(INCLUDE_GDIPLUS, [test x"$INCLUDE_gdip_ico" = xyes])
@ -1317,7 +1325,6 @@ GDK_PIXBUF_XLIB_PACKAGES=
GDK_PIXBUF_XLIB_EXTRA_CFLAGS=
GDK_PIXBUF_XLIB_EXTRA_LIBS=
X_PACKAGES=fontconfig
GDK_EXTRA_LIBS="$GDK_WLIBS"
GDK_EXTRA_CFLAGS=
@ -1326,6 +1333,8 @@ GTK_DEP_PACKAGES_FOR_X=
GTK_DEP_LIBS_FOR_X=
if test "x$gdktarget" = "xx11"; then
X_PACKAGES=fontconfig
#
# We use fontconfig very peripherally when decoding the default
# settings.
@ -1626,6 +1635,8 @@ if test "x$gdktarget" = "xx11"; then
AM_CONDITIONAL(USE_X11, true)
else
XPACKAGES=
AM_CONDITIONAL(XINPUT_XFREE, false)
AM_CONDITIONAL(USE_X11, false)
AM_CONDITIONAL(HAVE_X11R6, false)
@ -1832,10 +1843,19 @@ AC_ARG_ENABLE(cups,
[disable cups print backend])],,
[enable_cups=auto])
if test "x$enable_cups" = "xauto"
then
if test "x$enable_cups" = "xno"; then
AM_CONDITIONAL(HAVE_CUPS, false)
else
AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
if test "x$CUPS_CONFIG" != "xno"; then
if test "x$CUPS_CONFIG" = "xno"; then
if test "x$enable_cups" = "xauto"; then
AM_CONDITIONAL(HAVE_CUPS, false)
else
AC_MSG_ERROR([
*** cups not found.
])
fi
else
CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
CUPS_LIBS=`$CUPS_CONFIG --libs`
@ -1855,26 +1875,24 @@ then
AC_SUBST(CUPS_LIBS)
AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
AM_CONDITIONAL(HAVE_CUPS, true)
gtk_save_cflags="$CFLAGS"
CFLAGS="$CUPS_CFLAGS"
AC_TRY_COMPILE([#include <cups/http.h>],
[http_t http; char *s = http.authstring;],
[AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
[Define if cups http_t authstring field is accessible])],)
CFLAGS="$gtk_save_cflags"
AC_SUBST(HAVE_HTTP_AUTHSTRING)
gtk_save_libs="$LIBS"
LIBS="$CUPS_LIBS"
AC_CHECK_FUNCS(httpGetAuthString)
LIBS="$gtk_save_libs"
fi
AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
gtk_save_cflags="$CFLAGS"
CFLAGS="$CUPS_CFLAGS"
AC_TRY_COMPILE([#include <cups/http.h>],
[http_t http; char *s = http.authstring;],
[AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
[Define if cups http_t authstring field is accessible])],)
CFLAGS="$gtk_save_cflags"
AC_SUBST(HAVE_HTTP_AUTHSTRING)
gtk_save_libs="$LIBS"
LIBS="$CUPS_LIBS"
AC_CHECK_FUNCS(httpGetAuthString)
LIBS="$gtk_save_libs"
else
AM_CONDITIONAL(HAVE_CUPS, false)
fi
# Checks to see if we should compile with PAPI backend for GTK+
@ -1885,23 +1903,27 @@ AC_ARG_ENABLE(papi,
[disable papi print backend])],,
[enable_papi=auto])
if test "x$enable_papi" = "xauto"
then
if test "x$enable_papi" = "xno"; then
AM_CONDITIONAL(HAVE_PAPI, false)
else
AC_MSG_CHECKING(libpapi)
AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
if test $have_papi = yes; then
AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
fi
AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
else
AM_CONDITIONAL(HAVE_PAPI, false)
if test "x$enable_papi" = "xyes" -a "x$have_papi" = "xno"; then
AC_MSG_ERROR([
*** papi not found.
])
fi
fi
AM_CONDITIONAL(HAVE_PAPI_CUPS, test $have_papi = yes && test "x$CUPS_CONFIG" != "xno")
AM_CONDITIONAL(HAVE_PAPI_CUPS, test "x$have_papi" = "xyes" -a "x$CUPS_CONFIG" != "xno")
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
*** Can't find cairo-pdf.h. You must build Cairo with the pdf
*** backend enabled.]))

View File

@ -28,6 +28,8 @@ demos = \
links.c \
list_store.c \
menus.c \
offscreen_window.c \
offscreen_window2.c \
panes.c \
pickers.c \
pixbufs.c \
@ -35,6 +37,7 @@ demos = \
rotated_text.c \
search_entry.c \
sizegroup.c \
spinner.c \
stock_browser.c \
textview.c \
textscroll.c \

View File

@ -203,6 +203,10 @@ do_clipboard (GtkWidget *do_widget)
GtkClipboard *clipboard;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Clipboard demo");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);

View File

@ -43,11 +43,11 @@ activate_link (GtkWidget *label,
return FALSE;
}
static GtkWidget *window = NULL;
GtkWidget *
do_links (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *box;
GtkWidget *label;
if (!window)
@ -55,11 +55,10 @@ do_links (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Links");
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy",
G_CALLBACK(gtk_widget_destroyed), &window);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_true), NULL);
G_CALLBACK (gtk_widget_destroyed), &window);
label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\""
"title=\"plain text\">text</a> may be marked up\n"

View File

@ -10,6 +10,8 @@
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static GtkTreeModel *model = NULL;
static guint timeout = 0;
typedef struct
{
@ -26,6 +28,8 @@ enum
COLUMN_NUMBER,
COLUMN_SEVERITY,
COLUMN_DESCRIPTION,
COLUMN_PULSE,
COLUMN_ACTIVE,
NUM_COLUMNS
};
@ -47,6 +51,33 @@ static Bug data[] =
{ FALSE, 1, "Normal", "First bug :=)" },
};
static gboolean
spinner_timeout (gpointer data)
{
GtkTreeIter iter;
guint pulse;
if (model == NULL)
return FALSE;
gtk_tree_model_get_iter_first (model, &iter);
gtk_tree_model_get (model, &iter,
COLUMN_PULSE, &pulse,
-1);
if (pulse == G_MAXUINT)
pulse = 0;
else
pulse++;
gtk_list_store_set (GTK_LIST_STORE (model),
&iter,
COLUMN_PULSE, pulse,
COLUMN_ACTIVE, TRUE,
-1);
return TRUE;
}
static GtkTreeModel *
create_model (void)
{
@ -56,21 +87,25 @@ create_model (void)
/* create list store */
store = gtk_list_store_new (NUM_COLUMNS,
G_TYPE_BOOLEAN,
G_TYPE_UINT,
G_TYPE_STRING,
G_TYPE_STRING);
G_TYPE_BOOLEAN,
G_TYPE_UINT,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_UINT,
G_TYPE_BOOLEAN);
/* add data to the list store */
for (i = 0; i < G_N_ELEMENTS (data); i++)
{
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COLUMN_FIXED, data[i].fixed,
COLUMN_NUMBER, data[i].number,
COLUMN_SEVERITY, data[i].severity,
COLUMN_DESCRIPTION, data[i].description,
-1);
COLUMN_FIXED, data[i].fixed,
COLUMN_NUMBER, data[i].number,
COLUMN_SEVERITY, data[i].severity,
COLUMN_DESCRIPTION, data[i].description,
COLUMN_PULSE, 0,
COLUMN_ACTIVE, FALSE,
-1);
}
return GTK_TREE_MODEL (store);
@ -78,8 +113,8 @@ create_model (void)
static void
fixed_toggled (GtkCellRendererToggle *cell,
gchar *path_str,
gpointer data)
gchar *path_str,
gpointer data)
{
GtkTreeModel *model = (GtkTreeModel *)data;
GtkTreeIter iter;
@ -110,48 +145,75 @@ add_columns (GtkTreeView *treeview)
/* column for fixed toggles */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect (renderer, "toggled",
G_CALLBACK (fixed_toggled), model);
G_CALLBACK (fixed_toggled), model);
column = gtk_tree_view_column_new_with_attributes ("Fixed?",
renderer,
"active", COLUMN_FIXED,
NULL);
renderer,
"active", COLUMN_FIXED,
NULL);
/* set this column to a fixed sizing (of 50 pixels) */
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_append_column (treeview, column);
/* column for bug numbers */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Bug number",
renderer,
"text",
COLUMN_NUMBER,
NULL);
renderer,
"text",
COLUMN_NUMBER,
NULL);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_NUMBER);
gtk_tree_view_append_column (treeview, column);
/* column for severities */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Severity",
renderer,
"text",
COLUMN_SEVERITY,
NULL);
renderer,
"text",
COLUMN_SEVERITY,
NULL);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_SEVERITY);
gtk_tree_view_append_column (treeview, column);
/* column for description */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Description",
renderer,
"text",
COLUMN_DESCRIPTION,
NULL);
renderer,
"text",
COLUMN_DESCRIPTION,
NULL);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_DESCRIPTION);
gtk_tree_view_append_column (treeview, column);
/* column for spinner */
renderer = gtk_cell_renderer_spinner_new ();
column = gtk_tree_view_column_new_with_attributes ("Spinning",
renderer,
"pulse",
COLUMN_PULSE,
"active",
COLUMN_ACTIVE,
NULL);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_PULSE);
gtk_tree_view_append_column (treeview, column);
}
static gboolean
window_closed (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
model = NULL;
window = NULL;
if (timeout != 0)
{
g_source_remove (timeout);
timeout = 0;
}
return FALSE;
}
GtkWidget *
@ -162,17 +224,16 @@ do_list_store (GtkWidget *do_widget)
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *sw;
GtkTreeModel *model;
GtkWidget *treeview;
/* create window, etc */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "GtkListStore demo");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
vbox = gtk_vbox_new (FALSE, 8);
@ -183,10 +244,10 @@ do_list_store (GtkWidget *do_widget)
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_ETCHED_IN);
GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
/* create tree model */
@ -196,7 +257,7 @@ do_list_store (GtkWidget *do_widget)
treeview = gtk_tree_view_new_with_model (model);
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE);
gtk_tree_view_set_search_column (GTK_TREE_VIEW (treeview),
COLUMN_DESCRIPTION);
COLUMN_DESCRIPTION);
g_object_unref (model);
@ -207,14 +268,27 @@ do_list_store (GtkWidget *do_widget)
/* finish & show */
gtk_window_set_default_size (GTK_WINDOW (window), 280, 250);
g_signal_connect (window, "delete-event",
G_CALLBACK (window_closed), NULL);
}
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show_all (window);
{
gtk_widget_show_all (window);
if (timeout == 0) {
/* FIXME this should use the animation-duration instead */
timeout = g_timeout_add (80, spinner_timeout, NULL);
}
}
else
{
gtk_widget_destroy (window);
window = NULL;
if (timeout != 0)
{
g_source_remove (timeout);
timeout = 0;
}
}
return window;

View File

@ -2,10 +2,10 @@
*
* There are several widgets involved in displaying menus. The
* GtkMenuBar widget is a menu bar, which normally appears horizontally
* at the top of an application, but can also be layed out vertically.
* The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar
* and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains
* menu items (GtkMenuItem). Each menu item contains text and/or images
* at the top of an application, but can also be layed out vertically.
* The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar
* and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains
* menu items (GtkMenuItem). Each menu item contains text and/or images
* and can be selected by the user.
*
* There are several kinds of menu item, including plain GtkMenuItem,
@ -22,7 +22,6 @@
* GtkUIManager provides a higher-level interface for creating menu bars
* and menus; while you can construct menus manually, most people don't
* do that. There's a separate demo for GtkUIManager.
*
*/
#include <gtk/gtk.h>
@ -118,37 +117,35 @@ change_orientation (GtkWidget *button,
}
}
static GtkWidget *window = NULL;
GtkWidget *
do_menus (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *box;
GtkWidget *box1;
GtkWidget *box2;
GtkWidget *button;
if (!window)
{
GtkWidget *menubar;
GtkWidget *menu;
GtkWidget *menuitem;
GtkAccelGroup *accel_group;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Menus");
g_signal_connect (window, "destroy",
G_CALLBACK(gtk_widget_destroyed), &window);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_true), NULL);
accel_group = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
gtk_window_set_title (GTK_WINDOW (window), "menus");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
box = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box);
gtk_widget_show (box);
@ -156,18 +153,18 @@ do_menus (GtkWidget *do_widget)
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (box), box1);
gtk_widget_show (box1);
menubar = gtk_menu_bar_new ();
gtk_box_pack_start (GTK_BOX (box1), menubar, FALSE, TRUE, 0);
gtk_widget_show (menubar);
menu = create_menu (2, TRUE);
menuitem = gtk_menu_item_new_with_label ("test\nline2");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
menuitem = gtk_menu_item_new_with_label ("foo");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (3, TRUE));
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
@ -178,7 +175,7 @@ do_menus (GtkWidget *do_widget)
gtk_menu_item_set_right_justified (GTK_MENU_ITEM (menuitem), TRUE);
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);

View File

@ -0,0 +1,579 @@
/* Offscreen windows/Rotated button
*
* Offscreen windows can be used to transform parts of a widget
* hierarchy. Note that the rotated button is fully functional.
*/
#include <math.h>
#include <gtk/gtk.h>
#define GTK_TYPE_ROTATED_BIN (gtk_rotated_bin_get_type ())
#define GTK_ROTATED_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ROTATED_BIN, GtkRotatedBin))
#define GTK_ROTATED_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ROTATED_BIN, GtkRotatedBinClass))
#define GTK_IS_ROTATED_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ROTATED_BIN))
#define GTK_IS_ROTATED_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ROTATED_BIN))
#define GTK_ROTATED_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ROTATED_BIN, GtkRotatedBinClass))
typedef struct _GtkRotatedBin GtkRotatedBin;
typedef struct _GtkRotatedBinClass GtkRotatedBinClass;
struct _GtkRotatedBin
{
GtkContainer container;
GtkWidget *child;
GdkWindow *offscreen_window;
gdouble angle;
};
struct _GtkRotatedBinClass
{
GtkContainerClass parent_class;
};
GType gtk_rotated_bin_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_rotated_bin_new (void);
void gtk_rotated_bin_set_angle (GtkRotatedBin *bin,
gdouble angle);
/*** implementation ***/
static void gtk_rotated_bin_realize (GtkWidget *widget);
static void gtk_rotated_bin_unrealize (GtkWidget *widget);
static void gtk_rotated_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_rotated_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_rotated_bin_damage (GtkWidget *widget,
GdkEventExpose *event);
static gboolean gtk_rotated_bin_expose (GtkWidget *widget,
GdkEventExpose *offscreen);
static void gtk_rotated_bin_add (GtkContainer *container,
GtkWidget *child);
static void gtk_rotated_bin_remove (GtkContainer *container,
GtkWidget *widget);
static void gtk_rotated_bin_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static GType gtk_rotated_bin_child_type (GtkContainer *container);
G_DEFINE_TYPE (GtkRotatedBin, gtk_rotated_bin, GTK_TYPE_CONTAINER);
static void
to_child (GtkRotatedBin *bin,
double widget_x,
double widget_y,
double *x_out,
double *y_out)
{
GtkAllocation child_area;
double x, y, xr, yr;
double c, s;
double w, h;
s = sin (bin->angle);
c = cos (bin->angle);
child_area = bin->child->allocation;
w = c * child_area.width + s * child_area.height;
h = s * child_area.width + c * child_area.height;
x = widget_x;
y = widget_y;
x -= (w - child_area.width) / 2;
y -= (h - child_area.height) / 2;
x -= child_area.width / 2;
y -= child_area.height / 2;
xr = x * c + y * s;
yr = y * c - x * s;
x = xr;
y = yr;
x += child_area.width / 2;
y += child_area.height / 2;
*x_out = x;
*y_out = y;
}
static void
to_parent (GtkRotatedBin *bin,
double offscreen_x,
double offscreen_y,
double *x_out,
double *y_out)
{
GtkAllocation child_area;
double x, y, xr, yr;
double c, s;
double w, h;
s = sin (bin->angle);
c = cos (bin->angle);
child_area = bin->child->allocation;
w = c * child_area.width + s * child_area.height;
h = s * child_area.width + c * child_area.height;
x = offscreen_x;
y = offscreen_y;
x -= child_area.width / 2;
y -= child_area.height / 2;
xr = x * c - y * s;
yr = x * s + y * c;
x = xr;
y = yr;
x += child_area.width / 2;
y += child_area.height / 2;
x -= (w - child_area.width) / 2;
y -= (h - child_area.height) / 2;
*x_out = x;
*y_out = y;
}
static void
gtk_rotated_bin_class_init (GtkRotatedBinClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
widget_class->realize = gtk_rotated_bin_realize;
widget_class->unrealize = gtk_rotated_bin_unrealize;
widget_class->size_request = gtk_rotated_bin_size_request;
widget_class->size_allocate = gtk_rotated_bin_size_allocate;
widget_class->expose_event = gtk_rotated_bin_expose;
g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
GTK_TYPE_ROTATED_BIN,
g_cclosure_new (G_CALLBACK (gtk_rotated_bin_damage),
NULL, NULL));
container_class->add = gtk_rotated_bin_add;
container_class->remove = gtk_rotated_bin_remove;
container_class->forall = gtk_rotated_bin_forall;
container_class->child_type = gtk_rotated_bin_child_type;
}
static void
gtk_rotated_bin_init (GtkRotatedBin *bin)
{
GTK_WIDGET_UNSET_FLAGS (bin, GTK_NO_WINDOW);
}
GtkWidget *
gtk_rotated_bin_new (void)
{
return g_object_new (GTK_TYPE_ROTATED_BIN, NULL);
}
static GdkWindow *
pick_offscreen_child (GdkWindow *offscreen_window,
double widget_x,
double widget_y,
GtkRotatedBin *bin)
{
GtkAllocation child_area;
double x, y;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
to_child (bin, widget_x, widget_y, &x, &y);
child_area = bin->child->allocation;
if (x >= 0 && x < child_area.width &&
y >= 0 && y < child_area.height)
return bin->offscreen_window;
}
return NULL;
}
static void
offscreen_window_to_parent (GdkWindow *offscreen_window,
double offscreen_x,
double offscreen_y,
double *parent_x,
double *parent_y,
GtkRotatedBin *bin)
{
to_parent (bin, offscreen_x, offscreen_y, parent_x, parent_y);
}
static void
offscreen_window_from_parent (GdkWindow *window,
double parent_x,
double parent_y,
double *offscreen_x,
double *offscreen_y,
GtkRotatedBin *bin)
{
to_child (bin, parent_x, parent_y, offscreen_x, offscreen_y);
}
static void
gtk_rotated_bin_realize (GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
gint border_width;
GtkRequisition child_requisition;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
border_width = GTK_CONTAINER (widget)->border_width;
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
attributes.width = widget->allocation.width - 2 * border_width;
attributes.height = widget->allocation.height - 2 * border_width;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (widget->window, widget);
g_signal_connect (widget->window, "pick-embedded-child",
G_CALLBACK (pick_offscreen_child), bin);
attributes.window_type = GDK_WINDOW_OFFSCREEN;
child_requisition.width = child_requisition.height = 0;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
attributes.width = bin->child->allocation.width;
attributes.height = bin->child->allocation.height;
}
bin->offscreen_window = gdk_window_new (gtk_widget_get_root_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (bin->offscreen_window, widget);
if (bin->child)
gtk_widget_set_parent_window (bin->child, bin->offscreen_window);
gdk_offscreen_window_set_embedder (bin->offscreen_window, widget->window);
g_signal_connect (bin->offscreen_window, "to-embedder",
G_CALLBACK (offscreen_window_to_parent), bin);
g_signal_connect (bin->offscreen_window, "from-embedder",
G_CALLBACK (offscreen_window_from_parent), bin);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, bin->offscreen_window, GTK_STATE_NORMAL);
gdk_window_show (bin->offscreen_window);
}
static void
gtk_rotated_bin_unrealize (GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
gdk_window_set_user_data (bin->offscreen_window, NULL);
gdk_window_destroy (bin->offscreen_window);
bin->offscreen_window = NULL;
GTK_WIDGET_CLASS (gtk_rotated_bin_parent_class)->unrealize (widget);
}
static GType
gtk_rotated_bin_child_type (GtkContainer *container)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
if (bin->child)
return G_TYPE_NONE;
return GTK_TYPE_WIDGET;
}
static void
gtk_rotated_bin_add (GtkContainer *container,
GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
if (!bin->child)
{
gtk_widget_set_parent_window (widget, bin->offscreen_window);
gtk_widget_set_parent (widget, GTK_WIDGET (bin));
bin->child = widget;
}
else
g_warning ("GtkRotatedBin cannot have more than one child\n");
}
static void
gtk_rotated_bin_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
gboolean was_visible;
was_visible = GTK_WIDGET_VISIBLE (widget);
if (bin->child == widget)
{
gtk_widget_unparent (widget);
bin->child = NULL;
if (was_visible && GTK_WIDGET_VISIBLE (container))
gtk_widget_queue_resize (GTK_WIDGET (container));
}
}
static void
gtk_rotated_bin_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
g_return_if_fail (callback != NULL);
if (bin->child)
(*callback) (bin->child, callback_data);
}
void
gtk_rotated_bin_set_angle (GtkRotatedBin *bin,
gdouble angle)
{
g_return_if_fail (GTK_IS_ROTATED_BIN (bin));
bin->angle = angle;
gtk_widget_queue_resize (GTK_WIDGET (bin));
gdk_window_geometry_changed (bin->offscreen_window);
}
static void
gtk_rotated_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GtkRequisition child_requisition;
double s, c;
double w, h;
child_requisition.width = 0;
child_requisition.height = 0;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
gtk_widget_size_request (bin->child, &child_requisition);
s = sin (bin->angle);
c = cos (bin->angle);
w = c * child_requisition.width + s * child_requisition.height;
h = s * child_requisition.width + c * child_requisition.height;
requisition->width = GTK_CONTAINER (widget)->border_width * 2 + w;
requisition->height = GTK_CONTAINER (widget)->border_width * 2 + h;
}
static void
gtk_rotated_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
gint border_width;
gint w, h;
gdouble s, c;
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
w, h);
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
s = sin (bin->angle);
c = cos (bin->angle);
gtk_widget_get_child_requisition (bin->child, &child_requisition);
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.height = child_requisition.height;
if (c == 0.0)
child_allocation.width = h / s;
else if (s == 0.0)
child_allocation.width = w / c;
else
child_allocation.width = MIN ((w - s * child_allocation.height) / c,
(h - c * child_allocation.height) / s);
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (bin->offscreen_window,
child_allocation.x,
child_allocation.y,
child_allocation.width,
child_allocation.height);
child_allocation.x = child_allocation.y = 0;
gtk_widget_size_allocate (bin->child, &child_allocation);
}
}
static gboolean
gtk_rotated_bin_damage (GtkWidget *widget,
GdkEventExpose *event)
{
gdk_window_invalidate_rect (widget->window, NULL, FALSE);
return TRUE;
}
static gboolean
gtk_rotated_bin_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
gint width, height;
gdouble s, c;
gdouble w, h;
if (GTK_WIDGET_DRAWABLE (widget))
{
if (event->window == widget->window)
{
GdkPixmap *pixmap;
GtkAllocation child_area;
cairo_t *cr;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
child_area = bin->child->allocation;
cr = gdk_cairo_create (widget->window);
/* transform */
s = sin (bin->angle);
c = cos (bin->angle);
w = c * child_area.width + s * child_area.height;
h = s * child_area.width + c * child_area.height;
cairo_translate (cr, (w - child_area.width) / 2, (h - child_area.height) / 2);
cairo_translate (cr, child_area.width / 2, child_area.height / 2);
cairo_rotate (cr, bin->angle);
cairo_translate (cr, -child_area.width / 2, -child_area.height / 2);
/* clip */
gdk_drawable_get_size (pixmap, &width, &height);
cairo_rectangle (cr, 0, 0, width, height);
cairo_clip (cr);
/* paint */
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
cairo_paint (cr);
cairo_destroy (cr);
}
}
else if (event->window == bin->offscreen_window)
{
gtk_paint_flat_box (widget->style, event->window,
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&event->area, widget, "blah",
0, 0, -1, -1);
if (bin->child)
gtk_container_propagate_expose (GTK_CONTAINER (widget),
bin->child,
event);
}
}
return FALSE;
}
/*** ***/
static void
scale_changed (GtkRange *range,
GtkRotatedBin *bin)
{
gtk_rotated_bin_set_angle (bin, gtk_range_get_value (range));
}
static GtkWidget *window = NULL;
GtkWidget *
do_offscreen_window (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *bin, *vbox, *scale, *button;
GdkColor black;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Rotated widget");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gdk_color_parse ("black", &black);
gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &black);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_vbox_new (0, FALSE);
scale = gtk_hscale_new_with_range (0, G_PI/2, 0.01);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
button = gtk_button_new_with_label ("A Button");
bin = gtk_rotated_bin_new ();
g_signal_connect (scale, "value-changed", G_CALLBACK (scale_changed), bin);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (bin), button);
}
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@ -0,0 +1,500 @@
/* Offscreen windows/Effects
*
* Offscreen windows can be used to render elements multiple times to achieve
* various effects.
*/
#include <gtk/gtk.h>
#define GTK_TYPE_MIRROR_BIN (gtk_mirror_bin_get_type ())
#define GTK_MIRROR_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MIRROR_BIN, GtkMirrorBin))
#define GTK_MIRROR_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MIRROR_BIN, GtkMirrorBinClass))
#define GTK_IS_MIRROR_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MIRROR_BIN))
#define GTK_IS_MIRROR_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MIRROR_BIN))
#define GTK_MIRROR_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MIRROR_BIN, GtkMirrorBinClass))
typedef struct _GtkMirrorBin GtkMirrorBin;
typedef struct _GtkMirrorBinClass GtkMirrorBinClass;
struct _GtkMirrorBin
{
GtkContainer container;
GtkWidget *child;
GdkWindow *offscreen_window;
};
struct _GtkMirrorBinClass
{
GtkContainerClass parent_class;
};
GType gtk_mirror_bin_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_mirror_bin_new (void);
/*** implementation ***/
static void gtk_mirror_bin_realize (GtkWidget *widget);
static void gtk_mirror_bin_unrealize (GtkWidget *widget);
static void gtk_mirror_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_mirror_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_mirror_bin_damage (GtkWidget *widget,
GdkEventExpose *event);
static gboolean gtk_mirror_bin_expose (GtkWidget *widget,
GdkEventExpose *offscreen);
static void gtk_mirror_bin_add (GtkContainer *container,
GtkWidget *child);
static void gtk_mirror_bin_remove (GtkContainer *container,
GtkWidget *widget);
static void gtk_mirror_bin_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static GType gtk_mirror_bin_child_type (GtkContainer *container);
G_DEFINE_TYPE (GtkMirrorBin, gtk_mirror_bin, GTK_TYPE_CONTAINER);
static void
to_child (GtkMirrorBin *bin,
double widget_x,
double widget_y,
double *x_out,
double *y_out)
{
*x_out = widget_x;
*y_out = widget_y;
}
static void
to_parent (GtkMirrorBin *bin,
double offscreen_x,
double offscreen_y,
double *x_out,
double *y_out)
{
*x_out = offscreen_x;
*y_out = offscreen_y;
}
static void
gtk_mirror_bin_class_init (GtkMirrorBinClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
widget_class->realize = gtk_mirror_bin_realize;
widget_class->unrealize = gtk_mirror_bin_unrealize;
widget_class->size_request = gtk_mirror_bin_size_request;
widget_class->size_allocate = gtk_mirror_bin_size_allocate;
widget_class->expose_event = gtk_mirror_bin_expose;
g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
GTK_TYPE_MIRROR_BIN,
g_cclosure_new (G_CALLBACK (gtk_mirror_bin_damage),
NULL, NULL));
container_class->add = gtk_mirror_bin_add;
container_class->remove = gtk_mirror_bin_remove;
container_class->forall = gtk_mirror_bin_forall;
container_class->child_type = gtk_mirror_bin_child_type;
}
static void
gtk_mirror_bin_init (GtkMirrorBin *bin)
{
GTK_WIDGET_UNSET_FLAGS (bin, GTK_NO_WINDOW);
}
GtkWidget *
gtk_mirror_bin_new (void)
{
return g_object_new (GTK_TYPE_MIRROR_BIN, NULL);
}
static GdkWindow *
pick_offscreen_child (GdkWindow *offscreen_window,
double widget_x,
double widget_y,
GtkMirrorBin *bin)
{
GtkAllocation child_area;
double x, y;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
to_child (bin, widget_x, widget_y, &x, &y);
child_area = bin->child->allocation;
if (x >= 0 && x < child_area.width &&
y >= 0 && y < child_area.height)
return bin->offscreen_window;
}
return NULL;
}
static void
offscreen_window_to_parent (GdkWindow *offscreen_window,
double offscreen_x,
double offscreen_y,
double *parent_x,
double *parent_y,
GtkMirrorBin *bin)
{
to_parent (bin, offscreen_x, offscreen_y, parent_x, parent_y);
}
static void
offscreen_window_from_parent (GdkWindow *window,
double parent_x,
double parent_y,
double *offscreen_x,
double *offscreen_y,
GtkMirrorBin *bin)
{
to_child (bin, parent_x, parent_y, offscreen_x, offscreen_y);
}
static void
gtk_mirror_bin_realize (GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
gint border_width;
GtkRequisition child_requisition;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
border_width = GTK_CONTAINER (widget)->border_width;
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
attributes.width = widget->allocation.width - 2 * border_width;
attributes.height = widget->allocation.height - 2 * border_width;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (widget->window, widget);
g_signal_connect (widget->window, "pick-embedded-child",
G_CALLBACK (pick_offscreen_child), bin);
attributes.window_type = GDK_WINDOW_OFFSCREEN;
child_requisition.width = child_requisition.height = 0;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
attributes.width = bin->child->allocation.width;
attributes.height = bin->child->allocation.height;
}
bin->offscreen_window = gdk_window_new (gtk_widget_get_root_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (bin->offscreen_window, widget);
if (bin->child)
gtk_widget_set_parent_window (bin->child, bin->offscreen_window);
gdk_offscreen_window_set_embedder (bin->offscreen_window, widget->window);
g_signal_connect (bin->offscreen_window, "to-embedder",
G_CALLBACK (offscreen_window_to_parent), bin);
g_signal_connect (bin->offscreen_window, "from-embedder",
G_CALLBACK (offscreen_window_from_parent), bin);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, bin->offscreen_window, GTK_STATE_NORMAL);
gdk_window_show (bin->offscreen_window);
}
static void
gtk_mirror_bin_unrealize (GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gdk_window_set_user_data (bin->offscreen_window, NULL);
gdk_window_destroy (bin->offscreen_window);
bin->offscreen_window = NULL;
GTK_WIDGET_CLASS (gtk_mirror_bin_parent_class)->unrealize (widget);
}
static GType
gtk_mirror_bin_child_type (GtkContainer *container)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
if (bin->child)
return G_TYPE_NONE;
return GTK_TYPE_WIDGET;
}
static void
gtk_mirror_bin_add (GtkContainer *container,
GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
if (!bin->child)
{
gtk_widget_set_parent_window (widget, bin->offscreen_window);
gtk_widget_set_parent (widget, GTK_WIDGET (bin));
bin->child = widget;
}
else
g_warning ("GtkMirrorBin cannot have more than one child\n");
}
static void
gtk_mirror_bin_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
gboolean was_visible;
was_visible = GTK_WIDGET_VISIBLE (widget);
if (bin->child == widget)
{
gtk_widget_unparent (widget);
bin->child = NULL;
if (was_visible && GTK_WIDGET_VISIBLE (container))
gtk_widget_queue_resize (GTK_WIDGET (container));
}
}
static void
gtk_mirror_bin_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
g_return_if_fail (callback != NULL);
if (bin->child)
(*callback) (bin->child, callback_data);
}
static void
gtk_mirror_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GtkRequisition child_requisition;
child_requisition.width = 0;
child_requisition.height = 0;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.width + 10;
requisition->height = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.height * 2 + 10;
}
static void
gtk_mirror_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gint border_width;
gint w, h;
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
w, h);
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
gtk_widget_get_child_requisition (bin->child, &child_requisition);
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.height = child_requisition.height;
child_allocation.width = child_requisition.width;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (bin->offscreen_window,
allocation->x + border_width,
allocation->y + border_width,
child_allocation.width, child_allocation.height);
gtk_widget_size_allocate (bin->child, &child_allocation);
}
}
static gboolean
gtk_mirror_bin_damage (GtkWidget *widget,
GdkEventExpose *event)
{
gdk_window_invalidate_rect (widget->window, NULL, FALSE);
return TRUE;
}
static gboolean
gtk_mirror_bin_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gint width, height;
if (GTK_WIDGET_DRAWABLE (widget))
{
if (event->window == widget->window)
{
GdkPixmap *pixmap;
cairo_t *cr;
cairo_matrix_t matrix;
cairo_pattern_t *mask;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
gdk_drawable_get_size (pixmap, &width, &height);
cr = gdk_cairo_create (widget->window);
cairo_save (cr);
cairo_rectangle (cr, 0, 0, width, height);
cairo_clip (cr);
/* paint the offscreen child */
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
cairo_paint (cr);
cairo_restore (cr);
cairo_matrix_init (&matrix, 1.0, 0.0, 0.3, 1.0, 0.0, 0.0);
cairo_matrix_scale (&matrix, 1.0, -1.0);
cairo_matrix_translate (&matrix, -10, - 3 * height - 10);
cairo_transform (cr, &matrix);
cairo_rectangle (cr, 0, height, width, height);
cairo_clip (cr);
gdk_cairo_set_source_pixmap (cr, pixmap, 0, height);
/* create linear gradient as mask-pattern to fade out the source */
mask = cairo_pattern_create_linear (0.0, height, 0.0, 2*height);
cairo_pattern_add_color_stop_rgba (mask, 0.0, 0.0, 0.0, 0.0, 0.0);
cairo_pattern_add_color_stop_rgba (mask, 0.25, 0.0, 0.0, 0.0, 0.01);
cairo_pattern_add_color_stop_rgba (mask, 0.5, 0.0, 0.0, 0.0, 0.25);
cairo_pattern_add_color_stop_rgba (mask, 0.75, 0.0, 0.0, 0.0, 0.5);
cairo_pattern_add_color_stop_rgba (mask, 1.0, 0.0, 0.0, 0.0, 1.0);
/* paint the reflection */
cairo_mask (cr, mask);
cairo_pattern_destroy (mask);
cairo_destroy (cr);
}
}
else if (event->window == bin->offscreen_window)
{
gtk_paint_flat_box (widget->style, event->window,
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&event->area, widget, "blah",
0, 0, -1, -1);
if (bin->child)
gtk_container_propagate_expose (GTK_CONTAINER (widget),
bin->child,
event);
}
}
return FALSE;
}
/*** ***/
static GtkWidget *window = NULL;
GtkWidget *
do_offscreen_window2 (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *bin, *vbox;
GtkWidget *hbox, *entry, *applybutton, *backbutton;
GtkSizeGroup *group;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Effects");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_vbox_new (0, FALSE);
bin = gtk_mirror_bin_new ();
group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
hbox = gtk_hbox_new (FALSE, 6);
backbutton = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (backbutton),
gtk_image_new_from_stock (GTK_STOCK_GO_BACK, 4));
gtk_size_group_add_widget (group, backbutton);
entry = gtk_entry_new ();
gtk_size_group_add_widget (group, entry);
applybutton = gtk_button_new ();
gtk_size_group_add_widget (group, applybutton);
gtk_container_add (GTK_CONTAINER (applybutton),
gtk_image_new_from_stock (GTK_STOCK_APPLY, 4));
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (bin), hbox);
gtk_box_pack_start (GTK_BOX (hbox), backbutton, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), applybutton, FALSE, FALSE, 0);
}
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@ -174,6 +174,8 @@ do_printing (GtkWidget *do_widget)
dir = g_get_home_dir ();
if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "ps") == 0)
ext = ".ps";
else if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "svg") == 0)
ext = ".svg";
else
ext = ".pdf";

94
demos/gtk-demo/spinner.c Normal file
View File

@ -0,0 +1,94 @@
/* Spinner
*
* GtkSpinner allows to show that background activity is on-going.
*
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static GtkWidget *spinner_sensitive = NULL;
static GtkWidget *spinner_unsensitive = NULL;
static void
on_play_clicked (GtkButton *button, gpointer user_data)
{
gtk_spinner_start (GTK_SPINNER (spinner_sensitive));
gtk_spinner_start (GTK_SPINNER (spinner_unsensitive));
}
static void
on_stop_clicked (GtkButton *button, gpointer user_data)
{
gtk_spinner_stop (GTK_SPINNER (spinner_sensitive));
gtk_spinner_stop (GTK_SPINNER (spinner_unsensitive));
}
GtkWidget *
do_spinner (GtkWidget *do_widget)
{
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *spinner;
if (!window)
{
window = gtk_dialog_new_with_buttons ("GtkSpinner",
GTK_WINDOW (do_widget),
0,
GTK_STOCK_CLOSE,
GTK_RESPONSE_NONE,
NULL);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
/* Sensitive */
hbox = gtk_hbox_new (FALSE, 5);
spinner = gtk_spinner_new ();
gtk_container_add (GTK_CONTAINER (hbox), spinner);
gtk_container_add (GTK_CONTAINER (hbox), gtk_entry_new ());
gtk_container_add (GTK_CONTAINER (vbox), hbox);
spinner_sensitive = spinner;
/* Disabled */
hbox = gtk_hbox_new (FALSE, 5);
spinner = gtk_spinner_new ();
gtk_container_add (GTK_CONTAINER (hbox), spinner);
gtk_container_add (GTK_CONTAINER (hbox), gtk_entry_new ());
gtk_container_add (GTK_CONTAINER (vbox), hbox);
spinner_unsensitive = spinner;
gtk_widget_set_sensitive (hbox, FALSE);
button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PLAY);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (on_play_clicked), spinner);
gtk_container_add (GTK_CONTAINER (vbox), button);
button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_STOP);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (on_stop_clicked), spinner);
gtk_container_add (GTK_CONTAINER (vbox), button);
/* Start by default to test for:
* https://bugzilla.gnome.org/show_bug.cgi?id=598496 */
on_play_clicked (NULL, NULL);
}
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show_all (window);
else
gtk_widget_destroy (window);
return window;
}

View File

@ -48,15 +48,6 @@ Events that are assured to have a valid GdkEvent.any.window field are
GDK_EXPOSE GtkWidget::expose_event
gtk_widget_ref() vs. gtk_object_ref()
-------------------------------------
The widget referencing functions gtk_widget_ref() and gtk_widget_unref()
are currently just wrappers about the corresponding referencing functions
for objects. Still you should use the widget referencing functions if you
are sure the referenced object is of type GTK_WIDGET_TYPE.
Writing Gdk functions
---------------------

View File

@ -62,8 +62,6 @@ used by anything other than the DND code in GTK+.
/* Drag and Drop */
GdkDragContext * gdk_drag_context_new (void);
void gdk_drag_context_ref (GdkDragContext *context);
void gdk_drag_context_unref (GdkDragContext *context);
These create and refcount GdkDragContexts in a
straightforward manner.

View File

@ -2108,10 +2108,10 @@ not.</para>
snippet:</para>
<programlisting role="C">
gtk_widget_ref(widget);
g_object_ref(widget);
gtk_container_remove(GTK_CONTAINER(old_parent), widget);
gtk_container_add(GTK_CONTAINER(new_parent), widget);
gtk_widget_unref(widget);
g_object_unref(widget);
</programlisting>
</sect1>
@ -2307,8 +2307,8 @@ used, as in:</para>
NULL, gtk_widget_get_colormap(top),
&amp;pixmap_mask, NULL, pixfile);
pixw = gtk_pixmap_new (pixmap, pixmap_mask);
gdk_pixmap_unref (pixmap);
gdk_pixmap_unref (pixmap_mask);
g_object_unref (pixmap);
g_object_unref (pixmap_mask);
</programlisting>
</sect1>

View File

@ -250,12 +250,12 @@ Example code sequences that require reference wraps:
/* gtk_container_remove() will unparent the child and therefore
* cause its reference count to be decremented by one.
*/
gtk_widget_ref (widget);
g_object_ref (widget);
gtk_container_remove (container, widget);
/* without the reference count, the widget would have been destroyed here.
*/
gtk_container_add (container, widget);
gtk_widget_unref (widget);
g_object_unref (widget);
/* all items in item_list need to be referenced
@ -267,7 +267,7 @@ Example code sequences that require reference wraps:
slist = NULL;
for (list = item_list; list; list = list->next)
{
gtk_widget_ref (GTK_WIDGET (list->data));
g_object_ref (GTK_WIDGET (list->data));
slist = g_slist_prepend (slist, list->data);
}
gtk_list_remove_items (list, item_list);
@ -280,7 +280,7 @@ Example code sequences that require reference wraps:
tmp = slist;
slist = slist->next;
gtk_widget_unref (GTK_WIDGET (tmp->data));
g_object_unref (GTK_WIDGET (tmp->data));
g_slist_free_1 (tmp);
}

View File

@ -640,6 +640,7 @@ gdk_window_at_pointer
gdk_window_show
gdk_window_show_unraised
gdk_window_hide
gdk_window_is_destroyed
gdk_window_is_visible
gdk_window_is_viewable
gdk_window_get_state
@ -661,6 +662,7 @@ gdk_window_resize
gdk_window_move_resize
gdk_window_scroll
gdk_window_move_region
gdk_window_flush
gdk_window_ensure_native
gdk_window_reparent
gdk_window_clear
@ -669,6 +671,7 @@ gdk_window_clear_area_e
gdk_window_copy_area
gdk_window_raise
gdk_window_lower
gdk_window_restack
gdk_window_focus
gdk_window_register_dnd
gdk_window_begin_resize_drag
@ -720,6 +723,7 @@ gdk_window_set_background
gdk_window_set_back_pixmap
GDK_PARENT_RELATIVE
gdk_window_set_cursor
gdk_window_get_cursor
gdk_window_set_colormap
gdk_window_get_user_data
gdk_window_get_geometry
@ -911,6 +915,7 @@ gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_pixmap
gdk_cairo_rectangle
gdk_cairo_region
gdk_cairo_reset_clip
</SECTION>
<SECTION>

View File

@ -85,3 +85,12 @@ Cairo paths and to use pixbufs as sources for drawing operations.
@region:
<!-- ##### FUNCTION gdk_cairo_reset_clip ##### -->
<para>
</para>
@cr:
@drawable:

View File

@ -57,12 +57,7 @@ devices without having to keep track of complicated per-device
settings.
</para>
<para>
Various aspects of each device may be configured. The easiest way of
creating a GUI to allow the user to configure such a device
is to use the #GtkInputDialog widget in GTK+.
However, even when using this widget, application writers
will need to directly query and set the configuration parameters
in order to save the state between invocations of the application.
Various aspects of each device may be configured.
The configuration of devices is queried using gdk_devices_list().
Each device must be activated using gdk_device_set_mode(), which
also controls whether the device's range is mapped to the

View File

@ -15,6 +15,11 @@ header file. <filename>&lt;gdk/gdkkeysyms.h&gt;</filename> is not included in <f
it must be included independently, because the file is quite large.
</para>
<para>
Key values are regularly updated from the upstream X.org X11 implementation,
so new values are added regularly. They will be prefixed with GDK_ rather than
XF86XK_ or XK_ (for older symbols).
</para>
<para>
Key values can be converted into a string representation using
gdk_keyval_name(). The reverse function, converting a string to a key value,
is provided by gdk_keyval_from_name().

View File

@ -8,10 +8,18 @@ Onscreen display areas in the target window system
<para>
A #GdkWindow is a rectangular region on the screen. It's a low-level object,
used to implement high-level objects such as #GtkWidget and #GtkWindow on the
GTK+ level. A #GtkWindow is a toplevel window, the thing a user might think of
as a "window" with a titlebar and so on; a #GtkWindow may contain many #GdkWindow.
GTK+ level. A #GtkWindow is a toplevel window, the thing a user might think of
as a "window" with a titlebar and so on; a #GtkWindow may contain many #GdkWindow.
For example, each #GtkButton has a #GdkWindow associated with it.
</para>
<refsect2 id="COMPOSITED-WINDOWS"><title>Composited Windows</title>
<para>
Normally, the windowing system takes care of rendering the contents of a child
window onto its parent window. This mechanism can be intercepted by calling
gdk_window_set_composited() on the child window. For a
<firstterm>composited</firstterm> window it is the responsibility of the
application to render the window contents at the right spot.
</para>
<example id="composited-window-example"><title>Composited windows</title>
<programlisting><![CDATA[
#include <gtk/gtk.h>
@ -54,7 +62,7 @@ transparent_expose (GtkWidget *widget,
* this handler is called after the red has been drawn. If it was
* called before then GTK would just blindly paint over our work.
*
* Note: if the child window has children, then you need a cairo 1.16
* Note: if the child window has children, then you need a cairo 1.6
* feature to make this work correctly.
*/
static gboolean
@ -153,10 +161,10 @@ main (int argc, char **argv)
]]>
</programlisting></example>
<para>
In the example <xref linkend="composited-window-example"/>, a button is
placed inside of an event box inside of a window. The event box is
set as composited and therefore is no longer automatically drawn to
the screen.
In the example <xref linkend="composited-window-example"/>, a button is
placed inside of an event box inside of a window. The event box is
set as composited and therefore is no longer automatically drawn to
the screen.
</para>
<para>
When the contents of the event box change, an expose event is
@ -168,8 +176,31 @@ that it wishes.
<para>
In our case, we merge the contents with a 50% transparency. We
also set the background colour of the window to red. The effect is
that the background shows through the button.
that the background shows through the button.
</para>
</refsect2>
<refsect2 id="OFFSCREEN-WINDOWS"><title>Offscreen Windows</title>
<para>
Offscreen windows are more general than composited windows, since they
allow not only to modify the rendering of the child window onto its parent,
but also to apply coordinate transformations.
</para>
<para>
To integrate an offscreen window into a window hierarchy, one has to call
gdk_window_set_embedder() and handle a number of signals. The
gdk_offscreen_window_set_embedder() and handle a number of signals. The
#GdkWindow::pick-embedded-child signal on the embedder window is used to
select an offscreen child at given coordinates, and the #GdkWindow::to-embedder
and #GdkWindow::from-embedder signals on the offscreen window are used to
translate coordinates between the embedder and the offscreen window.
</para>
<para>
For rendering an offscreen window onto its embedder, the contents of the
offscreen window are available as a pixmap, via
gdk_offscreen_window_get_pixmap().
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>
@ -221,6 +252,11 @@ these types.
@arg3:
@arg4:
<!-- ##### ARG GdkWindow:cursor ##### -->
<para>
</para>
<!-- ##### ENUM GdkWindowType ##### -->
<para>
Describes the kind of window.
@ -232,7 +268,7 @@ Describes the kind of window.
@GDK_WINDOW_DIALOG: useless/deprecated compatibility type
@GDK_WINDOW_TEMP: override redirect temporary window (used to implement #GtkMenu)
@GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
@GDK_WINDOW_OFFSCREEN: offscreen window. Since 2.18
@GDK_WINDOW_OFFSCREEN: offscreen window (see <xref linkend="OFFSCREEN-WINDOWS"/>). Since 2.18
<!-- ##### ENUM GdkWindowClass ##### -->
<para>
@ -530,6 +566,15 @@ Deprecated equivalent of g_object_unref()
@window:
<!-- ##### FUNCTION gdk_window_is_destroyed ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_is_visible ##### -->
<para>
@ -718,6 +763,14 @@ Deprecated equivalent of g_object_unref()
@dy:
<!-- ##### FUNCTION gdk_window_flush ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_ensure_native ##### -->
<para>
@ -806,6 +859,16 @@ Deprecated equivalent to gdk_draw_drawable(), see that function for docs
@window:
<!-- ##### FUNCTION gdk_window_restack ##### -->
<para>
</para>
@window:
@sibling:
@above:
<!-- ##### FUNCTION gdk_window_focus ##### -->
<para>
@ -1242,6 +1305,15 @@ window.
@cursor:
<!-- ##### FUNCTION gdk_window_get_cursor ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### MACRO gdk_window_set_colormap ##### -->
<para>
Deprecated equivalent to gdk_drawable_set_colormap()

View File

@ -130,6 +130,7 @@ content_files = \
drawing-model.xml \
glossary.xml \
migrating-checklist.sgml \
migrating-ClientSideWindows.sgml \
migrating-GtkAboutDialog.sgml \
migrating-GtkAction.sgml \
migrating-GtkAssistant.sgml \
@ -160,6 +161,7 @@ expand_content_files = \
drawing-model.xml \
glossary.xml \
migrating-checklist.sgml \
migrating-ClientSideWindows.sgml \
migrating-GtkAction.sgml \
migrating-GtkComboBox.sgml \
migrating-GtkEntry-icons.sgml \
@ -169,6 +171,7 @@ expand_content_files = \
migrating-GtkColorButton.sgml \
migrating-GtkAssistant.sgml \
migrating-GtkRecentChooser.sgml \
migrating-GtkLabel-links.sgml \
migrating-GtkLinkButton.sgml \
migrating-GtkBuilder.sgml \
migrating-GtkTooltip.sgml \
@ -333,6 +336,7 @@ HTML_IMAGES = \
$(srcdir)/images/scrolledwindow.png \
$(srcdir)/images/separator.png \
$(srcdir)/images/spinbutton.png \
$(srcdir)/images/spinner.png \
$(srcdir)/images/statusbar.png \
$(srcdir)/images/toggle-button.png \
$(srcdir)/images/toolbar.png \

View File

@ -161,6 +161,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/gtkstatusbar.xml" />
<xi:include href="xml/gtkinfobar.xml" />
<xi:include href="xml/gtkstatusicon.xml" />
<xi:include href="xml/gtkspinner.xml" />
</chapter>
<chapter id="ButtonWidgets">
@ -219,6 +220,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/gtkcellrendererspin.xml" />
<xi:include href="xml/gtkcellrenderertext.xml" />
<xi:include href="xml/gtkcellrenderertoggle.xml" />
<xi:include href="xml/gtkcellrendererspinner.xml" />
<xi:include href="xml/gtkliststore.xml" />
<xi:include href="xml/gtktreestore.xml" />
</chapter>
@ -437,6 +439,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/migrating-GtkTooltip.sgml" />
<xi:include href="xml/migrating-GtkEntry-icons.sgml" />
<xi:include href="xml/migrating-GtkLabel-links.sgml" />
<xi:include href="xml/migrating-ClientSideWindows.sgml" />
</part>
<part>
@ -492,4 +495,8 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<title>Index of new symbols in 2.18</title>
<xi:include href="xml/api-index-2.18.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-2-20" role="2.20">
<title>Index of new symbols in 2.20</title>
<xi:include href="xml/api-index-2.20.xml"><xi:fallback /></xi:include>
</index>
</book>

View File

@ -1483,6 +1483,8 @@ gtk_file_chooser_set_show_hidden
gtk_file_chooser_get_show_hidden
gtk_file_chooser_set_do_overwrite_confirmation
gtk_file_chooser_get_do_overwrite_confirmation
gtk_file_chooser_set_create_folders
gtk_file_chooser_get_create_folders
gtk_file_chooser_set_current_name
gtk_file_chooser_get_filename
gtk_file_chooser_set_filename
@ -1970,6 +1972,8 @@ gtk_icon_view_set_column_spacing
gtk_icon_view_get_column_spacing
gtk_icon_view_set_margin
gtk_icon_view_get_margin
gtk_icon_view_set_item_padding
gtk_icon_view_get_item_padding
gtk_icon_view_select_path
gtk_icon_view_unselect_path
gtk_icon_view_path_is_selected
@ -3070,6 +3074,8 @@ gtk_range_set_lower_stepper_sensitivity
gtk_range_get_lower_stepper_sensitivity
gtk_range_set_upper_stepper_sensitivity
gtk_range_get_upper_stepper_sensitivity
gtk_range_get_flippable
gtk_range_set_flippable
<SUBSECTION Standard>
GTK_RANGE
GTK_IS_RANGE
@ -3578,6 +3584,24 @@ GTK_SPIN_BUTTON_GET_CLASS
gtk_spin_button_get_type
</SECTION>
<SECTION>
<FILE>gtkspinner</FILE>
<TITLE>GtkSpinner</TITLE>
GtkSpinner
gtk_spinner_new
gtk_spinner_start
gtk_spinner_stop
<SUBSECTION Standard>
GTK_SPINNER
GTK_IS_SPINNER
GTK_TYPE_SPINNER
GTK_SPINNER_CLASS
GTK_IS_SPINER_CLASS
GTK_SPINNER_GET_CLASS
<SUBSECTION Private>
gtk_spinner_get_type
</SECTION>
<SECTION>
<FILE>gtkstatusbar</FILE>
<TITLE>GtkStatusbar</TITLE>
@ -4550,6 +4574,7 @@ gtk_tooltip_set_text
gtk_tooltip_set_icon
gtk_tooltip_set_icon_from_stock
gtk_tooltip_set_icon_from_icon_name
gtk_tooltip_set_icon_from_gicon
gtk_tooltip_set_custom
gtk_tooltip_trigger_tooltip_query
gtk_tooltip_set_tip_area
@ -5139,6 +5164,14 @@ gtk_cell_renderer_editing_canceled
gtk_cell_renderer_stop_editing
gtk_cell_renderer_get_fixed_size
gtk_cell_renderer_set_fixed_size
gtk_cell_renderer_get_visible
gtk_cell_renderer_set_visible
gtk_cell_renderer_get_sensitive
gtk_cell_renderer_set_sensitive
gtk_cell_renderer_get_alignment
gtk_cell_renderer_set_alignment
gtk_cell_renderer_get_padding
gtk_cell_renderer_set_padding
<SUBSECTION Standard>
GTK_CELL_RENDERER
@ -5202,6 +5235,23 @@ GtkCellRendererSpinPrivate
gtk_cell_renderer_spin_get_type
</SECTION>
<SECTION>
<FILE>gtkcellrendererspinner</FILE>
<TITLE>GtkCellRendererSpinner</TITLE>
GtkCellRendererSpinner
gtk_cell_renderer_spinner_new
<SUBSECTION Standard>
GTK_TYPE_CELL_RENDERER_SPINNER
GTK_CELL_RENDERER_SPINNER
GTK_CELL_RENDERER_SPINNER_CLASS
GTK_IS_CELL_RENDERER_SPINNER
GTK_IS_CELL_RENDERER_SPINNER_CLASS
GTK_CELL_RENDERER_SPINNER_GET_CLASS
<SUBSECTION Private>
GtkCellRendererSpinnerPrivate
gtk_cell_renderer_spinner_get_type
</SECTION>
<SECTION>
<FILE>gtkcellrendererpixbuf</FILE>
<TITLE>GtkCellRendererPixbuf</TITLE>
@ -5244,6 +5294,9 @@ gtk_cell_renderer_toggle_get_radio
gtk_cell_renderer_toggle_set_radio
gtk_cell_renderer_toggle_get_active
gtk_cell_renderer_toggle_set_active
gtk_cell_renderer_toggle_get_activatable
gtk_cell_renderer_toggle_set_activatable
<SUBSECTION Standard>
GTK_CELL_RENDERER_TOGGLE
GTK_IS_CELL_RENDERER_TOGGLE
@ -5673,6 +5726,30 @@ gtk_widget_set_has_tooltip
gtk_widget_trigger_tooltip_query
gtk_widget_get_snapshot
gtk_widget_get_window
gtk_widget_get_allocation
gtk_widget_set_allocation
gtk_widget_get_app_paintable
gtk_widget_get_can_default
gtk_widget_set_can_default
gtk_widget_get_can_focus
gtk_widget_set_can_focus
gtk_widget_get_double_buffered
gtk_widget_get_has_window
gtk_widget_set_has_window
gtk_widget_get_sensitive
gtk_widget_is_sensitive
gtk_widget_get_state
gtk_widget_get_visible
gtk_widget_set_visible
gtk_widget_has_default
gtk_widget_has_focus
gtk_widget_has_grab
gtk_widget_is_drawable
gtk_widget_is_toplevel
gtk_widget_set_window
gtk_widget_set_receives_default
gtk_widget_get_receives_default
<SUBSECTION>
gtk_requisition_copy
gtk_requisition_free
@ -5998,6 +6075,7 @@ gtk_paint_polygon
gtk_paint_shadow
gtk_paint_shadow_gap
gtk_paint_slider
gtk_paint_spinner
gtk_paint_string
gtk_paint_tab
gtk_paint_vline
@ -6698,6 +6776,7 @@ gtk_print_operation_set_print_settings
gtk_print_operation_get_print_settings
gtk_print_operation_set_job_name
gtk_print_operation_set_n_pages
gtk_print_operation_get_n_pages_to_print
gtk_print_operation_set_current_page
gtk_print_operation_set_use_full_page
gtk_print_operation_set_unit

View File

@ -29,6 +29,7 @@ gtk_cell_renderer_get_type
gtk_cell_renderer_pixbuf_get_type
gtk_cell_renderer_progress_get_type
gtk_cell_renderer_spin_get_type
gtk_cell_renderer_spinner_get_type
gtk_cell_renderer_text_get_type
gtk_cell_renderer_toggle_get_type
gtk_cell_view_get_type
@ -146,6 +147,7 @@ gtk_settings_get_type
gtk_size_group_get_type
gtk_socket_get_type
gtk_spin_button_get_type
gtk_spinner_get_type
gtk_statusbar_get_type
gtk_status_icon_get_type
gtk_style_get_type

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,70 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-migrating-ClientSideWindows">
<title>Migrating to client-side windows</title>
<para>
In version 2.18, GDK has been changed to use client-side windows. This
means that there is no longer a 1-1 correspondence between #GdkWindows
and windows in the underlying window system. In particular, it is no
longer correct to assume that each window has an associated XID.
Code that makes this assumption can sometimes be fixed by calling
gdk_window_ensure_native() on the windows in question.
Calling gdk_x11_drawable_get_xid() (or GDK_WINDOW_XID()) from the
X11-specific API on a non-native window will explicitly call
gdk_window_ensure_native(), so old code using this will continue to
work. A small gotcha is that the GDK_WINDOW_XID() call is no longer a
trivial accessor for the XID of the window, and thus must not be called
from another thread without taking locking precautions.
</para>
<para>
GDK looks for the <envar>GDK_NATIVE_WINDOWS</envar> environment variable
and makes all windows native if it is set. It also tries to be more
compatible with the way prior versions worked in some other ways.
</para>
<para>
Some applications assume that they can just operate on the X windows
corresponding to their GDK windows without ever telling GDK. One
example that we've seen is changing the child window stacking order
using XRestackWindows(). Fixing this properly requires to fix the code
to use GDK functions to achieve whatever it is trying to achieve.
To make this easier in the case of stacking order changes, we've added
a gdk_window_restack() function.
</para>
<para>
One change that can cause problems for some applications is that GDK
is more aggressive about optimizing away expose events. Code that does
more than just repainting exposed areas in response to expose events
may be affected by this.
</para>
<para>
Problems can also occur when using cairo for drawing. One thing that can
go wrong is clip handling. If you ever need to reset the clip region on
a cairo_t (i.e. use cairo_reset_clip()), you have to to use
gdk_cairo_reset_clip() instead. The reason for this is that the cairo_reset_clip() call will remove the initial clip region that limits your drawing to
the client-side window at hand, so you will end up drawing over stuff
outside the window. You also need to use gdk_cairo_reset_clip() if you
use a cairo_t that was not allocated in a double-buffered expose handler
and keep it in use after window hierarchy changes (resizing, moving,
stacking order changes). The easiest fix for this kind of problem is to
simply create a new cairo context for each expose event.
</para>
<para>
Due to a weird API in XClearArea the gdk_window_clear_area() call handled
a specified width or height of zero to mean "to end of window" for
non-double-buffered drawing. This has been changed to be consistent with
the docs and what happens in the double-buffered case. All code in GTK+
that relied on this has been fixed, but it is possible (although unlikely)
that third party applications rely on this. If you need to do this, just
implement it yourself using gdk_drawable_get_size().
</para>
</chapter>

View File

@ -13,21 +13,18 @@
</para>
<para>
A good way to start a migration from libglade to GtkBuilder is
to run the <link linkend="gtk-builder-convert">gtk-builder-convert</link>
utility on your glade file, and inspect the resulting output.
If your code uses the @root parameter of glade_xml_new(), you
may want to split your glade file into multiple GtkBuilder files
by using the <option>--root</option> option of
<application>gtk-builder-convert</application>. Alternatively, you
can use gtk_builder_add_objects_from_file() to construct only certain
A good way to start a migration from libglade to GtkBuilder is using
<application>glade3</application> to convert your .glade file.
If your code uses the @root parameter of glade_xml_new(),
you can use gtk_builder_add_objects_from_file() to construct only certain
objects from a GtkBuilder file.
</para>
<para>
Alternatively, you can open the glade file with
<application>glade3</application> and then save it in GtkBuilder
format. This is supported by glade3 since version 3.6.
Alternatively, GTK+ also offers the
<link linkend="gtk-builder-convert">gtk-builder-convert</link> script you can use
to do the conversion; in which case you should be careful to inspect the output
and make sure you didn't lose any data.
</para>
<table pgwide="1" frame="topbot">
@ -53,7 +50,7 @@ GError* error = NULL;
GtkBuilder* builder = gtk_builder_new (<!-- -->);
if (!gtk_builder_add_from_file (builder, FILE, &amp;error))
{
g_warning ("Couldn't load builder file: %amp;s", error->message);
g_warning ("Couldn't load builder file: &percnt;s", error->message);
g_error_free (error);
}
</screen>

View File

@ -7,10 +7,10 @@
<title>Migrating from SexyIconEntry to GtkEntry</title>
<para>
GTK+ 2.16 supports showing icons inside a #GtkEntry, similar to
SexyIconEntry. Porting from SexyIconEntry to GtkEntry is relatively
straightforward. The main difference between the two APIs is that
SexyIconEntry uses #GtkImage widgets in a somewhat awkward way as
GTK+ 2.16 supports showing icons inside a #GtkEntry, similar to
SexyIconEntry. Porting from SexyIconEntry to GtkEntry is relatively
straightforward. The main difference between the two APIs is that
SexyIconEntry uses #GtkImage widgets in a somewhat awkward way as
storage vehicles for icons, while GtkEntry allows to specify icons
via pixbufs, stock ids, icon names or #GIcons. So, if your code uses
e.g.:
@ -130,7 +130,7 @@ text_changed_cb (GtkEntry *entry,
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
GTK_ENTRY_ICON_SECONDARY,
GTK_STOCK_CLEAR);
g_signal_connect (entry, "icon-pressed",
g_signal_connect (entry, "icon-press",
G_CALLBACK (icon_pressed_cb), NULL);
g_signal_connect (entry, "notify::text",
G_CALLBACK (text_changed_cb), find_button);

View File

@ -130,7 +130,7 @@
<structname>GtkIconView</structname>:
<itemizedlist>
<listitem><para>
<typename>GnomeIconListMode</typename> is replaced by the
<type>GnomeIconListMode</type> is replaced by the
<link linkend="GtkIconView--orientation">orientation</link>
property of <structname>GtkIconView</structname>
</para></listitem>

View File

@ -341,6 +341,16 @@ nevertheless.
</para>
</formalpara>
<formalpara>
<title><envar>GDK_NATIVE_WINDOWS</envar></title>
<para>
If set, GDK creates all windows as native windows. This can help
applications that make assumptions about 1-1 correspondence between
GDK windows and X11 windows.
</para>
</formalpara>
<formalpara>
<title><envar>XDG_DATA_HOME</envar>, <envar>XDG_DATA_DIRS</envar></title>

View File

@ -3885,14 +3885,6 @@ fundamental type.
@group_cycling:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_allocation ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_usize ##### -->
<para>

View File

@ -1,475 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkAboutDialog
<!-- ##### SECTION Short_Description ##### -->
Display information about an application
<!-- ##### SECTION Long_Description ##### -->
<para>
The #GtkAboutDialog offers a simple way to display information about
a program like its logo, name, copyright, website and license. It is
also possible to give credits to the authors, documenters, translators
and artists who have worked on the program. An about dialog is typically
opened when the user selects the <literal>About</literal> option from
the <literal>Help</literal> menu. All parts of the dialog are optional.
</para>
<para>
About dialog often contain links and email addresses. #GtkAboutDialog
supports this by offering global hooks, which are called when the user
clicks on a link or email address, see gtk_about_dialog_set_email_hook()
and gtk_about_dialog_set_url_hook(). Email addresses in the
authors, documenters and artists properties are recognized by looking for
<literal>&lt;user@<!-- -->host&gt;</literal>, URLs are
recognized by looking for <literal>http://url</literal>, with
<literal>url</literal> extending to the next space, tab or line break.
</para>
<para id="gtk-about-dialog-hook-setup">
Since 2.18 #GtkAboutDialog provides default website and email hooks that use
gtk_show_uri().
</para>
<para>
If you want provide your own hooks overriding the default ones, it is important
to do so before setting the website and email URL properties, like this:
</para>
<informalexample><programlisting>
gtk_about_dialog_set_url_hook (GTK_ABOUT_DIALOG (dialog), launch_url, NULL, NULL);
gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), app_url);
</programlisting></informalexample>
<para>
To disable the default hooks, you can pass %NULL as the hook func. Then,
the #GtkAboutDialog widget will not display the website or the
email addresses as clickable.
</para>
<para>
To make constructing a #GtkAboutDialog as convenient as possible, you can
use the function gtk_show_about_dialog() which constructs and shows a dialog
and keeps it around so that it can be shown again.
</para>
<para>
Note that GTK+ sets a default title of <literal>_("About &percnt;s")</literal>
on the dialog window (where &percnt;s is replaced by the name of the
application, but in order to ensure proper translation of the title,
applications should set the title property explicitly when constructing
a #GtkAboutDialog, as shown in the following example:
</para>
<informalexample><programlisting>
gtk_show_about_dialog (NULL,
"program-name", "ExampleCode",
"logo", example_logo,
"title" _("About ExampleCode"),
NULL);
</programlisting></informalexample>
<para>
Note that prior to GTK+ 2.12, the #GtkAboutDialog:program-name property
was called "name". This was changed to avoid the conflict with the
#GtkWidget:name property.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GTK_STOCK_ABOUT
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkAboutDialog ##### -->
<para>
The <structname>GtkAboutDialog</structname> struct contains
only private fields and should not be directly accessed.
</para>
<!-- ##### ARG GtkAboutDialog:artists ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:authors ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:comments ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:copyright ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:documenters ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:license ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:logo ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:logo-icon-name ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:program-name ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:translator-credits ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:version ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:website ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:website-label ##### -->
<para>
</para>
<!-- ##### ARG GtkAboutDialog:wrap-license ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_about_dialog_new ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_get_name ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_name ##### -->
<para>
</para>
@about:
@name:
<!-- ##### FUNCTION gtk_about_dialog_get_program_name ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_program_name ##### -->
<para>
</para>
@about:
@name:
<!-- ##### FUNCTION gtk_about_dialog_get_version ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_version ##### -->
<para>
</para>
@about:
@version:
<!-- ##### FUNCTION gtk_about_dialog_get_copyright ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_copyright ##### -->
<para>
</para>
@about:
@copyright:
<!-- ##### FUNCTION gtk_about_dialog_get_comments ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_comments ##### -->
<para>
</para>
@about:
@comments:
<!-- ##### FUNCTION gtk_about_dialog_get_license ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_license ##### -->
<para>
</para>
@about:
@license:
<!-- ##### FUNCTION gtk_about_dialog_get_wrap_license ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_wrap_license ##### -->
<para>
</para>
@about:
@wrap_license:
<!-- ##### FUNCTION gtk_about_dialog_get_website ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_website ##### -->
<para>
</para>
@about:
@website:
<!-- ##### FUNCTION gtk_about_dialog_get_website_label ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_website_label ##### -->
<para>
</para>
@about:
@website_label:
<!-- ##### FUNCTION gtk_about_dialog_get_authors ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_authors ##### -->
<para>
</para>
@about:
@authors:
<!-- ##### FUNCTION gtk_about_dialog_get_artists ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_artists ##### -->
<para>
</para>
@about:
@artists:
<!-- ##### FUNCTION gtk_about_dialog_get_documenters ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_documenters ##### -->
<para>
</para>
@about:
@documenters:
<!-- ##### FUNCTION gtk_about_dialog_get_translator_credits ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_translator_credits ##### -->
<para>
</para>
@about:
@translator_credits:
<!-- ##### FUNCTION gtk_about_dialog_get_logo ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_logo ##### -->
<para>
</para>
@about:
@logo:
<!-- ##### FUNCTION gtk_about_dialog_get_logo_icon_name ##### -->
<para>
</para>
@about:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_logo_icon_name ##### -->
<para>
</para>
@about:
@icon_name:
<!-- ##### USER_FUNCTION GtkAboutDialogActivateLinkFunc ##### -->
<para>
The type of a function which is called when a URL or email
link is activated.
</para>
@about: the #GtkAboutDialog in which the link was activated
@link_: the URL or email address to which the activated link points
@data: user data that was passed when the function was registered
with gtk_about_dialog_set_email_hook() or
gtk_about_dialog_set_url_hook()
<!-- ##### FUNCTION gtk_about_dialog_set_email_hook ##### -->
<para>
</para>
@func:
@data:
@destroy:
@Returns:
<!-- ##### FUNCTION gtk_about_dialog_set_url_hook ##### -->
<para>
</para>
@func:
@data:
@destroy:
@Returns:
<!-- ##### FUNCTION gtk_show_about_dialog ##### -->
<para>
</para>
@parent:
@first_property_name:
@Varargs:

View File

@ -1,327 +0,0 @@
<!-- ##### SECTION Title ##### -->
Accelerator Groups
<!-- ##### SECTION Short_Description ##### -->
Groups of global keyboard accelerators for an entire GtkWindow
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GtkAccelGroup represents a group of keyboard accelerators,
typically attached to a toplevel #GtkWindow (with
gtk_window_add_accel_group()). Usually you won't need to create a
#GtkAccelGroup directly; instead, when using #GtkItemFactory, GTK+
automatically sets up the accelerators for your menus in the item
factory's #GtkAccelGroup.
</para>
<para>
Note that <firstterm>accelerators</firstterm> are different from
<firstterm>mnemonics</firstterm>. Accelerators are shortcuts for
activating a menu item; they appear alongside the menu item they're a
shortcut for. For example "Ctrl+Q" might appear alongside the "Quit"
menu item. Mnemonics are shortcuts for GUI elements such as text
entries or buttons; they appear as underlined characters. See
gtk_label_new_with_mnemonic(). Menu items can have both accelerators
and mnemonics, of course.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
gtk_window_add_accel_group(), gtk_accel_map_change_entry(),
gtk_item_factory_new(), gtk_label_new_with_mnemonic()
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkAccelGroup ##### -->
<para>
An object representing and maintaining a group of accelerators.
</para>
<!-- ##### SIGNAL GtkAccelGroup::accel-activate ##### -->
<para>
</para>
@accelgroup: the object which received the signal.
@arg1:
@arg2:
@arg3:
@Returns:
<!-- ##### SIGNAL GtkAccelGroup::accel-changed ##### -->
<para>
</para>
@accelgroup: the object which received the signal.
@arg1:
@arg2:
@arg3:
<!-- ##### ARG GtkAccelGroup:is-locked ##### -->
<para>
</para>
<!-- ##### ARG GtkAccelGroup:modifier-mask ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_accel_group_new ##### -->
<para>
</para>
@Returns:
<!-- ##### MACRO gtk_accel_group_ref ##### -->
<para>
Deprecated equivalent of g_object_ref().
</para>
@Returns: the accel group that was passed in
<!-- ##### MACRO gtk_accel_group_unref ##### -->
<para>
Deprecated equivalent of g_object_unref().
</para>
<!-- ##### FUNCTION gtk_accel_group_connect ##### -->
<para>
</para>
@accel_group:
@accel_key:
@accel_mods:
@accel_flags:
@closure:
<!-- ##### FUNCTION gtk_accel_group_connect_by_path ##### -->
<para>
</para>
@accel_group:
@accel_path:
@closure:
<!-- ##### USER_FUNCTION GtkAccelGroupActivate ##### -->
<para>
</para>
@accel_group:
@acceleratable:
@keyval:
@modifier:
@Returns:
<!-- ##### USER_FUNCTION GtkAccelGroupFindFunc ##### -->
<para>
</para>
@key:
@closure:
@data:
@Returns:
@Since: 2.2
<!-- ##### FUNCTION gtk_accel_group_disconnect ##### -->
<para>
</para>
@accel_group:
@closure:
@Returns:
<!-- ##### FUNCTION gtk_accel_group_disconnect_key ##### -->
<para>
</para>
@accel_group:
@accel_key:
@accel_mods:
@Returns:
<!-- ##### FUNCTION gtk_accel_group_query ##### -->
<para>
</para>
@accel_group:
@accel_key:
@accel_mods:
@n_entries:
@Returns:
<!-- ##### FUNCTION gtk_accel_group_activate ##### -->
<para>
</para>
@accel_group:
@accel_quark:
@acceleratable:
@accel_key:
@accel_mods:
@Returns:
<!-- ##### FUNCTION gtk_accel_group_lock ##### -->
<para>
</para>
@accel_group:
<!-- ##### FUNCTION gtk_accel_group_unlock ##### -->
<para>
</para>
@accel_group:
<!-- ##### FUNCTION gtk_accel_group_get_is_locked ##### -->
<para>
</para>
@accel_group:
@Returns:
<!-- ##### FUNCTION gtk_accel_group_from_accel_closure ##### -->
<para>
</para>
@closure:
@Returns:
<!-- ##### FUNCTION gtk_accel_group_get_modifier_mask ##### -->
<para>
</para>
@accel_group:
@Returns:
<!-- ##### FUNCTION gtk_accel_groups_activate ##### -->
<para>
</para>
@object:
@accel_key:
@accel_mods:
@Returns:
<!-- ##### FUNCTION gtk_accel_groups_from_object ##### -->
<para>
</para>
@object:
@Returns:
<!-- ##### FUNCTION gtk_accel_group_find ##### -->
<para>
</para>
@accel_group:
@find_func:
@data:
@Returns:
<!-- ##### STRUCT GtkAccelKey ##### -->
<para>
</para>
@accel_key:
@accel_mods:
@accel_flags:
<!-- ##### FUNCTION gtk_accelerator_valid ##### -->
<para>
</para>
@keyval:
@modifiers:
@Returns:
<!-- ##### FUNCTION gtk_accelerator_parse ##### -->
<para>
</para>
@accelerator:
@accelerator_key:
@accelerator_mods:
<!-- ##### FUNCTION gtk_accelerator_name ##### -->
<para>
</para>
@accelerator_key:
@accelerator_mods:
@Returns:
<!-- ##### FUNCTION gtk_accelerator_get_label ##### -->
<para>
</para>
@accelerator_key:
@accelerator_mods:
@Returns:
<!-- ##### FUNCTION gtk_accelerator_set_default_mod_mask ##### -->
<para>
</para>
@default_mod_mask:
<!-- ##### FUNCTION gtk_accelerator_get_default_mod_mask ##### -->
<para>
</para>
@Returns:

View File

@ -1,33 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkAccessible
<!-- ##### SECTION Short_Description ##### -->
Accessibility support for widgets
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkAccessible ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_accessible_connect_widget_destroyed ##### -->
<para>
</para>
@accessible:

View File

@ -1,98 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkActivatable
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkActivatable ##### -->
<para>
</para>
<!-- ##### ARG GtkActivatable:related-action ##### -->
<para>
</para>
<!-- ##### ARG GtkActivatable:use-action-appearance ##### -->
<para>
</para>
<!-- ##### STRUCT GtkActivatableIface ##### -->
<para>
</para>
@g_iface:
@update:
@sync_action_properties:
<!-- ##### FUNCTION gtk_activatable_do_set_related_action ##### -->
<para>
</para>
@activatable:
@action:
<!-- ##### FUNCTION gtk_activatable_get_related_action ##### -->
<para>
</para>
@activatable:
@Returns:
<!-- ##### FUNCTION gtk_activatable_get_use_action_appearance ##### -->
<para>
</para>
@activatable:
@Returns:
<!-- ##### FUNCTION gtk_activatable_sync_action_properties ##### -->
<para>
</para>
@activatable:
@action:
<!-- ##### FUNCTION gtk_activatable_set_related_action ##### -->
<para>
</para>
@activatable:
@action:
<!-- ##### FUNCTION gtk_activatable_set_use_action_appearance ##### -->
<para>
</para>
@activatable:
@use_appearance:

View File

@ -195,6 +195,7 @@ Emits a #GtkButton::pressed signal to the given #GtkButton.
</para>
@button: The #GtkButton you want to send the signal to.
@Deprecated: 2.20: Use the #GtkWidget::button-press-event signal.
<!-- ##### FUNCTION gtk_button_released ##### -->
@ -203,6 +204,7 @@ Emits a #GtkButton::released signal to the given #GtkButton.
</para>
@button: The #GtkButton you want to send the signal to.
@Deprecated: 2.20: Use the #GtkWidget::button-release-event signal.
<!-- ##### FUNCTION gtk_button_clicked ##### -->
@ -213,12 +215,14 @@ Emits a #GtkButton::clicked signal to the given #GtkButton.
@button: The #GtkButton you want to send the signal to.
<!-- ##### FUNCTION gtk_button_enter ##### -->
<para>
Emits a #GtkButton::enter signal to the given #GtkButton.
</para>
@button: The #GtkButton you want to send the signal to.
@Deprecated: 2.20: Use the #GtkWidget::enter-notify-event signal.
<!-- ##### FUNCTION gtk_button_leave ##### -->
@ -227,6 +231,7 @@ Emits a #GtkButton::leave signal to the given #GtkButton.
</para>
@button: The #GtkButton you want to send the signal to.
@Deprecated: 2.20: Use the #GtkWidget::leave-notify-event signal.
<!-- ##### FUNCTION gtk_button_set_relief ##### -->

View File

@ -282,3 +282,79 @@ it cannot be individually modified.
@height:
<!-- ##### FUNCTION gtk_cell_renderer_get_visible ##### -->
<para>
</para>
@cell:
@Returns:
<!-- ##### FUNCTION gtk_cell_renderer_set_visible ##### -->
<para>
</para>
@cell:
@visible:
<!-- ##### FUNCTION gtk_cell_renderer_get_sensitive ##### -->
<para>
</para>
@cell:
@Returns:
<!-- ##### FUNCTION gtk_cell_renderer_set_sensitive ##### -->
<para>
</para>
@cell:
@sensitive:
<!-- ##### FUNCTION gtk_cell_renderer_get_alignment ##### -->
<para>
</para>
@cell:
@xalign:
@yalign:
<!-- ##### FUNCTION gtk_cell_renderer_set_alignment ##### -->
<para>
</para>
@cell:
@xalign:
@yalign:
<!-- ##### FUNCTION gtk_cell_renderer_get_padding ##### -->
<para>
</para>
@cell:
@xpad:
@ypad:
<!-- ##### FUNCTION gtk_cell_renderer_set_padding ##### -->
<para>
</para>
@cell:
@xpad:
@ypad:

View File

@ -103,3 +103,21 @@ property. When activated, it emits the toggled signal.
@setting:
<!-- ##### FUNCTION gtk_cell_renderer_toggle_get_activatable ##### -->
<para>
</para>
@toggle:
@Returns:
<!-- ##### FUNCTION gtk_cell_renderer_toggle_set_activatable ##### -->
<para>
</para>
@toggle:
@setting:

View File

@ -5,17 +5,6 @@ GtkCurve
Allows direct editing of a curve
<!-- ##### SECTION Long_Description ##### -->
<note>
<para>
This widget is considered too specialized/little-used for
GTK+, and will in the future be moved to some other package. If
your application needs this widget, feel free to use it, as the
widget does work and is useful in some applications; it's just not
of general interest. However, we are not accepting new features for
the widget, and it will eventually move out of the GTK+
distribution.
</para>
</note>
<para>
The #GtkCurve widget allows the user to edit a curve covering a range of
values. It is typically used to fine-tune color balances in graphics
@ -28,6 +17,9 @@ connected together into a smooth curve. In linear mode the user places points
on the curve which are connected by straight lines. In free mode the user can
draw the points of the curve freely, and they are not connected at all.
</para>
<para>
As of GTK+ 2.20, #GtkCurve has been deprecated since it is too specialized.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
@ -92,6 +84,7 @@ Creates a new #GtkCurve.
</para>
@Returns: a new #GtkCurve.
@Deprecated: 2.20: Don't use this widget anymore.
<!-- ##### FUNCTION gtk_curve_reset ##### -->
@ -102,6 +95,7 @@ The curve type is not changed.
</para>
@curve: a #GtkCurve.
@Deprecated: 2.20: Don't use this widget anymore.
<!-- ##### FUNCTION gtk_curve_set_gamma ##### -->
@ -115,6 +109,7 @@ FIXME: Needs a more precise definition of gamma.
@curve: a #GtkCurve.
@gamma_: the gamma value.
@Deprecated: 2.20: Don't use this widget anymore.
<!-- ##### FUNCTION gtk_curve_set_range ##### -->
@ -128,6 +123,7 @@ The curve is also reset with a call to gtk_curve_reset().
@max_x: the maximum x value.
@min_y: the minimum y value.
@max_y: the maximum y value.
@Deprecated: 2.20: Don't use this widget anymore.
<!-- ##### FUNCTION gtk_curve_get_vector ##### -->
@ -138,6 +134,7 @@ Returns a vector of points representing the curve.
@curve: a #GtkCurve.
@veclen: the number of points to calculate.
@vector: returns the points.
@Deprecated: 2.20: Don't use this widget anymore.
<!-- ##### FUNCTION gtk_curve_set_vector ##### -->
@ -149,6 +146,7 @@ The curve type is set to %GTK_CURVE_TYPE_FREE.
@curve: a #GtkCurve.
@veclen: the number of points.
@vector: the points on the curve.
@Deprecated: 2.20: Don't use this widget anymore.
<!-- ##### FUNCTION gtk_curve_set_curve_type ##### -->
@ -160,5 +158,6 @@ curve will be changed as little as possible.
@curve: a #GtkCurve.
@type: the type of the curve.
@Deprecated: 2.20: Don't use this widget anymore.

View File

@ -677,6 +677,11 @@ gtk_widget_destroy (chooser);
</para>
<!-- ##### ARG GtkFileChooser:create-folders ##### -->
<para>
</para>
<!-- ##### ARG GtkFileChooser:do-overwrite-confirmation ##### -->
<para>
@ -875,6 +880,24 @@ gtk_widget_destroy (chooser);
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_set_create_folders ##### -->
<para>
</para>
@chooser:
@create_folders:
<!-- ##### FUNCTION gtk_file_chooser_get_create_folders ##### -->
<para>
</para>
@chooser:
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_set_current_name ##### -->
<para>

View File

@ -5,17 +5,6 @@ GtkGammaCurve
A subclass of GtkCurve for editing gamma curves
<!-- ##### SECTION Long_Description ##### -->
<note>
<para>
This widget is considered too specialized/little-used for
GTK+, and will in the future be moved to some other package. If
your application needs this widget, feel free to use it, as the
widget does work and is useful in some applications; it's just not
of general interest. However, we are not accepting new features for
the widget, and it will eventually move out of the GTK+
distribution.
</para>
</note>
<para>
The #GtkGammaCurve widget is a variant of #GtkCurve specifically for
editing gamma curves, which are used in graphics applications such as the
@ -28,6 +17,9 @@ mouse just like a #GtkCurve widget. On the right of the curve it also displays
free), and the other 2 set the curve to a particular gamma value, or reset it
to a straight line.
</para>
<para>
As of GTK+ 2.20, #GtkGammaCurve has been deprecated since it is too specialized.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
@ -50,5 +42,6 @@ Creates a new #GtkGammaCurve.
</para>
@Returns: a new #GtkGammaCurve.
@Deprecated: 2.20: Don't use this widget anymore.

View File

@ -109,6 +109,11 @@ private fields and should not be directly accessed.
</para>
<!-- ##### ARG GtkIconView:item-padding ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:item-width ##### -->
<para>
@ -491,6 +496,24 @@ selected rows. It will be called on every selected row in the view.
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_item_padding ##### -->
<para>
</para>
@icon_view:
@item_padding:
<!-- ##### FUNCTION gtk_icon_view_get_item_padding ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_select_path ##### -->
<para>

View File

@ -196,7 +196,7 @@ functions), but they will all return %NULL values.
@GTK_IMAGE_ANIMATION: the widget contains a #GdkPixbufAnimation
@GTK_IMAGE_ICON_NAME: the widget contains a named icon.
This image type was added in GTK+ 2.6
@GTK_IMAGE_GICON: the widgte contains a #GIcon.
@GTK_IMAGE_GICON: the widget contains a #GIcon.
This image type was added in GTK+ 2.14
<!-- ##### FUNCTION gtk_image_get_icon_set ##### -->

View File

@ -5,15 +5,6 @@ GtkInputDialog
Configure devices for the XInput extension
<!-- ##### SECTION Long_Description ##### -->
<para>
NOTE this widget is considered too specialized/little-used for
GTK+, and will in the future be moved to some other package. If
your application needs this widget, feel free to use it, as the
widget does work and is useful in some applications; it's just not
of general interest. However, we are not accepting new features for
the widget, and it will eventually move out of the GTK+
distribution.
</para>
<para>
#GtkInputDialog displays a dialog which allows the user
@ -32,6 +23,9 @@ No actions are bound to these by default.
The changes that the user makes take effect
immediately.
</para>
<para>
As of GTK+ 2.20, #GtkInputDialog has been deprecated since it is too specialized.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
@ -55,6 +49,7 @@ to #GDK_MODE_ENABLED.
@inputdialog: the object which received the signal.
@deviceid: The ID of the newly disabled device.
@Deprecated: 2.20: Don't use this widget anymore.
<!-- ##### SIGNAL GtkInputDialog::enable-device ##### -->
<para>
@ -65,6 +60,7 @@ mode of a device from #GDK_MODE_DISABLED to a
@inputdialog: the object which received the signal.
@deviceid: The ID of the newly enabled device.
@Deprecated: 2.20: Don't use this widget anymore.
<!-- ##### FUNCTION gtk_input_dialog_new ##### -->
<para>
@ -72,5 +68,4 @@ Creates a new #GtkInputDialog.
</para>
@Returns: the new #GtkInputDialog.
@Deprecated: 2.20: Don't use this widget anymore.

View File

@ -19,19 +19,21 @@ A GtkToolItem containing a button with an additional dropdown menu
<!-- ##### SECTION See_Also ##### -->
<para>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkMenuToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkMenuToolButton<!-- -->s.
</para>
</listitem>
</varlistentry>
<variablelist>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkMenuToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkMenuToolButton<!-- -->s.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->

View File

@ -256,7 +256,8 @@ Emitted when the user or a function changes the current page.
<!-- ##### ARG GtkNotebook:tab-pack ##### -->
<para>
Deprecated: 2.20: The tab packing functionality of children should not
be used anymore and support will be removed in the future.
</para>
<!-- ##### ARG GtkNotebook:arrow-spacing ##### -->

View File

@ -233,6 +233,11 @@ Printing support was added in GTK+ 2.10.
</para>
<!-- ##### ARG GtkPrintOperation:n-pages-to-print ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintOperation:print-settings ##### -->
<para>
@ -419,6 +424,15 @@ The #GQuark used for #GtkPrintError errors.
@n_pages:
<!-- ##### FUNCTION gtk_print_operation_get_n_pages_to_print ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_print_operation_set_current_page ##### -->
<para>

View File

@ -288,7 +288,7 @@ formats are supported.
the printer in PDF format
@GTK_PRINT_CAPABILITY_GENERATE_PS: The program will send the document to
the printer in Postscript format
@GTK_PRINT_CAPABILITY_PREVIEW: Print dialog will offer a previe
@GTK_PRINT_CAPABILITY_PREVIEW: Print dialog will offer a preview
@GTK_PRINT_CAPABILITY_NUMBER_UP: Print dialog will offer printing multiple
pages per sheet. Since 2.12
@GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT: Print dialog will allow to rearrange

View File

@ -346,3 +346,21 @@ at the end of range widgets.
@Returns:
<!-- ##### FUNCTION gtk_range_get_flippable ##### -->
<para>
</para>
@range:
@Returns:
<!-- ##### FUNCTION gtk_range_set_flippable ##### -->
<para>
</para>
@range:
@flippable:

View File

@ -19,25 +19,27 @@ A GtkToolItem containing a toggle button
<!-- ##### SECTION See_Also ##### -->
<para>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkToggleToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkToggleToolButton<!-- -->s.
</para>
</listitem>
<term>#GtkSeparatorToolItem</term>
<listitem>
<para>A subclass of #GtkToolItem that separates groups of
items on a toolbar.
</para>
</listitem>
</varlistentry>
<variablelist>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkToggleToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkToggleToolButton<!-- -->s.
</para>
</listitem>
<term>#GtkSeparatorToolItem</term>
<listitem>
<para>A subclass of #GtkToolItem that separates groups of
items on a toolbar.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->

View File

@ -12,23 +12,6 @@ GtkToolItem
<!-- ##### SECTION See_Also ##### -->
<para>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkToolButton</term>
<listitem><para>A subclass of #GtkToolItem that displays buttons on
the toolbar</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkSeparatorToolItem</term>
<listitem><para>A subclass of #GtkToolItem that separates groups of
items on a toolbar</para></listitem>
</varlistentry>
</para>
<!-- ##### SECTION Stability_Level ##### -->

View File

@ -1,80 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkToolShell
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkToolShell ##### -->
<para>
</para>
<!-- ##### STRUCT GtkToolShellIface ##### -->
<para>
</para>
@get_icon_size:
@get_orientation:
@get_style:
@get_relief_style:
@rebuild_menu:
<!-- ##### FUNCTION gtk_tool_shell_get_icon_size ##### -->
<para>
</para>
@shell:
@Returns:
<!-- ##### FUNCTION gtk_tool_shell_get_orientation ##### -->
<para>
</para>
@shell:
@Returns:
<!-- ##### FUNCTION gtk_tool_shell_get_relief_style ##### -->
<para>
</para>
@shell:
@Returns:
<!-- ##### FUNCTION gtk_tool_shell_get_style ##### -->
<para>
</para>
@shell:
@Returns:
<!-- ##### FUNCTION gtk_tool_shell_rebuild_menu ##### -->
<para>
</para>
@shell:

View File

@ -112,6 +112,11 @@ calling gtk_tree_view_column_set_cell_data_func()
</para>
<!-- ##### ARG GtkTreeViewColumn:sort-column-id ##### -->
<para>
</para>
<!-- ##### ARG GtkTreeViewColumn:sort-indicator ##### -->
<para>

View File

@ -693,6 +693,11 @@ internal child "accessible" of a <structname>GtkWidget</structname>.
</para>
<!-- ##### ARG GtkWidget:double-buffered ##### -->
<para>
</para>
<!-- ##### ARG GtkWidget:events ##### -->
<para>
@ -2636,6 +2641,213 @@ This function is deprecated; it does nothing.
@Returns:
<!-- ##### FUNCTION gtk_widget_get_allocation ##### -->
<para>
</para>
@widget:
@allocation:
<!-- ##### FUNCTION gtk_widget_set_allocation ##### -->
<para>
</para>
@widget:
@allocation:
<!-- ##### FUNCTION gtk_widget_get_app_paintable ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_can_default ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_can_default ##### -->
<para>
</para>
@widget:
@can_default:
<!-- ##### FUNCTION gtk_widget_get_can_focus ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_can_focus ##### -->
<para>
</para>
@widget:
@can_focus:
<!-- ##### FUNCTION gtk_widget_get_double_buffered ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_has_window ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_has_window ##### -->
<para>
</para>
@widget:
@has_window:
<!-- ##### FUNCTION gtk_widget_get_sensitive ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_is_sensitive ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_state ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_visible ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_visible ##### -->
<para>
</para>
@widget:
@visible:
<!-- ##### FUNCTION gtk_widget_has_default ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_has_focus ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_has_grab ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_is_drawable ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_is_toplevel ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_window ##### -->
<para>
</para>
@widget:
@window:
<!-- ##### FUNCTION gtk_widget_set_receives_default ##### -->
<para>
</para>
@widget:
@receives_default:
<!-- ##### FUNCTION gtk_widget_get_receives_default ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_requisition_copy ##### -->
<para>

View File

@ -39,6 +39,9 @@
<link linkend="GtkImage">
<inlinegraphic fileref="image.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkSpinner">
<inlinegraphic fileref="spinner.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkLabel">
<inlinegraphic fileref="label.png" format="PNG"></inlinegraphic>
</link>

View File

@ -939,6 +939,26 @@ create_image (void)
return new_widget_info ("image", vbox, SMALL);
}
static WidgetInfo *
create_spinner (void)
{
GtkWidget *widget;
GtkWidget *align, *vbox;
widget = gtk_spinner_new ();
gtk_widget_set_size_request (widget, 24, 24);
vbox = gtk_vbox_new (FALSE, 3);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), widget);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new ("Spinner"),
FALSE, FALSE, 0);
return new_widget_info ("spinner", vbox, SMALL);
}
static WidgetInfo *
create_volume_button (void)
{
@ -985,6 +1005,7 @@ get_all_widgets (void)
{
GList *retval = NULL;
retval = g_list_prepend (retval, create_spinner ());
retval = g_list_prepend (retval, create_about_dialog ());
retval = g_list_prepend (retval, create_accel_label ());
retval = g_list_prepend (retval, create_button ());

View File

@ -4114,7 +4114,7 @@ static const char * xpm_data[] = {
When we're done using a pixmap and not likely to reuse it again soon,
it is a good idea to release the resource using
gdk_pixmap_unref(). Pixmaps should be considered a precious resource,
g_object_unref(). Pixmaps should be considered a precious resource,
because they take up memory in the end-user's X server process. Even
though the X client you write may run on a powerful "server" computer,
the user may be running the X server on a small personal computer.
@ -9564,7 +9564,7 @@ which owns it will be collapsed. So, if you want it to stick around,
do something like the following:
<tscreen><verb>
gtk_widget_ref (tree);
g_object_ref (tree);
owner = GTK_TREE(tree)->tree_owner;
gtk_container_remove (GTK_CONTAINER(tree), item);
if (tree->parent == NULL){
@ -9572,7 +9572,7 @@ if (tree->parent == NULL){
gtk_tree_item_set_subtree (GTK_TREE_ITEM(owner), tree);
}
else
gtk_widget_unref (tree);
g_object_unref (tree);
</verb></tscreen>
Finally, drag-n-drop <em>does</em> work with TreeItems. You just
@ -14476,7 +14476,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
gdk_pixmap_unref(pixmap);
g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
@ -16978,7 +16978,7 @@ gtk_dial_expose (GtkWidget *widget,
points, 5,
FALSE);
gtk_style_unref(blankstyle);
g_object_unref(blankstyle);
/* Draw ticks */
@ -17406,7 +17406,7 @@ static gint configure_event( GtkWidget *widget,
GdkEventConfigure *event )
{
if (pixmap)
gdk_pixmap_unref(pixmap);
g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
@ -17592,7 +17592,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
gdk_pixmap_unref(pixmap);
g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,

View File

@ -4061,7 +4061,7 @@ static const char * xpm_data[] = {
Cuando hayamos acabado de usar un <em/pixmap/ y no lo vayamos a usar
durante un tiempo suele ser conveniente liberar el recurso mediante
gdk_pixmap_unref(). (Los <em/pixmaps/ deben ser considerados recursos
g_object_unref(). (Los <em/pixmaps/ deben ser considerados recursos
preciosos).
Una vez que hemos creado el <em/pixmap/ lo podemos mostrar como un
@ -8986,7 +8986,7 @@ se colapsar
tendrá que hacer algo así:
<tscreen><verb>
gtk_widget_ref (arbol);
g_object_ref (arbol);
propietario = GTK_TREE(arbol)->tree_owner;
gtk_container_remove (GTK_CONTAINER(arbol), item);
if (arbol->parent == NULL){
@ -8994,7 +8994,7 @@ if (arbol->parent == NULL){
gtk_tree_item_set_subtree (GTK_TREE_ITEM(propietario), arbol);
}
else
gtk_widget_unref (arbol);
g_object_unref (arbol);
</verb></tscreen>
Finalmente, hay que mencionar que la opción de drag-n-drop (arrastar y
@ -13967,7 +13967,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
gdk_pixmap_unref(pixmap);
g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
@ -16855,7 +16855,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
gdk_pixmap_unref(pixmap);
g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,

View File

@ -365,7 +365,7 @@ When a widget receives the "realize" signal it should:
1) set the realized flag
2) set widget->window
widget->window = gtk_widget_get_parent_window (widget);
gdk_window_ref (widget->window);
g_object_ref (widget->window);
3) attach the widget's style
widget->style = gtk_style_attach (widget->style, widget->window);

View File

@ -193,6 +193,14 @@ libpixbufloader_jasper_la_SOURCES = io-jasper.c
libpixbufloader_jasper_la_LDFLAGS = -avoid-version -module $(no_undefined)
libpixbufloader_jasper_la_LIBADD = $(LIBJASPER) $(module_libs)
#
# The QTIF loader
#
libstatic_pixbufloader_qtif_la_SOURCES = io-qtif.c
libpixbufloader_qtif_la_SOURCES = io-qtif.c
libpixbufloader_qtif_la_LDFLAGS = -avoid-version -module $(no_undefined)
libpixbufloader_qtif_la_LIBADD = $(module_libs)
if BUILD_GDIPLUS_LOADERS
if INCLUDE_GDIPLUS
@ -451,6 +459,12 @@ JASPER_LIB = libpixbufloader-jasper.la
endif
endif
if INCLUDE_QTIF
STATIC_QTIF_LIB = libstatic-pixbufloader-qtif.la
else
QTIF_LIB = libpixbufloader-qtif.la
endif
if BUILD_DYNAMIC_MODULES
loader_LTLIBRARIES = \
@ -470,6 +484,7 @@ loader_LTLIBRARIES = \
$(ICNS_LIB) \
$(PCX_LIB) \
$(JASPER_LIB) \
$(QTIF_LIB) \
$(GDIPLUS_LIBS)
@ -492,6 +507,7 @@ noinst_LTLIBRARIES = \
$(STATIC_ICNS_LIB) \
$(STATIC_PCX_LIB) \
$(STATIC_JASPER_LIB) \
$(STATIC_QTIF_LIB) \
$(STATIC_GDIPLUS_LIBS)
builtin_objs = @INCLUDED_LOADER_OBJ@

View File

@ -277,6 +277,13 @@ correct_prefix (gchar **path)
if (strncmp (*path, GTK_PREFIX "/", strlen (GTK_PREFIX "/")) == 0 ||
strncmp (*path, GTK_PREFIX "\\", strlen (GTK_PREFIX "\\")) == 0)
{
gchar *tem = NULL;
if (strlen(*path) > 5 && strncmp (*path - 5, ".libs", 5) == 0)
{
/* We are being run from inside the build tree, and shouldn't mess about. */
return;
}
/* This is an entry put there by gdk-pixbuf-query-loaders on the
* packager's system. On Windows a prebuilt GTK+ package can be
* installed in a random location. The gdk-pixbuf.loaders file
@ -284,7 +291,7 @@ correct_prefix (gchar **path)
* builder's machine. Replace the build-time prefix with the
* installation prefix on this machine.
*/
gchar *tem = *path;
tem = *path;
*path = g_strconcat (get_toplevel (), tem + strlen (GTK_PREFIX), NULL);
g_free (tem);
}
@ -389,6 +396,9 @@ gdk_pixbuf_io_init (void)
#ifdef INCLUDE_jasper
load_one_builtin_module (jasper);
#endif
#ifdef INCLUDE_qtif
load_one_builtin_module (qtif);
#endif
#ifdef INCLUDE_gdiplus
/* We don't bother having the GDI+ loaders individually selectable
* for building in or not.
@ -582,6 +592,7 @@ module (tga);
module (pcx);
module (icns);
module (jasper);
module (qtif);
module (gdip_ico);
module (gdip_wmf);
module (gdip_emf);
@ -660,6 +671,9 @@ gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
#ifdef INCLUDE_jasper
try_module (jasper,jasper);
#endif
#ifdef INCLUDE_qtif
try_module (qtif,qtif);
#endif
#ifdef INCLUDE_gdiplus
try_module (ico,gdip_ico);
try_module (wmf,gdip_wmf);

View File

@ -329,7 +329,7 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
(context->Flags & 0x2) != 0,
(context->Flags & 0x1) != 0);
#endif
if (!context->Flags & 0x2)
if (!(context->Flags & 0x2))
{
g_set_error_literal (error,
GDK_PIXBUF_ERROR,

View File

@ -1318,7 +1318,7 @@ gdk_pixbuf__bmp_image_save_to_callback (GdkPixbufSaveFunc save_func,
put32 (dst, 0); /* biClrUsed */
put32 (dst, 0); /* biClrImportant */
if (!save_func (BFH_BIH, 14 + 40, error, user_data))
if (!save_func ((gchar *)BFH_BIH, 14 + 40, error, user_data))
return FALSE;
dst_line = buf = g_try_malloc (size);
@ -1341,7 +1341,7 @@ gdk_pixbuf__bmp_image_save_to_callback (GdkPixbufSaveFunc save_func,
dst[2] = src[0];
}
}
ret = save_func (buf, size, error, user_data);
ret = save_func ((gchar *)buf, size, error, user_data);
g_free (buf);
return ret;

View File

@ -31,6 +31,18 @@
#define LOAD_BUFFER_SIZE 65536
struct _GdipContext {
GdkPixbufModuleUpdatedFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleSizeFunc size_func;
gpointer user_data;
GByteArray *buffer;
IStream *stream;
HGLOBAL hg;
};
typedef struct _GdipContext GdipContext;
static GdiplusStartupFunc GdiplusStartup;
static GdipCreateBitmapFromStreamFunc GdipCreateBitmapFromStream;
static GdipBitmapGetPixelFunc GdipBitmapGetPixel;
@ -339,21 +351,20 @@ gdip_pixbuf_to_bitmap (GdkPixbuf *pixbuf)
}
static GpBitmap *
gdip_buffer_to_bitmap (const gchar *buffer, size_t size, GError **error)
gdip_buffer_to_bitmap (GdipContext *context, GError **error)
{
HRESULT hr;
HGLOBAL hg = NULL;
GpBitmap *bitmap = NULL;
IStream *stream = NULL;
GpStatus status;
guint64 size64 = size;
guint64 size64 = context->buffer->len;
hg = gdip_buffer_to_hglobal (buffer, size, error);
hg = gdip_buffer_to_hglobal (context->buffer->data, context->buffer->len, error);
if (!hg)
return NULL;
IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
hr = CreateStreamOnHGlobal (hg, FALSE, (LPSTREAM *)&stream);
if (!SUCCEEDED (hr)) {
@ -361,29 +372,35 @@ gdip_buffer_to_bitmap (const gchar *buffer, size_t size, GError **error)
GlobalFree (hg);
return NULL;
}
IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
status = GdipCreateBitmapFromStream (stream, &bitmap);
if (Ok != status)
if (Ok != status) {
gdip_set_error_from_gpstatus (error, GDK_PIXBUF_ERROR_FAILED, status);
IStream_Release (stream);
GlobalFree (hg);
return NULL;
}
IStream_Release (stream);
GlobalFree (hg);
context->stream = stream;
context->hg = hg;
return bitmap;
}
static GpImage *
gdip_buffer_to_image (const gchar *buffer, size_t size, GError **error)
gdip_buffer_to_image (GdipContext *context, GError **error)
{
HRESULT hr;
HGLOBAL hg = NULL;
GpImage *image = NULL;
IStream *stream = NULL;
GpStatus status;
guint64 size64 = size;
guint64 size64 = context->buffer->len;
hg = gdip_buffer_to_hglobal (buffer, size, error);
hg = gdip_buffer_to_hglobal (context->buffer->data, context->buffer->len, error);
if (!hg)
return NULL;
@ -399,11 +416,15 @@ gdip_buffer_to_image (const gchar *buffer, size_t size, GError **error)
IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
status = GdipLoadImageFromStream (stream, &image);
if (Ok != status)
if (Ok != status) {
gdip_set_error_from_gpstatus (error, GDK_PIXBUF_ERROR_FAILED, status);
IStream_Release (stream);
GlobalFree (hg);
return NULL;
}
IStream_Release (stream);
GlobalFree (hg);
context->stream = stream;
context->hg = hg;
return image;
}
@ -590,24 +611,14 @@ gdip_bitmap_get_n_loops (GpBitmap *bitmap, guint *loops)
return success;
}
/*************************************************************************/
/*************************************************************************/
struct _GdipContext {
GdkPixbufModuleUpdatedFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleSizeFunc size_func;
gpointer user_data;
GByteArray *buffer;
};
typedef struct _GdipContext GdipContext;
static void
destroy_gdipcontext (GdipContext *context)
{
if (context != NULL) {
if (context->stream != NULL) {
IStream_Release(context->stream);
GlobalFree (context->hg);
}
g_byte_array_free (context->buffer, TRUE);
g_free (context);
}
@ -806,9 +817,8 @@ gdk_pixbuf__gdip_image_stop_load (gpointer data, GError **error)
{
GdipContext *context = (GdipContext *)data;
GpBitmap *bitmap = NULL;
GByteArray *image_buffer = context->buffer;
bitmap = gdip_buffer_to_bitmap ((gchar *)image_buffer->data, image_buffer->len, error);
bitmap = gdip_buffer_to_bitmap (context, error);
if (!bitmap) {
destroy_gdipcontext (context);
@ -823,7 +833,6 @@ static gboolean
gdk_pixbuf__gdip_image_stop_vector_load (gpointer data, GError **error)
{
GdipContext *context = (GdipContext *)data;
GByteArray *image_buffer = context->buffer;
GpImage *metafile;
GpGraphics *graphics;
@ -832,7 +841,7 @@ gdk_pixbuf__gdip_image_stop_vector_load (gpointer data, GError **error)
float metafile_xres, metafile_yres;
guint width, height;
metafile = gdip_buffer_to_image ((gchar *)image_buffer->data, image_buffer->len, error);
metafile = gdip_buffer_to_image (context, error);
if (!metafile) {
destroy_gdipcontext (context);
g_set_error_literal (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, _("Couldn't load metafile"));

View File

@ -220,7 +220,7 @@ gif_read (GifContext *context, guchar *buffer, size_t len)
G_FILE_ERROR,
g_file_error_from_errno (save_errno),
_("Failure reading GIF: %s"),
strerror (save_errno));
g_strerror (save_errno));
}
#ifdef IO_GIFDEBUG
@ -411,8 +411,8 @@ gif_get_extension (GifContext *context)
retval = get_data_block (context, (unsigned char *) context->block_buf, NULL);
if (retval != 0)
return retval;
if (!strncmp (context->block_buf, "NETSCAPE2.0", 11) ||
!strncmp (context->block_buf, "ANIMEXTS1.0", 11)) {
if (!strncmp ((gchar *)context->block_buf, "NETSCAPE2.0", 11) ||
!strncmp ((gchar *)context->block_buf, "ANIMEXTS1.0", 11)) {
context->in_loop_extension = TRUE;
}
context->block_count = 0;

View File

@ -468,7 +468,6 @@ gdk_pixbuf__jpeg_image_load (FILE *f, GError **error)
cinfo.err = jpeg_std_error (&jerr.pub);
jerr.pub.error_exit = fatal_error_handler;
jerr.pub.output_message = output_message_handler;
jerr.error = error;
if (sigsetjmp (jerr.setjmp_buffer, 1)) {
@ -1047,7 +1046,7 @@ to_callback_do_write (j_compress_ptr cinfo, gsize length)
ToFunctionDestinationManager *destmgr;
destmgr = (ToFunctionDestinationManager*) cinfo->dest;
if (!destmgr->save_func (destmgr->buffer,
if (!destmgr->save_func ((gchar *)destmgr->buffer,
length,
destmgr->error,
destmgr->user_data)) {
@ -1190,11 +1189,11 @@ real_save_jpeg (GdkPixbuf *pixbuf,
}
/* set up error handling */
cinfo.err = jpeg_std_error (&(jerr.pub));
jerr.pub.error_exit = fatal_error_handler;
jerr.pub.output_message = output_message_handler;
jerr.error = error;
cinfo.err = jpeg_std_error (&(jerr.pub));
if (sigsetjmp (jerr.setjmp_buffer, 1)) {
jpeg_destroy_compress (&cinfo);
g_free (buf);

View File

@ -242,7 +242,7 @@ pnm_read_next_value (PnmIOBuffer *inbuf, gint max_length, guint *value, GError *
return PNM_SUSPEND;
/* get the value */
result = strtol (buf, &endptr, 10);
result = strtol ((gchar *)buf, &endptr, 10);
if (*endptr != '\0' || result < 0 || result > G_MAXUINT) {
g_set_error_literal (error,
GDK_PIXBUF_ERROR,

607
gdk-pixbuf/io-qtif.c Normal file
View File

@ -0,0 +1,607 @@
/* -*- mode: C; c-file-style: "linux" -*- */
/* GdkPixbuf library - QTIF image loader
*
* This module extracts image data from QTIF format and uses
* other GDK pixbuf modules to decode the image data.
*
* Copyright (C) 2008 Kevin Peng
*
* Authors: Kevin Peng <kevin@zycomtech.com>
*
* 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.
*/
#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
/***
* Definitions
*/
/* Read buffer size */
#define READ_BUFFER_SIZE 8192
/* Only allow atom of size up to 10MB. */
#define ATOM_SIZE_MAX 100000000
/* Aborts after going to through this many atoms. */
#define QTIF_ATOM_COUNT_MAX 10u
/* QTIF static image data tag "idat". */
#define QTIF_TAG_IDATA 0x69646174u
/***
* Types
*/
/* QTIF State */
typedef enum {
STATE_READY,
STATE_DATA,
STATE_OTHER
} QTIFState;
/* QTIF Atom Header */
typedef struct {
guint32 length;
guint32 tag;
} QtHeader;
/* QTIF loader context */
typedef struct {
GdkPixbufLoader *loader;
gpointer user_data;
QTIFState state;
guint32 run_length;
gint atom_count;
guchar header_buffer[sizeof(QtHeader)];
GdkPixbufModuleSizeFunc size_func;
GdkPixbufModulePreparedFunc prepare_func;
GdkPixbufModuleUpdatedFunc update_func;
gint cb_prepare_count;
gint cb_update_count;
} QTIFContext;
/***
* Local function prototypes
*/
static GdkPixbuf *gdk_pixbuf__qtif_image_load (FILE *f, GError **error);
static gpointer gdk_pixbuf__qtif_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepare_func,
GdkPixbufModuleUpdatedFunc update_func,
gpointer user_data,
GError **error);
static gboolean gdk_pixbuf__qtif_image_stop_load (gpointer context, GError **error);
static gboolean gdk_pixbuf__qtif_image_load_increment(gpointer context,
const guchar *buf, guint size,
GError **error);
static gboolean gdk_pixbuf__qtif_image_create_loader (QTIFContext *context, GError **error);
static gboolean gdk_pixbuf__qtif_image_free_loader (QTIFContext *context, GError **error);
static void gdk_pixbuf__qtif_cb_size_prepared(GdkPixbufLoader *loader,
gint width,
gint height,
gpointer user_data);
static void gdk_pixbuf__qtif_cb_area_prepared(GdkPixbufLoader *loader, gpointer user_data);
static void gdk_pixbuf__qtif_cb_area_updated(GdkPixbufLoader *loader,
gint x,
gint y,
gint width,
gint height,
gpointer user_data);
/***
* Function definitions.
*/
/* Load QTIF from a file handler. */
static GdkPixbuf *gdk_pixbuf__qtif_image_load (FILE *f, GError **error)
{
guint count;
if(f == NULL)
{
g_set_error_literal (error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_BAD_OPTION,
_("Input file descriptor is NULL."));
return NULL;
}
for(count = QTIF_ATOM_COUNT_MAX; count != 0u; count--)
{
QtHeader hdr;
size_t rd;
/* Read QtHeader. */
rd = fread(&hdr, 1, sizeof(QtHeader), f);
if(rd != sizeof(QtHeader))
{
g_set_error_literal(error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Failed to read QTIF header"));
return NULL;
}
hdr.length = GUINT32_FROM_BE(hdr.length) - sizeof(QtHeader);
if(hdr.length > ATOM_SIZE_MAX)
{
g_set_error(error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("QTIF atom size too large (%d bytes)"), hdr.length);
return NULL;
}
switch(GUINT32_FROM_BE(hdr.tag))
{
case QTIF_TAG_IDATA: /* "idat" data atom. */
{
/* Load image using GdkPixbufLoader. */
guchar *buf;
GdkPixbufLoader *loader;
GdkPixbuf *pixbuf = NULL;
GError *tmp = NULL;
/* Allocate read buffer. */
buf = g_try_malloc(READ_BUFFER_SIZE);
if(buf == NULL)
{
g_set_error(error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
_("Failed to allocate %d bytes for file read buffer"), READ_BUFFER_SIZE);
return NULL;
}
/* Create GdkPixbufLoader. */
loader = gdk_pixbuf_loader_new();
if(loader == NULL)
{
g_set_error(error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("QTIF atom size too large (%d bytes)"), hdr.length);
goto clean_up;
}
/* Read atom data. */
while(hdr.length != 0u)
{
rd = (hdr.length > READ_BUFFER_SIZE) ? READ_BUFFER_SIZE : hdr.length;
rd = fread(buf, 1, rd, f);
if(rd < 0)
{
g_set_error(error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("File error when reading QTIF atom: %s"), g_strerror(errno));
break;
}
if(!gdk_pixbuf_loader_write(loader, buf, rd, &tmp))
{
g_propagate_error (error, tmp);
break;
}
hdr.length -= rd;
}
clean_up:
/* Release loader */
if(loader != NULL)
{
gdk_pixbuf_loader_close(loader, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
if(pixbuf != NULL)
{
g_object_ref(pixbuf);
}
g_object_unref(loader);
}
if(buf != NULL)
{
g_free(buf);
}
return pixbuf;
}
default:
/* Skip any other types of atom. */
if(!fseek(f, hdr.length, SEEK_CUR))
{
g_set_error(error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Failed to skip the next %d bytes with seek()."), hdr.length);
return NULL;
}
break;
}
}
return NULL;
}
/* Incremental load begin. */
static gpointer gdk_pixbuf__qtif_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepare_func,
GdkPixbufModuleUpdatedFunc update_func,
gpointer user_data,
GError **error)
{
QTIFContext *context;
/* Create context struct. */
context = g_new0(QTIFContext, 1);
if(context == NULL)
{
g_set_error_literal (error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
_("Failed to QTIF context structure."));
return NULL;
}
/* Fill context parameters. */
context->loader = NULL;
context->user_data = user_data;
context->state = STATE_READY;
context->run_length = 0u;
context->atom_count = QTIF_ATOM_COUNT_MAX;
context->size_func = size_func;
context->prepare_func = prepare_func;
context->update_func = update_func;
return context;
}
/* Incremental load clean up. */
static gboolean gdk_pixbuf__qtif_image_stop_load (gpointer data, GError **error)
{
QTIFContext *context = (QTIFContext *)data;
gboolean ret;
if(context->loader != NULL)
{
GError *tmp = NULL;
ret = gdk_pixbuf__qtif_image_free_loader(context, &tmp);
if(!ret)
{
g_propagate_error (error, tmp);
}
}
g_free(context);
return ret;
}
/* Create a new GdkPixbufLoader and connect to its signals. */
static gboolean gdk_pixbuf__qtif_image_create_loader (QTIFContext *context, GError **error)
{
GError *tmp = NULL;
if(context == NULL)
{
return FALSE;
}
/* Free existing loader. */
if(context->loader != NULL)
{
gdk_pixbuf__qtif_image_free_loader(context, &tmp);
}
/* Create GdkPixbufLoader object. */
context->loader = gdk_pixbuf_loader_new();
if(context->loader == NULL)
{
g_set_error_literal (error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
_("Failed to create GdkPixbufLoader object."));
return FALSE;
}
/* Connect signals. */
context->cb_prepare_count = 0;
context->cb_update_count = 0;
if(context->size_func != NULL)
{
g_signal_connect(context->loader, "size-prepared",
G_CALLBACK(gdk_pixbuf__qtif_cb_size_prepared),
context);
}
if(context->prepare_func != NULL)
{
g_signal_connect(context->loader, "area-prepared",
G_CALLBACK(gdk_pixbuf__qtif_cb_area_prepared),
context);
}
if(context->update_func != NULL)
{
g_signal_connect(context->loader, "area-updated",
G_CALLBACK(gdk_pixbuf__qtif_cb_area_updated),
context);
}
return TRUE;
}
/* Free the GdkPixbufLoader and perform callback if haven't done so. */
static gboolean gdk_pixbuf__qtif_image_free_loader (QTIFContext *context, GError **error)
{
GdkPixbuf *pixbuf;
GError *tmp = NULL;
gboolean ret;
if((context == NULL) || (context->loader == NULL))
{
return FALSE;
}
/* Close GdkPixbufLoader. */
ret = gdk_pixbuf_loader_close(context->loader, &tmp);
if(!ret)
{
g_propagate_error (error, tmp);
}
/* Get GdkPixbuf from GdkPixbufLoader. */
pixbuf = gdk_pixbuf_loader_get_pixbuf(context->loader);
if(pixbuf != NULL)
{
g_object_ref(pixbuf);
}
/* Free GdkPixbufLoader. */
g_object_ref(context->loader);
context->loader = NULL;
if(pixbuf != NULL)
{
/* Callback functions should be called for at least once. */
if((context->prepare_func != NULL) && (context->cb_prepare_count == 0))
{
(context->prepare_func)(pixbuf, NULL, context->user_data);
}
if((context->update_func != NULL) && (context->cb_update_count == 0))
{
gint width;
gint height;
width = gdk_pixbuf_get_width(pixbuf);
height = gdk_pixbuf_get_height(pixbuf);
(context->update_func)(pixbuf, 0, 0, width, height, context->user_data);
}
/* Free GdkPixbuf (callback function should ref it). */
g_object_ref(pixbuf);
}
return ret;
}
/* Incrementally load the next chunk of data. */
static gboolean gdk_pixbuf__qtif_image_load_increment (gpointer data,
const guchar *buf, guint size,
GError **error)
{
QTIFContext *context = (QTIFContext *)data;
GError *tmp = NULL;
gboolean ret = TRUE; /* Return TRUE for insufficient data. */
while(ret && (size != 0u))
{
switch(context->state)
{
case STATE_READY:
/* Abort if we have seen too mant atoms. */
if(context->atom_count == 0u)
{
g_set_error_literal (error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Failed to find an image data atom."));
return FALSE;
}
context->atom_count--;
/* Copy to header buffer in context, in case supplied data is not enough. */
while(context->run_length < sizeof(QtHeader))
{
context->header_buffer[context->run_length] = *buf;
context->run_length++;
buf++;
size--;
}
/* Parse buffer as QT header. */
if(context->run_length == sizeof(QtHeader))
{
QtHeader *hdr = (QtHeader *)context->header_buffer;
context->run_length = GUINT32_FROM_BE(hdr->length) - sizeof(QtHeader);
/* Atom max size check. */
if(context->run_length > ATOM_SIZE_MAX)
{
g_set_error(error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("QTIF atom size too large (%d bytes)"), hdr->length);
return FALSE;
}
/* Set state according to atom type. */
if(GUINT32_FROM_BE(hdr->tag) == QTIF_TAG_IDATA)
{
GError *tmp = NULL;
context->state = STATE_DATA;
/* Create GdkPixbufLoader for this image data. */
ret = gdk_pixbuf__qtif_image_create_loader(context, &tmp);
if(!ret)
{
g_propagate_error (error, tmp);
}
}
else
{
context->state = STATE_OTHER;
}
}
break;
default: /* Both STATE_DATA and STATE_OTHER will come here. */
/* Check for atom boundary. */
if(context->run_length > size)
{
/* Supply image data to GdkPixbufLoader if in STATE_DATA. */
if(context->state == STATE_DATA)
{
tmp = NULL;
ret = gdk_pixbuf_loader_write(context->loader, buf, size, &tmp);
if(!ret && (error != NULL) && (*error == NULL))
{
g_propagate_error (error, tmp);
}
}
context->run_length -= size;
size = 0u;
}
else
{
/* Supply image data to GdkPixbufLoader if in STATE_DATA. */
if(context->state == STATE_DATA)
{
gboolean r;
/* Here we should have concluded a complete image atom. */
tmp = NULL;
ret = gdk_pixbuf_loader_write(context->loader, buf, context->run_length, &tmp);
if(!ret && (error != NULL) && (*error == NULL))
{
g_propagate_error (error, tmp);
}
/* Free GdkPixbufLoader and handle callback. */
tmp = NULL;
r = gdk_pixbuf__qtif_image_free_loader(context, &tmp);
if(!r)
{
if((error != NULL) && (*error == NULL))
{
g_propagate_error (error, tmp);
}
ret = FALSE;
}
}
buf = &buf[context->run_length];
size -= context->run_length;
context->run_length = 0u;
context->state = STATE_READY;
}
break;
}
}
return ret;
}
/* Event handlers */
static void gdk_pixbuf__qtif_cb_size_prepared(GdkPixbufLoader *loader,
gint width,
gint height,
gpointer user_data)
{
QTIFContext *context = (QTIFContext *)user_data;
if((context != NULL) && (context->size_func != NULL))
{
(context->size_func)(&width, &height, context->user_data);
context->cb_prepare_count++;
}
}
static void gdk_pixbuf__qtif_cb_area_prepared(GdkPixbufLoader *loader, gpointer user_data)
{
QTIFContext *context = (QTIFContext *)user_data;
if((loader != NULL) && (context != NULL) && (context->prepare_func != NULL))
{
GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf(context->loader);
(context->prepare_func)(pixbuf, NULL, context->user_data);
context->cb_update_count++;
}
}
static void gdk_pixbuf__qtif_cb_area_updated(GdkPixbufLoader *loader,
gint x,
gint y,
gint width,
gint height,
gpointer user_data)
{
QTIFContext *context = (QTIFContext *)user_data;
if((loader != NULL) && (context != NULL) && (context->update_func != NULL))
{
GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf(context->loader);
(context->update_func)(pixbuf, x, y, width, height, context->user_data);
}
}
#ifndef INCLUDE_qtif
#define MODULE_ENTRY(function) G_MODULE_EXPORT void function
#else
#define MODULE_ENTRY(function) void _gdk_pixbuf__qtif_ ## function
#endif
MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__qtif_image_load;
module->begin_load = gdk_pixbuf__qtif_image_begin_load;
module->stop_load = gdk_pixbuf__qtif_image_stop_load;
module->load_increment = gdk_pixbuf__qtif_image_load_increment;
}
MODULE_ENTRY (fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "abcdidsc", "xxxx ", 100 },
{ "abcdidat", "xxxx ", 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/x-quicktime",
"image/qtif",
NULL
};
static gchar * extensions[] = {
"qtif",
"qif",
NULL
};
info->name = "qtif";
info->signature = signature;
info->description = N_("The QTIF image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = GDK_PIXBUF_FORMAT_THREADSAFE;
info->license = "LGPL";
}

View File

@ -596,7 +596,7 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
if ((!buffer) || (strlen (buffer) < wbytes))
continue;
for (n = 0, cnt = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
for (n = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
strncpy (pixel_str, &buffer[n], cpp);
pixel_str[cpp] = 0;

View File

@ -119,17 +119,20 @@ loader_sanity_check (const char *path, GdkPixbufFormat *info, GdkPixbufModule *v
return 0;
}
static void
static void
write_loader_info (const char *path, GdkPixbufFormat *info)
{
const GdkPixbufModulePattern *pattern;
char **mime;
char **ext;
char **mime;
char **ext;
g_printf("\"%s\"\n", path);
g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n",
info->name, info->flags,
info->domain ? info->domain : GETTEXT_PACKAGE, info->description, info->license);
g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n",
info->name,
info->flags,
info->domain ? info->domain : GETTEXT_PACKAGE,
info->description,
info->license ? info->license : "");
for (mime = info->mime_types; *mime; mime++) {
g_printf ("\"%s\" ", *mime);
}

View File

@ -68,12 +68,14 @@ extern gboolean gdk_directfb_monochrome_fonts;
void gdk_directfb_window_set_opacity (GdkWindow *window,
guchar opacity);
#ifndef GDK_DISABLE_DEPRECATED
GdkWindow * gdk_directfb_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask,
DFBWindowCapabilities window_caps,
DFBWindowOptions window_options,
DFBSurfaceCapabilities surface_caps);
#endif /* GDK_DISABLE_DEPRECATED */
GdkVisual * gdk_directfb_visual_by_format (DFBSurfacePixelFormat pixel_format);

View File

@ -235,7 +235,7 @@ local_send_enter (GdkDragContext *context,
if (current_dest_drag != NULL)
{
gdk_drag_context_unref (current_dest_drag);
g_object_unref (current_dest_drag);
current_dest_drag = NULL;
}
@ -627,7 +627,7 @@ gdk_drop_finish (GdkDragContext *context,
context->dest_window);
if (src_context)
{
gdk_drag_context_ref (src_context);
g_object_ref (src_context);
event.dnd.type = GDK_DROP_FINISHED;
event.dnd.window = src_context->source_window;

View File

@ -160,7 +160,7 @@ gdk_directfb_set_colormap (GdkDrawable *drawable,
impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p ) <- old %p\n", __FUNCTION__, drawable, colormap, impl->colormap );
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p ) <- old %p\n", G_STRFUNC, drawable, colormap, impl->colormap );
if (impl->colormap == colormap)
return;
@ -235,7 +235,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable,
g_return_if_fail (GDK_IS_DRAWABLE_IMPL_DIRECTFB (drawable));
g_return_if_fail (ret_clip != NULL);
D_DEBUG_AT( GDKDFB_DrawClip, "%s( %p, %p, %p )\n", __FUNCTION__, drawable, gc, draw_rect );
D_DEBUG_AT( GDKDFB_DrawClip, "%s( %p, %p, %p )\n", G_STRFUNC, drawable, gc, draw_rect );
private = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
@ -435,7 +435,7 @@ gdk_directfb_draw_rectangle (GdkDrawable *drawable,
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %s, %4d,%4d - %4dx%4d )\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %s, %4d,%4d - %4dx%4d )\n", G_STRFUNC,
drawable, gc, filled ? " filled" : "outline", x, y, width, height );
impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
@ -593,7 +593,7 @@ gdk_directfb_draw_polygon (GdkDrawable *drawable,
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %s, %p, %d )\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %s, %p, %d )\n", G_STRFUNC,
drawable, gc, filled ? " filled" : "outline", points, npoints );
if (npoints < 3)
@ -704,7 +704,7 @@ gdk_directfb_draw_drawable (GdkDrawable *drawable,
DFBRectangle rect = { xsrc, ysrc, width, height };
gint i;
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %4d,%4d -> %4d,%4d - %dx%d )\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %4d,%4d -> %4d,%4d - %dx%d )\n", G_STRFUNC,
drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height );
impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
@ -749,7 +749,7 @@ gdk_directfb_draw_points (GdkDrawable *drawable,
DFBRegion region = { points->x, points->y, points->x, points->y };
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", __FUNCTION__, drawable, gc, points, npoints );
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", G_STRFUNC, drawable, gc, points, npoints );
if (npoints < 1)
return;
@ -798,7 +798,7 @@ gdk_directfb_draw_segments (GdkDrawable *drawable,
// DFBRegion region = { segs->x1, segs->y1, segs->x2, segs->y2 };
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", __FUNCTION__, drawable, gc, segs, nsegs );
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", G_STRFUNC, drawable, gc, segs, nsegs );
if (nsegs < 1)
return;
@ -878,7 +878,7 @@ gdk_directfb_draw_lines (GdkDrawable *drawable,
DFBRegion region = { points->x, points->y, points->x, points->y };
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", __FUNCTION__, drawable, gc, points, npoints );
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", G_STRFUNC, drawable, gc, points, npoints );
if (npoints < 2)
return;
@ -953,7 +953,7 @@ gdk_directfb_draw_image (GdkDrawable *drawable,
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (image != NULL);
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %4d,%4d -> %4d,%4d - %dx%d )\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %4d,%4d -> %4d,%4d - %dx%d )\n", G_STRFUNC,
drawable, gc, image, xsrc, ysrc, xdest, ydest, width, height );
impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
@ -1202,7 +1202,7 @@ gdk_directfb_draw_pixbuf (GdkDrawable *drawable,
g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width);
g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height);
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %4d,%4d -> %4d,%4d - %dx%d )\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %4d,%4d -> %4d,%4d - %dx%d )\n", G_STRFUNC,
drawable, gc, pixbuf, src_x, src_y, dest_x, dest_y, width, height );
/* Clip to the drawable; this is required for get_from_drawable() so
@ -1494,7 +1494,7 @@ gdk_drawable_impl_directfb_finalize (GObject *object)
GdkDrawableImplDirectFB *impl;
impl = GDK_DRAWABLE_IMPL_DIRECTFB (object);
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p ) <- %dx%d (%s at %4d,%4d)\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p ) <- %dx%d (%s at %4d,%4d)\n", G_STRFUNC,
object, impl->width, impl->height,
drawable_impl_type_name( object ),
impl->abs_x, impl->abs_y );
@ -1600,6 +1600,32 @@ gdk_directfb_cairo_surface_destroy (void *data)
impl->cairo_surface = NULL;
}
void
_gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
int width,
int height)
{
}
cairo_surface_t *
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
int width,
int height)
{
GdkDrawableImplDirectFB *impl;
IDirectFB *dfb;
cairo_surface_t *ret;
impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
dfb = GDK_DISPLAY_DFB (gdk_drawable_get_display (drawable))->directfb;
ret = cairo_directfb_surface_create (dfb, impl->surface);
cairo_surface_set_user_data (ret,
&gdk_directfb_cairo_key, drawable,
gdk_directfb_cairo_surface_destroy);
return ret;
}
static cairo_surface_t *
gdk_directfb_ref_cairo_surface (GdkDrawable *drawable)

View File

@ -209,7 +209,7 @@ dfb_events_io_func (GIOChannel *channel,
if (result == G_IO_STATUS_ERROR)
{
g_warning ("%s: GIOError occured", __FUNCTION__);
g_warning ("%s: GIOError occured", G_STRFUNC);
return TRUE;
}

View File

@ -151,7 +151,7 @@ gdk_image_new_bitmap (GdkVisual *visual,
GDK_NOTE (MISC, g_print ("gdk_image_new_bitmap: %dx%d\n", w, h));
g_message ("not fully implemented %s", __FUNCTION__);
g_message ("not fully implemented %s", G_STRFUNC);
image->bpl = (w + 7) / 8;
image->mem = g_malloc (image->bpl * h);
@ -209,7 +209,7 @@ _gdk_image_new_for_depth (GdkScreen *screen,
format = DSPF_ARGB;
break;
default:
g_message ("unimplemented %s for depth %d", __FUNCTION__, depth);
g_message ("unimplemented %s for depth %d", G_STRFUNC, depth);
return NULL;
}

View File

@ -228,7 +228,7 @@ gboolean
gdk_device_set_mode (GdkDevice *device,
GdkInputMode mode)
{
g_message ("unimplemented %s", __FUNCTION__);
g_message ("unimplemented %s", G_STRFUNC);
return FALSE;
}
@ -303,7 +303,7 @@ gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode)
{
g_message ("unimplemented %s", __FUNCTION__);
g_message ("unimplemented %s", G_STRFUNC);
}
GList *

View File

@ -405,23 +405,25 @@ gdk_keyboard_grab (GdkWindow *window,
GdkGrabStatus
gdk_display_pointer_grab (GdkDisplay *display,GdkWindow *window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time)
_gdk_windowing_pointer_grab (GdkWindow *window,
GdkWindow *native,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0);
return gdk_directfb_pointer_grab (window,
owner_events,
event_mask,
confine_to,
cursor,
time,
FALSE);
_gdk_display_add_pointer_grab (_gdk_display,
window,
native,
owner_events,
event_mask,
confine_to,
cursor,
time);
}
#define __GDK_MAIN_X11_C__

View File

@ -170,7 +170,7 @@ _gdk_pixmap_new (GdkDrawable *drawable,
format = DSPF_RGB32;
break;
default:
g_message ("unimplemented %s for depth %d", __FUNCTION__, depth);
g_message ("unimplemented %s for depth %d", G_STRFUNC, depth);
return NULL;
}
}

View File

@ -185,7 +185,7 @@ gdk_window_impl_directfb_finalize (GObject *object)
{
GdkWindowImplDirectFB *impl = GDK_WINDOW_IMPL_DIRECTFB (object);
D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %dx%d\n", __FUNCTION__, impl, impl->drawable.width, impl->drawable.height );
D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %dx%d\n", G_STRFUNC, impl, impl->drawable.width, impl->drawable.height );
if (GDK_WINDOW_IS_MAPPED (impl->drawable.wrapper))
gdk_window_hide (impl->drawable.wrapper);
@ -216,7 +216,7 @@ gdk_window_impl_directfb_get_visible_region (GdkDrawable *drawable)
GdkRectangle rect = { 0, 0, 0, 0 };
DFBRectangle drect = { 0, 0, 0, 0 };
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, drawable );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, drawable );
if (priv->surface)
priv->surface->GetVisibleRectangle (priv->surface, &drect);
@ -259,7 +259,7 @@ create_directfb_window (GdkWindowImplDirectFB *impl,
DFBResult ret;
IDirectFBWindow *window;
D_DEBUG_AT( GDKDFB_Window, "%s( %4dx%4d, caps 0x%08x )\n", __FUNCTION__, desc->width, desc->height, desc->caps );
D_DEBUG_AT( GDKDFB_Window, "%s( %4dx%4d, caps 0x%08x )\n", G_STRFUNC, desc->width, desc->height, desc->caps );
ret = _gdk_display->layer->CreateWindow (_gdk_display->layer, desc, &window);
@ -313,6 +313,7 @@ _gdk_windowing_window_init (void)
private->window_type = GDK_WINDOW_ROOT;
private->state = 0;
private->children = NULL;
private->viewable = TRUE;
// impl->drawable.paint_region = NULL;
impl->gdkWindow = _gdk_parent_root;
impl->window = NULL;
@ -350,7 +351,6 @@ _gdk_windowing_window_init (void)
}
GdkWindow *
gdk_directfb_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
@ -370,7 +370,7 @@ gdk_directfb_window_new (GdkWindow *parent,
g_return_val_if_fail (attributes != NULL, NULL);
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, parent );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, parent );
if (!parent || attributes->window_type != GDK_WINDOW_CHILD)
parent = _gdk_parent_root;
@ -447,6 +447,7 @@ gdk_directfb_window_new (GdkWindow *parent,
desc.posy = y;
desc.width = impl->drawable.width;
desc.height = impl->drawable.height;
#if 0
if (window_caps)
{
@ -468,16 +469,22 @@ gdk_directfb_window_new (GdkWindow *parent,
if (!create_directfb_window (impl, &desc, window_options))
{
g_assert(0);
g_assert(0);
_gdk_window_destroy (window, FALSE);
return NULL;
}
if( desc.caps != DWCAPS_INPUTONLY )
impl->window->SetOpacity(impl->window, 0x00 );
if (desc.caps != DWCAPS_INPUTONLY)
{
impl->window->SetOpacity(impl->window, 0x00 );
}
break;
case GDK_WINDOW_CHILD:
impl->window=NULL;
impl->window=NULL;
if (!private->input_only && parent_impl->drawable.surface)
{
@ -487,12 +494,14 @@ gdk_directfb_window_new (GdkWindow *parent,
&rect,
&impl->drawable.surface);
}
break;
default:
g_warning ("gdk_window_new: unsupported window type: %d",
private->window_type);
_gdk_window_destroy (window, FALSE);
return NULL;
}
@ -501,28 +510,28 @@ gdk_directfb_window_new (GdkWindow *parent,
GdkColormap *colormap;
impl->drawable.surface->GetPixelFormat (impl->drawable.surface,
&impl->drawable.format);
&impl->drawable.format);
private->depth = DFB_BITS_PER_PIXEL(impl->drawable.format);
private->depth = DFB_BITS_PER_PIXEL(impl->drawable.format);
if ((attributes_mask & GDK_WA_COLORMAP) && attributes->colormap)
{
colormap = attributes->colormap;
}
{
colormap = attributes->colormap;
}
else
{
if (gdk_visual_get_system () == visual)
colormap = gdk_colormap_get_system ();
else
colormap =gdk_drawable_get_colormap (parent);
}
{
if (gdk_visual_get_system () == visual)
colormap = gdk_colormap_get_system ();
else
colormap =gdk_drawable_get_colormap (parent);
}
gdk_drawable_set_colormap (GDK_DRAWABLE (window), colormap);
}
else
{
impl->drawable.format = ((GdkVisualDirectFB *)visual)->format;
private->depth = visual->depth;
private->depth = visual->depth;
}
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
@ -548,17 +557,174 @@ gdk_directfb_window_new (GdkWindow *parent,
return window;
}
GdkWindow *
_gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask)
void
_gdk_window_impl_new (GdkWindow *window,
GdkWindow *real_parent,
GdkScreen *screen,
GdkVisual *visual,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask)
{
g_return_val_if_fail (attributes != NULL, NULL);
GdkWindowObject *private;
GdkWindowObject *parent_private;
GdkWindowImplDirectFB *impl;
GdkWindowImplDirectFB *parent_impl;
DFBWindowDescription desc;
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, parent );
impl = g_object_new (_gdk_window_impl_get_type (), NULL);
impl->drawable.wrapper = GDK_DRAWABLE (window);
impl->gdkWindow = window;
return gdk_directfb_window_new (parent, attributes, attributes_mask,
DWCAPS_NONE, DWOP_NONE, DSCAPS_NONE);
private = GDK_WINDOW_OBJECT (window);
private->impl = (GdkDrawable *)impl;
private->x = (attributes_mask & GDK_WA_X) ? attributes->x : 0;
private->y = (attributes_mask & GDK_WA_Y) ? attributes->y : 0;
parent_private = private->parent;
parent_impl = GDK_WINDOW_IMPL_DIRECTFB (parent_private->impl);
private->parent = parent_private;
_gdk_directfb_calc_abs (window);
impl->drawable.width = MAX (1, attributes->width);
impl->drawable.height = MAX (1, attributes->height);
private->window_type = attributes->window_type;
desc.flags = 0;
switch (attributes->wclass)
{
case GDK_INPUT_OUTPUT:
private->input_only = FALSE;
desc.flags |= DWDESC_PIXELFORMAT;
desc.pixelformat = ((GdkVisualDirectFB *)visual)->format;
if (DFB_PIXELFORMAT_HAS_ALPHA (desc.pixelformat))
{
desc.flags |= DWDESC_CAPS;
desc.caps = DWCAPS_ALPHACHANNEL;
}
break;
case GDK_INPUT_ONLY:
private->input_only = TRUE;
desc.flags |= DWDESC_CAPS;
desc.caps = DWCAPS_INPUTONLY;
break;
default:
g_warning ("_gdk_window_impl_new: unsupported window class\n");
_gdk_window_destroy (window, FALSE);
return;
}
switch (private->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_DIALOG:
case GDK_WINDOW_TEMP:
desc.flags |= (DWDESC_WIDTH | DWDESC_HEIGHT |
DWDESC_POSX | DWDESC_POSY);
desc.posx = private->x;
desc.posy = private->y;
desc.width = impl->drawable.width;
desc.height = impl->drawable.height;
if (!create_directfb_window (impl, &desc, DWOP_NONE))
{
g_assert (0);
_gdk_window_destroy (window, FALSE);
return;
}
if (desc.caps != DWCAPS_INPUTONLY)
{
impl->window->SetOpacity (impl->window, 0x00);
}
break;
case GDK_WINDOW_CHILD:
impl->window = NULL;
if (!private->input_only && parent_impl->drawable.surface)
{
DFBRectangle rect = { private->x,
private->y,
impl->drawable.width,
impl->drawable.height };
parent_impl->drawable.surface->GetSubSurface (parent_impl->drawable.surface,
&rect,
&impl->drawable.surface);
}
break;
default:
g_warning ("_gdk_window_impl_new: unsupported window type: %d",
private->window_type);
_gdk_window_destroy (window, FALSE);
return;
}
if (impl->drawable.surface)
{
GdkColormap *colormap;
impl->drawable.surface->GetPixelFormat (impl->drawable.surface,
&impl->drawable.format);
private->depth = DFB_BITS_PER_PIXEL (impl->drawable.format);
if ((attributes_mask & GDK_WA_COLORMAP) && attributes->colormap)
{
colormap = attributes->colormap;
}
else
{
if (gdk_visual_get_system () == visual)
colormap = gdk_colormap_get_system ();
else
colormap = gdk_colormap_new (visual, FALSE);
}
gdk_drawable_set_colormap (GDK_DRAWABLE (window), colormap);
}
else
{
impl->drawable.format = ((GdkVisualDirectFB *)visual)->format;
private->depth = visual->depth;
}
gdk_window_set_cursor (window,
((attributes_mask & GDK_WA_CURSOR) ?
(attributes->cursor) : NULL));
if (parent_private)
parent_private->children = g_list_prepend (parent_private->children,
window);
/* we hold a reference count on ourself */
g_object_ref (window);
if (impl->window)
{
impl->window->GetID (impl->window, &impl->dfb_id);
gdk_directfb_window_id_table_insert (impl->dfb_id, window);
gdk_directfb_event_windows_add (window);
}
if (attributes_mask & GDK_WA_TYPE_HINT)
gdk_window_set_type_hint (window, attributes->type_hint);
}
void
@ -581,7 +747,7 @@ gdk_directfb_window_destroy (GdkWindow *window,
g_return_if_fail (GDK_IS_WINDOW (window));
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %srecursing, %sforeign )\n", __FUNCTION__, window,
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %srecursing, %sforeign )\n", G_STRFUNC, window,
recursing ? "" : "not ", foreign_destroy ? "" : "no " );
private = GDK_WINDOW_OBJECT (window);
@ -623,7 +789,7 @@ gdk_window_destroy_notify (GdkWindow *window)
{
g_return_if_fail (GDK_IS_WINDOW (window));
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, window );
if (!GDK_WINDOW_DESTROYED (window))
{
@ -672,7 +838,7 @@ gdk_directfb_change_focus (GdkWindow *new_focus_window)
GdkWindow *new_win;
GdkWindow *event_win;
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, new_focus_window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, new_focus_window );
/* No focus changes while the pointer is grabbed */
if (_gdk_directfb_pointer_grab_window)
@ -748,7 +914,7 @@ gdk_directfb_window_raise (GdkWindow *window)
{
GdkWindowObject *parent;
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, window );
parent = GDK_WINDOW_OBJECT (window)->parent;
@ -766,7 +932,7 @@ gdk_directfb_window_lower (GdkWindow *window)
{
GdkWindowObject *parent;
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, window );
parent = GDK_WINDOW_OBJECT (window)->parent;
@ -797,7 +963,7 @@ send_map_events (GdkWindowObject *private)
if (!GDK_WINDOW_IS_MAPPED (private))
return;
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, private );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, private );
event_win = gdk_directfb_other_event_window ((GdkWindow *) private, GDK_MAP);
if (event_win)
@ -840,7 +1006,7 @@ gdk_directfb_window_send_crossing_events (GdkWindow *src,
GdkWindow *b;
GdkWindow *event_win;
D_DEBUG_AT( GDKDFB_Crossing, "%s( %p -> %p, %d )\n", __FUNCTION__, src, dest, mode );
D_DEBUG_AT( GDKDFB_Crossing, "%s( %p -> %p, %d )\n", G_STRFUNC, src, dest, mode );
/* Do a possible cursor change before checking if we need to
generate crossing events so cursor changes due to pointer
@ -1093,7 +1259,7 @@ show_window_internal (GdkWindow *window,
GdkWindowImplDirectFB *impl;
GdkWindow *mousewin;
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %sraise )\n", __FUNCTION__, window, raise ? "" : "no " );
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %sraise )\n", G_STRFUNC, window, raise ? "" : "no " );
private = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
@ -1137,7 +1303,7 @@ gdk_directfb_window_show (GdkWindow *window,
{
g_return_if_fail (GDK_IS_WINDOW (window));
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, window );
show_window_internal (window, raise);
}
@ -1152,7 +1318,7 @@ gdk_directfb_window_hide (GdkWindow *window)
g_return_if_fail (GDK_IS_WINDOW (window));
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, window );
private = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
@ -1356,13 +1522,14 @@ gdk_directfb_window_move_resize (GdkWindow *window,
}
else if (impl->window)
{
private->x = x;
private->y = y;
if (with_move) {
private->x = x;
private->y = y;
impl->window->MoveTo (impl->window, x, y);
}
impl->drawable.width = width;
impl->drawable.height = height;
if (with_move)
impl->window->MoveTo (impl->window, x, y);
impl->window->Resize (impl->window, width, height);
}
else
@ -1504,7 +1671,7 @@ gdk_window_directfb_raise (GdkWindow *window)
{
GdkWindowImplDirectFB *impl;
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, window );
g_return_if_fail (GDK_IS_WINDOW (window));
@ -1535,7 +1702,7 @@ gdk_window_directfb_lower (GdkWindow *window)
{
GdkWindowImplDirectFB *impl;
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, window );
g_return_if_fail (GDK_IS_WINDOW (window));
@ -1576,7 +1743,7 @@ gdk_window_set_hints (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %3d,%3d, min %4dx%4d, max %4dx%4d, flags 0x%08x )\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %3d,%3d, min %4dx%4d, max %4dx%4d, flags 0x%08x )\n", G_STRFUNC,
window, x,y, min_width, min_height, max_width, max_height, flags );
/* N/A */
}
@ -1603,9 +1770,9 @@ gdk_window_set_title (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
D_DEBUG_AT( GDKDFB_Window, "%s( %p, '%s' )\n", __FUNCTION__, window, title );
D_DEBUG_AT( GDKDFB_Window, "%s( %p, '%s' )\n", G_STRFUNC, window, title );
/* N/A */
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, window );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, window );
}
void
@ -1673,7 +1840,7 @@ gdk_directfb_window_set_background (GdkWindow *window,
g_return_if_fail (color != NULL);
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %d,%d,%d )\n", __FUNCTION__, window, color->red, color->green, color->blue );
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %d,%d,%d )\n", G_STRFUNC, window, color->red, color->green, color->blue );
private = GDK_WINDOW_OBJECT (window);
private->bg_color = *color;
@ -1694,7 +1861,7 @@ gdk_directfb_window_set_back_pixmap (GdkWindow *window,
g_return_if_fail (GDK_IS_WINDOW (window));
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %p )\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %p )\n", G_STRFUNC,
window, pixmap);
private = GDK_WINDOW_OBJECT (window);
@ -1822,7 +1989,7 @@ _gdk_directfb_calc_abs (GdkWindow *window)
impl->abs_y += parent_impl->abs_y;
}
D_DEBUG_AT( GDKDFB_Window, "%s( %p ) -> %4d,%4d\n", __FUNCTION__, window, impl->abs_x, impl->abs_y );
D_DEBUG_AT( GDKDFB_Window, "%s( %p ) -> %4d,%4d\n", G_STRFUNC, window, impl->abs_x, impl->abs_y );
for (list = private->children; list; list = list->next)
{
@ -1911,7 +2078,8 @@ GdkWindow *
_gdk_windowing_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y,
GdkModifierType *mask)
GdkModifierType *mask,
gboolean get_toplevel)
{
GdkWindow *retval;
gint wx, wy;
@ -1933,6 +2101,26 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
if (win_y)
*win_y = wy;
if (get_toplevel)
{
GdkWindowObject *w = (GdkWindowObject *)retval;
/* Requested toplevel, find it. */
/* TODO: This can be implemented more efficient by never
recursing into children in the first place */
if (w)
{
/* Convert to toplevel */
while (w->parent != NULL &&
w->parent->window_type != GDK_WINDOW_ROOT)
{
*win_x += w->x;
*win_y += w->y;
w = w->parent;
}
retval = (GdkWindow *)w;
}
}
return retval;
}
@ -1951,7 +2139,8 @@ _gdk_windowing_get_pointer (GdkDisplay *display,
gdk_directfb_window_get_pointer (_gdk_windowing_window_at_pointer (display,
NULL,
NULL,
NULL),
NULL,
FALSE),
x, y, mask);
}
@ -1998,6 +2187,7 @@ gdk_directfb_window_input_shape_combine_region (GdkWindow *window,
static void
gdk_directfb_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *region,
gint dx,
gint dy)
@ -2313,7 +2503,7 @@ gdk_window_set_functions (GdkWindow *window,
return;
/* N/A */
g_message("unimplemented %s", __FUNCTION__);
g_message("unimplemented %s", G_STRFUNC);
}
static gboolean
@ -2326,7 +2516,7 @@ gdk_directfb_window_set_static_gravities (GdkWindow *window,
return FALSE;
/* N/A */
g_message("unimplemented %s", __FUNCTION__);
g_message("unimplemented %s", G_STRFUNC);
return FALSE;
}
@ -2344,7 +2534,7 @@ gdk_window_begin_resize_drag (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
g_message("unimplemented %s", __FUNCTION__);
g_message("unimplemented %s", G_STRFUNC);
}
void
@ -2359,7 +2549,7 @@ gdk_window_begin_move_drag (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
g_message("unimplemented %s", __FUNCTION__);
g_message("unimplemented %s", G_STRFUNC);
}
/**
@ -2501,6 +2691,7 @@ gdk_window_foreign_new_for_display (GdkDisplay* display,GdkNativeWindow anid)
private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
private->parent = parent_private;
private->window_type = GDK_WINDOW_TOPLEVEL;
private->viewable = TRUE;
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
impl->drawable.wrapper = GDK_DRAWABLE (window);
@ -2673,7 +2864,7 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable,
if (!region)
return;
D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %4d,%4d-%4d,%4d (%ld boxes)\n", __FUNCTION__,
D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %4d,%4d-%4d,%4d (%ld boxes)\n", G_STRFUNC,
paintable, GDKDFB_RECTANGLE_VALS_FROM_BOX(&region->extents), region->numRects );
/* When it's buffered... */
@ -2736,7 +2927,7 @@ gdk_window_impl_directfb_end_paint (GdkPaintable *paintable)
impl = GDK_DRAWABLE_IMPL_DIRECTFB (paintable);
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, paintable );
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, paintable );
g_return_if_fail (impl->paint_depth > 0);
@ -2804,6 +2995,46 @@ gdk_window_impl_directfb_end_paint (GdkPaintable *paintable)
D_DEBUG_AT( GDKDFB_Window, " -> depth is still %d\n", impl->paint_depth );
}
GdkRegion *
_gdk_windowing_get_shape_for_mask (GdkBitmap *mask)
{
return NULL;
}
GdkRegion *
_gdk_windowing_window_get_shape (GdkWindow *window)
{
return NULL;
}
gulong
_gdk_windowing_window_get_next_serial (GdkDisplay *display)
{
return 0;
}
GdkRegion *
_gdk_windowing_window_get_input_shape (GdkWindow *window)
{
return NULL;
}
void
_gdk_windowing_before_process_all_updates (void)
{
}
void
_gdk_windowing_after_process_all_updates (void)
{
}
void
_gdk_windowing_window_process_updates_recurse (GdkWindow *window,
GdkRegion *region)
{
_gdk_window_process_updates_recurse (window, region);
}
static void
gdk_window_impl_directfb_paintable_init (GdkPaintableIface *iface)

View File

@ -206,6 +206,14 @@ gdk_pre_parse_libgtk_only (void)
}
#endif /* G_ENABLE_DEBUG */
if (getenv ("GDK_NATIVE_WINDOWS"))
{
_gdk_native_windows = TRUE;
/* Ensure that this is not propagated
to spawned applications */
g_unsetenv ("GDK_NATIVE_WINDOWS");
}
g_type_init ();
/* Do any setup particular to the windowing system

View File

@ -22,7 +22,9 @@
#if IN_HEADER(__GDK_EVENTS_H__)
#if IN_FILE(__GDK_EVENTS_X11_C__)
gdk_add_client_message_filter
#ifndef GDK_DISABLE_DEPRECATED
gdk_event_get_graphics_expose
#endif
gdk_events_pending
#endif
#endif
@ -299,6 +301,7 @@ gdk_fontset_load_for_display
#if IN_HEADER(__GDK_CAIRO_H__)
#if IN_FILE(__GDK_CAIRO_C__)
gdk_cairo_create
gdk_cairo_reset_clip
gdk_cairo_set_source_color
gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_pixmap
@ -650,6 +653,7 @@ gdk_window_get_events
gdk_window_set_events
gdk_window_raise
gdk_window_lower
gdk_window_restack
gdk_window_move
gdk_window_resize
gdk_window_move_resize
@ -658,6 +662,7 @@ gdk_window_move_region
gdk_window_set_background
gdk_window_set_back_pixmap
gdk_window_set_cursor
gdk_window_get_cursor
gdk_window_get_geometry
gdk_window_get_origin
gdk_window_get_root_coords
@ -682,6 +687,7 @@ gdk_window_clear_area_e
gdk_window_constrain_size
gdk_window_destroy
gdk_window_end_paint
gdk_window_flush
gdk_window_foreign_new
gdk_window_freeze_toplevel_updates_libgtk_only
gdk_window_freeze_updates
@ -698,6 +704,7 @@ gdk_window_get_toplevels
gdk_window_get_update_area
gdk_window_get_user_data
gdk_window_get_window_type
gdk_window_is_destroyed
gdk_window_invalidate_maybe_recurse
gdk_window_invalidate_rect
gdk_window_invalidate_region
@ -1215,6 +1222,8 @@ gdk_x11_display_get_startup_notification_id
#if IN_FILE(__GDK_DRAWABLE_X11_C__)
gdk_x11_drawable_get_xdisplay
gdk_x11_drawable_get_xid
gdk_x11_window_get_drawable_impl
gdk_x11_pixmap_get_drawable_impl
#endif
#if IN_FILE(__GDK_FONT_X11_C__)

View File

@ -59,6 +59,34 @@ gdk_cairo_create (GdkDrawable *drawable)
return cr;
}
/**
* gdk_cairo_reset_clip:
* @cr: a #cairo_t
* @drawable: a #GdkDrawable
*
* Resets the clip region for a Cairo context created by gdk_cairo_create().
*
* This resets the clip region to the "empty" state for the given drawable.
* This is required for non-native windows since a direct call to
* cairo_reset_clip() would unset the clip region inherited from the
* drawable (i.e. the window clip region), and thus let you e.g.
* draw outside your window.
*
* This is rarely needed though, since most code just create a new cairo_t
* using gdk_cairo_create() each time they want to draw something.
*
* Since: 2.18
**/
void
gdk_cairo_reset_clip (cairo_t *cr,
GdkDrawable *drawable)
{
cairo_reset_clip (cr);
if (GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip)
GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
}
/**
* gdk_cairo_set_source_color:
* @cr: a #cairo_t

View File

@ -31,6 +31,8 @@
G_BEGIN_DECLS
cairo_t *gdk_cairo_create (GdkDrawable *drawable);
void gdk_cairo_reset_clip (cairo_t *cr,
GdkDrawable *drawable);
void gdk_cairo_set_source_color (cairo_t *cr,
const GdkColor *color);

View File

@ -510,7 +510,7 @@ gdk_display_real_get_window_at_pointer (GdkDisplay *display,
GdkWindow *window;
gint x, y;
window = _gdk_windowing_window_at_pointer (display, &x, &y, NULL);
window = _gdk_windowing_window_at_pointer (display, &x, &y, NULL, FALSE);
/* This might need corrections, as the native window returned
may contain client side children */
@ -836,6 +836,10 @@ synthesize_crossing_events (GdkDisplay *display,
GdkWindow *src_toplevel, *dest_toplevel;
GdkModifierType state;
int x, y;
/* We use the native crossing events if all native */
if (_gdk_native_windows)
return;
if (src_window)
src_toplevel = gdk_window_get_toplevel (src_window);
@ -909,34 +913,20 @@ get_current_toplevel (GdkDisplay *display,
GdkModifierType *state_out)
{
GdkWindow *pointer_window;
GdkWindowObject *w;
int x, y;
GdkModifierType state;
pointer_window = _gdk_windowing_window_at_pointer (display, &x, &y, &state);
pointer_window = _gdk_windowing_window_at_pointer (display, &x, &y, &state, TRUE);
if (pointer_window != NULL &&
(GDK_WINDOW_DESTROYED (pointer_window) ||
GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT ||
GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_FOREIGN))
pointer_window = NULL;
w = (GdkWindowObject *)pointer_window;
if (w)
{
/* Convert to toplevel */
while (w->parent != NULL &&
w->parent->window_type != GDK_WINDOW_ROOT)
{
x += w->x;
y += w->y;
w = w->parent;
}
}
*x_out = x;
*y_out = y;
*state_out = state;
return (GdkWindow *)w;
return pointer_window;
}
static void
@ -1033,11 +1023,6 @@ switch_to_pointer_grab (GdkDisplay *display,
/* We're now ungrabbed, update the window_under_pointer */
_gdk_display_set_window_under_pointer (display, pointer_window);
if (last_grab->implicit_ungrab)
generate_grab_broken_event (last_grab->window,
FALSE, TRUE,
NULL);
}
}
@ -1061,9 +1046,7 @@ _gdk_display_pointer_grab_update (GdkDisplay *display,
if (current_grab->serial_start > current_serial)
return; /* Hasn't started yet */
if (current_grab->serial_end > current_serial ||
(current_grab->serial_end == current_serial &&
current_grab->grab_one_pointer_release_event))
if (current_grab->serial_end > current_serial)
{
/* This one hasn't ended yet.
its the currently active one or scheduled to be active */
@ -1085,13 +1068,12 @@ _gdk_display_pointer_grab_update (GdkDisplay *display,
next_grab = NULL; /* Actually its not yet active */
}
if (next_grab == NULL ||
current_grab->window != next_grab->window)
if ((next_grab == NULL && current_grab->implicit_ungrab) ||
(next_grab != NULL && current_grab->window != next_grab->window))
generate_grab_broken_event (GDK_WINDOW (current_grab->window),
FALSE, current_grab->implicit,
next_grab? next_grab->window : NULL);
/* Remove old grab */
display->pointer_grabs =
g_list_delete_link (display->pointer_grabs,
@ -1138,7 +1120,9 @@ _gdk_display_has_pointer_grab (GdkDisplay *display,
return NULL;
}
/* Returns true if last grab was ended */
/* Returns true if last grab was ended
* If if_child is non-NULL, end the grab only if the grabbed
* window is the same as if_child or a descendant of it */
gboolean
_gdk_display_end_pointer_grab (GdkDisplay *display,
gulong serial,
@ -1156,7 +1140,7 @@ _gdk_display_end_pointer_grab (GdkDisplay *display,
grab = l->data;
if (grab &&
(if_child == NULL ||
_gdk_window_event_parent_of (grab->window, if_child)))
_gdk_window_event_parent_of (if_child, grab->window)))
{
grab->serial_end = serial;
grab->implicit_ungrab = implicit;

View File

@ -61,6 +61,15 @@ static void gdk_drawable_real_draw_pixbuf (GdkDrawable *draw
GdkRgbDither dither,
gint x_dither,
gint y_dither);
static void gdk_drawable_real_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
G_DEFINE_ABSTRACT_TYPE (GdkDrawable, gdk_drawable, G_TYPE_OBJECT)
@ -74,6 +83,7 @@ gdk_drawable_class_init (GdkDrawableClass *klass)
klass->get_clip_region = gdk_drawable_real_get_visible_region;
klass->get_visible_region = gdk_drawable_real_get_visible_region;
klass->draw_pixbuf = gdk_drawable_real_draw_pixbuf;
klass->draw_drawable = gdk_drawable_real_draw_drawable;
}
static void
@ -624,7 +634,7 @@ gdk_draw_drawable (GdkDrawable *drawable,
gint width,
gint height)
{
GdkDrawable *composite, *composite_impl;
GdkDrawable *composite;
gint composite_x_offset = 0;
gint composite_y_offset = 0;
@ -653,24 +663,13 @@ gdk_draw_drawable (GdkDrawable *drawable,
&composite_x_offset,
&composite_y_offset);
/* The draw_drawable call below is will recurse into gdk_draw_drawable again,
* specifying the right impl for the destination. This means the composite
* we got here will be fed to get_composite_drawable again, which is a problem
* for window as that causes double the composite offset. Avoid this by passing
* in the impl directly.
*/
if (GDK_IS_WINDOW (composite))
composite_impl = GDK_WINDOW_OBJECT (src)->impl;
else
composite_impl = composite;
/* TODO: For non-native windows this may copy stuff from other overlapping
windows. We should clip that and (for windows with bg != None) clear that
area in the destination instead. */
if (GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src)
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src (drawable, gc,
composite_impl,
composite,
xsrc - composite_x_offset,
ysrc - composite_y_offset,
xdest, ydest,
@ -678,7 +677,7 @@ gdk_draw_drawable (GdkDrawable *drawable,
src);
else /* backwards compat for old out-of-tree implementations of GdkDrawable (are there any?) */
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc,
composite_impl,
composite,
xsrc - composite_x_offset,
ysrc - composite_y_offset,
xdest, ydest,
@ -1506,6 +1505,31 @@ composite_565 (guchar *src_buf,
}
}
/* Implementation of the old vfunc in terms of the new one
in case someone calls it directly (which they shouldn't!) */
static void
gdk_drawable_real_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src (drawable,
gc,
src,
xsrc,
ysrc,
xdest,
ydest,
width,
height,
src);
}
static void
gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
GdkGC *gc,
@ -1525,6 +1549,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
GdkRegion *clip;
GdkRegion *drect;
GdkRectangle tmp_rect;
GdkDrawable *real_drawable;
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);
@ -1597,7 +1622,19 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
/* Actually draw */
if (!gc)
gc = _gdk_drawable_get_scratch_gc (drawable, FALSE);
/* Drawable is a wrapper here, but at this time we
have already retargeted the destination to any
impl window and set the clip, so what we really
want to do is draw directly on the impl, ignoring
client side subwindows. We also use the impl
in the pixmap target case to avoid resetting the
already set clip on the GC. */
if (GDK_IS_WINDOW (drawable))
real_drawable = GDK_WINDOW_OBJECT (drawable)->impl;
else
real_drawable = GDK_PIXMAP_OBJECT (drawable)->impl;
if (pixbuf->has_alpha)
{
GdkVisual *visual = gdk_drawable_get_visual (drawable);
@ -1667,7 +1704,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
image->bpl,
visual->byte_order,
width1, height1);
gdk_draw_image (drawable, gc, image,
gdk_draw_image (real_drawable, gc, image,
xs0, ys0,
dest_x + x0, dest_y + y0,
width1, height1);
@ -1708,7 +1745,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
{
guchar *buf = pixbuf->pixels + src_y * pixbuf->rowstride + src_x * 4;
gdk_draw_rgb_32_image_dithalign (drawable, gc,
gdk_draw_rgb_32_image_dithalign (real_drawable, gc,
dest_x, dest_y,
width, height,
dither,
@ -1719,7 +1756,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
{
guchar *buf = pixbuf->pixels + src_y * pixbuf->rowstride + src_x * 3;
gdk_draw_rgb_image_dithalign (drawable, gc,
gdk_draw_rgb_image_dithalign (real_drawable, gc,
dest_x, dest_y,
width, height,
dither,

View File

@ -1266,6 +1266,9 @@ gdk_synthesize_window_state (GdkWindow *window,
((GdkWindowObject*) window)->state = temp_event.window_state.new_window_state;
if (temp_event.window_state.changed_mask & GDK_WINDOW_STATE_WITHDRAWN)
_gdk_window_update_viewable (window);
/* We only really send the event to toplevels, since
* all the window states don't apply to non-toplevels.
* Non-toplevels do use the GDK_WINDOW_STATE_WITHDRAWN flag

View File

@ -519,7 +519,9 @@ gboolean gdk_events_pending (void);
GdkEvent* gdk_event_get (void);
GdkEvent* gdk_event_peek (void);
#ifndef GDK_DISABLE_DEPRECATED
GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window);
#endif
void gdk_event_put (const GdkEvent *event);
GdkEvent* gdk_event_new (GdkEventType type);

View File

@ -648,7 +648,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
GdkColor black = {0, 0, 0, 0};
GdkRectangle r;
GdkOverlapType overlap;
gdk_drawable_get_size (priv->clip_mask, &w, &h);
r.x = 0;
@ -659,7 +659,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
/* Its quite common to expose areas that are completely in or outside
* the region, so we try to avoid allocating bitmaps that are just fully
* set or completely unset.
*/
*/
overlap = gdk_region_rect_in (region, &r);
if (overlap == GDK_OVERLAP_RECTANGLE_PART)
{
@ -683,11 +683,19 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
}
else if (overlap == GDK_OVERLAP_RECTANGLE_OUT)
{
/* No intersection, set empty clip region */
GdkRegion *empty = gdk_region_new ();
gdk_region_destroy (region);
priv->old_clip_mask = g_object_ref (priv->clip_mask);
priv->clip_region = empty;
_gdk_windowing_gc_set_clip_region (gc, empty, FALSE);
gdk_region_destroy (empty);
}
else
{
/* Completely inside region, don't set unnecessary clip */
gdk_region_destroy (region);
return;
}
}
else
@ -696,7 +704,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
priv->clip_region = region;
if (priv->old_clip_region)
gdk_region_intersect (region, priv->old_clip_region);
_gdk_windowing_gc_set_clip_region (gc, priv->clip_region, FALSE);
}
@ -718,6 +726,12 @@ _gdk_gc_remove_drawable_clip (GdkGC *gc)
gdk_gc_set_clip_mask (gc, priv->old_clip_mask);
g_object_unref (priv->old_clip_mask);
priv->old_clip_mask = NULL;
if (priv->clip_region)
{
g_object_unref (priv->clip_region);
priv->clip_region = NULL;
}
}
else
{
@ -1382,6 +1396,8 @@ _gdk_gc_update_context (GdkGC *gc,
priv = GDK_GC_GET_PRIVATE (gc);
_gdk_gc_remove_drawable_clip (gc);
fill = priv->fill;
if (override_stipple && fill != GDK_OPAQUE_STIPPLED)
fill = GDK_STIPPLED;
@ -1472,6 +1488,10 @@ _gdk_gc_update_context (GdkGC *gc,
return;
cairo_reset_clip (cr);
/* The reset above resets the window clip rect, so we want to re-set that */
if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
if (priv->clip_region)
{
cairo_save (cr);
@ -1487,9 +1507,6 @@ _gdk_gc_update_context (GdkGC *gc,
cairo_clip (cr);
}
/* The reset above resets the window clip rect, so we want to re-set that */
if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
}

View File

@ -294,7 +294,7 @@ void gdk_gc_set_rgb_bg_color (GdkGC *gc,
GdkScreen * gdk_gc_get_screen (GdkGC *gc);
#ifndef GDK_DISABLE_DEPRECATED
#define gdk_gc_destroy gdk_gc_unref
#define gdk_gc_destroy g_object_unref
#endif /* GDK_DISABLE_DEPRECATED */
G_END_DECLS

View File

@ -39,6 +39,7 @@ GList *_gdk_default_filters = NULL;
gchar *_gdk_display_name = NULL;
gint _gdk_screen_number = -1;
gchar *_gdk_display_arg_name = NULL;
gboolean _gdk_native_windows = FALSE;
GSList *_gdk_displays = NULL;

View File

@ -129,7 +129,7 @@ GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
#endif /* GDK_ENABLE_BROKEN */
#ifndef GDK_DISABLE_DEPRECATED
#define gdk_image_destroy gdk_image_unref
#define gdk_image_destroy g_object_unref
#endif /* GDK_DISABLE_DEPRECATED */
G_END_DECLS

View File

@ -107,6 +107,7 @@ extern gint _gdk_error_code;
extern gint _gdk_error_warnings;
extern guint _gdk_debug_flags;
extern gboolean _gdk_native_windows;
#ifdef G_ENABLE_DEBUG
@ -184,7 +185,6 @@ typedef struct
gboolean activated;
gboolean implicit_ungrab;
gboolean grab_one_pointer_release_event;
} GdkPointerGrabInfo;
typedef struct _GdkInputWindow GdkInputWindow;
@ -260,6 +260,8 @@ struct _GdkWindowObject
guint effective_visibility : 2;
guint visibility : 2; /* The visibility wrt the toplevel (i.e. based on clip_region) */
guint native_visibility : 2; /* the native visibility of a impl windows */
guint viewable : 1; /* mapped and all parents mapped */
guint applied_shape : 1;
guint num_offscreen_children;
GdkWindowPaint *implicit_paint;
@ -273,6 +275,8 @@ struct _GdkWindowObject
cairo_surface_t *cairo_surface;
};
#define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
extern GdkEventFunc _gdk_event_func; /* Callback for events */
extern gpointer _gdk_event_data;
@ -385,6 +389,7 @@ void _gdk_window_destroy (GdkWindow *window,
gboolean foreign_destroy);
void _gdk_window_clear_update_area (GdkWindow *window);
void _gdk_window_update_size (GdkWindow *window);
gboolean _gdk_window_update_viewable (GdkWindow *window);
void _gdk_window_process_updates_recurse (GdkWindow *window,
GdkRegion *expose_region);
@ -455,7 +460,8 @@ void _gdk_windowing_get_pointer (GdkDisplay *display,
GdkWindow* _gdk_windowing_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y,
GdkModifierType *mask);
GdkModifierType *mask,
gboolean get_toplevel);
GdkGrabStatus _gdk_windowing_pointer_grab (GdkWindow *window,
GdkWindow *native,
gboolean owner_events,
@ -603,7 +609,7 @@ void _gdk_display_enable_motion_hints (GdkDisplay *display);
void _gdk_window_invalidate_for_expose (GdkWindow *window,
const GdkRegion *region);
GdkRegion *region);
void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
int width,
@ -626,6 +632,8 @@ GdkEvent * _gdk_make_event (GdkWindow *window,
GdkEventType type,
GdkEvent *event_in_queue,
gboolean before_event);
gboolean _gdk_window_event_parent_of (GdkWindow *parent,
GdkWindow *child);
void _gdk_synthesize_crossing_events (GdkDisplay *display,
GdkWindow *src,

View File

@ -1,13 +1,15 @@
#!/usr/bin/env perl
# Updates http://svn.gnome.org/viewcvs/gtk%2B/trunk/gdk/gdkkeysyms.h?view=log from upstream (X.org 7.x),
# Updates http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h from upstream (X.org 7.x),
# from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
#
# Author : Simos Xenitellis <simos at gnome dot org>.
# Authos : Bastien Nocera <hadess@hadess.net>
# Version : 1.2
#
# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
# Output : http://svn.gnome.org/svn/gtk+/trunk/gdk/gdkkeysyms.h
# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
# Output : http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h
#
# Notes : It downloads keysymdef.h from the Internet, if not found locally,
# Notes : and creates an updated gdkkeysyms.h
@ -33,6 +35,20 @@ else
print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h\n\n";
}
if ( ! -f "XF86keysym.h" )
{
print "Trying to download XF86keysym.h from\n";
print "http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n";
die "Unable to download keysymdef.h from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n"
unless system("wget -c -O XF86keysym.h \"http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\"") == 0;
print " done.\n\n";
}
else
{
print "We are using existing XF86keysym.h found in this directory.\n";
print "It is assumed that you took care and it is a recent version\n";
print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h\n\n";
}
if ( -f "gdkkeysyms.h" )
{
@ -41,7 +57,7 @@ if ( -f "gdkkeysyms.h" )
die "Exiting...\n\n";
}
# Source: http://cvs.freedesktop.org/xorg/xc/include/keysymdef.h
# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h
die "Could not open file keysymdef.h: $!\n" unless open(IN_KEYSYMDEF, "<:utf8", "keysymdef.h");
# Output: gtk+/gdk/gdkkeysyms.h
@ -50,7 +66,7 @@ die "Could not open file gdkkeysyms.h: $!\n" unless open(OUT_GDKKEYSYMS, ">:utf8
print OUT_GDKKEYSYMS<<EOF;
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 2005, 2006, 2007 GNOME Foundation
* Copyright (C) 2005, 2006, 2007, 2009 GNOME Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -69,9 +85,11 @@ print OUT_GDKKEYSYMS<<EOF;
*/
/*
* File auto-generated from script http://svn.gnome.org/viewcvs/gtk%2B/trunk/gdk/gdkkeysyms-update.pl
* File auto-generated from script http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms-update.pl
* using the input file
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
* and
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
*/
/*
@ -106,9 +124,50 @@ while (<IN_KEYSYMDEF>)
printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $keysymelements[1], hex($keysymelements[2]);
}
close IN_KEYSYMDEF;
#$gdksyms{"0"} = "0000";
close IN_KEYSYMDEF;
# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h
die "Could not open file XF86keysym.h: $!\n" unless open(IN_XF86KEYSYM, "<:utf8", "XF86keysym.h");
while (<IN_XF86KEYSYM>)
{
next if ( ! /^#define / );
@keysymelements = split(/\s+/);
die "Internal error, no \@keysymelements: $_\n" unless @keysymelements;
$_ = $keysymelements[1];
die "Internal error, was expecting \"XF86XK_*\", found: $_\n" if ( ! /^XF86XK_/ );
# Work-around https://bugs.freedesktop.org/show_bug.cgi?id=11193
if ($_ eq "XF86XK_XF86BackForward") {
$keysymelements[1] = "XF86XK_AudioForward";
}
# XF86XK_Clear could end up a dupe of XK_Clear
# XF86XK_Select could end up a dupe of XK_Select
if ($_ eq "XF86XK_Clear") {
$keysymelements[1] = "XF86XK_WindowClear";
}
if ($_ eq "XF86XK_Select") {
$keysymelements[1] = "XF86XK_SelectButton";
}
# Ignore XF86XK_Q
next if ( $_ eq "XF86XK_Q");
# XF86XK_Calculater is misspelled, and a dupe
next if ( $_ eq "XF86XK_Calculater");
$_ = $keysymelements[2];
die "Internal error, was expecting \"0x*\", found: $_\n" if ( ! /^0x/ );
$keysymelements[1] =~ s/^XF86XK_/GDK_/g;
printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $keysymelements[1], hex($keysymelements[2]);
}
close IN_XF86KEYSYM;
print OUT_GDKKEYSYMS<<EOF;

File diff suppressed because it is too large Load Diff

View File

@ -601,7 +601,6 @@ _gdk_offscreen_window_new (GdkWindow *window,
GdkWindowAttr *attributes,
gint attributes_mask)
{
GdkWindowObject *parent_private;
GdkWindowObject *private;
GdkOffscreenWindow *offscreen;
@ -615,7 +614,6 @@ _gdk_offscreen_window_new (GdkWindow *window,
if (private->parent != NULL && GDK_WINDOW_DESTROYED (private->parent))
return;
parent_private = (GdkWindowObject*) private->parent;
private->impl = g_object_new (GDK_TYPE_OFFSCREEN_WINDOW, NULL);
offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
offscreen->wrapper = window;
@ -650,7 +648,6 @@ gdk_offscreen_window_reparent (GdkWindow *window,
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowObject *new_parent_private = (GdkWindowObject *)new_parent;
GdkWindowObject *old_parent;
GdkOffscreenWindow *offscreen;
gboolean was_mapped;
if (new_parent)
@ -664,8 +661,6 @@ gdk_offscreen_window_reparent (GdkWindow *window,
return FALSE;
}
offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
was_mapped = GDK_WINDOW_IS_MAPPED (window);
gdk_window_hide (window);
@ -837,6 +832,8 @@ gdk_offscreen_window_get_pointer (GdkWindow *window,
* add a reference to it.
*
* Returns: The offscreen pixmap, or %NULL if not offscreen
*
* Since: 2.18
*/
GdkPixmap *
gdk_offscreen_window_get_pixmap (GdkWindow *window)
@ -1119,9 +1116,6 @@ gdk_offscreen_window_get_geometry (GdkWindow *window,
gint *depth)
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkOffscreenWindow *offscreen;
offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
@ -1149,6 +1143,7 @@ gdk_offscreen_window_queue_antiexpose (GdkWindow *window,
static void
gdk_offscreen_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *area,
gint dx,
gint dy)
@ -1160,6 +1155,13 @@ gdk_offscreen_window_queue_translation (GdkWindow *window,
* @window: a #GdkWindow
* @embedder: the #GdkWindow that @window gets embedded in
*
* Sets @window to be embedded in @embedder.
*
* To fully embed an offscreen window, in addition to calling this
* function, it is also necessary to handle the #GdkWindow::pick-embedded-child
* signal on the @embedder and the #GdkWindow::to-embedder and
* #GdkWindow::from-embedder signals on @window.
*
* Since: 2.18
*/
void

View File

@ -385,10 +385,14 @@ gdk_pixmap_draw_drawable (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_drawable (private->impl, gc, src, xsrc, ysrc,
xdest, ydest,
width, height);
_gdk_gc_remove_drawable_clip (gc);
/* Call the method directly to avoid getting the composite drawable again */
GDK_DRAWABLE_GET_CLASS (private->impl)->draw_drawable_with_src (private->impl, gc,
src,
xsrc, ysrc,
xdest, ydest,
width, height,
original_src);
}
static void

View File

@ -119,10 +119,10 @@ GdkPixmap* gdk_pixmap_foreign_new_for_screen (GdkScreen *screen,
gint depth);
#ifndef GDK_DISABLE_DEPRECATED
#define gdk_bitmap_ref gdk_drawable_ref
#define gdk_bitmap_unref gdk_drawable_unref
#define gdk_pixmap_ref gdk_drawable_ref
#define gdk_pixmap_unref gdk_drawable_unref
#define gdk_bitmap_ref g_object_ref
#define gdk_bitmap_unref g_object_unref
#define gdk_pixmap_ref g_object_ref
#define gdk_pixmap_unref g_object_unref
#endif /* GDK_DISABLE_DEPRECATED */
G_END_DECLS

Some files were not shown because too many files have changed in this diff Show More