Commit Graph

13522 Commits

Author SHA1 Message Date
Murray Cumming
b91549a38a Add "extern C" declarations around AppChooser headers.
This is necessary to allow linking from code compiled as C++.
2011-02-10 10:02:38 +01:00
Matthias Clasen
3f1c95de8d Don't try to modify readonly strings
This was an oversight in the recent accel label improvement.
When we get an untranslated string back from gettext(), it is
not ok to replace '_' by ' ' in-place. Instead, do it while
appending to the GString.
https://bugzilla.gnome.org/show_bug.cgi?id=641912
2011-02-09 17:32:05 -05:00
Carlos Garnacho
d1632f87d1 Avoid the need for cairo_push_group() in gtk_render_background()
This operation is potentially expensive, so the code has been
refurbished so avoid the cases it was needed for. Antialiased
cairo_clip() has been also reduced to transitions with surface
patterns involved.
2011-02-09 20:05:32 +01:00
Tristan Van Berkom
f2ff2138db Added padding to GtkTextLineDisplay struct for an addition of GdkRGBA pointer comming soon. 2011-02-10 04:04:31 +09:00
Matthias Clasen
5ada6ac197 Remove no-longer exported symbols from the symbol list 2011-02-08 23:21:40 -05:00
Matthias Clasen
49433673fc Don't export GtkModifierStyle symbols
This is not public API, so don't export it.
2011-02-08 23:21:39 -05:00
Matthias Clasen
861ba00166 Don't export gtk_cell_area_box_init_groups
That function can't be meant to be public, since it take
a GtkCellAreaBoxContext argument, which is not a public type.
2011-02-08 23:21:39 -05:00
Matthias Clasen
394ae46ec0 Add some missing symbols to the docs 2011-02-08 23:21:39 -05:00
Matthias Clasen
d2bdd50a0b Extend the mixed-dependency check to modules as well
This helps prevent accidents with GTK_PATH.
2011-02-08 13:49:16 -05:00
Johan Dahlin
6a40c0f865 introspection: Remove redundant include
Gdk-3.0 is already included above via --include-uninstalled, so
don't also specify it in INCLUDES.  Doing so breaks if it isn't
installed already, since we try to find the gdk-3.0.pc.
2011-02-08 13:30:24 -02:00
Johan Dahlin
358a2b8675 Rename time to time_ to avoid a scanner warning 2011-02-08 13:29:57 -02:00
Benjamin Otte
1483145806 API: image: Move private struct definitions into private header
They weren't privatized because the dnd code used them, too. But a
private header can allow the dnd code to be nasty, so go dnd code!
2011-02-08 08:58:49 +01:00
Carlos Garnacho
15fdf90265 doc: Add a note about prioritization of GtkStyleProviders
It was unclear in the docs what happened if
gtk_style_context_add_provider() and
gtk_style_context_add_provider_for_screen()
were used with the same priority.
2011-02-08 04:17:56 +01:00
Matthias Clasen
3a50b460c6 Update the context direction when emitting ::direction-changed
This makes the flipping example in testgtk work as expected again.
https://bugzilla.gnome.org/show_bug.cgi?id=632775
2011-02-07 20:37:09 -05:00
Matthias Clasen
208974636f Set the correct initial value for the direction property 2011-02-07 20:36:46 -05:00
Carlos Garnacho
2be692687f Fix color style properties lookup when the color resolution fails
The cached GValue ended up with a GtkSymbolicColor type, so
the contained value was bogus. Noticed by Mitch.
2011-02-07 19:56:17 +01:00
Matthias Clasen
23f9bdd586 Fix problems with state propagation
Sensitivity changes were not properly propagated down the
hierarchy. There were two issues here:

a) correctly identifying when a state change request affects
   sensitivity
b) not filtering out sensitivity in gtk_widget_propagate_state(),
  since gtk_widget_set_sensitivity() uses that to do its work

