Rework the way actions and proxies interact, to make the
interaction less ad hoc, more extensible, and better suited
for support in GUI builders like glade.
To be used as a proxy, a widget must now implement the
GtkActivatable interface, and GtkActivatable implementations
are responsible for syncing their appearance with the action
and for activating the action.
All the widgets that are commonly used as proxies implement
GtkActivatable now.
Patch by Tristan van Berkom.
* gtk/gtkactivatable.[hc]: The GtkActivatable interface.
* gtk/gtkbutton.c:
* gtk/gtktogglebutton.c:
* gtk/gtktoolitem.c:
* gtk/gtktoolbutton.c:
* gtk/gtktoggletoolbutton.c:
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkimagemenuitem.c:
* gtk/gtkradiomenuitem.c:
* gtk/gtkrecentchooserprivate.h:
* gtk/gtkrecentchooser.c:
* gtk/gtkrecentchooserdefault.c:
* gtk/gtkrecentchoosermenu.c: Implement GtkActivatable.
* gtk/gtkaction.[hc]: Move appearance synchronization to
GtkActivatable implementations.
* gtk/gtkradioaction.c:
* gtk/gtkrecentaction.c:
* gtk/gtktoggleaction.c:
* gtk/gtkactiongroup.c: Adapt.
* gtk/gtk.h: Include gtkactivatable.h
* gtk/gtk.symbols: Add new functions
svn path=/trunk/; revision=22195
* gtk/gtktextview.c: Don't set up im stuff if the widget
is not realized.
* gtk/gtkimmodule.c: Assert that we have a window.
svn path=/trunk/; revision=22193
Patch by Federico Mena Quintero
* gtk/gtkwindow.h:
* gtk/gtkwindow.c (_gtk_window_set_is_toplevel): New internal
function used when a GtkPlug parents/unparents itself by an
in-process GtkSocket. This keeps the plug's GTK_TOPLEVEL flag in
sync with the global toplevel_list.
* gtk/gtkplug.c (gtk_plug_set_is_child): Call
_gtk_window_set_is_toplevel() to keep the toplevel list updated,
instead of just setting/unsetting the GTK_TOPLEVEL flag.
svn path=/trunk/; revision=22191
* gtk/gtkwidget.c (gtk_widget_get_snapshot): Use a different approach
to snapshotting that is in line with what is done in the client-side
windows branch, and that works for widgets regardless if they are
double-buffered or not. Patch by Alex Larsson.
* gdk/gdkwindow.c (_gdk_window_calculate_full_clip_region): Clip
to the parent.
svn path=/trunk/; revision=22187
2009-01-22 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechooserentry.c (autocomplete): Relax the assertion;
just do nothing if the folder is not loaded or if the cursor position
is not at the end of the text. A very slow-to-load folder can get
us into the latter state if the user starts typing first.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22186
2009-01-22 Federico Mena Quintero <federico@novell.com>
Fix the computation of "complete but unique" in
GtkFileChooserEntry. Fix the case where "/" was not appended to a
unique directory name during explicit Tab completion.
* gtk/gtkfilechooserentry.c (maybe_append_separator_to_file):
Return whether anything was appended as well as the new string
itself.
(find_common_prefix): Oops, only turn on
is_complete_not_unique_ret if we had a unique match!
(append_common_prefix): If we appended a directory separator, we
*did* expand the common prefix, so we are not in the "nothing
inserted" case.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22184
(start_explicit_completion): Add comments for translators, to
explain the purpose of the various feedback messages used during
completion.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22183
(start_loading_current_folder): Check if the folder to be loaded
is non-native for the local_only=TRUE case; if so, return an error
as we are configured to load only local folders.
(reload_current_folder): Pass on errors from
start_loading_current_folder(). Tighten the preconditions, as we
are sure that we can only receive non-NULL folder-files to load.
(refresh_current_folder_and_file_part): Pass on errors from
reload_current_folder(). At the very end, assert the invariant
described above.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22182
(discard_loading_and_current_folder_file): Factor out function to
cancel the cancellable and discard the current_folder_file,
i.e. to reset the invariant to the "nothing valid is loaded" case.
(gtk_file_chooser_entry_dispose): Use
discard_loading_and_current_folder_file().
(reload_current_folder): Likewise.
(refresh_current_folder_and_file_part): Likewise, and ensure that
the error cases result in the invariant being held.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22181
(start_autocompletion): Process the result from refresh...(). We
only do completion in the REFRESH_OK case. For the error cases,
we don't do anything, as this is autocompletion and must not
result in non-asked-for errors popping up.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22180
(commit_completion_and_refresh): Don't do anything with the result
of refresh...(), since this function doesn't get called during
completion-related interaction.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22179
(start_explicit_completion): Process the result from
refresh...(). Here we present the actual feedback about only
being able to display local folders for local_only=TRUE.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22178
2009-01-22 Federico Mena Quintero <federico@novell.com>
Return an error code when refreshing the entry from the user's
input. We use this in the completion code to know when completion
can't happen due to (for example) having a non-local URI in a file
chooser that is local_only=TRUE.
Also, we start maintaining an invariant that
chooser_entry->current_folder_file != NULL implies that:
* what the user entered is valid
* we are loading that folder (chooser_entry->load_folder_cancellable != NULL)
* or we are done loading that folder, or we have a handle
to it at least (chooser_entry->current_folder != NULL)
The invariant also says that all of the above are NULL (and
chooser_entry->current_folder_file == NULL) implies that the user
typed something invalid. This makes
_gtk_file_chooser_entry_get_current_folder() not able to return
an invalid folder.
* gtk/gtkfilechooserentry.c (RefreshStatus): New enum.
(refresh_current_folder_and_file_part): Return a RefreshStatus.
We filter out incomplete hostnames here (typing
"sftp://incompl[tab]" will error out), as well as completely
unparsable input.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22177
2009-01-22 Michael Natterer <mitch@imendio.com>
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): g_return_if_fail()
on icon_name != NULL so we get a warning instead of a crash here.
svn path=/trunk/; revision=22174
2009-01-19 Tor Lillqvist <tml@iki.fi>
Bug 568305 - gdk-pixbuf mishandles BI_BITFIELDS bmps
* io-bmp.c (OneLine32): Use unsigned variables so that we can
right-shift them without risk of sign extension. Don't "reverse"
the alpha value, actually storing 0xFF-alpha, but use it as such.
svn path=/trunk/; revision=22172
009-01-21 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c: Change the Caps Lock warning to the more
neutral "Caps Lock is on". Requested by Wouter Bolsterlee
svn path=/trunk/; revision=22166
2009-01-21 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkcursor-win32.c: Rename static local functions and
variables to not have any unnecessary _ or _gdk_win32 prefix.
* gdk/win32/gdkcursor-win32.c (hcursor_from_type): Implement
creating a GDK_BLANK_CURSOR.
svn path=/trunk/; revision=22165
* gtk/gtkentry.c: Fix an expose loop caused by raising windows out
of an expose handler. Also, don't show the 'Caps Lock' warning for
activated input methods, since that makes it permanently shown
for some locales. It should not be that necessary, now that we
do show preedit text even in password entries. Pointed out by
Frederic Crozat.
svn path=/trunk/; revision=22164
2009-01-21 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechooserdefault.c (save_widgets_create): Set
local_only on the location entry when we create it...
(set_local_only): ... and set it here only if the location entry
exists.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22163