Merge branch 'master' into client-side-windows

Conflicts:
	gdk/x11/gdkwindow-x11.c
This commit is contained in:
Alexander Larsson 2009-05-25 14:30:01 +02:00
commit 7698daf97a
370 changed files with 91228 additions and 78845 deletions

View file

@ -17,7 +17,7 @@ can be found here:
Information about using git with GNOME can be found here:
http://live.gnome.org/GitMigration
http://live.gnome.org/Git
In order to get GIT gtk+ installed on your system, you need to have
the most recent GIT versions of glib, pango, and atk installed as well.
@ -32,6 +32,11 @@ gtk+ and glib. You can do the following to get glib and gtk+ from GIT:
$ git clone git://git.gnome.org/atk
$ git clone git://git.gnome.org/gtk+
Note: if you plan to push changes to back to the master repository and
have a gnome account, you want to use the following instead:
$ git clone ssh://<username>@git.gnome.org/git/gtk+
To compile the GIT version of gtk+ on your system, you will need to take
several steps to setup the tree for compilation. You can do all these
steps at once by running:

41
INSTALL
View file

@ -1,41 +0,0 @@
Prerequisites
=============
GTK+ requires the following packages:
- The GLib, Pango, ATK and cairo libraries, available at the same
location as GTK+. GTK+ 2.16.0 requires at least GLib 2.17.6,
Pango 1.20, ATK 1.13.0 and cairo 1.6.0.
- The TIFF, PNG, and JPEG image loading libraries. You most
likely have these installed on your system already. If not
these libraries are available from:
http://www.libtiff.org/
http://www.libpng.org/
http://www.ijg.org/
libtiff must be version 3.6.0 or higher.
Simple install procedure
========================
% gzip -cd gtk+-2.16.0.tar.gz | tar xvf - # unpack the sources
% cd gtk+-2.16.0 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK+
[ Become root if necessary ]
% make install # install GTK+
The Details
===========
Complete information about installing GTK+ and related libraries can be found
in the file:
docs/reference/gtk/html/gtk-building.html
Or online at:
http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html

View file

@ -19,6 +19,9 @@ EXTRA_DIST += \
ChangeLog.pre-2-6 \
ChangeLog.pre-2-8 \
ChangeLog.pre-2-10 \
ChangeLog.pre-2-12 \
ChangeLog.pre-2-14 \
ChangeLog.pre-2-16 \
ChangeLog.gtk-async-file-chooser \
ChangeLog.gtk-printing \
README.commits \
@ -115,6 +118,26 @@ EXTRA_DIST += \
examples/spinbutton/spinbutton.c \
examples/spinbutton/Makefile \
examples/find-examples.sh
MAINTAINERCLEANFILES = \
$(srcdir)/INSTALL \
$(srcdir)/README \
$(srcdir)/aclocal.m4 \
$(srcdir)/autoscan.log \
$(srcdir)/compile \
$(srcdir)/config.guess \
$(srcdir)/config.h.in \
$(srcdir)/config.sub \
$(srcdir)/configure.scan \
$(srcdir)/depcomp \
$(srcdir)/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/missing \
$(srcdir)/mkinstalldirs \
$(srcdir)/omf.make \
$(srcdir)/xmldocs.make \
$(srcdir)/gtk-doc.make \
$(srcdir)/ChangeLog \
`find "$(srcdir)" -type f -name Makefile.in -print`
GDKTARGET=@gdktarget@
@ -152,6 +175,25 @@ DISTCLEANFILES = \
gail-uninstalled.pc \
config.lt
distclean-local:
if test $(srdcir) = .; then :; else \
rm -f ChangeLog; \
fi
ChangeLog:
@echo Creating $@
@if test -d "$(srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git ./missing --run git log GTK_2_16_0^^.. --stat) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp $@ \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
else \
test -f $@ || \
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
fi
## copy the default target for this platform to gdk-2.0.pc and gtk+-2.0.pc
DEFAULT_GDKTARGET=x11
install-data-hook:
@ -176,7 +218,7 @@ dist-hook:
&& cp INSTALL README $(distdir) ; \
fi
.PHONY: files release sanity snapshot
.PHONY: files release sanity snapshot ChangeLog
files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
@ -201,3 +243,15 @@ snapshot:
$(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"`
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-rebuilds
GITIGNOREFILES = \
po-properties/Makefile.in.in \
po-properties/Makefile.in \
po-properties/Makefile \
po-properties/*.gmo \
po-properties/*.mo \
po-properties/POTFILES \
po-properties/stamp-it \
po-properties/.intltool-merge-cache
-include $(top_srcdir)/git.mk

121
NEWS
View file

@ -1,3 +1,124 @@
Overview of Changes from GTK+ 2.17.0 to 2.17.1
==============================================
* GtkLabel:
- GtkLabel can now show embedded URLs, much like SexyUrlLabel
* Changes that are relevant for theme authors:
- The URL support in GtkLabel uses the link-color / visited-link-color
style properties
Overview of Changes from GTK+ 2.16.x to 2.17.0
==============================================
* GtkBuilder:
- Scale marks can now be specified in builder markup
- GtkAssistant action widgets can be added in builder markup
* Changes that are relevant for theme authors
- GtkEntry now has a ::invisible-char style property that allows
themes to set the preferred invisible character
* Printing:
- GTK+ supports authentication of users against CUPS servers now.
* Bugs fixed:
578634 gtkdial example fails to compile
580678 Minor improvement to GTK+ mediaLib code
580511 gdk_x11_atom_to_xatom_for_display translates GDK_NONE...
581110 Handlebox widget uses static variables, crashes in multi...
553385 gtk-builder-convert creates untranslated combobox models
580814 GtkTextLayout incorrectly assumes pango iterates in logi...
579366 gtkbuilderparser leaks RequiresInfo objects
579741 gailcombox should emit property-changed:accessible-name...
574386 Remove deprecated call to gtk_status_icon_set_tooltip...
384940 handle rejecting jobs and authentication meaningfully
* Updated translations
Arabic
Brazilian Portuguese
British English
Catalan
Czech
Estonian
Italian
Kannada
Oriya
Simplified Chinese
Slovenian
Spanish
Ukrainian
Overview of Changes from GTK+ 2.16.0 to 2.16.1
==============================================
* GtkBuilder:
- Accessible action names can now be marked as translatable.
- gtk-builder-convert correctly handles response ids in all dialogs.
- gtk-builder-convert warns about duplicate ids.
* GDK:
- GDK no longer refuses to work on 30-bit visuals
* Win32:
- The appearance of GTK+ menus on Vista has been improved.
* Bugs fixed:
575700 Crash when moving a GtkWindow
574283 unused assignment and dead code in gtk_widget_set_tooltip_window
538840 [Win32] GTK menu theming could be improved
576254 <object> requires attribute "id"
576306 gdkscreen.c: get_nearest_monitor too simple...
437533 Implement draw_shape PangoRenderer method
577224 crash when setting new icon after setting icon...
576150 Doc bug for GtkMenuPositionFunc
562863 GtkVscrollbar is hardly documented
575644 Cygwin gail build patch
571374 Add 30-bit visuals to the list of supported depths
577650 gtkitemfactory.h fails to compile
578094 ProcessIdToSessionId needs to be declared as WINAPI
518642 Custom tags and translatable content
532858 segv setting GBoxed subclass <property>
557629 Response ID not converted for GtkFileChooserDialog
577789 about dialogue doesn't linkify licence text
577824 empathy_chat_window_init: GClosure is leaked
577964 Page Range entry is not accessible
578221 Assertion warning `GTK_IS_TEXT_LAYOUT (layout)' failed
578271 PageSetup should be sent to the previewer
578276 gtk-builder-convert improperly converts GtkComboBox
578290 two memory leaks
578354 Memory leak in gdkscreen-x11
578365 GtkMountOperation does not allow passwordless mount of sf...
578366 file descriptor leak
573922 Using NET_WM_USER_TIME even if startup notification times...
561345 Title of Print Preview window should not be previewXXXXXX...
577868 about dialogue changes appearance on style-set (change th...
572797 GtkCellRendererAccel display string i18n in OTHER mode
* Updated translations:
Arabic
Assamese
Basque
Bulgarian
Crimean Tatar
Danish
Galician
German
Greek
Gujarati
Japanese
Kannada
Malayalam
Marathi
Oriya
Pashto
Russian
Spanish
Telugu
Turkish
Overview of Changes from GTK+ 2.15.5 to 2.16.0
==============================================

401
README
View file

@ -1,401 +0,0 @@
General Information
===================
This is GTK+ version 2.16.0. GTK+ is a multi-platform toolkit for
creating graphical user interfaces. Offering a complete set of widgets,
GTK+ is suitable for projects ranging from small one-off projects to
complete application suites.
GTK+ is free software and part of the GNU Project. However, the
licensing terms for GTK+, the GNU LGPL, allow it to be used by all
developers, including those developing proprietary software, without any
license fees or royalties.
The official ftp site is:
ftp://ftp.gtk.org/pub/gtk
The official web site is:
http://www.gtk.org/
Information about mailing lists can be found at
http://www.gtk.org/mailinglists.html
Installation
============
See the file 'INSTALL'
Release notes for 2.14
======================
* gtkitemfactory.h is now completely deprecated.
As gtkactiongroup.h and gtkstock.h no longer include the gtkitemfactory.h
header, this might break application using gtk_item_factory_* symbols
without including gtkitemfactory.h - even though this behaviour has never
been supported in the first place.
* The GtkFileSystem semi-private interface has been removed.
The GTK+ filechooser implementation now uses GIO directly, which has
rendered external filesystem implementations unnecessary. Consequently,
the GtkFileSystem interface is no longer available, nor the filechooser
will load any GtkFileSystem implementation.
* GtkComboBox now renders the popdown button insensitive when
the model is empty. Applications which want to populate the list
only before displaying it can set gtk_combo_box_set_button_sensitivity
to GTK_SENSITIVITY_ON, so that the button is always sensitive or
GTK_SENSITIVITY_OFF to make it insensitive respectively.
* GtkAdjustment now enforces that values are restricted to the
range [lower, upper - page_size]. This has always been the documented
behaviour, and the recommended practice is to set page_size to 0
when using adjustments for simple scalar values, like in a slider
or spin button.
* gdk-pixbuf will use GIO for mime type detection if possible. For
this to work, shared-mime-info needs to be installed and XDG_DATA_DIRS
set accordingly at configure time. Otherwise, gdk-pixbuf falls
back to its built-in sniffing implementation.
Release notes for 2.12
======================
* gtk_about_dialog_get/set_name() were deprecated in favour of
gtk_about_dialog_get/set_program_name(), the GtkAboutDialog now uses the
"program-name" property instead of the conflicting "name" property.
* The gdk-pixbuf tiff loader now requires libtiff 3.6.0 or later.
* Support for Windows 9x/ME has officially been removed. It hasn't worked
since 2.6 anyway.
* The GtkTextBufferTargetInfo enumeration values have been changed from
G_MAXUINT-0, G_MAXUINT-1, G_MAXUINT-2, etc, to -1, -2, -3 to stay within
ANSI C limits.
* A change in the handling of _NET_WM_USER_TIME properties on toplevel
windows can cause deadlock problems with window managers that are using
GDK for drawing decorations. In particular, metacity <= 2.18.0 is affected
by this. The problem has been fixed in metacity 2.18.1.
* Semi-private GtkTextLayout api has changed: new GtkTextLayout method
invalidate_cursors(), and new functions gtk_text_layout_invalidate_cursors()
and gtk_text_layout_cursors_changed(), which should be used in place of
gtk_text_layout_invalidate() and gtk_text_layout_changed() if invalidation
is due to marks moved or changed selection; new GtkTextLineDisplay structure
member. Source compatibility is preserved; binary compatibility may break
only if GtkTextLineDisplay structure was created on stack or as a part
of another structure (in particular GnomeCanvas and its clones do not need
recompiling).
* Another new signal has been added to GtkNotebook. The new signal
is called create-window, so this name can no longer be used for signals
in objects derived from GtkNotebook.
* The gtk_notebook_set/get_group_id() functions were found to be insufficient
and have been deprecated in favour of gtk_notebook_set/get_group().
* The move-focus signal has been moved to GtkWidget, to unify the
various implementations of this signal in specific widgets. Great care
has been taken to make sure that all code using this signal continues
to work.
* An unused and hardly visible GtkFrame has been removed from the menu
widget hierarchy when GtkComboBox::appears-as-list style property is
set. Any RC file applying a different style to any widget below the
widget path "gtk-combobox-popup-window.GtkFrame" should take into
account that the frame no longer exists.
* The external print preview application used by GtkPrintOperationPreview
is now passed the print settings on the command line with the
--print-settings parameter pointing to a temp file containing the
settings. The preview application assumes ownership of the file and
should delete it once it does not need it anymore. The --print-settings
commandline option is understood by Evince 0.9.0 and newer. To use a
different print preview application, change the gtk-print-preview-command
setting in your gtkrc file, e.g. gtk-print-preview-command = "ggv %f"
* GtkMenuShell is now defined as an abstract type. It was already
documented as an abstract class, and there is little reason to
instantiate it.
* The GtkTooltips struct (this is the old tooltips API) is now considered
private. Code that used to access this struct, in particular the
tips_data_list field, will need to change. All of the old tooltips
API has been deprecated in favour of a new implementation and
API. This affects all of the gtk_tooltips_ functions, and functions
which take a GtkTooltips argument, such as gtk_tool_item_set_tooltip()
and gtk_menu_tool_button_set_arrow_tooltip().
* The memory management of the GtkRecentManager object has been changed,
as using the screen didn't guarantee that the singleton instance was
correctly destroyed. The screen-related functions have been deprecated,
and should not be used anymore; the GtkRecentManager instance returned by
the gtk_recent_manager_get_default() function is guaranteed to be valid
for the entire lifetime of an application.
* A number of interfaces that have been superseded by newer interfaces for
a long time have finally been deprecated. This includes
gtk_widget_ref/unref(), gtk_rc_style_ref/unref() and the old file selector.
* The various coordinate systems in use in GtkTreeView widgets have
been clarified in the documentation, and in the cause of doing so,
the functions gtk_tree_view_widget_to_tree_coords() and
gtk_tree_view_tree_to_widget_coords() have been deprecated in
favour of a new family of gtk_tree_view_convert_ functions.
* gtk_menu_item_remove_submenu() has been deprecated in favour of
gtk_menu_item_set_submenu (..., NULL).
* gtk_default_draw_check() has been fixed to really decrease the
indicator size by one pixel to ensure an odd size instead of
accidentially increasing it.
Consequently, gtk_cell_renderer_toggle_render() could be fixed to
not subtract 1 from the size passed to gtk_paint_option(), which
was just a workaround for above off-by-two for even sizes (theme
engines now get the real indicator size passed).
The default toggle size of GtkCheckMenuItem and GtkCellRendererToggle
has been changed to 13 to be consistent with GtkCheckButton.
The only visible change with default settings is that the indicator in
GtkCellRendererToggle has changed its size from 11 to 13 and is now
consistent with menus and toggle buttons.
* GTK+ has always required that gtk_init() (or a variant thereof) is
called before any other GTK+ function. Some applications call functions
like gtk_clipboard_get() to check if they need to call gtk_init(),
anyway. A change in GLib 2.14 has recently broken this unsupported
practise. It is worth pointing out that calling gtk_init() twice
does no harm.
Release notes for 2.10
======================
* The hexadecimal Unicode input feature has been reworked. It no longer
blocks the use of the sixteen Ctrl-Shift-<hex digit> key sequences. Now
it only uses Ctrl-Shift-u.
* A memory leak in GtkStyle handling has been fixed. This may expose bugs
in third-party widgets which forget to call gtk_style_attach() in their
realize functions.
* Range widgets like GtkScrollbar now render their arrows insensitive
when the slider is at the end. Applications which react to arrow
clicks even if the slider is at the end may want to use the new
gtk_range_set_[upper/lower]_stepper_sensitivity() functions to
prevent the arrows from being rendered insensitive.
* GtkObject now uses the "floating reference" support in GObject.
GTK_OBJECT_IS_FLOATING() will still work, but direct checking
of the GTK_FLOATING flag will no longer detect the floating
reference. Details about floating references can be found in the docs:
http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#floating-ref
* Accelerators like (_F) are now stripped from labels when they are
displayed in toolbars. If this is not wanted, the feature can be
suppressed by inserting a Unicode control character, e.g ZWNJ.
* The pixbuf theme engine can now customize expanders (in GtkTreeView
and GtkExpander) and resize grips, using the new EXPANDER and
RESIZE_GRIP function values.
* Dialogs created by gtk_about_dialog_new() no longer hide automatically
when the user clicks close. It is the applications responsibility to
hide or destroy the dialog.
* Several new signals have been added to GtkNotebook. Care has been taken
to choose signal names which do not collide with signals added by well-known
derived classes. The names which can no longer be used for signals in
objects derived from GtkNotebook are page-reordered, page-removed and
page-added.
* Due to the interface changes in the file chooser backend interface,
the GTK+ ABI version has been bumped to 2.10.0. Third-party filesystem
backends have to be ported to the new interface, other modules, such as
theme engines, input method modules or pixbuf loaders have to be rebuilt
so that they are installed in the right place for GTK+ to find them.
Release notes for 2.8
=====================
* GTK+ 2.8 and Pango 1.10 require the cairo library.
* The default theme has been renamed to "Raleigh". Existing configurations
specifying the "Default" theme name should still work.
* The GtkTreeView::enable-search property has been changed to control
only typeahead search, not the C-f keybinding to start an interactive
search. To turn off interactive searching completely, you have to
set GtkTreeView::search-column to -1.
* The restriction on using the same cell renderer in multiple columns
of a GtkTreeView is now more strictly enforced.
* In GTK+ 2.8, GtkCalendar uses nl_langinfo() (if available) to determine
the first day of the week. Thus, it is possible to select the first day
of the week independently from the language, by setting LC_TIME.
* In GTK+ 2.8, the gtk-update-icon-cache utility includes image data
in the icon caches, which will make the icon cache files larger than
the one produced by GTK+ 2.6. This change will reduce the memory
overhead of icon themes at runtime, since all GTK+ applications can
share the image data in memory.
* In 2.8, GDK emits GdkEventGrabBroken events when a keyboard or pointer
grab is broken. On X11, this can happen if the same application grabs
again, or if the window used for the grab becomes unviewable. It happens
more often on Win32. Applications which use grabs should pay attention
to these events and do the necessary cleanups when the grab is lost.
* The GIOChannel code for sockets on win32 has been rewritten.
Applications who make non-trivial use of GIOChannels on win32 should
be watched for possible problems.
* GLib 2.8 uses atomic operations to implement reference counting, thus
g_object_ref/unref, g_closure_ref/sink/unref and g_iochannel_ref/unref
can be used without locking in multithreaded applications. Note that
other modifications, like concurrent setting of properties still require
locking.
* g_convert() and related character set conversion functions have been
fixed to emit pending shift states and to not cache iconv descriptors
across multiple calls, since that is problematic for some encodings.
Note that these functions are not suitable for streaming conversions;
use g_iconv() to do streaming conversion.
Release notes for 2.6
=====================
* GTK+ 2.6 supports clipboard persistency. To make use of this feature,
a clipboard manager following the specification at
http://www.freedesktop.org/wiki/Standards/clipboard-manager-spec
must be running. A sample implementation of such a clipboard manager
is available at
http://people.imendio.com/andersca/archives/clipboard-manager-0.3.tar.gz
Applications can use the function gdk_display_supports_clipboard_persistence()
to find out if clipboard persistence is available.
* Notification on clipboard ownership changes via GdkOwnerChange events
requires the XFIXES X extension. Applications can use the function
gdk_display_supports_selection_notification() to find out if ownerchip
change notification is available.
* The icon theme code in GTK+ 2.6 follows the freedesktop.org icon theme
specification. Setting the XDG_DATA_DIRS environtment variable may be
necessary if your icons aren't installed in the default location
/usr/share/icons.
* The icon theme code in GTK+ 2.6 can make use of mmap()able cache files
to avoid a lot of disk searching overhead. GTK+ includes a utility named
gtk-update-icon-cache to generate these cache files. For further details,
see the gtk-update-icon-cache man page or the GTK+ documentation.
* To reduce code size and improve efficiency, GTK+, when compiled
with the GNU toolchain, has separate internal and external entry
points for exported functions. The internal names, which begin with
IA__, may be seen when debugging a GTK+ program.
* The following functions have been deprecated in GTK+ 2.6:
gdk_pango_context_set_colormap
gtk_cell_renderer_editing_canceled
* The new GtkFileChooser widget emphasizes simplicity and thus does
not provide a navigation entry by default when opening files.
Experienced command line users will likely want to make heavy use of
the location dialog brought up by the Control-L key shortcut.
* The GTK+ libraries use an '_' prefix to indicate private symbols that
must not be used by applications. On some platforms, symbols beginning
with prefixes such as _gtk, _gdk, and _pango will be exported
from the library, on others not. In no case can applications
use these private symbols. In addition to that, GTK+ 2.6 makes several
symbols private which were not in any installed header files and
were never intended to be exported.
* The gdk_pixbuf_xlib library included in the contrib/ directory
and the framebuffer GDK backend included in the gdk/linux-fb directory
of GTK+ are provided on an as-is basis and have not been tested at all.
No guarantees about the degree of workingness or about future
compatibility are provided.
* On Unix, the assumption of GLib and GTK+ by default is that filenames on
the filesystem are encoded in UTF-8 rather than the encoding of the locale;
the GTK+ developers consider that having filenames whose interpretation
depends on the current locale is fundamentally a bad idea.
If you have filenames encoded in the encoding of your locale, then you
may want to set the G_FILENAME_ENCODING environment variable:
G_FILENAME_ENCODING=@locale
export G_FILENAME_ENCODING
(Earlier versions of GLib 2.x required a different environment variable
setting; G_BROKEN_FILENAMES=1 to achieve the same effect; this
is still supported, but G_FILENAME_ENCODING is preferred.)
Best integration of GTK+ 2.6 with the environment is achieved by
using a UTF-8 locale.
On Windows, filenames passed to GTK+ should always be in UTF-8, as
in GLib 2.6. This is different than in previous versions of GTK+
where the system codepage was used. As in GLib, for DLL ABI
stability, applications built against previous versions of GTK+ will
use entry points providing the old semantics.
When compiling against GTK+ 2.6, applications intended to be
portable to Windows must take the UTF-8 file name encoding into
consideration, and use the gstdio wrappers to access files whose
names have been constructed from strings returned from GTK+ or GLib.
How to report bugs
==================
Bugs should be reported to the GNOME bug tracking system.
(http://bugzilla.gnome.org, product gtk+.) You will need to create an
account for yourself.
In the bug report please include:
* Information about your system. For instance:
- What operating system and version
- What version of X
- For Linux, what version of the C library
And anything else you think is relevant.
* How to reproduce the bug.
If you can reproduce it with one of the tests or demos built with GTK+,
such as demos/gtk-demo/gtk-demo, that would be most convenient. Otherwise,
please include a short test program that exhibits the behavior. As a
last resort, you can also provide a pointer to a larger piece of software
that can be downloaded.
* If the bug was a crash, the exact text that was printed out when the
crash occured.
* Further information such as stack traces may be useful, but is not
necessary. If you do send a stack trace, and the error is an X error,
it will be more useful if the stacktrace is produced running the test
program with the --sync command line option.
Patches
=======
Patches should also be submitted to bugzilla.gnome.org. If the patch
fixes an existing bug, add the patch as an attachment to that bug
report.
Otherwise, enter a new bug report that describes the patch, and attach
the patch to that bug report.
Bug reports containing patches should include the PATCH keyword in their
keyword fields. If the patch adds to or changes the GTK+ programming
interface, the API keyword should also be included.
Patches should be in unified diff form. (The -u option to GNU diff.)

View file

@ -27,6 +27,14 @@ Installation
See the file 'INSTALL'
Release notes for 2.18
======================
* gtk_tooltip_set_custom now accept a NULL custom_widget to unset the
old custom_widget. Custom_widget does not get destroyed when the
tooltip goes away.
Release notes for 2.16
======================
@ -69,11 +77,15 @@ Release notes for 2.14
to GTK_SENSITIVITY_ON, so that the button is always sensitive or
GTK_SENSITIVITY_OFF to make it insensitive respectively.
* GtkAdjustment now enforces that values are restricted to the
range [lower, upper - page_size]. This has always been the documented
behaviour, and the recommended practice is to set page_size to 0
when using adjustments for simple scalar values, like in a slider
or spin button.
* In the early 2.14.x releases, GtkAdjustment was changed to enforce
that values are restricted to the range [lower, upper - page_size].
This has always been the documented behaviour, and the recommended
practice is to set page_size to 0 when using adjustments for simple
scalar values, like in a slider or spin button.
Due to the large number of applications that are affected by this
change, the behaviour has been reverted to the old behaviour in
2.14.3, with an explicit warning that this change will be
reintroduced in 2.90.
* gdk-pixbuf will use GIO for mime type detection if possible. For
this to work, shared-mime-info needs to be installed and XDG_DATA_DIRS

View file

@ -11,9 +11,9 @@ 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], [16])
m4_define([gtk_minor_version], [17])
m4_define([gtk_micro_version], [1])
m4_define([gtk_interface_age], [1])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@ -1879,6 +1879,28 @@ else
AM_CONDITIONAL(HAVE_CUPS, false)
fi
# Checks to see if we should compile with PAPI backend for GTK+
#
AC_ARG_ENABLE(papi,
[AC_HELP_STRING([--disable-papi]
[disable papi print backend])],,
[enable_papi=auto])
if test "x$enable_papi" = "xauto"
then
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)
fi
AM_CONDITIONAL(HAVE_PAPI_CUPS, test $have_papi = yes && test "x$CUPS_CONFIG" != "xno")
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
@ -2107,6 +2129,7 @@ modules/printbackends/Makefile
modules/printbackends/cups/Makefile
modules/printbackends/lpr/Makefile
modules/printbackends/file/Makefile
modules/printbackends/papi/Makefile
modules/printbackends/test/Makefile
perf/Makefile
contrib/Makefile

View file

@ -4,3 +4,5 @@ SUBDIRS =
if USE_X11
SUBDIRS += gdk-pixbuf-xlib
endif
-include $(top_srcdir)/git.mk

View file

@ -38,3 +38,5 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gdk-pixbuf-xlib-2.0.pc
EXTRA_DIST += gdk-pixbuf-xlib-2.0.pc.in
-include $(top_srcdir)/git.mk

View file

@ -82,3 +82,5 @@ EXTRA_DIST += \
gnu-keys.png
DISTCLEANFILES = test-inline-pixbufs.h
-include $(top_srcdir)/git.mk

View file

@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.decl
democodedir=$(datadir)/gtk-2.0/demo
## These should be in the order you want them to appear in the
## These should be in the order you want them to appear in the
## demo app, which means alphabetized by demo title, not filename
demos = \
appwindow.c \
@ -23,6 +23,7 @@ demos = \
iconview.c \
iconview_edit.c \
images.c \
links.c \
list_store.c \
menus.c \
panes.c \
@ -96,3 +97,5 @@ IMAGEFILES= alphatest.png \
democode_DATA = $(demos) $(IMAGEFILES) demo.ui
DISTCLEANFILES = demos.h
-include $(top_srcdir)/git.mk

85
demos/gtk-demo/links.c Normal file
View file

@ -0,0 +1,85 @@
/* Links
*
* GtkLabel can show hyperlinks. The default action is to call
* gtk_show_uri() on their URI, but it is possible to override
* this with a custom handler.
*/
#include <gtk/gtk.h>
static void
response_cb (GtkWidget *dialog,
gint response_id,
gpointer data)
{
gtk_widget_destroy (dialog);
}
static gboolean
activate_link (GtkWidget *label,
const gchar *uri,
gpointer data)
{
if (g_strcmp0 (uri, "keynav") == 0)
{
GtkWidget *dialog;
GtkWidget *parent;
parent = gtk_widget_get_toplevel (label);
dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
"The term <i>keynav</i> is a shorthand for "
"keyboard navigation and refers to the process of using "
"a program (exclusively) via keyboard input.");
gtk_window_present (GTK_WINDOW (dialog));
g_signal_connect (dialog, "response", G_CALLBACK (response_cb), NULL);
return TRUE;
}
return FALSE;
}
GtkWidget *
do_links (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *box;
GtkWidget *label;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
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);
label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\""
"title=\"plain text\">text</a> may be marked up\n"
"as hyperlinks, which can be clicked\n"
"or activated via <a href=\"keynav\">keynav</a>");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL);
gtk_container_add (GTK_CONTAINER (window), label);
gtk_widget_show (label);
}
if (!GTK_WIDGET_VISIBLE (window))
{
gtk_widget_show (window);
}
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View file