https://bugzilla.gnome.org/show_bug.cgi?id=641431
2011-02-07 11:27:50 -05:00
Tristan Van Berkom
1c20c93423 Optimize queue_resize_on_widget()
Optimized GtkSizeGroup code that is invoked for every queued resize
and every request that is not previously cached by trading qdata on
widgets for 3 extra bitfields on the GtkWidgetPrivate structure.
2011-02-08 00:39:51 +09:00
Javier Jardón
db97f8660a Use faster new G_VALUE_COLLECT_INIT variant instead G_VALUE_COLLECT
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=641621
2011-02-07 13:14:47 +00:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Hans Breuer
733731e80b No more gtk_plug_*/gtk_socket_* symbols on win32 2011-02-06 15:07:14 +01:00
Hans Breuer
f55ccce2d9 win32: msvc build update 2011-02-06 15:07:12 +01:00
Michael Natterer
e39e8acd67 gtk: gtk_cell_renderer_get_state(): check the widget's effective sensitivity 2011-02-06 14:47:58 +01:00
Michael Natterer
1c0f85a813 gtk: gtk_cell_renderer_get_state(): a row can be both selected and insensitive
so pull the SELECTED state flag out of the !sensitive branch. Also,
don't make FOCUSED depend on SELECTED here, it's up to the widget to
decide whether or not that is possible.
2011-02-06 14:45:49 +01:00
Michael Natterer
330158977d gtk: make the .trough background-color darker() as it was in GTK+ 2.x 2011-02-06 13:48:42 +01:00
Carlos Garnacho
42778894c0 s/state_changed/state_flags_changed/ in GtkComboBox 2011-02-06 11:21:42 +01:00
Carlos Garnacho
baa6343233 Handle insensitive cell renderer flags in gtk_cell_renderer_get_state() 2011-02-06 11:21:42 +01:00
Carlos Garnacho
217d3fd796 GtkStyleContext is meant to have a GdkScreen
It is used to get the default providers, without them
the style context can't do much. A check for NULL screen
is done before any sensitive call to
gtk_style_context_set_screen(), in the hope that any widget
will open the display before doing anything related to
styling. Fixes bug #641429, reported by Bastien Nocera.
2011-02-06 11:21:42 +01:00
Michael Natterer
f23585b7bb gtk: bail out in render_background_internal() if the extents are <= 0
otherwise we run into scaling the cairo_t into a borken state that's
not fixable by cairo_restore().
2011-02-06 11:17:59 +01:00
Michael Natterer
858ba35873 gtk: remove function gtk_entry_queue_draw() and call gtk_widget_queue_draw()
the old function was a leftover from when GtkEntry had a window
and was now invalidating the entire toplevel on each entry change.
2011-02-06 11:17:58 +01:00
Michael Natterer
c1bc521e92 gtk: get rid of two cases of invalidating the spinbutton when not needed 2011-02-06 11:17:58 +01:00
Matthias Clasen
bfaf472e70 Avoid tons of warnings from stylecontext initialization without screen
This reverts part of commit 4dc9b29.
2011-02-05 11:21:21 -05:00
Carlos Garnacho
c0ba1c96d4 Ensure gtk_render_background()/frame() yield the same shape
On rounded boxes the background and the frame wouldn't fit in
perfectly, leaving some visual noise in the corners. This is now
gone.
2011-02-05 15:26:40 +01:00
Carlos Garnacho
4c40349b92 Use cairo_push_group() to mix backgrounds during transitions
It also helps remove the cairo_clip() call to achieve the rounded
shape.
2011-02-05 15:26:40 +01:00
Michael Natterer
c990699922 gtk: don't style GtkLabel:selected's color separately
or labels in selected state will not have a different color. Reviewed
by Carlos.
2011-02-05 14:10:18 +01:00
Matthias Clasen
ceeb50be9a Don't leak a cell area context 2011-02-05 02:03:35 -05:00
Matthias Clasen
4dc9b294d8 Don't assume a screen exists before realize()
Fix for https://bugzilla.gnome.org/show_bug.cgi?id=641429
2011-02-04 22:03:11 -05:00
Matthias Clasen
3c1ff82b21 Fix a memory leak in GtkCSSProvider
Found by Felix Riemann
https://bugzilla.gnome.org/show_bug.cgi?id=641558
2011-02-04 21:13:56 -05:00
Matthias Clasen
b6783933c9 Strip XF86 prefix from untranslated keysyms
When we don't have translations, at least remove the
ugly XF86 prefix.
2011-02-04 15:34:36 -05:00
Javier Jardón
03df034684 Remove latest bits of GtkItemFactory 2011-02-04 17:30:11 +00:00
Tristan Van Berkom
012bc98936 Fixed gtk_recent_chooser_menu_set_current_filter to update the local pointer.
Before this patch, unsetting the filter manually before disposing
the recent chooser menu (or unsetting the filter twice), would cause
warnings (or invalid memory accesses).
2011-02-05 01:00:55 +09:00
Matthias Clasen
99691ab7aa Protect against tree_view being NULL
This apparently happens when setting the "visible" property
from ui files.
https://bugzilla.gnome.org/show_bug.cgi?id=640801
2011-02-03 14:40:53 -05:00
Laszlo Pandy
395b13bbce [GI] Add method annotation for gtk_grab_add and gtk_grab_remove. 2011-02-03 15:20:51 +01:00
Laszlo Pandy
295c2fe8d1 [GI] Add method annotations to remaining gtk_drag_* functions.
https://bugzilla.gnome.org/show_bug.cgi?id=639945
2011-02-03 15:10:43 +01:00
Tristan Van Berkom
d799d6d4f0 Fixing GtkColorButton to redraw itself when gtk_color_button_set_rgba() is called. 2011-02-03 23:02:15 +09:00
Tristan Van Berkom
b01fc35c18 Added default implementations of various GtkCellArea vfuncs.
Having default implementations on abstract classes that do nothing
or print errors make life easier for language bindings implementors,
inside GTK+ this makes little or no difference.
2011-02-03 19:03:49 +09:00
Tristan Van Berkom
ce000db7f6 Added default implementation of GtkCellRendererClass.get_request_mode()
Having default implementations on abstract classes that do nothing
or print errors make life easier for language bindings implementors,
inside GTK+ this makes little or no difference.
2011-02-03 19:01:55 +09:00
Matthias Clasen
7894ff4bcb Don't g_object_unref cairo surfaces
This was causing warnings when dragging text from labels.
2011-02-02 22:05:26 -05:00
Martin Pitt
1bd36ce723 [GI] Annotate gtk_drag_{dest,source}* as methods
As these do not start with gtk_widget_*, the GI scanner does not recognize them
as methods. With the recently added (method) annotation [1] it is now possible
to mark them as proper methods of GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=639945

