Ryan Lortie [Mon, 20 Aug 2012 21:03:15 +0000 (17:03 -0400)]
GtkMenuButton: rename _set_menu() to _set_popup()
It's too close to the release so we'll keep _set_menu() around, but
deprecate it, pointing to the new API. It will be removed (and the name
reused) before the 3.6.0 release.
Lars Uebernickel [Wed, 20 Jun 2012 14:56:56 +0000 (16:56 +0200)]
gtkmodelmenu: add support for action namespaces
If a section or submenu item has a "action-namespace" attribute, the
action names of the created GtkModelMenuItems will be prefixed with that
namespace. Namespaces can be cascaded.
Ryan Lortie [Sat, 18 Aug 2012 03:28:53 +0000 (23:28 -0400)]
GtkApplicationWindow: drop GActionMuxer use
There are no remaining users of the GActionMuxer in GtkApplicationWindow
because they've all been ported over to using the one on GtkWidget (via
GtkActionHelper, for the most part).
Ryan Lortie [Sat, 18 Aug 2012 03:26:44 +0000 (23:26 -0400)]
Remove private appwindow observer creation API
There are no remaining users of the GtkApplicationWindow API to create
GSimpleActionObserver or to get the GActionObservable (ie: muxer) for
the appwindow. Drop those APIs.
Ryan Lortie [Sat, 18 Aug 2012 03:13:42 +0000 (23:13 -0400)]
gtkmodelmenu: move to new action regime
Drop the explicit passing of GActionGroup into the GtkMenu(Bar)
constructors and operate from the action context instead.
With GtkMenuItem implementing GtkActionable, this turns out to be pretty
easy (and most of the code can be removed from GtkModelMenuItem,
including the GActionObserver implementation).
Lars Uebernickel [Fri, 17 Aug 2012 22:21:59 +0000 (18:21 -0400)]
Add two users of gtk_widget_insert_action_group
Each GtkWindow with an associated GtkApplication should add this as
"app" to its action context. Each GtkApplicationWindow is its own
GActionGroup, and it should add itself to itself with the prefix "win".
There is now some duplication here because we have the new GActionMuxer
hierarchy managed by GtkWidget, but GtkApplicationWindow still carries
its own muxer. The redundancy will be removed in a future patch.
Ryan Lortie [Fri, 17 Aug 2012 22:13:02 +0000 (18:13 -0400)]
introduce private GtkActionHelper
The current process of implementing GActionObserver is annoying and the
GSimpleActionObserver interface leaves a lot to be desired. Introduce a
new class, GtkActionHelper that gives you pretty much everything you'd
want to do as an implementor of GtkActionable.
The GtkActionHelper also features an "application" mode that is not
associated with a particular GtkWidget but rather with whatever widget
happens to be the active window of the given GtkApplication at a
particular point in time. This will be useful for the Mac OS menubar.
Lars Uebernickel [Fri, 17 Aug 2012 22:09:35 +0000 (18:09 -0400)]
GtkWidget: Add gtk_widget_insert_action_group()
This allows adding a GActionGroup with a given name at an arbitrary
point in the widget tree.
This patch also adds an internal _get_action_muxer() API. Calling this
will create a GActionMuxer associated with the widget. The parent of
the muxer will be the muxer of the widget's conceptual parent. For
non-menus, that is the normal parent. For menus, it is the attach
widget.
In this way, we end up with a hierarchy of GActionMuxer that largely
reflects the hierarchy of GtkWidget, but only in places that the action
context has been requested. These muxers are the ones on which the
inserted actions groups are installed.
Lars Uebernickel [Fri, 17 Aug 2012 17:16:51 +0000 (13:16 -0400)]
GActionMuxer: add support for parent muxers
If a muxer does not contain an action group with the given prefix, chain
up to the "parent" muxer to look for it.
This initial implementation is rather inefficient. It will lead to
changes on action groups associated with parent muxers being broadcast
to all children (regardless of if anybody there is interested or not).
An optimised version will follow soon.
Chun-wei Fan [Wed, 15 Aug 2012 07:52:01 +0000 (15:52 +0800)]
gtk/gtklevelbar.c: Fix build on non-C99 compilers
-Include fallback-c89.c for the usage of round(), where an implementation
of round() is provided for compilers that don't have it
-Use g_ascii_strtod() instead of strtof as strtof() may not be universally
available.
Chun-wei Fan [Wed, 15 Aug 2012 07:48:15 +0000 (15:48 +0800)]
Update Visual C++ 2010 project files
-Turn on Whole Program Optimization for all Release builds.
-Disable Incremental Linking for all Release builds.
-Use MultiByte character set for all configurations for consistency.
Chun-wei Fan [Wed, 15 Aug 2012 07:07:15 +0000 (15:07 +0800)]
Update Visual C++ 2008 projects
-Enhance optimization by turning on WholeProgramOptimization for all
Release builds
-Disable IncrementalLinking for all Release builds
-Make sure we are using MultiByte character set, to be consistent across
the board for all configurations
Expose the masked string for password fields to assistive technologies.
Call _gtk_entry_get_display_text()from gtkentryaccessible.c to make
sure we always consider the actual text being displayed when
implementing the functions from the AtkTet interface.
These widgets have ancestors other than GObject which could eventually
implement the notify vfunc for their properties. For correctness, they
should chain up the notify vfunc.
Cosimo Cecchi [Tue, 7 Aug 2012 11:09:42 +0000 (13:09 +0200)]
toolbar: deprecate shadow-type style property
While shadow-type *properties* can make sense, to opt-out of the
padding/border machinery programmatically, having it as a style
property doesn't make any sense, since we have a better way to change
the bevel style from the theme already.
This commit deprecates the shadow-type style property in GtkToolbar.
Matthias Clasen [Tue, 7 Aug 2012 04:38:48 +0000 (00:38 -0400)]
Optimize gtk_widget_path_copy() by preallocating "elems" array
gtk_widget_path_copy() currently calls g_array_append_val() in a loop,
which is inefficient due to reallocating the array's memory. Calling
g_array_set_size() before entering the loop reduces the number of CPU
cycles used by roughly 30%.
Patch by John Lindgren,
https://bugzilla.gnome.org/show_bug.cgi?id=679978
Matthias Clasen [Mon, 6 Aug 2012 12:34:46 +0000 (08:34 -0400)]
Leave GDK_THREADS_ENTER/LEAVE visible for now
Not defining these macros at all causes harsh build breakages.
Better to leave them defined (but documented as deprecated) for now.
Everybody will still get the deprecation warnings for the underlying
gdk_threads_enter/leave.
We can hide the macros again later on when the world has had some
time to port off GDK threads.
Paolo Borelli [Sat, 4 Aug 2012 15:22:38 +0000 (17:22 +0200)]
Make GtkToolbar honour css border and padding
The widget is already calling gtk_render_frame, but is not measuring css
border and padding when negotiating its size. This patch replaces the
already existing get_internal_padding static helper with a function that
sums the old internal-padding value with the values specified via css.
Matthias Clasen [Thu, 2 Aug 2012 23:49:15 +0000 (01:49 +0200)]
docs: Improve man page generation
Use $(AM_V_GEN) for generating man pages, and set some parameters
for the XSL stylesheets. Among other things, don't generate AUTHORS
and COPYRIGHT sections.
Matthias Clasen [Wed, 1 Aug 2012 08:26:17 +0000 (10:26 +0200)]
Expand the thread deprecation documentation
The story is slightly different for applications vs libraries;
make it clear that libraries should continue using the lock so
we don't break applications that haven't been ported to the
'single thread' model yet.
notebook: restore previous behaviour wrt. unparenting of tab labels
When the tab label gets removed from the notebook on widget
desctruction, we should still unconditionally unparent it from the
notebook, since failing to do so will keep a stray reference alive.
In case applications rely on the tab label being destroyed to release
other references (e.g. because the tab label is a custom object, or
another object's lifecycle is tied to it using g_object_set_data_full()),
this will also possibly cause other references to get leaked.
In Nautilus, the result was we were failing to release the reference to
a NautilusWindowSlot, and other parts of the application relied
on it being destroyed at a specific time instead, causing the
application to crash when closing a window.
menubutton: Clear references in dispose, not finalize
We need to do this here so that an explicit gtk_widget_destroy
on either the widget or a container that holds it will kill the
reference to the menu or model.
This commit deprecates gdk_threads_init, gdk_threads_enter,
gdk_threads_leave and gdk_threads_set_lock_functions. Using GTK+
from multiple threads does not work at all on Windows, and is
problematic on other platforms as well. We want to move to a world
where all GTK+ calls are made from the main thread.
Use g_main_context_invoke, g_idle_add and related functions if you
need to schedule GTK+ calls from other threads.