@ -189,6 +189,7 @@ load_file (const gchar *filename)
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
gtk_text_buffer_apply_tag_by_name (info_buffer, "source", &start, &end);
fclose (file);
}
gboolean

View file

@ -19,3 +19,5 @@ EXTRA_DIST += \
generation.txt \
gtkdocs_fix \
RELEASE-HOWTO
-include $(top_srcdir)/git.mk

View file

@ -9,17 +9,19 @@ dependencies:
Without those packages make distcheck will *not* pass.
0) Blow away your gtk+ directory, check a new version out
0) Go back to a pristine working directory. With git, this works:
1) autogen and build it, make sure to enable docs by specifying
git clean -f -x
1) autogen and build it, make sure to enable docs by specifying
--enable-gtk-doc --enable-man
2) Update NEWS based on the various ChangeLog files; follow the format
2) Update NEWS based on the content of git log; follow the format
of prior entries. This includes finding noteworthy new features,
collecting summaries for all the fixed bugs that are referenced
and collecting all updated translations.
Also collect the names of all contributors that are mentioned.
We don't discriminate between bug reporters, patch writers,
and collecting all updated translations.
Also collect the names of all contributors that are mentioned.
We don't discriminate between bug reporters, patch writers,
committers, etc. Anybody who is mentioned in ChangeLog gets
credits, but only real names, not email addresses or nicknames.
@ -29,14 +31,14 @@ Without those packages make distcheck will *not* pass.
with configure.in.
4) Verify that the version in configure.in has been bumped after the last
release. (Note that this is critical, a slip-up here will cause the
release. (Note that this is critical, a slip-up here will cause the
soname to change).
5) Make sure that make check is happy (If you don't do it here, make distcheck
will also catch it, but it is kind of disheartening to see make distcheck
fail due to an extraneous symbol after watching it build the docs for an
hour...).
Typical problems to expect here (depending on whether this is a devel
will also catch it, but it is kind of disheartening to see make distcheck
fail due to an extraneous symbol after watching it build the docs for an
hour...).
Typical problems to expect here (depending on whether this is a devel
snapshot or a stable release):
* forgotten source files
* new symbols missing from .symbols files
@ -48,57 +50,58 @@ Without those packages make distcheck will *not* pass.
6) If this is a devel release, make sure that the docs for new symbols
are in good shape. Look at the -unused.txt files and add stuff found
there to the corresponding -sections.txt file. Look at the
there to the corresponding -sections.txt file. Look at the
-undocumented.txt files and see if there is anything in there that
should be documented. If it is, this may be due to typos in the doc
comments in the source. Make sure that all new symbols have proper
Since: tags, and that there is an index in the main -docs.sgml for
the next stable version.
comments in the source. Make sure that all new symbols have proper
Since: tags, and that there is an index in the main -docs.sgml for
the next stable version.
7) Add === Released 2.x.y === at the top of all ChangeLog files
7) make distcheck
8) make distcheck
8) Fix broken stuff found by 7), repeat
9) Fix broken stuff found by 8), repeat
9) Commit all changes: git commit -a. You will have a bunch of po file
changes, NEWS and maybe some doc changes too
10) svn commit; you'll have a bunch of po file changes, ChangeLog updates,
and maybe some doc changes too
11) If 10) fails because someone else committed inbetween, curse, svn up,
fix conflicts and go to 8)
12) Now you've got the tarball. Check that the tarball size looks
10) Now you've got the tarball. Check that the tarball size looks
reasonable compared to previous releases. If the size goes down
a lot, likely the docs went missing for some reason. Or the translations.
If the size goes up by a lot, something else may be wrong.
13) Tag the release. The command for doing that looks like
11) Tag the release. The git command for doing that looks like
svn cp svn+ssh://matthiasc@svn.gnome.org/svn/gtk+/branches/gtk-2-12 \
svn+ssh://matthiasc@svn.gnome.org/svn/gtk+/tags/GTK_2_12_10
git tag -m "GTK+ 2.12.10" 2.12.10
14) Bump the version number in configure.in and commit this change
with a ChangeLog entry
12) Push the tagged commit upstream. The git command for doing that is
15) Upload the tarball to master.gnome.org and run install-module to transfer
git push origin refs/tags/2.12.10
13) Bump the version number in configure.in and commit and push this change
14) Upload the tarball to master.gnome.org and run install-module to transfer
it to download.gnome.org. If you don't have an account on master.gnome.org,
find someone who can do it for you. The command for this looks like
scp gtk+-2.12.10.tar.gz matthiasc@master.gnome.org:
ssh matthiasc@master.gnome.org
install-module gtk+-2.12.10.tar.gz
16) Get the bz2 tarball and the .md5sum files back from master.gnome.org
You can probably also create it locally, but I've experienced md5
mismatches when doing so
15) Get the .bz2 tarball and the .md5sum files back from master.gnome.org
You can probably also create it locally, but I've experienced md5
mismatches when doing so.
16) Upload the .gz and .bz2 tarballs and checksums to ftp.gtk.org and put
them in the right directory below /ftp/pub. Pay attention to correct
ownership, and don't forget to update the LATEST file in the directory.
17) Go to the gnome-announce list archives, find the last announce message,
create a new message in the same form, replacing version numbers,
commentary at the top about "what this release is about" and the
Summary of changes.
create a new message in the same form, replacing version numbers,
commentary at the top about "what this release is about" and the
summary of changes.
18) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and
gtk-devel-list. Set reply-to to gnome-hackers.
19) Add a link to the release announcement to www.gtk.org which lives
19) Add a link to the release announcement to www.gtk.org which lives
in the gtk-web cvs module.

View file

@ -38,3 +38,5 @@ dist-hook:
endif
.PHONY: html
-include $(top_srcdir)/git.mk

View file

@ -824,8 +824,8 @@ However, bindings for many other languages are available.</para>
<para>So, after you have installed GTK+ there are a couple of
things that can ease you into developing applications with
it. There is the GTK+ Tutorial <ulink
url="http://www.gtk.org/tutorial/">
http://www.gtk.org/tutorial/</ulink>, which is undergoing
url="http://library.gnome.org/devel/gtk-tutorial/stable/">
http://library.gnome.org/devel/gtk-tutorial/stable/</ulink>, which is undergoing
development. This will introduce you to writing applications
using C.</para>

View file