[1] http://git.gnome.org/browse/gobject-introspection/commit/?id=09bca85dd4
2011-02-02 17:51:48 +01:00
Martin Pitt
0e795b67c3 [GI] Mark mis-detected constructors as such
constructors which take an object of the same class as its first argument are
mis-detected as method call with "self" argument by the GIR scanner. Using the
new (constructor) annotation from bug 561264, mark some of them as proper
constuctors, so that you can call them with NULL as first argument from
bindings; in particular, this fixes gdk_window_new() and the
gtk_radio_button_new_with*() constructors.
2011-02-02 15:11:06 +01:00
Matthias Clasen
3067ef4a9b Fix the build with --enable-gtk2-dependency 2011-02-02 01:30:21 -05:00
Tristan Van Berkom
2e34842b1a Fixed GtkCellLayout buildable implementation to set cell properties explicitly set to "" (i.e. explicitly set to nothing). 2011-02-02 15:22:31 +09:00
Tristan Van Berkom
fb3e221559 Fixed GtkContainer buildable implementation to set packing properties explicitly set to "" (i.e. explicitly set to nothing). 2011-02-02 15:22:31 +09:00
Matthias Clasen
54c97f3ba2 Fix another GtkFixed regression, in gtk_fixed_forall()
b3f6f67c changed the loop from while() to for() in gtk_fixed_forall(),
but that's wrong since the callback can have side-effects on the list,
in case the current child gets removed. And that's the case when the
widget is destroyed.

Patch by Vincent Untz
https://bugzilla.gnome.org/show_bug.cgi?id=641196
2011-02-02 00:40:02 -05:00
Vincent Untz
62d7593fc2 Fix crash in gtk_fixed_remove()
b3f6f67c changed the loop from while() to for(), but the line to move to
the next child was kept, so we could go past the end of the list.

https://bugzilla.gnome.org/show_bug.cgi?id=641176
2011-02-01 20:08:52 +01:00
Matthias Clasen
1b25489cba Remove accidentally exported symbol 2011-02-01 13:54:27 -05:00
Benjamin Otte
44c02fcbb1 API: gdk: Change get_drag_window() API
The previous function gdk_drag_get_protocol_for_display() took native
window handles, so it had to be changed. Because it didn't do what it
was named to do (it didn't return a protocol even though it was named
get_protocol) and because it doesn't operate on the display anymore but
on the actual window, it's now called gdk_window_get_drag_protocol().
2011-02-01 18:51:57 +01:00
Benjamin Otte
5bc04bc07b API: gdk: Make GdkEventSelection.requestor a GdkWindow
instead of a GdkNativeWindow. Also change gdk_selection_notify() API to
take a GdkWindow to match this change.
2011-02-01 18:51:57 +01:00
Matthias Clasen
8448780a6c Make treeview expanders work reliably
It turns out that the gtk_grab_remove() can trigger a do_prelight()
call, which may end up changing prelight_node, and then the state
gets messed up. Moving the grab removal until after we're done with
button_pressed_node and prlight_node makes expanders work reliably.