@ -3,3 +3,6 @@ include $(top_srcdir)/Makefile.decl
SUBDIRS = gdk-pixbuf gdk gtk libgail-util
GITIGNOREFILES = */*.1
-include $(top_srcdir)/git.mk

View file

@ -79,19 +79,21 @@ EXTRA_DIST += version.xml.in \
########################################################################
man_MANS = gdk-pixbuf-csource.1 gdk-pixbuf-query-loaders.1
if ENABLE_MAN
man_MANS = gdk-pixbuf-csource.1 gdk-pixbuf-query-loaders.1
%.1 : %.xml
@XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
endif
BUILT_EXTRA_DIST = $(man_MANS)
endif
dist-hook-local: $(BUILT_EXTRA_DIST)
files='$(BUILT_EXTRA_DIST)'; \
for f in $$files; do \
if test -f $$f; then d=.; else d=$(srcdir); fi; \
cp $$d/$$f $(distdir) || exit 1; done
-include $(top_srcdir)/git.mk

View file

@ -1,138 +0,0 @@
'\" t
.\" Title: gdk-pixbuf-csource
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.74.2 <http://docbook.sf.net/>
.\" Date: 03/02/2009
.\" Manual: [FIXME: manual]
.\" Source: [FIXME: source]
.\" Language: English
.\"
.TH "GDK\-PIXBUF\-CSOURCE" "1" "03/02/2009" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
gdk-pixbuf-csource \- C code generation utility for GdkPixbuf images
.SH "SYNOPSIS"
.HP \w'\fBgdk\-pixbuf\-csource\fR\ 'u
\fBgdk\-pixbuf\-csource\fR [options] [image]
.HP \w'\fBgdk\-pixbuf\-csource\fR\ 'u
\fBgdk\-pixbuf\-csource\fR [options] \-\-build\-list [[name]\ [image]...]
.SH "DESCRIPTION"
.PP
\fBgdk\-pixbuf\-csource\fR
is a small utility that generates C code containing images, useful for compiling images directly into programs\&.
.SH "INVOCATION"
.PP
\fBgdk\-pixbuf\-csource\fR
either takes as input one image file name to generate code for, or, using the
\fB\-\-build\-list\fR
option, a list of (\fIname\fR,
\fIimage\fR) pairs to generate code for a list of images into named variables\&.
.SS "Options"
.PP
\fB\-\-stream\fR
.RS 4
Generate pixbuf data stream (a single string containing a serialized
GdkPixdata
structure in network byte order)\&.
.RE
.PP
\fB\-\-struct\fR
.RS 4
Generate GdkPixdata structure (needs the
GdkPixdata
structure definition from
gdk\-pixdata\&.h)\&.
.RE
.PP
\fB\-\-macros\fR
.RS 4
Generate *_ROWSTRIDE, *_WIDTH, *_HEIGHT, *_BYTES_PER_PIXEL and *_RLE_PIXEL_DATA or *_PIXEL_DATA macro definitions for the image\&.
.RE
.PP
\fB\-\-rle\fR
.RS 4
Enables run\-length encoding for the generated pixel data (default)\&.
.RE
.PP
\fB\-\-raw\fR
.RS 4
Disables run\-length encoding for the generated pixel data\&.
.RE
.PP
\fB\-\-extern\fR
.RS 4
Generate extern symbols\&.
.RE
.PP
\fB\-\-static\fR
.RS 4
Generate static symbols (default)\&.
.RE
.PP
\fB\-\-decoder\fR
.RS 4
Provide a *_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp) macro definition to decode run\-length encoded image data\&.
.RE
.PP
\fB\-\-name=identifier\fR
.RS 4
Specifies the identifier name (prefix) for the generated variables or macros (useful only if
\fB\-\-build\-list\fR
was not specified)\&.
.RE
.PP
\fB\-\-build\-list\fR
.RS 4
Enables (\fIname\fR,
\fIimage\fR) pair parsing mode\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print brief help and exit\&.
.RE
.PP
\fB\-v\fR, \fB\-\-version\fR
.RS 4
Print version and exit\&.
.RE
.PP
\fB\-\-g\-fatal\-warnings\fR
.RS 4
Make warnings fatal (causes the program to abort)\&.
.RE
.SH "SEE ALSO"
.PP
The
GdkPixbuf
documentation, shipped with the Gtk+ distribution, available from
\m[blue]\fBwww\&.gtk\&.org\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "BUGS"
.PP
The runlength encoder gets out of sync with the pixel boundaries, since it includes the rowstride padding in the encoded stream\&. Furthermore, it generates pixbufs with suboptimal rowstride in some cases\&.
.SH "AUTHOR"
.PP
\fBgdk\-pixbuf\-csource\fR
was written by Tim Janik
timj@gtk\&.org\&.
.PP
This manual page was provided by Tim Janik
timj@gtk\&.org\&.
.SH "NOTES"
.IP " 1." 4
www.gtk.org
.RS 4
\%http://www.gtk.org
.RE

View file

@ -1,50 +0,0 @@
'\" t
.\" Title: gdk-pixbuf-query-loaders
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.74.2 <http://docbook.sf.net/>
.\" Date: 03/13/2009
.\" Manual: [FIXME: manual]
.\" Source: [FIXME: source]
.\" Language: English
.\"
.TH "GDK\-PIXBUF\-QUERY\-" "1" "03/13/2009" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
gdk-pixbuf-query-loaders \- GdkPixbuf loader registration utility
.SH "SYNOPSIS"
.HP \w'\fBgdk\-pixbuf\-query\-loaders\fR\ 'u
\fBgdk\-pixbuf\-query\-loaders\fR [module...]
.SH "DESCRIPTION"
.PP
\fBgdk\-pixbuf\-query\-loaders\fR
collects information about loadable modules for
gdk\-pixbuf
and writes it to
stdout\&.
.PP
If called without arguments, it looks for modules in the
gdk\-pixbuf
loader directory\&.
.PP
If called with arguments, it looks for the specified modules\&. The arguments may be absolute or relative paths\&.
.SH "ENVIRONMENT"
.PP
The environment variable
\fBGDK_PIXBUF_MODULEDIR\fR
can be used to specify a different loader directory\&. The default
gdk\-pixbuf
loader directory is
\fIlibdir\fR/gtk\-2\&.0/\fIversion\fR/loaders\&.
.SH "BUGS"
.PP
None known yet\&.

View file

@ -136,6 +136,8 @@ gdk_pixbuf_animation_iter_get_pixbuf
GdkPixbufSimpleAnim
gdk_pixbuf_simple_anim_new
gdk_pixbuf_simple_anim_add_frame
gdk_pixbuf_simple_anim_set_loop
gdk_pixbuf_simple_anim_get_loop
<SUBSECTION Standard>
GDK_PIXBUF_ANIMATION

View file

@ -172,3 +172,21 @@ An opaque struct representing a simple animation.
@pixbuf:
<!-- ##### FUNCTION gdk_pixbuf_simple_anim_set_loop ##### -->
<para>
</para>
@animation:
@loop:
<!-- ##### FUNCTION gdk_pixbuf_simple_anim_get_loop ##### -->
<para>
</para>
@animation:
@Returns:

View file

@ -152,3 +152,5 @@ include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in
-include $(top_srcdir)/git.mk

View file

@ -129,17 +129,18 @@ content_files = \
drawing-model.xml \
glossary.xml \
migrating-checklist.sgml \
migrating-GtkAboutDialog.sgml \
migrating-GtkAction.sgml \
migrating-GtkAssistant.sgml \
migrating-GtkBuilder.sgml \
migrating-GtkColorButton.sgml \
migrating-GtkComboBox.sgml \
migrating-GtkEntry-icons.sgml \
migrating-GtkFileChooser.sgml \
migrating-GtkIconView.sgml \
migrating-GtkAboutDialog.sgml \
migrating-GtkColorButton.sgml \
migrating-GtkAssistant.sgml \
migrating-GtkRecentChooser.sgml \
migrating-GtkLabel-links.sgml \
migrating-GtkLinkButton.sgml \
migrating-GtkBuilder.sgml \
migrating-GtkRecentChooser.sgml \
migrating-GtkTooltip.sgml \
objects_grouped.sgml \
osx.sgml \
@ -361,19 +362,21 @@ EXTRA_DIST += version.xml.in
########################################################################
man_MANS = gtk-query-immodules-2.0.1 gtk-update-icon-cache.1 gtk-builder-convert.1
if ENABLE_MAN
man_MANS = gtk-query-immodules-2.0.1 gtk-update-icon-cache.1 gtk-builder-convert.1
%.1 : %.xml
@XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
endif
BUILT_EXTRA_DIST = $(man_MANS)
endif
dist-hook-local: $(BUILT_EXTRA_DIST)
files='$(BUILT_EXTRA_DIST)'; \
for f in $$files; do \
if test -f $$f; then d=.; else d=$(srcdir); fi; \
cp $$d/$$f $(distdir) || exit 1; done
-include $(top_srcdir)/git.mk

View file

@ -1,51 +0,0 @@
'\" t
.\" Title: gtk-builder-convert
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.74.2 <http://docbook.sf.net/>
.\" Date: 03/13/2009
.\" Manual: [FIXME: manual]
.\" Source: [FIXME: source]
.\" Language: English
.\"
.TH "GTK\-BUILDER\-CONVER" "1" "03/13/2009" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
gtk-builder-convert \- Glade file conversion utility
.SH "SYNOPSIS"
.HP \w'\fBgtk\-builder\-convert\fR\ 'u
\fBgtk\-builder\-convert\fR [\-\-skip\-windows] [\-\-root\ \fIname\fR] {input} {output}
.SH "DESCRIPTION"
.PP
\fBgtk\-builder\-convert\fR
converts glade files into XML files which can be loaded with GtkBuilder\&.
.PP
It expects the name of a glade file as the first argument, and writes its output the file specified as the second argument\&.
.SH "OPTIONS"
.PP
\-\-skip\-windows, \-w
.RS 4
Convert everything but GtkWindow subclasses\&.
.RE
.PP
\-\-root, \-r
.RS 4
Convert only the widget named
\fIname\fR
and its children\&.
.RE
.SH "BUGS"
.PP
Toolbars are not handled\&.
.PP
Support for accessibility is not yet implemented\&.
.PP
The script requires a python interpreter to run\&.

View file

@ -432,6 +432,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/migrating-GtkBuilder.sgml" />
<xi:include href="xml/migrating-GtkTooltip.sgml" />
<xi:include href="xml/migrating-GtkEntry-icons.sgml" />
<xi:include href="xml/migrating-GtkLabel-links.sgml" />
</part>
<part>
@ -483,4 +484,8 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<title>Index of new symbols in 2.16</title>
<xi:include href="xml/api-index-2.16.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-2-18" role="2.18">
<title>Index of new symbols in 2.18</title>
<xi:include href="xml/api-index-2.18.xml"><xi:fallback /></xi:include>
</index>
</book>

View file

@ -1,43 +0,0 @@
'\" t
.\" Title: gtk-query-immodules-2.0
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.74.2 <http://docbook.sf.net/>
.\" Date: 03/13/2009
.\" Manual: [FIXME: manual]
.\" Source: [FIXME: source]
.\" Language: English
.\"
.TH "GTK\-QUERY\-IMMODULE" "1" "03/13/2009" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
gtk-query-immodules-2.0 \- Input method module registration utility
.SH "SYNOPSIS"
.HP \w'\fBgtk\-query\-immodules\-2\&.0\fR\ 'u
\fBgtk\-query\-immodules\-2\&.0\fR [module...]
.SH "DESCRIPTION"
.PP
\fBgtk\-query\-immodules\-2\&.0\fR
collects information about loadable input method modules for GTK+ and writes it to
stdout\&.
.PP
If called without arguments, it looks for modules in the GTK+ input method module path\&.
.PP
If called with arguments, it looks for the specified modules\&. The arguments may be absolute or relative paths\&.
.SH "ENVIRONMENT"
.PP
The environment variable
\fBGTK_PATH\fR
can be used to prepend directories to the input method module path\&.
.SH "BUGS"
.PP
None known yet\&.

View file

@ -2274,6 +2274,7 @@ gtk_label_set_use_markup
gtk_label_set_use_underline
gtk_label_set_single_line_mode
gtk_label_set_angle
gtk_label_get_current_uri
<SUBSECTION Standard>
GTK_LABEL
GTK_IS_LABEL

View file

@ -1,51 +0,0 @@
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "GTK\-UPDATE\-ICON\-CACH" "1" "11/07/2005" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
gtk\-update\-icon\-cache \- Icon theme caching utility
.SH "SYNOPSIS"
.HP 22
\fBgtk\-update\-icon\-cache\fR [\-\-force] [\-\-ignore\-theme\-index] [\-\-index\-only] [\-\-source\ [name]] [\-\-quiet] {iconpath}
.SH "DESCRIPTION"
.PP
\fBgtk\-update\-icon\-cache\fR
creates mmap()able cache files for icon themes.
.PP
It expects to be given the path to a icon theme directory containing an
\fIindex.theme\fR, e.g.
\fI/usr/share/icons/hicolor\fR, and writes a
\fIicon\-theme.cache\fR
containing cached information about the icons in the directory tree below the given directory.
.PP
GTK+ can use the cache files created by
\fBgtk\-update\-icon\-cache\fR
to avoid a lot of system call and disk seek overhead when the application starts. Since the format of the cache files allows them to be mmap()ed shared between multiple applications, the overall memory consumption is reduced as well.
.SH "OPTIONS"
.TP
\-\-force, \-f
Overwrite an existing cache file even if it appears to be uptodate.
.TP
\-\-ignore\-theme\-index, \-t
Don't check for the existence of 'index.theme' in the icon theme directory. Without this option,
\fBgtk\-update\-icon\-cache\fR
refuses to create an icon cache in a directory which does not appear to be the toplevel directory of an icon theme.
.TP
\-\-index\-only, \-i
Don't include image data in the cache.
.TP
\-\-source, \-c
Output a C header file declaring a constant
\fIname\fR
with the contents of the icon cache.
.TP
\-\-quiet, \-q
Turn off verbose output.
.SH "BUGS"
.PP
None known yet.

View file

@ -72,6 +72,7 @@ gtk_hruler_get_type
gtk_hscale_get_type
gtk_hscrollbar_get_type
gtk_hseparator_get_type
gtk_hsv_get_type
gtk_icon_factory_get_type
gtk_icon_theme_get_type
gtk_icon_view_get_type

View file

@ -16,14 +16,65 @@
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
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
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
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.
</para>
<table pgwide="1" frame="topbot">
<title>Step-by-step instructions for porting code from libglade to GtkBuilder</title>
<tgroup cols="2" colsep="0" rowsep="0">
<thead>
<row><entry>libglade</entry><entry>GtkBuilder</entry></row>
</thead>
<tbody>
<row>
<entry><![CDATA[#include <glade/glade.h>]]></entry>
<entry>not needed</entry>
</row>
<row>
<entry><screen>GladeXML*</screen></entry>
<entry><screen>GtkBuilder*</screen></entry>
</row>
<row>
<entry><screen>glade_xml_new (FILE, "first_widget", NULL)</screen></entry>
<entry>
<screen>
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_error_free (error);
}
</screen>
</entry>
</row>
<row>
<entry><screen>glade_xml_get_widget (gxml, “widget_name”)</screen></entry>
<entry><screen>GTK_WIDGET (gtk_builder_get_object (builder, “widget_name”))</screen></entry>
</row>
<row>
<entry><screen>glade_get_widget_name (widget)</screen></entry>
<entry><screen>gtk_widget_get_name (widget)</screen></entry>
</row>
<row>
<entry><screen>glade_xml_get_widget_prefix (gxml, “prefix”)</screen></entry>
<entry>can be emulated by <literal>gtk_builder_get_objects (builder)</literal> together with manual filtering. It returns a GSList* instead of a GList* though.</entry>
</row>
</tbody>
</tgroup>
</table>
<para>
While GtkBuilder strives to be a complete replacement for
libglade, there are a number of areas where it is currently
@ -32,21 +83,23 @@
<listitem><para>
GtkBuilder supports context information in translatable
properties in a slightly different way than libglade.
Intltool does not yet support this; see
<ulink url="http://bugzilla.gnome.org/show_bug.cgi?id=454894">bug
454894</ulink> for the current status of intltool support for
GtkBuilder files. Thankfully, context in translations is a
rarely used feature, and if you are not using it, intltools
properties in a slightly different way than libglade.
Intltool does not yet support this; see
<ulink url="http://bugzilla.gnome.org/show_bug.cgi?id=454894">bug
454894</ulink> for the current status of intltool support for
GtkBuilder files. Thankfully, context in translations is a
rarely used feature, and if you are not using it, intltools
glade format support works just fine for GtkBuilder files.
</para></listitem>
<listitem><para>
While libglade can often tolerate multiple widgets having the
same id in a glade file, GtkBuilder will not accept duplicate
object ids. Both <application>gtk-builder-convert</application>
and the GtkBuilder parser emit warnings when they see
duplicate ids.
</para></listitem>
</itemizedlist>
</para>
<para>
More details about migrating from libglade to GtkBuilder will
appear here over time...
</para>
</chapter>

View file

@ -0,0 +1,24 @@
<?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-label-links">
<title>Migrating from SexyUrlLabel to GtkLabel</title>
<para>
GTK+ 2.18 supports showing links inside a #GtkLabel, similar to
SexyUrlLabel. Porting from SexyUrlLabel to GtkLabel is relatively
straightforward. GtkLabel accepts links in the markup using the
same HTML <tag>a</tag> notation that SexyUrlLabel uses. In addition
to the href attribute, GtkLabel accepts a title attribute that
is displayed as a tooltip on the link. Instead of
sexy_url_label_set_markup(), just call gtk_label_set_markup().
</para>
<para>
One difference between the two APIs is that the ::url-activated signal
from SexyUrlLabel has been replaced by the #GtkLabel::activate-link
signal. The need for connecting to this signal is greatly reduced,
since GtkLabel has a default handler that calls gtk_show_uri().
</para>
</chapter>

View file

@ -0,0 +1,108 @@
<!-- ##### SECTION Title ##### -->
Filesystem utilities
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkMountOperation ##### -->
<para>
</para>
<!-- ##### ARG GtkMountOperation:is-showing ##### -->
<para>
</para>
<!-- ##### ARG GtkMountOperation:parent ##### -->
<para>
</para>
<!-- ##### ARG GtkMountOperation:screen ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_mount_operation_new ##### -->
<para>
</para>
@parent:
@Returns:
<!-- ##### FUNCTION gtk_mount_operation_is_showing ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_mount_operation_set_parent ##### -->
<para>
</para>
@op:
@parent:
<!-- ##### FUNCTION gtk_mount_operation_get_parent ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_mount_operation_set_screen ##### -->
<para>
</para>
@op:
@screen:
<!-- ##### FUNCTION gtk_mount_operation_get_screen ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_show_uri ##### -->
<para>
</para>
@screen:
@uri:
@timestamp:
@error:
@Returns:

View file

@ -24,16 +24,20 @@ 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">
When setting the website and email hooks for the #GtkAboutDialog widget,
you should remember that the order is important: you should set the hook
functions before setting the website and email URL properties, like this:
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>
Otherwise the GtkAboutDialog widget will not display the website and the
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>

View file

@ -0,0 +1,100 @@
<!-- ##### 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

@ -10,6 +10,16 @@ A #GtkAssistant is a widget used to represent a generally complex
operation splitted in several steps, guiding the user through its pages
and controlling the page flow to collect the necessary data.
</para>
<refsect2 id="GtkAssistant-BUILDER-UI"><title>GtkAssistant as GtkBuildable</title>
<para>
The GtkAssistant implementation of the GtkBuildable interface exposes the
@action_area as internal children with the name "action_area".
</para>
<para>
To add pages to an assistant in GtkBuilder, simply add it as a &lt;child&gt;
to the GtkAssistant object, and set its child properties as necessary.
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>

View file

@ -7,46 +7,46 @@ Build an interface from an XML UI definition
<!-- ##### SECTION Long_Description ##### -->
<para>
A GtkBuilder is an auxiliary object that reads textual descriptions
of a user interface and instantiates the described objects. To pass a
description to a GtkBuilder, call gtk_builder_add_from_file() or
of a user interface and instantiates the described objects. To pass a
description to a GtkBuilder, call gtk_builder_add_from_file() or
gtk_builder_add_from_string(). These functions can be called multiple
times; the builder merges the content of all descriptions.
times; the builder merges the content of all descriptions.
</para>
<para>
A GtkBuilder holds a reference to all objects that it has constructed
and drops these references when it is finalized. This finalization can
cause the destruction of non-widget objects or widgets which are not
contained in a toplevel window. For toplevel windows constructed by a
builder, it is the responsibility of the user to call gtk_widget_destroy()
and drops these references when it is finalized. This finalization can
cause the destruction of non-widget objects or widgets which are not
contained in a toplevel window. For toplevel windows constructed by a
builder, it is the responsibility of the user to call gtk_widget_destroy()
to get rid of them and all the widgets they contain.
</para>
<para>
The functions gtk_builder_get_object() and gtk_builder_get_objects()
can be used to access the widgets in the interface by the names assigned
can be used to access the widgets in the interface by the names assigned
to them inside the UI description. Toplevel windows returned by these
functions will stay around until the user explicitly destroys them
with gtk_widget_destroy(). Other widgets will either be part of a
with gtk_widget_destroy(). Other widgets will either be part of a
larger hierarchy constructed by the builder (in which case you should
not have to worry about their lifecycle), or without a parent, in which
case they have to be added to some container to make use of them.
not have to worry about their lifecycle), or without a parent, in which
case they have to be added to some container to make use of them.
Non-widget objects need to be reffed with g_object_ref() to keep them
beyond the lifespan of the builder.
</para>
<para>
The function gtk_builder_connect_signals() and variants thereof can be
used to connect handlers to the named signals in the description.
The function gtk_builder_connect_signals() and variants thereof can be
used to connect handlers to the named signals in the description.
</para>
<refsect2 id="BUILDER-UI"><title>GtkBuilder UI Definitions</title>
<para>
GtkBuilder parses textual descriptions of user interfaces which
are specified in an XML format which can be roughly described
by the DTD below. We refer to these descriptions as
GtkBuilder parses textual descriptions of user interfaces which
are specified in an XML format which can be roughly described
by the DTD below. We refer to these descriptions as
<firstterm>GtkBuilder UI definitions</firstterm> or just
<firstterm>UI definitions</firstterm> if the context is clear.
Do not confuse GtkBuilder UI Definitions with
<link linkend="XML-UI">GtkUIManager UI Definitions</link>,
which are more limited in scope.
Do not confuse GtkBuilder UI Definitions with
<link linkend="XML-UI">GtkUIManager UI Definitions</link>,
which are more limited in scope.
</para>
<para>
<programlisting><![CDATA[
@ -65,7 +65,7 @@ which are more limited in scope.
<!ATTLIST requires lib #REQUIRED
version #REQUIRED >
<!ATTLIST property name #REQUIRED
translatable #IMPLIED
translatable #IMPLIED
comments #IMPLIED
context #IMPLIED >
<!ATTLIST signal name #REQUIRED
@ -93,7 +93,7 @@ or columns in a tree model). A &lt;child&gt; element contains
an &lt;object&gt; element which describes the child object.
The target toolkit version(s) are described by &lt;requires&gt;
elements, the "lib" attribute specifies the widget library in
question (currently the only supported value is "gtk+") and the "version"
question (currently the only supported value is "gtk+") and the "version"
attribute specifies the target version in the form "&lt;major&gt;.&lt;minor&gt;".
The builder will error out if the version requirements are not met.
</para>
@ -101,28 +101,28 @@ The builder will error out if the version requirements are not met.
Typically, the specific kind of object represented by an
&lt;object&gt; element is specified by the "class" attribute.
If the type has not been loaded yet, GTK+ tries to find the
<function>_get_type()</function> from the class name by applying
<function>_get_type()</function> from the class name by applying
heuristics. This works in most cases, but if necessary, it is
possible to specify the name of the <function>_get_type()</function>
explictly with the "type-func" attribute. As a special case,
possible to specify the name of the <function>_get_type()</function>
explictly with the "type-func" attribute. As a special case,
GtkBuilder allows to use an object that has been constructed
by a #GtkUIManager in another part of the UI definition by
specifying the id of the #GtkUIManager in the "constructor"
attribute and the name of the object in the "id" attribute.
</para>
<para>
Objects must be given a name with the "id" attribute, which
allows the application to retrieve them from the builder with
gtk_builder_get_object(). An id is also necessary to use the
Objects must be given a name with the "id" attribute, which
allows the application to retrieve them from the builder with
gtk_builder_get_object(). An id is also necessary to use the
object as property value in other parts of the UI definition.
</para>
<para>
Setting properties of objects is pretty straightforward with
the &lt;property&gt; element: the "name" attribute specifies
the name of the property, and the content of the element
specifies the value. If the "translatable" attribute is
the name of the property, and the content of the element
specifies the value. If the "translatable" attribute is
set to a true value, GTK+ uses gettext() (or dgettext() if
the builder has a translation domain set) to find a translation
the builder has a translation domain set) to find a translation
for the value. This happens before the value is parsed, so
it can be used for properties of any type, but it is probably
most useful for string properties. It is also possible to
@ -134,16 +134,16 @@ GtkBuilder can parse textual representations for the most
common property types: characters, strings, integers, floating-point
numbers, booleans (strings like "TRUE", "t", "yes", "y", "1" are
interpreted as %TRUE, strings like "FALSE, "f", "no", "n", "0" are
interpreted as %FALSE), enumerations (can be specified by their
name, nick or integer value), flags (can be specified by their name,
nick, integer value, optionally combined with "|", e.g.
"GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by
gdk_color_parse()). Objects can be referred to by their name.
interpreted as %FALSE), enumerations (can be specified by their
name, nick or integer value), flags (can be specified by their name,
nick, integer value, optionally combined with "|", e.g.
"GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by
gdk_color_parse()). Objects can be referred to by their name.
Pixbufs can be specified as a filename of an image file to load.
In general, GtkBuilder allows forward references to objects &mdash;
In general, GtkBuilder allows forward references to objects &mdash;
an object doesn't have to constructed before it can be referred to.
The exception to this rule is that an object has to be constructed
before it can be used as the value of a construct-only property.
before it can be used as the value of a construct-only property.
</para>
<para>
Signal handlers are set up with the &lt;signal&gt; element.
@ -152,25 +152,25 @@ The "name" attribute specifies the name of the signal, and the
By default, GTK+ tries to find the handler using g_module_symbol(),
but this can be changed by passing a custom #GtkBuilderConnectFunc
to gtk_builder_connect_signals_full(). The remaining attributes,
"after", "swapped" and "object", have the same meaning as the
"after", "swapped" and "object", have the same meaning as the
corresponding parameters of the g_signal_connect_object() or
g_signal_connect_data() functions. A "last_modification_time" attribute
is also allowed, but it does not have a meaning to the builder.
</para>
<para>
Sometimes it is necessary to refer to widgets which have implicitly
been constructed by GTK+ as part of a composite widget, to set
properties on them or to add further children (e.g. the @vbox
been constructed by GTK+ as part of a composite widget, to set
properties on them or to add further children (e.g. the @vbox
of a #GtkDialog). This can be achieved by setting the "internal-child"
propery of the &lt;child&gt; element to a true value. Note that
GtkBuilder still requires an &lt;object&gt; element for the internal
child, even if it has already been constructed.
</para>
<para>
A number of widgets have different places where a child can be
A number of widgets have different places where a child can be
added (e.g. tabs vs. page content in notebooks). This can be reflected
in a UI definition by specifying the "type" attribute on a &lt;child&gt;
The possible values for the "type" attribute are described in
The possible values for the "type" attribute are described in
the sections describing the widget-specific portions of UI definitions.
</para>
<example>
@ -205,11 +205,11 @@ their own XML DTD fragments for filling in the ANY placeholders
in the DTD above. Note that a custom element in a &lt;child&gt;
element gets parsed by the custom tag handler of the parent
object, while a custom element in an &lt;object&gt; element
gets parsed by the custom tag handler of the object.
gets parsed by the custom tag handler of the object.
</para>
<para>
These XML fragments are explained in the documentation of the
respective objects, see
respective objects, see
<link linkend="GtkWidget-BUILDER-UI">GtkWidget</link>,
<link linkend="GtkLabel-BUILDER-UI">GtkLabel</link>,
<link linkend="GtkWindow-BUILDER-UI">GtkWindow</link>,
@ -228,7 +228,9 @@ respective objects, see
<link linkend="GtkTreeView-BUILDER-UI">GtkTreeView</link>,
<link linkend="GtkUIManager-BUILDER-UI">GtkUIManager</link>,
<link linkend="GtkActionGroup-BUILDER-UI">GtkActionGroup</link>.
<link linkend="GtkMenuItem-BUILDER-UI">GtkMenuItem</link>.
<link linkend="GtkMenuItem-BUILDER-UI">GtkMenuItem</link>,
<link linkend="GtkAssistant-BUILDER-UI">GtkAssistant</link>,
<link linkend="GtkScale-BUILDER-UI">GtkScale</link>.
</para>
</refsect2>
@ -285,6 +287,7 @@ using #GtkBuilder.
some attribute value.
@GTK_BUILDER_ERROR_VERSION_MISMATCH: The input file requires a newer version
of GTK+.
@GTK_BUILDER_ERROR_DUPLICATE_ID: An object id occurred twice.
<!-- ##### FUNCTION gtk_builder_new ##### -->
<para>

View file

@ -378,6 +378,11 @@ The #GtkEntry-struct struct contains only private data.
</para>
<!-- ##### ARG GtkEntry:invisible-char ##### -->
<para>
</para>
<!-- ##### ARG GtkEntry:progress-border ##### -->
<para>

View file

@ -433,12 +433,12 @@ other, rather than vertically stacked
<!-- ##### ENUM GtkUpdateType ##### -->
<para>
Used by #GtkRange to control the policy for notifying value changes.
</para>
@GTK_UPDATE_CONTINUOUS:
@GTK_UPDATE_DISCONTINUOUS:
@GTK_UPDATE_DELAYED:
@GTK_UPDATE_CONTINUOUS: Notify updates whenever the value changed
@GTK_UPDATE_DISCONTINUOUS: Notify updates when the mouse button has been released
@GTK_UPDATE_DELAYED: Space out updates with a small timeout
<!-- ##### ENUM GtkVisibility ##### -->
<para>

View file

@ -35,7 +35,21 @@ saturation.
</para>
@parent_instance:
<!-- ##### SIGNAL GtkHSV::changed ##### -->
<para>
</para>
@hsv: the object which received the signal.
<!-- ##### SIGNAL GtkHSV::move ##### -->
<para>
</para>
@hsv: the object which received the signal.
@arg1:
<!-- ##### FUNCTION gtk_hsv_new ##### -->
<para>

View file

@ -0,0 +1,212 @@
<!-- ##### SECTION Title ##### -->
GtkIMContext
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkIMContext ##### -->
<para>
</para>
<!-- ##### SIGNAL GtkIMContext::commit ##### -->
<para>
</para>
@imcontext: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GtkIMContext::delete-surrounding ##### -->
<para>
</para>
@imcontext: the object which received the signal.
@arg1:
@arg2:
@Returns:
<!-- ##### SIGNAL GtkIMContext::preedit-changed ##### -->
<para>
</para>
@imcontext: the object which received the signal.
<!-- ##### SIGNAL GtkIMContext::preedit-end ##### -->
<para>
</para>
@imcontext: the object which received the signal.
<!-- ##### SIGNAL GtkIMContext::preedit-start ##### -->
<para>
</para>
@imcontext: the object which received the signal.
<!-- ##### SIGNAL GtkIMContext::retrieve-surrounding ##### -->
<para>
</para>
@imcontext: the object which received the signal.
@Returns:
<!-- ##### STRUCT GtkIMContextClass ##### -->
<para>
</para>
@preedit_start:
@preedit_end:
@preedit_changed:
@commit:
@retrieve_surrounding:
@delete_surrounding:
@set_client_window:
@get_preedit_string:
@filter_keypress:
@focus_in:
@focus_out:
@reset:
@set_cursor_location:
@set_use_preedit:
@set_surrounding:
@get_surrounding:
<!-- ##### STRUCT GtkIMContextInfo ##### -->
<para>
</para>
@context_id:
@context_name:
@domain:
@domain_dirname:
@default_locales:
<!-- ##### FUNCTION gtk_im_context_set_client_window ##### -->
<para>
</para>
@context:
@window:
<!-- ##### FUNCTION gtk_im_context_get_preedit_string ##### -->
<para>
</para>
@context:
@str:
@attrs:
@cursor_pos:
<!-- ##### FUNCTION gtk_im_context_filter_keypress ##### -->
<para>
</para>
@context:
@event:
@Returns:
<!-- ##### FUNCTION gtk_im_context_focus_in ##### -->
<para>
</para>
@context:
<!-- ##### FUNCTION gtk_im_context_focus_out ##### -->
<para>
</para>
@context:
<!-- ##### FUNCTION gtk_im_context_reset ##### -->
<para>
</para>
@context:
<!-- ##### FUNCTION gtk_im_context_set_cursor_location ##### -->
<para>
</para>
@context:
@area:
<!-- ##### FUNCTION gtk_im_context_set_use_preedit ##### -->
<para>
</para>
@context:
@use_preedit:
<!-- ##### FUNCTION gtk_im_context_set_surrounding ##### -->
<para>
</para>
@context:
@text:
@len:
@cursor_index:
<!-- ##### FUNCTION gtk_im_context_get_surrounding ##### -->
<para>
</para>
@context:
@text:
@cursor_index:
@Returns:
<!-- ##### FUNCTION gtk_im_context_delete_surrounding ##### -->
<para>
</para>
@context:
@offset:
@n_chars:
@Returns:

View file

@ -162,6 +162,24 @@ aligns in its available space, see gtk_misc_set_alignment().
</refsect2>
<refsect2>
<title>Links</title>
<para>
Since 2.18, GTK+ supports markup for clickable hyperlinks in addition
to regular Pango markup. The markup for links is borrowed from HTML, using the
<tag>a</tag> with href and title attributes. GTK+ renders links similar to the
way they appear in web browsers, with colored, underlined text. The title
attribute is displayed as a tooltip on the link. An example looks like this:
<informalexample><programlisting>
gtk_label_set_markup (label, "Go to the &lt;a href=\"http://www.gtk.org\" title=\"&amp;lt;i&amp;gt;Our&amp;/i&amp;gt; website\"&gt;GTK+ website&lt;/a&gt; for more...");
</programlisting></informalexample>
It is possible to implement custom handling for links and their tooltips with
the #GtkLabel::activate-link signal and the gtk_label_get_current_uri() function.
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>

View file

@ -178,6 +178,16 @@ Printing support was added in GTK+ 2.10.
@printoperation: the object which received the signal.
<!-- ##### SIGNAL GtkPrintOperation::update-custom-widget ##### -->
<para>
</para>
@printoperation: the object which received the signal.
@widget:
@arg1:
@arg2:
<!-- ##### ARG GtkPrintOperation:allow-async ##### -->
<para>

View file

@ -7,18 +7,29 @@ Base class for GtkHScale and GtkVScale
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GtkScale is a slider control used to select a numeric value.
To use it, you'll probably want to investigate the methods on
To use it, you'll probably want to investigate the methods on
its base class, #GtkRange, in addition to the methods for #GtkScale itself.
To set the value of a scale, you would normally use gtk_range_set_value().
To detect changes to the value, you would normally use the "value_changed"
To set the value of a scale, you would normally use gtk_range_set_value().
To detect changes to the value, you would normally use the "value_changed"
signal.
</para>
<para>
The #GtkScale widget is an abstract class, used only for deriving the
subclasses #GtkHScale and #GtkVScale. To create a scale widget,
subclasses #GtkHScale and #GtkVScale. To create a scale widget,
call gtk_hscale_new_with_range() or gtk_vscale_new_with_range().
</para>
<refsect2 id="GtkScale-BUILDER-UI"><title>GtkScale as GtkBuildable</title>
<para>
GtkScale supports a custom &lt;marks&gt; element, which
can contain multiple &lt;mark&gt; elements. The "value" and "position"
attributes have the same meaning as gtk_scale_add_mark() parameters of the
same name. If the element is not empty, its content is taken as the markup
to show at the mark. It can be translated with the usual "translatable and
"context" attributes.
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>

View file

@ -0,0 +1,82 @@
<!-- ##### 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

@ -49,7 +49,7 @@ internal child "accessible" of a <structname>GtkWidget</structname>.
</object>
<object class="GtkButton" id="button1">
<accessibility>
<action action_name="click" description="Click the button."/>
<action action_name="click" translatable="yes">Click the button.</action>
<relation target="label1" type="labelled-by"/>
</accessibility>
<child internal-child="accessible">

View file

@ -32,3 +32,5 @@ content_files =
HTML_IMAGES =
include $(top_srcdir)/gtk-doc.make
-include $(top_srcdir)/git.mk

View file

@ -40,3 +40,5 @@ clean-local:
*) rm -f $$file ;; \
esac ; \
done
-include $(top_srcdir)/git.mk

View file

@ -72,3 +72,5 @@ dist-hook:
echo "***"
endif
-include $(top_srcdir)/git.mk

View file

@ -190,11 +190,11 @@ gtk_dial_set_adjustment (GtkDial *dial,
dial->adjustment = adjustment;
g_object_ref (GTK_OBJECT (dial->adjustment));
g_signal_connect (GTK_OBJECT (adjustment), "changed",
GTK_SIGNAL_FUNC (gtk_dial_adjustment_changed),
g_signal_connect (G_OBJECT (adjustment), "changed",
G_CALLBACK (gtk_dial_adjustment_changed),
(gpointer) dial);
g_signal_connect (GTK_OBJECT (adjustment), "value_changed",
GTK_SIGNAL_FUNC (gtk_dial_adjustment_value_changed),
g_signal_connect (G_OBJECT (adjustment), "value_changed",
G_CALLBACK (gtk_dial_adjustment_value_changed),
(gpointer) dial);
dial->old_value = adjustment->value;
@ -333,6 +333,8 @@ gtk_dial_expose( GtkWidget *widget,
widget->style->bg_gc[GTK_STATE_NORMAL];
blankstyle->black_gc =
widget->style->bg_gc[GTK_STATE_NORMAL];
blankstyle->depth =
gdk_drawable_get_depth( GDK_DRAWABLE (widget->window));
gtk_paint_polygon (blankstyle,
widget->window,

View file

@ -718,3 +718,5 @@ gdk-pixbuf.loaders:
echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
touch gdk-pixbuf.loaders;
endif
-include $(top_srcdir)/git.mk

View file

@ -25,9 +25,12 @@
* Havoc Pennington <hp@redhat.com>
*/
#include "config.h"
#include <glib.h>
#define GDK_PIXBUF_C_COMPILATION
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-simple-anim.h"
#include "gdk-pixbuf-alias.h"
@ -109,6 +112,21 @@ static GdkPixbufAnimationIter *get_iter (GdkPixbufAnimation *anim,
const GTimeVal *start_time);
static void gdk_pixbuf_simple_anim_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gdk_pixbuf_simple_anim_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
enum
{
PROP_0,
PROP_LOOP
};
G_DEFINE_TYPE (GdkPixbufSimpleAnim, gdk_pixbuf_simple_anim, GDK_TYPE_PIXBUF_ANIMATION)
static void
@ -124,13 +142,30 @@ gdk_pixbuf_simple_anim_class_init (GdkPixbufSimpleAnimClass *klass)
object_class = G_OBJECT_CLASS (klass);
anim_class = GDK_PIXBUF_ANIMATION_CLASS (klass);
object_class->set_property = gdk_pixbuf_simple_anim_set_property;
object_class->get_property = gdk_pixbuf_simple_anim_get_property;
object_class->finalize = gdk_pixbuf_simple_anim_finalize;
anim_class->is_static_image = is_static_image;
anim_class->get_static_image = get_static_image;
anim_class->get_size = get_size;
anim_class->get_iter = get_iter;
/**
* GdkPixbufSimpleAnim:loop:
*
* Whether the animation should loop when it reaches the end.
*
* Since: 2.18
*/
g_object_class_install_property (object_class,
PROP_LOOP,
g_param_spec_boolean ("loop",
P_("Loop"),
P_("Whether the animation should loop when it reaches the end"),
FALSE,
G_PARAM_READWRITE));
}
static void
@ -277,7 +312,7 @@ advance (GdkPixbufAnimationIter *anim_iter,
{
GdkPixbufSimpleAnimIter *iter;
gint elapsed;
gint loop;
gint loop_count;
GList *tmp;
GList *old;
@ -302,13 +337,13 @@ advance (GdkPixbufAnimationIter *anim_iter,
/* See how many times we've already played the full animation,
* and subtract time for that.
*/
loop = elapsed / iter->simple_anim->total_time;
loop_count = elapsed / iter->simple_anim->total_time;
elapsed = elapsed % iter->simple_anim->total_time;
iter->position = elapsed;
/* Now move to the proper frame */
if (loop < 1)
if (loop_count < 1 || iter->simple_anim->loop)
tmp = iter->simple_anim->frames;
else
tmp = NULL;
@ -437,6 +472,82 @@ gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation,
animation->frames = g_list_append (animation->frames, frame);
}
static void
gdk_pixbuf_simple_anim_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GdkPixbufSimpleAnim *animation = GDK_PIXBUF_SIMPLE_ANIM (object);
switch (prop_id) {
case PROP_LOOP:
g_value_set_boolean (value,
gdk_pixbuf_simple_anim_get_loop (animation));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gdk_pixbuf_simple_anim_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GdkPixbufSimpleAnim *animation = GDK_PIXBUF_SIMPLE_ANIM (object);
switch (prop_id) {
case PROP_LOOP:
gdk_pixbuf_simple_anim_set_loop (animation,
g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/**
* gdk_pixbuf_simple_anim_set_loop:
* @animation: a #GdkPixbufSimpleAnim
* @loop: whether to loop the animation
*
* Sets whether @animation should loop indefinitely when it reaches the end.
*
* Since: 2.18
**/
void
gdk_pixbuf_simple_anim_set_loop (GdkPixbufSimpleAnim *animation,
gboolean loop)
{
g_return_if_fail (GDK_IS_PIXBUF_SIMPLE_ANIM (animation));
if (loop != animation->loop) {
animation->loop = loop;
g_object_notify (G_OBJECT (animation), "loop");
}
}
/**
* gdk_pixbuf_simple_anim_get_loop:
* @animation: a #GdkPixbufSimpleAnim
*
* Gets whether @animation should loop indefinitely when it reaches the end.
*
* Returns: %TRUE if the animation loops forever, %FALSE otherwise
*
* Since: 2.18
**/
gboolean
gdk_pixbuf_simple_anim_get_loop (GdkPixbufSimpleAnim *animation)
{
g_return_val_if_fail (GDK_IS_PIXBUF_SIMPLE_ANIM (animation), FALSE);
return animation->loop;
}
#define __GDK_PIXBUF_SIMPLE_ANIM_C__
#include "gdk-pixbuf-aliasdef.c"

View file

@ -51,6 +51,9 @@ GdkPixbufSimpleAnim *gdk_pixbuf_simple_anim_new (gint width,
gfloat rate);
void gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation,
GdkPixbuf *pixbuf);
void gdk_pixbuf_simple_anim_set_loop (GdkPixbufSimpleAnim *animation,
gboolean loop);
gboolean gdk_pixbuf_simple_anim_get_loop (GdkPixbufSimpleAnim *animation);
G_END_DECLS

View file

@ -133,6 +133,8 @@ gdk_pixbuf_simple_anim_get_type G_GNUC_CONST
gdk_pixbuf_simple_anim_iter_get_type G_GNUC_CONST
gdk_pixbuf_simple_anim_new
gdk_pixbuf_simple_anim_add_frame
gdk_pixbuf_simple_anim_set_loop
gdk_pixbuf_simple_anim_get_loop
#endif
#endif

View file

@ -163,7 +163,6 @@ jasper_image_try_load (struct jasper_context *context, GError **error)
if (!context->pixbuf) {
int bits_per_sample;
guchar *data;
/* Unfortunately, gdk-pixbuf doesn't support 16 bpp images
* bits_per_sample = jas_image_cmptprec (image, 0);
@ -174,17 +173,16 @@ jasper_image_try_load (struct jasper_context *context, GError **error)
*/
bits_per_sample = 8;
data = g_try_malloc0 (context->width * context->height * bits_per_sample / 8);
if (data == NULL) {
context->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
FALSE, bits_per_sample,
context->width, context->height);
if (context->pixbuf == NULL) {
g_set_error_literal (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
_("Insufficient memory to open JPEG 2000 file"));
return FALSE;
}
context->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
FALSE, bits_per_sample,
context->width, context->height);
if (context->prepared_func)
context->prepared_func (context->pixbuf, NULL, context->user_data);
}

View file

@ -1184,6 +1184,7 @@ real_save_jpeg (GdkPixbuf *pixbuf,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
_("Couldn't allocate memory for loading JPEG file"));
g_free (buf);
return FALSE;
}
}

View file

@ -30,3 +30,5 @@ EXTRA_DIST += \
DETAILS \
pixbuf-transform-math.ltx \
makefile.msc
-include $(top_srcdir)/git.mk

View file

@ -217,10 +217,7 @@ _pixops_use_medialib ()
* For x86 processors use of libumem conflicts with
* mediaLib, so avoid using it.
*/
if ((dlsym (RTLD_DEFAULT, "umem_alloc") != NULL) ||
(dlsym (RTLD_PROBE, "umem_alloc") != NULL) ||
(dlsym (RTLD_NEXT, "umem_alloc") != NULL) ||
(dlsym (RTLD_SELF, "umem_alloc") != NULL))
if (dlsym (RTLD_PROBE, "umem_alloc") != NULL)
{
use_medialib = FALSE;
return;

View file

@ -304,3 +304,5 @@ files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
-include $(top_srcdir)/git.mk

View file

@ -56,3 +56,5 @@ libgdkinclude_HEADERS = \
EXTRA_DIST += AUTHORS README TODO
-include $(top_srcdir)/git.mk

View file

@ -161,7 +161,8 @@ gdk_test_simulate_key (GdkWindow *window,
DFBWindowEvent evt;
g_return_val_if_fail (GDK_IS_WINDOW(window), FALSE);
g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE);
g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS ||
key_pressrelease == GDK_KEY_RELEASE, FALSE);
private = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
@ -175,7 +176,9 @@ gdk_test_simulate_key (GdkWindow *window,
evt.clazz = DFEC_WINDOW;
evt.type = (key_pressrelease == GDK_KEY_PRESS) ? DWET_KEYDOWN : DWET_KEYUP;
#if ((DIRECTFB_MAJOR_VERSION > 1) || (DIRECTFB_MINOR_VERSION >= 2))
evt.flags = DWEF_NONE;
#endif
evt.window_id = impl->dfb_id;
evt.x = MAX(x, 0);
evt.y = MAX(y, 0);
@ -227,7 +230,8 @@ gdk_test_simulate_button (GdkWindow *window,
DFBWindowEvent evt;
g_return_val_if_fail (GDK_IS_WINDOW(window), FALSE);
g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS ||
button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
private = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
@ -241,13 +245,17 @@ gdk_test_simulate_button (GdkWindow *window,
evt.clazz = DFEC_WINDOW;
evt.type = (button_pressrelease == GDK_BUTTON_PRESS) ? DWET_BUTTONDOWN : DWET_BUTTONUP;
#if ((DIRECTFB_MAJOR_VERSION > 1) || (DIRECTFB_MINOR_VERSION >= 2))
evt.flags = DWEF_NONE;
#endif
evt.window_id = impl->dfb_id;
evt.x = MAX(x, 0);
evt.y = MAX(y, 0);
_gdk_display->layer->GetCursorPosition (_gdk_display->layer, &evt.cx, &evt.cy);
evt.modifiers = _gdk_modifiers_to_directfb (modifiers);
evt.locks = (modifiers & GDK_LOCK_MASK) ? DILS_CAPS : 0;
evt.button = button;
evt.buttons = 0;
gettimeofday (&evt.timestamp, NULL);
_gdk_display->buffer->PostEvent (_gdk_display->buffer, DFB_EVENT(&evt));

View file

@ -104,10 +104,7 @@ _gdk_use_medialib (void)
* For x86 processors use of libumem conflicts with
* mediaLib, so avoid using it.
*/
if ((dlsym (RTLD_DEFAULT, "umem_alloc") != NULL) ||
(dlsym (RTLD_PROBE, "umem_alloc") != NULL) ||
(dlsym (RTLD_NEXT, "umem_alloc") != NULL) ||
(dlsym (RTLD_SELF, "umem_alloc") != NULL))
if (dlsym (RTLD_PROBE, "umem_alloc") != NULL)
{
return FALSE;
}

View file

@ -57,3 +57,5 @@ libgdk_quartz_la_SOURCES = \
libgdkinclude_HEADERS = \
gdkquartz.h
-include $(top_srcdir)/git.mk

View file

@ -25,3 +25,5 @@ check_gdk_cairo_LDADD=\
CLEANFILES = \
cairosurface.png \
gdksurface.png
-include $(top_srcdir)/git.mk

View file

@ -63,3 +63,5 @@ libgdk_win32_la_SOURCES = \
libgdkinclude_HEADERS = \
gdkwin32.h
-include $(top_srcdir)/git.mk

View file

@ -235,7 +235,7 @@ gdk_display_get_name (GdkDisplay *display)
DWORD session_id;
char *display_name;
static const char *display_name_cache = NULL;
typedef BOOL (* PFN_ProcessIdToSessionId) (DWORD, DWORD *);
typedef BOOL (WINAPI *PFN_ProcessIdToSessionId) (DWORD, DWORD *);
PFN_ProcessIdToSessionId processIdToSessionId;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);

View file

@ -11,3 +11,5 @@ endif
gdk-win32-res.o : gdk.rc gtk.ico
$(WINDRES) gdk.rc $@
-include $(top_srcdir)/git.mk

View file

@ -82,3 +82,5 @@ EXTRA_DIST += \
gdkinput-xfree.c \
gdkinput-none.c \
gdksettings.c
-include $(top_srcdir)/git.mk

View file

@ -1919,9 +1919,14 @@ static GdkDragAction
xdnd_action_from_atom (GdkDisplay *display,
Atom xatom)
{
GdkAtom atom = gdk_x11_xatom_to_atom_for_display (display, xatom);
GdkAtom atom;
gint i;
if (xatom == None)
return 0;
atom = gdk_x11_xatom_to_atom_for_display (display, xatom);
if (!xdnd_actions_initialized)
xdnd_initialize_actions();

View file

@ -2004,7 +2004,10 @@ gdk_event_translate (GdkDisplay *display,
event->selection.window = window;
event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.selection);
event->selection.target = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.target);
event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.property);
if (xevent->xselection.property == None)
event->selection.property = GDK_NONE;
else
event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.property);
event->selection.time = xevent->xselection.time;
break;

View file

@ -44,7 +44,7 @@ static GHashTable *virtual_atom_hash;
static const gchar xatoms_string[] =
/* These are all the standard predefined X atoms */
"NONE\0"
"\0" /* leave a space for None, even though it is not a predefined atom */
"PRIMARY\0"
"SECONDARY\0"
"ARC\0"
@ -120,12 +120,12 @@ static const gchar xatoms_string[] =
;
static const gint xatoms_offset[] = {
0, 5, 13, 23, 27, 32, 39, 48, 57, 64, 76, 88,
100, 112, 124, 136, 148, 160, 169, 174, 182, 189, 195, 205,
222, 236, 249, 262, 278, 291, 305, 317, 324, 333, 340, 351,
360, 378, 391, 404, 412, 428, 442, 456, 466, 477, 487, 497,
511, 525, 537, 549, 568, 588, 605, 623, 636, 645, 656, 663,
674, 685, 695, 702, 712, 724, 734, 745, 754, 771
0, 1, 9, 19, 23, 28, 35, 44, 53, 60, 72, 84,
96, 108, 120, 132, 144, 156, 165, 170, 178, 185, 189, 201,
218, 232, 245, 258, 274, 287, 301, 313, 320, 329, 336, 347,
356, 374, 387, 400, 408, 424, 438, 452, 462, 473, 483, 493,
507, 521, 533, 545, 564, 584, 601, 619, 632, 641, 652, 659,
670, 681, 691, 698, 708, 720, 730, 741, 750, 767
};
#define N_CUSTOM_PREDEFINED 1
@ -189,6 +189,7 @@ gdk_x11_atom_to_xatom_for_display (GdkDisplay *display,
Atom xatom = None;
g_return_val_if_fail (GDK_IS_DISPLAY (display), None);
g_return_val_if_fail (atom != GDK_NONE, None);
if (display->closed)
return None;
@ -292,6 +293,7 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
GdkAtom virtual_atom = GDK_NONE;
g_return_val_if_fail (GDK_IS_DISPLAY (display), GDK_NONE);
g_return_val_if_fail (xatom != None, GDK_NONE);
if (display->closed)
return GDK_NONE;

View file

@ -663,6 +663,21 @@ init_fake_xinerama (GdkScreen *screen)
return FALSE;
}
static void
free_monitors (GdkX11Monitor *monitors,
gint n_monitors)
{
int i;
for (i = 0; i < n_monitors; ++i)
{
g_free (monitors[i].output_name);
g_free (monitors[i].manufacturer);
}
g_free (monitors);
}
static int
monitor_compare_function (GdkX11Monitor *monitor1,
GdkX11Monitor *monitor2)
@ -753,7 +768,11 @@ init_randr13 (GdkScreen *screen)
/* non RandR 1.2 X driver doesn't return any usable multihead data */
if (randr12_compat)
{
g_array_free (monitors, TRUE);
guint n_monitors = monitors->len;
free_monitors ((GdkX11Monitor *)g_array_free (monitors, FALSE),
n_monitors);
return FALSE;
}
@ -856,21 +875,6 @@ init_xfree_xinerama (GdkScreen *screen)
return FALSE;
}
static void
free_monitors (GdkX11Monitor *monitors,
gint n_monitors)
{
int i;
for (i = 0; i < n_monitors; ++i)
{
g_free (monitors[i].output_name);
g_free (monitors[i].manufacturer);
}
g_free (monitors);
}
static void
deinit_multihead (GdkScreen *screen)
{

View file

@ -405,7 +405,10 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
xevent.requestor = requestor;
xevent.selection = gdk_x11_atom_to_xatom_for_display (display, selection);
xevent.target = gdk_x11_atom_to_xatom_for_display (display, target);
xevent.property = gdk_x11_atom_to_xatom_for_display (display, property);
if (property == GDK_NONE)
xevent.property = None;
else
xevent.property = gdk_x11_atom_to_xatom_for_display (display, property);
xevent.time = time;
_gdk_send_xevent (display, requestor, False, NoEventMask, (XEvent*) & xevent);

View file

@ -95,7 +95,7 @@ gdk_visual_get_type (void)
void
_gdk_visual_init (GdkScreen *screen)
{
static const gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
static const gint possible_depths[8] = { 32, 30, 24, 16, 15, 8, 4, 1 };
static const GdkVisualType possible_types[6] =
{
GDK_VISUAL_DIRECT_COLOR,

View file

@ -3299,18 +3299,20 @@ gdk_window_x11_get_events (GdkWindow *window)
{
XWindowAttributes attrs;
GdkEventMask event_mask;
GdkEventMask filtered;
if (GDK_WINDOW_DESTROYED (window))
return 0;
else
{
XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
GDK_WINDOW_XID (window),
&attrs);
event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
GDK_WINDOW_OBJECT (window)->event_mask = event_mask;
/* if property change was filtered out before, keep it filtered out */
filtered = GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK;
GDK_WINDOW_OBJECT (window)->event_mask = event_mask & ((GDK_WINDOW_OBJECT (window)->event_mask & filtered) | ~filtered);
return event_mask;
}
}
@ -3318,13 +3320,13 @@ static void
gdk_window_x11_set_events (GdkWindow *window,
GdkEventMask event_mask)
{
long xevent_mask;
long xevent_mask = 0;
int i;
if (!GDK_WINDOW_DESTROYED (window))
{
xevent_mask = StructureNotifyMask | PropertyChangeMask;
if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window))
xevent_mask = StructureNotifyMask | PropertyChangeMask;
for (i = 0; i < _gdk_nenvent_masks; i++)
{
if (event_mask & (1 << (i + 1)))
@ -3647,7 +3649,9 @@ gdk_x11_window_set_user_time (GdkWindow *window,
XA_CARDINAL, 32, PropModeReplace,
(guchar *)&timestamp_long, 1);
if (timestamp_long != GDK_CURRENT_TIME)
if (timestamp_long != GDK_CURRENT_TIME &&
(display_x11->user_time == GDK_CURRENT_TIME ||
XSERVER_TIME_IS_LATER (timestamp_long, display_x11->user_time)))
display_x11->user_time = timestamp_long;
if (toplevel)
@ -3854,13 +3858,18 @@ gdk_window_icon_name_set (GdkWindow *window)
* idea from a user interface standpoint. But you can set such a name
* with this function, if you like.
*
* After calling this with a non-%NULL @name, calls to gdk_window_set_title()
* will not update the icon title.
*
* Using %NULL for @name unsets the icon title; further calls to
* gdk_window_set_title() will again update the icon title as well.
**/
void
void
gdk_window_set_icon_name (GdkWindow *window,
const gchar *name)
{
GdkDisplay *display;
if (GDK_WINDOW_DESTROYED (window) ||
WINDOW_IS_TOPLEVEL (window))
return;
@ -3868,17 +3877,29 @@ gdk_window_set_icon_name (GdkWindow *window,
display = gdk_drawable_get_display (window);
g_object_set_qdata (G_OBJECT (window), g_quark_from_static_string ("gdk-icon-name-set"),
GUINT_TO_POINTER (TRUE));
GUINT_TO_POINTER (name != NULL));
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (guchar *)name, strlen (name));
set_text_property (display, GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"),
name);
if (name != NULL)
{
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"),
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
PropModeReplace, (guchar *)name, strlen (name));
set_text_property (display, GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"),
name);
}
else
{
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"));
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"));
}
}
/**

View file

@ -47,16 +47,19 @@ _gdk_xid_table_insert (GdkDisplay *display,
gpointer data)
{
GdkDisplayX11 *display_x11;
g_return_if_fail (xid != NULL);
g_return_if_fail (GDK_IS_DISPLAY (display));
display_x11 = GDK_DISPLAY_X11 (display);
if (!display_x11->xid_ht)
display_x11->xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash,
(GEqualFunc) gdk_xid_equal);
if (g_hash_table_lookup (display_x11->xid_ht, xid))
g_warning ("XID collision, trouble ahead");
g_hash_table_insert (display_x11->xid_ht, xid, data);
}
@ -65,11 +68,11 @@ _gdk_xid_table_remove (GdkDisplay *display,
XID xid)
{
GdkDisplayX11 *display_x11;
g_return_if_fail (GDK_IS_DISPLAY (display));
display_x11 = GDK_DISPLAY_X11 (display);
if (display_x11->xid_ht)
g_hash_table_remove (display_x11->xid_ht, &xid);
}

182
git.mk Normal file
View file

@ -0,0 +1,182 @@
# git.mk
#
# Copyright 2009, Red Hat, Inc.
# Written by Behdad Esfahbod
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
#
# The canonical source for this file is pango/git.mk, or whereever the
# header of pango/git.mk suggests in the future.
#
# To use in your project, import this file in your git repo's toplevel,
# then do "make -f git.mk". This modifies all Makefile.am files in
# your project to include git.mk.
#
# This enables automatic .gitignore generation. If you need to ignore
# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
# But think twice before doing that. If a file has to be in .gitignore,
# chances are very high that it's a generated file and should be in one
# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
#
# The only case that you need to manually add a file to GITIGNOREFILES is
# when remove files in one of mostlyclean-local, clean-local, distclean-local,
# or maintainer-clean-local.
#
# Note that for files like editor backup, etc, there are better places to
# ignore them. See "man gitignore".
#
# If "make maintainer-clean" removes the files but they are not recognized
# by this script (that is, if "git status" shows untracked files still), send
# me the output of "git status" as well as your Makefile.am and Makefile for
# the directories involved.
#
# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
# pango/Makefile.am.
#
# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
# not tarballs. It serves no useful purpose in tarballs and clutters the
# build dir.
#
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
# gnome-doc-utils, intltool.
#
#
# KNOWN ISSUES:
#
# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
# submodule doesn't find us. If you have configure.{in,ac} files in
# subdirs, add a proxy git.mk file in those dirs that simply does:
# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste.
# And add those files to git. See vte/gnome-pty-helper/git.mk for
# example.
#
git-all: git-mk-install
git-mk-install:
@echo Installing git makefile
@any_failed=; find $(top_srcdir) -name Makefile.am | while read x; do \
if grep 'include .*/git.mk' $$x >/dev/null; then \
echo $$x already includes git.mk; \
else \
failed=; \
echo "Updating $$x"; \
{ cat $$x; \
echo ''; \
echo '-include $$(top_srcdir)/git.mk'; \
} > $$x.tmp || failed=1; \
if test x$$failed = x; then \
mv $$x.tmp $$x || failed=1; \
fi; \
if test x$$failed = x; then : else \
echo Failed updating $$x; >&2 \
any_failed=1; \
fi; \
fi; done; test -z "$$any_failed"
.PHONY: git-all git-mk-install
### .gitignore generation
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
@echo Generating $@; \
{ \
if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
for x in \
$(DOC_MODULE)-decl-list.txt \
$(DOC_MODULE)-decl.txt \
tmpl/$(DOC_MODULE)-unused.sgml \
"tmpl/*.bak" \
xml html \
; do echo /$$x; done; \
fi; \
if test "x$(DOC_MODULE)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
for x in \
$(_DOC_C_DOCS) \
$(_DOC_LC_DOCS) \
$(_DOC_OMF_ALL) \
$(_DOC_DSK_ALL) \
$(_DOC_HTML_ALL) \
$(_DOC_POFILES) \
"*/.xml2po.mo" \
"*/*.omf.out" \
; do echo /$$x; done; \
fi; \
if test -f $(srcdir)/po/Makefile.in.in; then \
for x in \
po/Makefile.in.in \
po/Makefile.in \
po/Makefile \
po/POTFILES \
po/stamp-it \
po/.intltool-merge-cache \
"po/*.gmo" \
"po/*.mo" \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
; do echo /$$x; done; \
fi; \
if test -f $(srcdir)/configure; then \
for x in \
autom4te.cache \
configure \
config.h \
stamp-h1 \
libtool \
config.lt \
; do echo /$$x; done; \
fi; \
for x in \
.gitignore \
$(GITIGNOREFILES) \
$(CLEANFILES) \
$(PROGRAMS) \
$(EXTRA_PROGRAMS) \
$(LTLIBRARIES) \
so_locations \
.libs _libs \
$(MOSTLYCLEANFILES) \
"*.$(OBJEXT)" \
"*.lo" \
$(DISTCLEANFILES) \
$(am__CONFIG_DISTCLEAN_FILES) \
$(CONFIG_CLEAN_FILES) \
TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
"*.tab.c" \
$(MAINTAINERCLEANFILES) \
$(BUILT_SOURCES) \
$(DEPDIR) \
Makefile \
Makefile.in \
"*.orig" \
"*.rej" \
"*.bak" \
"*~" \
".*.sw[nop]" \
; do echo /$$x; done; \
} | \
sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
sed 's@/[.]/@/@g' | \
LANG=C sort | uniq > $@.tmp && \
mv $@.tmp $@;
all: $(srcdir)/.gitignore gitignore-recurse-maybe
gitignore-recurse-maybe:
@if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \
$(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
fi;
gitignore-recurse:
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse); \
done
gitignore: $(srcdir)/.gitignore gitignore-recurse
maintainer-clean: gitignore-clean
gitignore-clean:
-rm -f $(srcdir)/.gitignore
.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe

View file

@ -10,11 +10,19 @@ endif
SUBDIRS = theme-bits . tests
DIST_SUBDIRS=theme-bits tests
if HAVE_PAPI_CUPS
GTK_PRINT_BACKENDS=file,papi,cups
else
if HAVE_CUPS
GTK_PRINT_BACKENDS=file,cups
else
if HAVE_PAPI
GTK_PRINT_BACKENDS=file,papi
else
GTK_PRINT_BACKENDS=file,lpr
endif
endif
endif
INCLUDES = \
-DG_LOG_DOMAIN=\"Gtk\" \
@ -778,7 +786,7 @@ gtk_extra_sources = \
#
# setup GTK+ sources and their dependencies
#
MAINTAINERCLEANFILES = $(gtk_built_sources) $(stamp_files) $(GENERATED_ICONS)
MAINTAINERCLEANFILES = $(gtk_built_sources) $(stamp_files) $(GENERATED_ICONS) stock-icons/icon-theme.cache
EXTRA_HEADERS =
EXTRA_DIST += $(gtk_private_h_sources) $(gtk_extra_sources)
EXTRA_DIST += $(gtk_built_sources)
@ -1286,3 +1294,5 @@ EXTRA_DIST += \
install-data-local:
-include $(top_srcdir)/git.mk

View file

@ -29,7 +29,7 @@ The [INPUT] file is
-r, --root Convert only widget named root and its children
-h, --help display this help and exit
When OUTPUT is -, write to standard input.
When OUTPUT is -, write to standard output.
Examples:
gtk-builder-convert preference.glade preferences.ui
@ -42,10 +42,10 @@ import sys
from xml.dom import minidom, Node
WINDOWS = ['GtkWindow',
'GtkDialog',
DIALOGS = ['GtkDialog',
'GtkFileChooserDialog',
'GtkMessageDialog']
WINDOWS = ['GtkWindow'] + DIALOGS
# The subprocess is only available in Python 2.4+
try:
@ -257,6 +257,8 @@ class GtkBuilderConverter(object):
for node in objects:
self._convert(node.getAttribute("class"), node)
if self._get_object(node.getAttribute('id')) is not None:
print "WARNING: duplicate id \"" + node.getAttribute('id') + "\""
self.objects[node.getAttribute('id')] = node
# Convert Gazpachos UI tag
@ -497,7 +499,7 @@ class GtkBuilderConverter(object):
return
if (node.tagName == 'object' and
node.getAttribute('class') == 'GtkDialog'):
node.getAttribute('class') in DIALOGS):
dialog = node
break
node = node.parentNode
@ -544,6 +546,14 @@ class GtkBuilderConverter(object):
if not prop.childNodes:
parent.removeChild(prop)
return
translatable_attr = prop.attributes.get('translatable')
translatable = translatable_attr is not None and translatable_attr.value == 'yes'
has_context_attr = prop.attributes.get('context')
has_context = has_context_attr is not None and has_context_attr.value == 'yes'
comments_attr = prop.attributes.get('comments')
comments = comments_attr is not None and comments_attr.value or None
value = prop.childNodes[0].data
model = self._create_root_object("GtkListStore",
template="model")
@ -558,13 +568,23 @@ class GtkBuilderConverter(object):
data = self._dom.createElement('data')
model.appendChild(data)
if value.endswith('\n'):
value = value[:-1]
for item in value.split('\n'):
row = self._dom.createElement('row')
data.appendChild(row)
col = self._dom.createElement('col')
col.setAttribute('id', '0')
col.setAttribute('translatable', 'yes')
if translatable:
col.setAttribute('translatable', 'yes')
if has_context:
splitting = item.split('|', 1)
if len(splitting) == 2:
context, item = splitting
col.setAttribute('context', context)
if comments is not None:
col.setAttribute('comments', comments)
col.appendChild(self._dom.createTextNode(item))
row.appendChild(col)

View file

@ -2210,6 +2210,7 @@ gtk_label_set_text_with_mnemonic
gtk_label_set_use_markup
gtk_label_set_use_underline
gtk_label_set_width_chars
gtk_label_get_current_uri
#endif
#endif
@ -2823,6 +2824,7 @@ gtk_print_backend_printer_list_is_done
gtk_print_backend_find_printer
gtk_print_backend_print_stream
gtk_print_backend_load_modules
gtk_print_backend_set_password
#endif
#endif
#endif

View file

@ -49,6 +49,9 @@
#include "gtktextview.h"
#include "gtkvbox.h"
#include "gtkiconfactory.h"
#include "gtkshow.h"
#include "gtkmain.h"
#include "gtkmessagedialog.h"
#include "gtkprivate.h"
#include "gtkintl.h"
@ -137,37 +140,73 @@ static void set_cursor_if_appropriate (GtkAboutDialog
GtkTextView *text_view,
gint x,
gint y);
static void add_credits_page (GtkAboutDialog *about,
GtkWidget *notebook,
gchar *title,
gchar **people);
static gboolean credits_key_press_event (GtkWidget *text_view,
GdkEventKey *event,
GtkAboutDialog *about);
static gboolean credits_event_after (GtkWidget *text_view,
GdkEvent *event,
GtkAboutDialog *about);
static gboolean credits_motion_notify_event (GtkWidget *text_view,
GdkEventMotion *event,
GtkAboutDialog *about);
static gboolean credits_visibility_notify_event (GtkWidget *text_view,
GdkEventVisibility *event,
GtkAboutDialog *about);
static void display_credits_dialog (GtkWidget *button,
gpointer data);
static void display_license_dialog (GtkWidget *button,
gpointer data);
static void close_cb (GtkAboutDialog *about);
static void default_url_hook (GtkAboutDialog *about,
const gchar *uri,
gpointer user_data);
static void default_email_hook (GtkAboutDialog *about,
const gchar *email_address,
gpointer user_data);
static gboolean activate_email_hook_set = FALSE;
static GtkAboutDialogActivateLinkFunc activate_email_hook = NULL;
static gpointer activate_email_hook_data = NULL;
static GDestroyNotify activate_email_hook_destroy = NULL;
static gboolean activate_url_hook_set = FALSE;
static GtkAboutDialogActivateLinkFunc activate_url_hook = NULL;
static gpointer activate_url_hook_data = NULL;
static GDestroyNotify activate_url_hook_destroy = NULL;
static void
default_url_hook (GtkAboutDialog *about,
const gchar *uri,
gpointer user_data G_GNUC_UNUSED)
{
GdkScreen *screen;
GError *error = NULL;
screen = gtk_widget_get_screen (GTK_WIDGET (about));
if (!gtk_show_uri (screen, uri, gtk_get_current_event_time (), &error)) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (about),
GTK_DIALOG_DESTROY_WITH_PARENT |
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s", _("Could not show link"));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", error->message);
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
}
}
static void
default_email_hook (GtkAboutDialog *about,
const gchar *email_address,
gpointer user_data)
{
char *escaped, *uri;
escaped = g_uri_escape_string (email_address, NULL, FALSE);
uri = g_strdup_printf ("mailto:%s", escaped);
g_free (escaped);
default_url_hook (about, uri, user_data);
g_free (uri);
}
G_DEFINE_TYPE (GtkAboutDialog, gtk_about_dialog, GTK_TYPE_DIALOG)
static void
@ -485,8 +524,6 @@ gtk_about_dialog_init (GtkAboutDialog *about)
priv->website_button = button = gtk_link_button_new ("");
gtk_widget_set_no_show_all (button, TRUE);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (activate_url), about);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
priv->website_label = button = gtk_label_new ("");
@ -704,7 +741,7 @@ update_website (GtkAboutDialog *about)
{
GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data;
if (priv->website_url && activate_url_hook)
if (priv->website_url && (!activate_url_hook_set || activate_url_hook != NULL))
{
gtk_widget_show (priv->website_button);
gtk_widget_hide (priv->website_label);
@ -1663,9 +1700,22 @@ activate_url (GtkWidget *widget,
{
GtkAboutDialog *about = GTK_ABOUT_DIALOG (data);
const gchar *url = gtk_link_button_get_uri (GTK_LINK_BUTTON (widget));
if (activate_url_hook != NULL)
(* activate_url_hook) (about, url, activate_url_hook_data);
GtkAboutDialogActivateLinkFunc url_hook;
gpointer url_hook_data;
if (activate_url_hook_set)
{
url_hook = activate_url_hook;
url_hook_data = activate_url_hook_data;
}
else
{
url_hook = default_url_hook;
url_hook_data = NULL;
}
if (url_hook)
url_hook (about, url, url_hook_data);
}
static void
@ -1676,24 +1726,48 @@ follow_if_link (GtkAboutDialog *about,
GSList *tags = NULL, *tagp = NULL;
GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data;
gchar *url = NULL;
GtkAboutDialogActivateLinkFunc email_hook, url_hook;
gpointer email_hook_data, url_hook_data;
if (activate_email_hook_set)
{
email_hook = activate_email_hook;
email_hook_data = activate_email_hook_data;
}
else
{
email_hook = default_email_hook;
email_hook_data = NULL;
}
if (activate_url_hook_set)
{
url_hook = activate_url_hook;
url_hook_data = activate_url_hook_data;
}
else
{
url_hook = default_url_hook;
url_hook_data = NULL;
}
tags = gtk_text_iter_get_tags (iter);
for (tagp = tags; tagp != NULL && !url; tagp = tagp->next)
{
GtkTextTag *tag = tagp->data;
if (activate_email_hook != NULL)
if (email_hook != NULL)
{
url = g_object_get_data (G_OBJECT (tag), "email");
if (url)
(* activate_email_hook) (about, url, activate_email_hook_data);
if (url)
email_hook (about, url, email_hook_data);
}
if (!url && activate_url_hook != NULL)
if (!url && url_hook != NULL)
{
url = g_object_get_data (G_OBJECT (tag), "url");
if (url)
(* activate_url_hook) (about, url, activate_url_hook_data);
url_hook (about, url, url_hook_data);
}
if (url && !g_slist_find_custom (priv->visited_links, url, (GCompareFunc)strcmp))
@ -1724,9 +1798,9 @@ follow_if_link (GtkAboutDialog *about,
}
static gboolean
credits_key_press_event (GtkWidget *text_view,
GdkEventKey *event,
GtkAboutDialog *about)
text_view_key_press_event (GtkWidget *text_view,
GdkEventKey *event,
GtkAboutDialog *about)
{
GtkTextIter iter;
GtkTextBuffer *buffer;
@ -1750,9 +1824,9 @@ credits_key_press_event (GtkWidget *text_view,
}
static gboolean
credits_event_after (GtkWidget *text_view,
GdkEvent *event,
GtkAboutDialog *about)
text_view_event_after (GtkWidget *text_view,
GdkEvent *event,
GtkAboutDialog *about)
{
GtkTextIter start, end, iter;
GtkTextBuffer *buffer;
@ -1827,9 +1901,9 @@ set_cursor_if_appropriate (GtkAboutDialog *about,
}
static gboolean
credits_motion_notify_event (GtkWidget *text_view,
GdkEventMotion *event,
GtkAboutDialog *about)
text_view_motion_notify_event (GtkWidget *text_view,
GdkEventMotion *event,
GtkAboutDialog *about)
{
gint x, y;
@ -1846,9 +1920,9 @@ credits_motion_notify_event (GtkWidget *text_view,
static gboolean
credits_visibility_notify_event (GtkWidget *text_view,
GdkEventVisibility *event,
GtkAboutDialog *about)
text_view_visibility_notify_event (GtkWidget *text_view,
GdkEventVisibility *event,
GtkAboutDialog *about)
{
gint wx, wy, bx, by;
@ -1863,24 +1937,16 @@ credits_visibility_notify_event (GtkWidget *text_view,
return FALSE;
}
static void
text_view_style_set (GtkWidget *widget,
GtkStyle *prev_style,
GtkWidget *text_view)
{
gtk_widget_modify_base (text_view, GTK_STATE_NORMAL,
&widget->style->bg[GTK_STATE_NORMAL]);
}
static void
add_credits_page (GtkAboutDialog *about,
GtkWidget *notebook,
gchar *title,
gchar **people)
static GtkWidget *
text_view_new (GtkAboutDialog *about,
GtkWidget *dialog,
gchar **strings,
GtkWrapMode wrap_mode)
{
gchar **p;
gchar *q0, *q1, *q2, *r1, *r2;
GtkWidget *sw, *view;
GtkWidget *view;
GtkTextView *text_view;
GtkTextBuffer *buffer;
gboolean linkify_email, linkify_urls;
GdkColor *style_link_color;
@ -1890,11 +1956,11 @@ add_credits_page (GtkAboutDialog *about,
GdkColor visited_link_color;
GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data;
linkify_email = (activate_email_hook != NULL);
linkify_urls = (activate_url_hook != NULL);
linkify_email = (!activate_email_hook_set || activate_email_hook != NULL);
linkify_urls = (!activate_url_hook_set || activate_url_hook != NULL);
gtk_widget_ensure_style (GTK_WIDGET (about));
gtk_widget_style_get (GTK_WIDGET (about),
gtk_widget_style_get (GTK_WIDGET (about),
"link-color", &style_link_color,
"visited-link-color", &style_visited_link_color,
NULL);
@ -1915,48 +1981,34 @@ add_credits_page (GtkAboutDialog *about,
visited_link_color = default_visited_link_color;
view = gtk_text_view_new ();
g_signal_connect_object (about, "style-set",
G_CALLBACK (text_view_style_set), view, 0);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
text_view = GTK_TEXT_VIEW (view);
buffer = gtk_text_view_get_buffer (text_view);
gtk_text_view_set_cursor_visible (text_view, FALSE);
gtk_text_view_set_editable (text_view, FALSE);
gtk_text_view_set_wrap_mode (text_view, wrap_mode);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 8);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 8);
gtk_text_view_set_left_margin (text_view, 8);
gtk_text_view_set_right_margin (text_view, 8);
g_signal_connect (view, "key-press-event",
G_CALLBACK (credits_key_press_event), about);
G_CALLBACK (text_view_key_press_event), about);
g_signal_connect (view, "event-after",
G_CALLBACK (credits_event_after), about);
g_signal_connect (view, "motion-notify-event",
G_CALLBACK (credits_motion_notify_event), about);
g_signal_connect (view, "visibility-notify-event",
G_CALLBACK (credits_visibility_notify_event), about);
G_CALLBACK (text_view_event_after), about);
g_signal_connect (view, "motion-notify-event",
G_CALLBACK (text_view_motion_notify_event), about);
g_signal_connect (view, "visibility-notify-event",
G_CALLBACK (text_view_visibility_notify_event), about);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
sw, gtk_label_new (title));
if (people == NULL)
if (strings == NULL)
{
gtk_widget_hide (view);
return;
return view;
}
else
gtk_widget_show (view);
for (p = people; *p; p++)
for (p = strings; *p; p++)
{
q0 = *p;
while (*q0)
while (*q0)
{
q1 = linkify_email ? strchr (q0, '<') : NULL;
q2 = q1 ? strchr (q1, '>') : NULL;
@ -2025,6 +2077,32 @@ add_credits_page (GtkAboutDialog *about,
if (p[1])
gtk_text_buffer_insert_at_cursor (buffer, "\n", 1);
}
gtk_widget_show (view);
return view;
}
static void
add_credits_page (GtkAboutDialog *about,
GtkWidget *credits_dialog,
GtkWidget *notebook,
gchar *title,
gchar **people)
{
GtkWidget *sw, *view;
view = text_view_new (about, credits_dialog, people, GTK_WRAP_NONE);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
sw, gtk_label_new (title));
}
static void
@ -2071,10 +2149,10 @@ display_credits_dialog (GtkWidget *button,
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE, TRUE, 0);
if (priv->authors != NULL)
add_credits_page (about, notebook, _("Written by"), priv->authors);
add_credits_page (about, dialog, notebook, _("Written by"), priv->authors);
if (priv->documenters != NULL)
add_credits_page (about, notebook, _("Documented by"), priv->documenters);
add_credits_page (about, dialog, notebook, _("Documented by"), priv->documenters);
/* Don't show an untranslated gettext msgid */
if (priv->translator_credits != NULL &&
@ -2086,11 +2164,11 @@ display_credits_dialog (GtkWidget *button,
translators[0] = priv->translator_credits;
translators[1] = NULL;
add_credits_page (about, notebook, _("Translated by"), translators);
add_credits_page (about, dialog, notebook, _("Translated by"), translators);
}
if (priv->artists != NULL)
add_credits_page (about, notebook, _("Artwork by"), priv->artists);
add_credits_page (about, dialog, notebook, _("Artwork by"), priv->artists);
gtk_widget_show_all (dialog);
}
@ -2111,7 +2189,8 @@ display_license_dialog (GtkWidget *button,
GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data;
GtkWidget *dialog, *view, *sw;
GtkDialog *licence_dialog;
gchar *strings[2];
if (priv->license_dialog != NULL)
{
gtk_window_present (GTK_WINDOW (priv->license_dialog));
@ -2152,17 +2231,10 @@ display_license_dialog (GtkWidget *button,
g_signal_connect (sw, "map", G_CALLBACK (set_policy), NULL);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), sw, TRUE, TRUE, 0);
view = gtk_text_view_new ();
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view),
priv->wrap_license ? GTK_WRAP_WORD : GTK_WRAP_NONE);
gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)),
priv->license, -1);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 8);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 8);
strings[0] = priv->license;
strings[1] = NULL;
view = text_view_new (about, dialog, strings,
priv->wrap_license ? GTK_WRAP_WORD : GTK_WRAP_NONE);
gtk_container_add (GTK_CONTAINER (sw), view);
@ -2194,6 +2266,9 @@ gtk_about_dialog_new (void)
*
* Installs a global function to be called whenever the user activates an
* email link in an about dialog.
*
* Since 2.18 there exists a default function which uses gtk_show_uri(). To
* deactivate it, you can pass %NULL for @func.
*
* Return value: the previous email hook.
*
@ -2211,6 +2286,7 @@ gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func,
old = activate_email_hook;
activate_email_hook_set = TRUE;
activate_email_hook = func;
activate_email_hook_data = data;
activate_email_hook_destroy = destroy;
@ -2227,6 +2303,9 @@ gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func,
* Installs a global function to be called whenever the user activates a
* URL link in an about dialog.
*
* Since 2.18 here exists a default function which uses gtk_show_uri(). To
* deactivate it, you can pass %NULL for @func.
*
* Return value: the previous URL hook.
*
* Since: 2.6
@ -2243,6 +2322,7 @@ gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func,
old = activate_url_hook;
activate_url_hook_set = TRUE;
activate_url_hook = func;
activate_url_hook_data = data;
activate_url_hook_destroy = destroy;

View file

@ -165,6 +165,9 @@ gtk_accel_group_finalize (GObject *object)
_gtk_accel_map_remove_group (accel_path, accel_group);
}
g_closure_remove_invalidate_notifier (entry->closure, accel_group, accel_closure_invalidate);
/* remove quick_accel_add() refcount */
g_closure_unref (entry->closure);
}
g_free (accel_group->priv_accels);

View file

@ -359,11 +359,7 @@ gtk_adjustment_set_value (GtkAdjustment *adjustment,
{
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
/* don't use CLAMP() so we don't end up below lower if upper - page_size
* is smaller than lower
*/
value = MIN (value, adjustment->upper - adjustment->page_size);
value = MAX (value, adjustment->lower);
value = CLAMP (value, adjustment->lower, adjustment->upper);
if (value != adjustment->value)
{

View file

@ -40,6 +40,7 @@
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtkbuildable.h"
#include "gtkalias.h"
@ -119,6 +120,23 @@ static void gtk_assistant_get_child_property (GtkContainer *container,
static AtkObject *gtk_assistant_get_accessible (GtkWidget *widget);
static void gtk_assistant_buildable_interface_init (GtkBuildableIface *iface);
static GObject *gtk_assistant_buildable_get_internal_child (GtkBuildable *buildable,
GtkBuilder *builder,
const gchar *childname);
static gboolean gtk_assistant_buildable_custom_tag_start (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const gchar *tagname,
GMarkupParser *parser,
gpointer *data);
static void gtk_assistant_buildable_custom_finished (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const gchar *tagname,
gpointer user_data);
enum
{
CHILD_PROP_0,
@ -141,7 +159,9 @@ enum
static guint signals [LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GtkAssistant, gtk_assistant, GTK_TYPE_WINDOW)
G_DEFINE_TYPE_WITH_CODE (GtkAssistant, gtk_assistant, GTK_TYPE_WINDOW,
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_assistant_buildable_interface_init))
static void
@ -197,8 +217,8 @@ gtk_assistant_class_init (GtkAssistantClass *class)
* @assistant: the #GtkAssistant
* @page: the current page
*
* The ::prepared signal is emitted when a new page is set as the assistant's
* current page, before making the new page visible. A handler for this signal
* The ::prepared signal is emitted when a new page is set as the assistant's
* current page, before making the new page visible. A handler for this signal
* can do any preparation which are necessary before showing @page.
*
* Since: 2.10
@ -709,6 +729,7 @@ gtk_assistant_init (GtkAssistant *assistant)
priv = assistant->priv = GTK_ASSISTANT_GET_PRIVATE (assistant);
gtk_container_set_reallocate_redraws (GTK_CONTAINER (assistant), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (assistant), 12);
gtk_widget_push_composite_child ();
@ -1472,9 +1493,8 @@ gtk_assistant_new (void)
{
GtkWidget *assistant;
assistant = g_object_new (GTK_TYPE_ASSISTANT,
"border-width", 12,
NULL);
assistant = g_object_new (GTK_TYPE_ASSISTANT, NULL);
return assistant;
}
@ -2233,7 +2253,7 @@ gtk_assistant_accessible_ref_child (AtkObject *accessible,
GtkWidget *widget, *child;
gint n_pages;
AtkObject *obj;
gchar *title;
const gchar *title;
widget = GTK_ACCESSIBLE (accessible)->widget;
if (!widget)
@ -2290,15 +2310,15 @@ gtk_assistant_accessible_get_type (void)
GType derived_type;
GTypeQuery query;
GType derived_atk_type;
derived_type = g_type_parent (GTK_TYPE_ASSISTANT);
factory = atk_registry_get_factory (atk_get_default_registry (),
derived_type);
derived_atk_type = atk_object_factory_get_accessible_type (factory);
g_type_query (derived_atk_type, &query);
type = g_type_register_static_simple (derived_atk_type,
I_("GtkAssistantAccessible"),
type = g_type_register_static_simple (derived_atk_type,
I_("GtkAssistantAccessible"),
query.class_size,
(GClassInitFunc) gtk_assistant_accessible_class_init,
query.instance_size,
@ -2315,9 +2335,9 @@ gtk_assistant_accessible_new (GObject *obj)
g_return_val_if_fail (GTK_IS_ASSISTANT (obj), NULL);
accessible = g_object_new (gtk_assistant_accessible_get_type (), NULL);
accessible = g_object_new (gtk_assistant_accessible_get_type (), NULL);
atk_object_initialize (accessible, obj);
return accessible;
}
@ -2345,16 +2365,16 @@ gtk_assistant_accessible_factory_get_type (void)
{
static GType type = 0;
if (!type)
if (!type)
{
type = g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY,
type = g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY,
I_("GtkAssistantAccessibleFactory"),
sizeof (AtkObjectFactoryClass),
(GClassInitFunc) gtk_assistant_accessible_factory_class_init,
sizeof (AtkObjectFactory),
NULL, 0);
}
return type;
}
@ -2363,12 +2383,12 @@ gtk_assistant_get_accessible (GtkWidget *widget)
{
static gboolean first_time = TRUE;
if (first_time)
if (first_time)
{
AtkObjectFactory *factory;
AtkRegistry *registry;
GType derived_type;
GType derived_atk_type;
GType derived_type;
GType derived_atk_type;
/*
* Figure out whether accessibility is enabled by looking at the
@ -2383,7 +2403,7 @@ gtk_assistant_get_accessible (GtkWidget *widget)
derived_atk_type = atk_object_factory_get_accessible_type (factory);
if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE))
{
atk_registry_set_factory_type (registry,
atk_registry_set_factory_type (registry,
GTK_TYPE_ASSISTANT,
gtk_assistant_accessible_factory_get_type ());
}
@ -2394,5 +2414,53 @@ gtk_assistant_get_accessible (GtkWidget *widget)
}
static GtkBuildableIface *parent_buildable_iface;
static void
gtk_assistant_buildable_interface_init (GtkBuildableIface *iface)
{
parent_buildable_iface = g_type_interface_peek_parent (iface);
iface->get_internal_child = gtk_assistant_buildable_get_internal_child;
iface->custom_tag_start = gtk_assistant_buildable_custom_tag_start;
iface->custom_finished = gtk_assistant_buildable_custom_finished;
}
static GObject *
gtk_assistant_buildable_get_internal_child (GtkBuildable *buildable,
GtkBuilder *builder,
const gchar *childname)
{
if (strcmp (childname, "action_area") == 0)
return G_OBJECT (GTK_ASSISTANT (buildable)->priv->action_area);
return parent_buildable_iface->get_internal_child (buildable,
builder,
childname);
}
gboolean
gtk_assistant_buildable_custom_tag_start (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const gchar *tagname,
GMarkupParser *parser,
gpointer *data)
{
return parent_buildable_iface->custom_tag_start (buildable, builder, child,
tagname, parser, data);
}
static void
gtk_assistant_buildable_custom_finished (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const gchar *tagname,
gpointer user_data)
{
parent_buildable_iface->custom_finished (buildable, builder, child,
tagname, user_data);
}
#define __GTK_ASSISTANT_C__
#include "gtkaliasdef.c"

View file

@ -1329,7 +1329,14 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
g_value_take_boxed (value, vector);
}
else
ret = FALSE;
{
g_set_error (error,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_INVALID_VALUE,
"Could not parse '%s' as a %s",
string, G_VALUE_TYPE_NAME (value));
ret = FALSE;
}
break;
case G_TYPE_OBJECT:
if (G_VALUE_HOLDS (value, GDK_TYPE_PIXBUF))

View file

@ -52,7 +52,8 @@ typedef enum
GTK_BUILDER_ERROR_INVALID_TAG,
GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
GTK_BUILDER_ERROR_INVALID_VALUE,
GTK_BUILDER_ERROR_VERSION_MISMATCH
GTK_BUILDER_ERROR_VERSION_MISMATCH,
GTK_BUILDER_ERROR_DUPLICATE_ID
} GtkBuilderError;
GQuark gtk_builder_error_quark (void);

View file

@ -298,11 +298,12 @@ is_requested_object (const gchar *object,
}
static void
parse_object (ParserData *data,
const gchar *element_name,
const gchar **names,
const gchar **values,
GError **error)
parse_object (GMarkupParseContext *context,
ParserData *data,
const gchar *element_name,
const gchar **names,
const gchar **values,
GError **error)
{
ObjectInfo *object_info;
ChildInfo* child_info;
@ -310,6 +311,7 @@ parse_object (ParserData *data,
gchar *object_class = NULL;
gchar *object_id = NULL;
gchar *constructor = NULL;
gint line, line2;
child_info = state_peek_info (data, ChildInfo);
if (child_info && strcmp (child_info->tag.name, "object") == 0)
@ -335,10 +337,11 @@ parse_object (ParserData *data,
object_class = _get_type_by_symbol (values[i]);
if (!object_class)
{
g_set_error (error, GTK_BUILDER_ERROR,
g_markup_parse_context_get_position (context, &line, NULL);
g_set_error (error, GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
_("Invalid type function: `%s'"),
values[i]);
_("Invalid type function on line %d: '%s'"),
line, values[i]);
return;
}
}
@ -389,6 +392,19 @@ parse_object (ParserData *data,
if (child_info)
object_info->parent = (CommonInfo*)child_info;
g_markup_parse_context_get_position (context, &line, NULL);
line2 = GPOINTER_TO_INT (g_hash_table_lookup (data->object_ids, object_id));
if (line2 != 0)
{
g_set_error (error, GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_DUPLICATE_ID,
_("Duplicate object id '%s' on line %d (previously on line %d)"),
object_id, line, line2);
return;
}
g_hash_table_insert (data->object_ids, object_id, GINT_TO_POINTER (line));
}
static void
@ -848,7 +864,7 @@ start_element (GMarkupParseContext *context,
if (strcmp (element_name, "requires") == 0)
parse_requires (data, element_name, names, values, error);
else if (strcmp (element_name, "object") == 0)
parse_object (data, element_name, names, values, error);
parse_object (context, data, element_name, names, values, error);
else if (data->requested_objects && !data->inside_requested_object)
{
/* If outside a requested object, simply ignore this tag */
@ -958,10 +974,11 @@ end_element (GMarkupParseContext *context,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_VERSION_MISMATCH,
"%s: required %s version %d.%d, current version is %d.%d",
data->filename, req_info->library,
data->filename, req_info->library,
req_info->major, req_info->minor,
GTK_MAJOR_VERSION, GTK_MINOR_VERSION);
}
_free_requires_info (req_info, NULL);
}
else if (strcmp (element_name, "interface") == 0)
{
@ -1145,6 +1162,7 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
data->builder = builder;
data->filename = filename;
data->domain = g_strdup (domain);
data->object_ids = g_hash_table_new (g_str_hash, g_str_equal);
data->requested_objects = NULL;
if (requested_objs)
@ -1204,6 +1222,7 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
g_slist_foreach (data->requested_objects, (GFunc) g_free, NULL);
g_slist_free (data->requested_objects);
g_free (data->domain);
g_hash_table_destroy (data->object_ids);
g_markup_parse_context_free (data->ctx);
g_free (data);

View file

@ -101,6 +101,8 @@ typedef struct {
gboolean inside_requested_object;
gint requested_object_level;
gint cur_object_level;
GHashTable *object_ids;
} ParserData;
typedef GType (*GTypeGetFunc) (void);

View file

@ -244,12 +244,24 @@ convert_keysym_state_to_string (GtkCellRendererAccel *accel,
else
{
if (accel->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK)
return gtk_accelerator_get_label (keysym, mask);
{
if (!gtk_accelerator_valid (keysym, mask))
/* This label is displayed in a treeview cell displaying
* an accelerator key combination that is not valid according
* to gtk_accelerator_valid().
*/
return g_strdup (C_("Accelerator", "Invalid"));
return gtk_accelerator_get_label (keysym, mask);
}
else
{
gchar *name;
name = gtk_accelerator_name (keysym, mask);
name = gtk_accelerator_get_label (keysym, mask);
if (name == NULL)
name = gtk_accelerator_name (keysym, mask);
if (keysym == 0)
{
gchar *tmp;

View file

@ -300,6 +300,7 @@ GtkClipboard *
gtk_clipboard_get_for_display (GdkDisplay *display,
GdkAtom selection)
{
g_return_val_if_fail (display != NULL, NULL); /* See bgo#463773; this is needed because Flash Player sucks */
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
g_return_val_if_fail (!display->closed, NULL);

View file

@ -4018,13 +4018,13 @@ gtk_combo_box_list_auto_scroll (GtkComboBox *combo_box,
adj->lower < adj->value)
{
value = adj->value - (tree_view->allocation.x - x + 1);
gtk_adjustment_set_value (adj, value);
gtk_adjustment_set_value (adj, CLAMP (value, adj->lower, adj->upper - adj->page_size));
}
else if (x >= tree_view->allocation.x + tree_view->allocation.width &&
adj->upper - adj->page_size > adj->value)
{
value = adj->value + (x - tree_view->allocation.x - tree_view->allocation.width + 1);
gtk_adjustment_set_value (adj, MAX (value, 0.0));
gtk_adjustment_set_value (adj, CLAMP (value, 0.0, adj->upper - adj->page_size));
}
}
@ -4035,13 +4035,13 @@ gtk_combo_box_list_auto_scroll (GtkComboBox *combo_box,
adj->lower < adj->value)
{
value = adj->value - (tree_view->allocation.y - y + 1);
gtk_adjustment_set_value (adj, value);
gtk_adjustment_set_value (adj, CLAMP (value, adj->lower, adj->upper - adj->page_size));
}
else if (y >= tree_view->allocation.height &&
adj->upper - adj->page_size > adj->value)
{
value = adj->value + (y - tree_view->allocation.height + 1);
gtk_adjustment_set_value (adj, MAX (value, 0.0));
gtk_adjustment_set_value (adj, CLAMP (value, 0.0, adj->upper - adj->page_size));
}
}
}
@ -5251,10 +5251,11 @@ gtk_combo_box_remove_text (GtkComboBox *combo_box,
*
* Returns the currently active string in @combo_box or %NULL if none
* is selected. Note that you can only use this function with combo
* boxes constructed with gtk_combo_box_new_text() and with
* boxes constructed with gtk_combo_box_new_text() and with
* #GtkComboBoxEntry<!-- -->s.
*
* Returns: a newly allocated string containing the currently active text.
* Must be freed with g_free().
*
* Since: 2.6
*/

View file

@ -1371,7 +1371,7 @@ static const GMarkupParser attributes_parser =
attributes_text_element,
};
gboolean
static gboolean
gtk_dialog_buildable_custom_tag_start (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,

View file

@ -1213,6 +1213,27 @@ gtk_entry_class_init (GtkEntryClass *class)
GTK_TYPE_BORDER,
GTK_PARAM_READABLE));
/**
* GtkEntry::invisible-char:
*
* The invisible character is used when masking entry contents (in
* \"password mode\")"). When it is not explicitly set with the
* #GtkEntry::invisible-char property, GTK+ determines the character
* to use from a list of possible candidates, depending on availability
* in the current font.
*
* This style property allows the theme to prepend a character
* to the list of candidates.
*
* Since: 2.22
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_unichar ("invisible-char",
P_("Invisible character"),
P_("The character to use when masking entry contents (in \"password mode\")"),
0,
GTK_PARAM_READABLE));
/**
* GtkEntry::populate-popup:
* @entry: The entry on which the signal is emitted
@ -2149,12 +2170,18 @@ find_invisible_char (GtkWidget *widget)
PangoAttrList *attr_list;
gint i;
gunichar invisible_chars [] = {
0,
0x25cf, /* BLACK CIRCLE */
0x2022, /* BULLET */
0x2731, /* HEAVY ASTERISK */
0x273a /* SIXTEEN POINTED ASTERISK */
};
if (widget->style)
gtk_widget_style_get (widget,
"invisible-char", &invisible_chars[0],
NULL);
layout = gtk_widget_create_pango_layout (widget, NULL);
attr_list = pango_attr_list_new ();
@ -2163,7 +2190,7 @@ find_invisible_char (GtkWidget *widget)
pango_layout_set_attributes (layout, attr_list);
pango_attr_list_unref (attr_list);
for (i = 0; i < G_N_ELEMENTS (invisible_chars); i++)
for (i = (invisible_chars[0] != 0 ? 0 : 1); i < G_N_ELEMENTS (invisible_chars); i++)
{
gchar text[7] = { 0, };
gint len, count;
@ -2181,6 +2208,7 @@ find_invisible_char (GtkWidget *widget)
}
g_object_unref (layout);
return '*';
}

View file

@ -1538,6 +1538,12 @@ gtk_expander_set_label (GtkExpander *expander,
* return value will be %NULL. This will be the case if you create an
* empty button with gtk_button_new() to use as a container.
*
* Note that this function behaved differently in versions prior to
* 2.14 and used to return the label text stripped of embedded
* underlines indicating mnemonics and Pango markup. This problem can
* be avoided by fetching the label text directly from the label
* widget.
*
* Return value: The text of the label widget. This string is owned
* by the widget and must not be modified or freed.
*

View file

@ -8307,10 +8307,15 @@ save_entry_get_info_cb (GCancellable *cancellable,
if (data->file_exists_and_is_not_folder)
{
gboolean retval;
const char *file_part;
char *file_part;
file_part = _gtk_file_chooser_entry_get_file_part (GTK_FILE_CHOOSER_ENTRY (data->impl->location_entry));
/* Dup the string because the string may be modified
* depending on what clients do in the confirm-overwrite
* signal and this corrupts the pointer
*/
file_part = g_strdup (_gtk_file_chooser_entry_get_file_part (GTK_FILE_CHOOSER_ENTRY (data->impl->location_entry)));
retval = should_respond_after_confirm_overwrite (data->impl, file_part, data->parent_file);
g_free (file_part);
if (retval)
g_signal_emit_by_name (data->impl, "response-requested");

View file

@ -3005,14 +3005,16 @@ open_new_dir (gchar *dir_name,
if (!sys_dir_name)
{
cmpl_errno = CMPL_ERRNO_DID_NOT_CONVERT;
g_free (sent);
return NULL;
}
directory = g_dir_open (sys_dir_name, 0, &error);
if (!directory)
{
cmpl_errno = error->code; /* ??? */
g_free (sys_dir_name);
g_free (sent);
return NULL;
}

View file

@ -1079,6 +1079,7 @@ gtk_handle_box_button_press (GtkWidget *widget,
gint root_x, root_y;
gint width, height;
gtk_invisible_set_screen (GTK_INVISIBLE (invisible), gtk_widget_get_screen (hb));
gdk_window_get_deskrelative_origin (hb->bin_window, &desk_x, &desk_y);
gdk_window_get_origin (hb->bin_window, &root_x, &root_y);
gdk_drawable_get_size (hb->bin_window, &width, &height);

View file

@ -1471,7 +1471,7 @@ gtk_icon_view_size_allocate (GtkWidget *widget,
hadjustment->upper = MAX (allocation->width, icon_view->priv->width);
if (hadjustment->value > hadjustment->upper - hadjustment->page_size)
gtk_adjustment_set_value (hadjustment, hadjustment->upper - hadjustment->page_size);
gtk_adjustment_set_value (hadjustment, MAX (0, hadjustment->upper - hadjustment->page_size));
vadjustment->page_size = allocation->height;
vadjustment->page_increment = allocation->height * 0.9;
@ -1480,7 +1480,7 @@ gtk_icon_view_size_allocate (GtkWidget *widget,
vadjustment->upper = MAX (allocation->height, icon_view->priv->height);
if (vadjustment->value > vadjustment->upper - vadjustment->page_size)
gtk_adjustment_set_value (vadjustment, vadjustment->upper - vadjustment->page_size);
gtk_adjustment_set_value (vadjustment, MAX (0, vadjustment->upper - vadjustment->page_size));
if (GTK_WIDGET_REALIZED (widget) &&
icon_view->priv->scroll_to_path)
@ -1638,11 +1638,17 @@ gtk_icon_view_expose (GtkWidget *widget,
static gboolean
rubberband_scroll_timeout (gpointer data)
{
GtkIconView *icon_view = data;
GtkIconView *icon_view;
gdouble value;
gtk_adjustment_set_value (icon_view->priv->vadjustment,
icon_view->priv->vadjustment->value +
icon_view->priv->scroll_value_diff);
icon_view = data;
value = MIN (icon_view->priv->vadjustment->value +
icon_view->priv->scroll_value_diff,
icon_view->priv->vadjustment->upper -
icon_view->priv->vadjustment->page_size);
gtk_adjustment_set_value (icon_view->priv->vadjustment, value);
gtk_icon_view_update_rubberband (icon_view);
@ -2144,14 +2150,11 @@ gtk_icon_view_button_press (GtkWidget *widget,
}
else
{
if (!item->selected)
{
gtk_icon_view_unselect_all_internal (icon_view);
item->selected = TRUE;
gtk_icon_view_queue_draw_item (icon_view, item);
dirty = TRUE;
}
gtk_icon_view_unselect_all_internal (icon_view);
item->selected = TRUE;
gtk_icon_view_queue_draw_item (icon_view, item);
dirty = TRUE;
}
gtk_icon_view_set_cursor_item (icon_view, item, cursor_cell);
icon_view->priv->anchor_item = item;
@ -4349,7 +4352,7 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
{
gint x, y;
gint focus_width;
gfloat offset;
gfloat offset, value;
gtk_widget_style_get (GTK_WIDGET (icon_view),
"focus-line-width", &focus_width,
@ -4359,15 +4362,17 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
offset = y + item->y - focus_width -
row_align * (GTK_WIDGET (icon_view)->allocation.height - item->height);
gtk_adjustment_set_value (icon_view->priv->vadjustment,
icon_view->priv->vadjustment->value + offset);
value = CLAMP (icon_view->priv->vadjustment->value + offset,
icon_view->priv->vadjustment->lower,
icon_view->priv->vadjustment->upper - icon_view->priv->vadjustment->page_size);
gtk_adjustment_set_value (icon_view->priv->vadjustment, value);
offset = x + item->x - focus_width -
col_align * (GTK_WIDGET (icon_view)->allocation.width - item->width);
gtk_adjustment_set_value (icon_view->priv->hadjustment,
icon_view->priv->hadjustment->value + offset);
value = CLAMP (icon_view->priv->hadjustment->value + offset,
icon_view->priv->hadjustment->lower,
icon_view->priv->hadjustment->upper - icon_view->priv->hadjustment->page_size);
gtk_adjustment_set_value (icon_view->priv->hadjustment, value);
gtk_adjustment_changed (icon_view->priv->hadjustment);
gtk_adjustment_changed (icon_view->priv->vadjustment);
@ -6407,6 +6412,7 @@ gtk_icon_view_autoscroll (GtkIconView *icon_view)
{
gint px, py, x, y, width, height;
gint hoffset, voffset;
gfloat value;
gdk_window_get_pointer (GTK_WIDGET (icon_view)->window, &px, &py, NULL);
gdk_window_get_geometry (GTK_WIDGET (icon_view)->window, &x, &y, &width, &height, NULL);
@ -6421,12 +6427,19 @@ gtk_icon_view_autoscroll (GtkIconView *icon_view)
hoffset = MAX (px - (x + width - 2 * SCROLL_EDGE_SIZE), 0);
if (voffset != 0)
gtk_adjustment_set_value (icon_view->priv->vadjustment,
icon_view->priv->vadjustment->value + voffset);
{
value = CLAMP (icon_view->priv->vadjustment->value + voffset,
icon_view->priv->vadjustment->lower,
icon_view->priv->vadjustment->upper - icon_view->priv->vadjustment->page_size);
gtk_adjustment_set_value (icon_view->priv->vadjustment, value);
}
if (hoffset != 0)
gtk_adjustment_set_value (icon_view->priv->hadjustment,
icon_view->priv->hadjustment->value + hoffset);
{
value = CLAMP (icon_view->priv->hadjustment->value + hoffset,
icon_view->priv->hadjustment->lower,
icon_view->priv->hadjustment->upper - icon_view->priv->hadjustment->page_size);
gtk_adjustment_set_value (icon_view->priv->hadjustment, value);
}
}

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