One thing that is still not right is that the expander doesn't get
prelight again after the animation is done, if you manage to release
without any additional motion events.

https://bugzilla.gnome.org/show_bug.cgi?id=641039
2011-02-01 01:32:02 -05:00
Benjamin Otte
fac914d70c API: gtk: Remove client_event vfunc from GtkWidget
Also remove the (de-facto unused) implementation from GtkWindow that was
only used for sockets/plugs.
2011-02-01 06:33:01 +01:00
Dan Winship
fc43e42bf2 Fix several bugs handling GtkTrayIcon symbolic colors
https://bugzilla.gnome.org/show_bug.cgi?id=641059
2011-01-31 19:13:29 -05:00
Matthias Clasen
6d218084c3 Clarify models vs callbacks in entry completion docs
See https://bugzilla.gnome.org/show_bug.cgi?id=641073
2011-01-31 19:01:16 -05:00
Kristian Rietveld
9dcdca2501 Don't use GTK_IS_PLUG for non-X11 backends 2011-02-01 00:26:04 +01:00
Kristian Rietveld
119d29dcb9 Only include gtktrayicon.h when building for X11
GtkTrayIcon depends on GtkPlug which is X11-specific.  This fixes the
build for Quartz.
2011-01-31 23:54:38 +01:00
Matthias Clasen
726b0d8736 Bandaid fix for icon view subclassing
I've decided that it is isn't feasible to make cell areas runtime-settable
in the time we have left before 3.0, therefore, I'm going with the
approach to allow init() functions to instantiate the default cell area
and issue a warning if a construct property is ignored.

This is not ideal, but it keeps existing icon view and combo box
subclasses working.

https://bugzilla.gnome.org/show_bug.cgi?id=639139
2011-01-31 17:39:42 -05:00
Stefan Kost
1f3a5a8d92 Clarify key-{press,release}-event docs.
Mention key-repeat in key-press and fix a copy'n'paste in key-release docs.
2011-01-31 23:10:10 +02:00
Tristan Van Berkom
a37976dae0 Fixed GtkToolPalette ->forall implementation to be gtk_widget_destroy friendly
The forall() loop was buggy as it was skipping items in the list when
the current item gets removed from the groups array as a result of
calling the callback (causing memory leaks).
2011-02-01 05:02:56 +09:00
Tristan Van Berkom
ddb4b3ebe2 Added "shift" modifier versions of keybings for GtkFileChooser "folder-up"/"folder-down" bindings.
Also updated documentation, closes bug 322926
2011-02-01 05:02:56 +09:00
Matthias Clasen
30958ea8ad Fix a segfault in gtk_statusbar_remove_all
https://bugzilla.gnome.org/show_bug.cgi?id=640487
2011-01-31 11:50:23 -05:00
Emmanuele Bassi
d51c617e13 css-provider: Fix up the Switch style
As it was with the old style, when the Switch is in the "on" state the
trough should be using the selected background color.
2011-01-31 16:21:36 +00:00
Matthias Clasen
cb498c2101 Speed up expander animation
Go back to 200ms, which is what we had in GTK+ 2.x.
Themes can change this, of course.
2011-01-31 10:51:09 -05:00
Matthias Clasen
38f6065b2b Make GtkEntryCompletion::match-selected arguments consistent
For keynav, we were still passing it the filter model.
https://bugzilla.gnome.org/show_bug.cgi?id=640698
2011-01-31 10:48:40 -05:00
Matthias Clasen
fb860a9527 Add a note to ::fill and ::expand docs 2011-01-31 10:26:28 -05:00
Matthias Clasen
a26ffdc740 Prevent a segfault in GtkPlug
The grabbed_keys might be NULL, so deal with that.
https://bugzilla.gnome.org/show_bug.cgi?id=641023
2011-01-31 10:17:21 -05:00
Matthias Clasen
0208539c4b Remove RC file references from docs where appropriate 2011-01-31 09:34:46 -05:00
Matthias Clasen
6a8d494ba1 Fix GTK_SPINNER_CLASS macro
https://bugzilla.gnome.org/show_bug.cgi?id=640999
2011-01-31 07:39:06 -05:00
Matthias Clasen
09a52de478 Add a missing id to the docs 2011-01-31 07:39:06 -05:00
Matthias Clasen
175c57ebd7 Small optimization
We can use the fact that all involved strings are interned; also
deprecate gtk_binding_set_add_path() in the headers, too.
2011-01-30 23:35:25 -05:00
Matthias Clasen
f67ab808fd doc fixes 2011-01-30 23:35:25 -05:00
Matthias Clasen
b448bb81ce Move GtkBindings docs inline 2011-01-30 23:00:12 -05:00
Matthias Clasen
dcf3430e17 Add a gtkbindingsprivate.h header 2011-01-30 21:50:54 -05:00
Matthias Clasen
8bb0d552f1 Improve binding-set parser
Make gtk_binding_entry_add_signal_from_string() return the expected
token in case of parsing error, so that we can return a GError
instead of spewing. Also, add a separate scope for binding-set,
since allowing {} in identifiers in SCOPE_VALUE breaks the fact
that the ; after the last assignment in a rule is optional.
2011-01-30 21:27:56 -05:00
Matthias Clasen
a04e721473 Add binding-set tests 2011-01-30 21:27:55 -05:00
Matthias Clasen
2ea010bca0 Convert remaining rc files to css 2011-01-30 21:27:55 -05:00
Matthias Clasen
f16dbe0db3 Convert the mac key theme to css 2011-01-30 21:27:55 -05:00
Matthias Clasen
c770f441ca Convert the Emacs key theme to css 2011-01-30 21:27:55 -05:00
Matthias Clasen
bf9e59e392 Make documentation match behaviour 2011-01-30 21:27:55 -05:00
Carlos Garnacho
c0b8053089 Move key/theme CSS providers to GtkSettingsPrivate 2011-01-30 21:27:55 -05:00
Carlos Garnacho
a03e33b10b Parse the gtk-keys.css file in the GtkSettings::gtk-key-theme-name theme path 2011-01-30 21:25:42 -05:00
Carlos Garnacho
c70b65f0eb Document @binding-set and the gtk-key-bindings css parser property 2011-01-30 21:24:52 -05:00
Carlos Garnacho
b5bee0a827 Remove unneeded code from GtkBindingSet 2011-01-30 21:24:52 -05:00
Carlos Garnacho
9a3466832c Hook up key bindings in CSS with key propagation.
This is done in the same place than it was done before the switch
to GtkStyleContext, the GtkBindingEntry has been slightly simplified
since it's now the GtkStyleContext which hands us the list
of binding sets applying to a widget, so no need to use the older
matching mechanisms.
2011-01-30 21:24:52 -05:00
Carlos Garnacho
d39f0411be Add the gtk-key-bindings CSS parser property.
This property takes a list of binding set names to have these
stored as a GPtrArray containing GtkBindingSets. this property
is handled so merging GtkStyleProperties will merge both
GtkBindingSet lists.
2011-01-30 21:24:51 -05:00
Carlos Garnacho
dbff92fd9f Add @binding-set rules to the CSS parser
these custom rules can be used to define key themes
as in the RC files, a series of bind/unbind rules
may be added then:

@binding foo-bar {
  bind "<alt>1" { "move-cursor" (visual-positions, 1, 0) };
  unbind "<ctl>d"
}
2011-01-30 21:24:51 -05:00
Carlos Garnacho
53ca6eb0b5 Add gtk_binding_entry_add_signal_from_string()
This function rescues part of the old parser (which
is now standalone) to load a bind/unbind definition
string into a GtkBindingSet.
2011-01-30 21:24:51 -05:00
Bastien Nocera
b98caf9385 GtkCssProvider: Take into account variant
When loading a theme, make sure we take into account the variant
so we don't use the plain version when the theme changes.

Also make sure to fallback to the plain theme when loading a variant
fails.

https://bugzilla.gnome.org/show_bug.cgi?id=640983
2011-01-30 21:22:12 -05:00
Bastien Nocera
7f3aa92086 GtkSettings: Fix theme not updating for dark theme
The theme was not updated when the "gtk-application-prefer-dark-theme"
GtkSettings property changed.

https://bugzilla.gnome.org/show_bug.cgi?id=640983
2011-01-30 20:48:29 -05:00
Matthias Clasen
ec37512f64 Add a gtkscaleprivate.h header 2011-01-30 03:17:05 -05:00
Matthias Clasen
4a0aa41742 Add gtkorientableprivate.h header 2011-01-30 03:12:49 -05:00
Matthias Clasen
4b5b1ab43a Fix build
We must build gtk before gtk/tests
2011-01-30 02:49:31 -05:00