Commit Graph

17943 Commits

Author SHA1 Message Date
Matthias Clasen
d559ed0ce9 Don't build native tools when not cross-compiling
This was my local native build to fail.
2013-02-01 23:53:59 -05:00
Erik van Pienbroek
9a1235bf0d Don't build gtk-launch when gio-unix is not available
https://bugzilla.gnome.org/show_bug.cgi?id=682824
2013-02-01 23:08:03 -05:00
Erik van Pienbroek
3493814ead Only build native-update-icon-cache when no external update-icon-cache binary was found
https://bugzilla.gnome.org/show_bug.cgi?id=692637
2013-02-01 23:01:40 -05:00
Cosimo Cecchi
ad70142d2c scrolledwindow: deprecate gtk_scrolled_window_add_with_viewport()
https://bugzilla.gnome.org/show_bug.cgi?id=693015
2013-02-01 22:58:55 -05:00
Cosimo Cecchi
7c1c7cb728 Don't use gtk_scrolled_window_add_with_viewport() internally
Just use gtk_container_add() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=693015
2013-02-01 22:58:54 -05:00
Cosimo Cecchi
9efa28591c scrolledwindow: make gtk_scrolled_window_add() smart
There's really no reason why we shouldn't automatically create a
GtkViewport when the widget added to GtkScrolledWindow is not a
GtkScrollable, instead of just printing a g_warning.
Copy the viewport special case into the scrolled window implementation
of gtk_container_add().

https://bugzilla.gnome.org/show_bug.cgi?id=693015
2013-02-01 22:58:53 -05:00
Matthias Clasen
5f41eb74a5 Fix a few parameter mismatches in the symbols 2013-02-01 22:54:21 -05:00
Matthias Clasen
48777cb656 Make new state flags show up in the docs 2013-02-01 22:54:21 -05:00
Matthias Clasen
3aa43f0f17 Add new symbols 2013-02-01 22:54:20 -05:00
Matthias Clasen
fae1da8ec9 Include gtklevelbaraccessible.h in gtk-a11y.h 2013-02-01 22:54:20 -05:00
Benjamin Otte
e6b3cbe7d2 cssimage: Only load image data when needed
Saves ~6MB of memory per application in the Adwaita I am using - at
least until the app starts using all the images in the theme, because
the code doesn't discard images yet once they were loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:44:17 +01:00
Benjamin Otte
b2e1b1124f cssimage: Add a getter
This will be needed in the next commit.

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:44:13 +01:00
Benjamin Otte
e3cd958e36 cssimage: Return the loaded image from compute()
This way, we don't keep the indirection when actually rendering the
image.

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:43:37 +01:00
Benjamin Otte
18ca907c4c css: Split out GtkCssImageSurface
This is essentially a GtkCssImage for a cairo_surface_t and is a pretty
much straight up copy of GtkCssImageUrl. But we want to implement lazy
loading and animations, so GtkCssImageUrl is going to gain new
features...

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:43:30 +01:00
Benjamin Otte
6348ded15d cssimage: Store the URI we're loaded from
I'd like to use it when printing the value, but I haven't found a way to
do that sanely yet, as I'd need to be able to print relative paths for
make check to work (otherwise the srcdir would blow things up). And we
use a GString to output to, so there's no way to attach a base dir to
that.

If anyone has an idea how to achieve that, poke me. Having the real
filename in debug prints sounds like a very good idea to me.

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:42:48 +01:00
Mike Gorse
92f0c5c384 Add accessibility for GtkLevelBar and value test 2013-02-01 11:44:15 -06:00
Benjamin Otte
a6bf34e292 scrolledwindow: Use local variables
This (a) makes the code look nicer, and (b) works for non-scrollables
2013-02-01 17:42:45 +01:00
Benjamin Otte
d1c642d1f5 image: Make gtk_image_new_from_resource() load animations
Requires new gdk-pixbuf APIs to load animations from resources.
2013-02-01 17:42:44 +01:00
Cosimo Cecchi
eacdaf28a6 tree-view: add back gtk_style_context_set_background()
Commit ddceddaa84 removed the call to
gtk_style_context_set_background() in favour of always rendering it with
gtk_render_background() during the draw vfunc.
This has the side effect of making the backing window always
transparent, which blocks GTK from applying some optimizations during
the paint cycle. The result is that, especially in clutter-gtk
applications, scrolling performance gets really bad.

This commit partially reverts ddceddaa84
and changes the code so that both gtk_style_context_set_background() and
gtk_render_background() are called
2013-02-01 11:27:32 +01:00
Cosimo Cecchi
c4183405fe icon-view: add back gtk_style_context_set_background()
Commit da09447914 removed the call to
gtk_style_context_set_background() in favour of always rendering it with
gtk_render_background() during the draw vfunc.
This has the side effect of making the backing window always
transparent, which blocks GTK from applying some optimizations during
the paint cycle. The result is that, especially in clutter-gtk
applications, scrolling performance gets really bad.

This commit partially reverts da09447914
and changes the code so that both gtk_style_context_set_background() and
gtk_render_background() are called.
2013-02-01 11:27:14 +01:00
Torsten Schönfeld
843e5f9cb3 treednd: Remove (out) annotation for GtkSelectionData arg
gtk_tree_drag_source_drag_data_get's GtkSelectionData argument should not be
marked as (out) because:

a) GtkSelectionData is semi-private (it's declared in gtkselectionprivate.h),
and thus gobject-introspection has no knowledge of its fields or its size.
There is thus no way for language bindings to allocate GtkSelectionData.

b) Even if it was possible for language bindings to allocate GtkSelectionData,
a zeroed-out instance thus created would not be usable with
gtk_tree_drag_source_drag_data_get.  As far as I can tell, you need to
initialize its "target" member to the GdkAtom of "GTK_TREE_MODEL_ROW".
Language bindings have no way of knowing this, of course.

https://bugzilla.gnome.org/show_bug.cgi?id=692844
2013-01-31 21:36:37 +01:00
Daiki Ueno
7a9553cfb5 textlayout: respect preedit color attribute
gtk_text_renderer_prepare_run now checks appearance.rgba, rather than
appearance.{fg_color,bg_color}.

https://bugzilla.gnome.org/show_bug.cgi?id=692766
2013-01-31 11:22:06 +09:00
Benjamin Otte
e26031e0c7 filechooser: Move saving geometry to where it belongs
Move it from the filechooserwidget to the filechooserdialog unmap
function. It was previously only working for filechooserdialogs, too.
2013-01-26 21:04:55 +01:00
Benjamin Otte
c83a7a13e1 filechooser: Move settings key defines into header
... so we can read/write those keys from different source files.
2013-01-26 21:04:55 +01:00
Benjamin Otte
af176efc0f widget: Another place to relax the visibility requirement
See commit 154204e891 for details
2013-01-26 21:04:55 +01:00
Federico Mena Quintero
e57de53108 GtkFileChooser: Remove the last remains of the last_folder_uri logic
This is akin to commit cfb09e5654 in the gtk-2-24 branch;
the last_folder_uri is no longer being used for anything meaningful, so we
remove it altogether.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-01-24 18:07:03 -06:00
Jasper St. Pierre
cca05d1dc8 Add git.mk to more places 2013-01-24 17:47:34 -05:00
Jasper St. Pierre
86f024ba0d gtkimage: Add GtkImage::resource property
This is designed for GtkBuilder scenarios:

    <object class="GtkImage" id="blah">
        <property name="resource">/org/myapp/blah.png</property>
    </object>

https://bugzilla.gnome.org/show_bug.cgi?id=692481
2013-01-24 17:47:34 -05:00
Benjamin Otte
154204e891 widget: Allow invisible toplevels to do sizing operations
This is a quickfix to keep things working.

It turns out GtkWindow assumes it can do sizing operations while not
being visible, or while in the process of show()ing/hide()ing itself.
And commit b495ce54 broke these operations.

Figuring this properly requires some more thinking and restructuring on
my part, so for now we relax the requirement of visiblility enough for
these things to start working again.
2013-01-24 14:28:58 +01:00
Benjamin Otte
78d91aaf9b filechooser: Attach GSettings object to GtkSettings
... instead of keeping one per GtkFileChooserDefault. This allows using
it in other places, too.
2013-01-24 14:28:58 +01:00
Benjamin Otte
b112a85395 filechooser: Use macros
Thanks for not letting me catch that place when I was greeping...
2013-01-24 14:28:57 +01:00
Matthias Clasen
db986ddc4f color chooser: give GSettings schema a path
The code is always instantiating this schema at a fixed location, so why
is it relocatable?

Add a path so that it shows up properly in dconf-editor, and from the
gsettings commandline tool.
2013-01-23 07:48:26 -05:00
Ryan Lortie
dc8b67de92 file chooser: give GSettings schema a path
The code is always instantiating this schema at a fixed location, so why
is it relocatable?

Add a path so that it shows up properly in dconf-editor, and from the
gsettings commandline tool.

https://bugzilla.gnome.org/show_bug.cgi?id=692163
2013-01-23 07:46:05 -05:00
Chun-wei Fan
9bdc970f8d gtk/gtktreeview: Avoid a C99ism
Declare a variable at the top of the block
2013-01-23 14:49:50 +08:00
Chun-wei Fan
ecf2a9471b Visual C++: Update gtka11y projects completion
-Rename the "libgail" projects to gtka11y, for consistency with the
 autotools builds
-Update the projects completion in gtk/a11y/Makefile.am, as the sources are
 now listed under $(libgtka11y_la_SOURCES) instead of $(libgail_la_SOURCES)
2013-01-23 13:56:11 +08:00
Cosimo Cecchi
2d820defef applicationwindow: fix mem leak
In the error path, code is leaking a ref to a GVariant.

https://bugzilla.gnome.org/show_bug.cgi?id=692203
2013-01-21 18:47:34 -05:00
Federico Mena Quintero
7d30e601de GtkFileChooserDefault: Don't use Backspace anymore to to to the parent folder
This is for consistency with Nautilus.

https://bugzilla.gnome.org/show_bug.cgi?id=692188
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-01-21 13:33:43 -06:00
Kouhei Sutou
ce15472955 Add missing $(EXEEXT)
https://bugzilla.gnome.org/show_bug.cgi?id=692073
2013-01-20 22:23:20 -05:00
Matthias Clasen
88ed5af5e4 Use g_signal_connect_object for adjustments in GtkSpinButtonAccessible
An instance of GtkAdjustment may be used by another instance after
the spin button widget is destroyed. In that case, the function
gtk_spin_button_accessible_value_changed() will be called with an
invalid argument. This situation is often caused when one use
GtkCellRendererSpin widget. To avoid invalid call of the function,
the signal handler for the "value-changed" signal should be disconnected
when the spin-button widget is destroyed.
Using g_signal_connect_object achieves just that.
https://bugzilla.gnome.org/show_bug.cgi?id=691592
2013-01-20 22:16:47 -05:00
Cole Robinson
cbce906228 widget: Add annotation (allow-none) for set_tooltip_text
https://bugzilla.gnome.org/show_bug.cgi?id=691639
2013-01-20 22:03:49 -05:00
William Jon McCann
c7169e119e Add optional single click activation mode for icon view
https://bugzilla.gnome.org/show_bug.cgi?id=345023
2013-01-20 16:49:30 -05:00
William Jon McCann
dcc412c88e Add an optional single click activation mode to treeview
https://bugzilla.gnome.org/show_bug.cgi?id=345023
2013-01-20 16:49:30 -05:00
John Lindgren
bb10561450 More or less revert 91949934 which broke the regression test for bug #111500.
https://bugzilla.gnome.org/show_bug.cgi?id=691842
2013-01-18 01:30:16 +01:00
Benjamin Otte
e84ed710a2 window: allocation x/y is 0,0
This was incorrect in 97ba4b1b8e.
2013-01-17 20:56:31 +01:00
Sébastien Wilmet
2c3b9a89a9 iconhelper: small code simplification
https://bugzilla.gnome.org/show_bug.cgi?id=687025
2013-01-17 16:21:18 +01:00
Michael Natterer
c1e0317824 quartz: merge the clipboard storing code from gtk-2-24 2013-01-17 13:16:02 +01:00
John Lindgren
11e78d9d9f docs: Update docs for recent treeviewcolumn changes 2013-01-17 02:24:15 +01:00
Benjamin Otte
104be175fc docs: Don't mark up numbers 2013-01-17 02:12:44 +01:00
Carl-Anton Ingmarsson
b5887bd26e treeviewcolumn: always hide button widget if the header is not shown
Fixes the following warning from appearing:
Gtk-WARNING **: GtkTreeView 0xb44010 is mapped but visible child
GtkButton 0xad9320 is not mapped
2013-01-17 00:45:33 +01:00
Benjamin Otte
a763738f15 cssvalue: Remove NULL check
The value cannot ever be NULL here.
2013-01-15 15:33:53 +01:00
Benjamin Otte
301e22121a cssvalue: Move value initialization
Makes it easier to track places where tha value is not initialized.
2013-01-15 15:31:59 +01:00
Benjamin Otte
b60478bb49 cssvalue: Fix return_if_fail() calls... 2013-01-15 15:29:23 +01:00
Benjamin Otte
993e3f715f cssvalue: Remove useless call 2013-01-15 15:24:04 +01:00
John Lindgren
0050d469b5 Better resize of expandable columns
Since 16195ad the “expand” property is always set to FALSE when a
column is resized.  This commit takes a different approach and enables
“expand” whenever the column is wide enough.  An appropriate
“fixed-width” (so that the desired width is achieved after expanding) is
calculated using equations that are explained in the code.

https://bugzilla.gnome.org/show_bug.cgi?id=691751
2013-01-15 14:41:30 +01:00
John Lindgren
6d53c2339f Use minimum/natural size semantics
Rewrites gtk_tree_view_column_request_width() and
gtk_tree_view_size_allocate_columns() to respect the minimum and natural
sizes that are already being returned by
gtk_cell_area_context_get_preferred_width().

The convoluted logic explained (not!) by this comment has been removed:
“Only update the expand value if the width of the widget has changed, or
the number of expand columns has changed, or if there are no expand
columns, or if we didn't have an size-allocation yet after the last
validated node.”  This logic seems to have been a workaround for the
“jumping” behavior fixed in 16195ad and is no longer necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=691751
2013-01-15 14:41:20 +01:00
John Lindgren
9b6661a0bf Minor refactoring
No functional change, only moves a self-contained block of code out of
size_allocate_columns() to its own function.

https://bugzilla.gnome.org/show_bug.cgi?id=691751
2013-01-15 14:40:40 +01:00
John Lindgren
16195adc92 Use fixed width for resizing
Removes the hidden “resized-width” and “use-resized-width” properties
from GtkTreeViewColumn and instead uses the “fixed-width” property to
serve the same purpose.  “fixed-width”, if set, will now override the
auto-sized width (-1 is now a legal value meaning “not set”).

Additional “cleanups” in this commit:

1. When the user resizes the column the “expand” property is now also
set to FALSE, in order to prevent the column from suddenly jumping to a
different width when the window is resized.

2. The code that translated mouse movement to column sizes has been
simplified:
the change in column width is now calculated directly from the distance
the mouse cursor has traveled.  Weird behavior that might have happened
previously if the position of the column changed during resizing, is now
prevented.

3. There was some lengthy logic handling the keyboard shortcuts used to
resize treeview columns, which would call gtk_widget_error_bell() once
the minimum or maximum width was reached.  Instead of rewriting these
checks I simply set the “fixed-width” property to what was requested,
relying on the fact that it is already clamped between the minimum and
maximum width during size allocation.
I will greatly surprised if anyone notices the missing error bell.

https://bugzilla.gnome.org/show_bug.cgi?id=691751
2013-01-15 14:40:40 +01:00
John Lindgren
d0e0e48942 Kill gtk_tree_view_size_request
Splits up size_request() so that the height calculations are only done
when get_preferred_height() is called and the width calculations are
only done when get_preferred_width() is called.  Since
get_preferred_width() does not change the treeview->priv->width value,
treeview->priv->prev_width will always be equal to it and can therefore
be removed.  The only place where prev_width was used is a block in
gtk_tree_view_size_allocate().  This block seems to be adjusting the
horizontal scrollbar to account for treeview->priv->width having been
changed in size_request() and should no longer be necessary.  A similar
block immediately above it seems to already account for the width change
in size_allocate().

https://bugzilla.gnome.org/show_bug.cgi?id=691751
2013-01-15 14:40:40 +01:00
John Lindgren
9194993453 Remove extraneous size request
After “validation” (i.e., background size calculations) of some cells,
size_request() was called here to update the internally cached size of
the treeview.  Apparently not updating the sizes leads to some kind of
“inconsistency” that messes with top_row_to_dy().  In the GTK3 model for
size allocation, things are more complicated.  The treeview can’t just
go ahead and calculate its own size any more; instead it reports both a
“minimum” and a “natural” size, and it doesn’t know what size it will
actually get until size_allocate().  It may be necessary to update
top_row_to_dy() to deal with not knowing the exact size.

https://bugzilla.gnome.org/show_bug.cgi?id=691751
2013-01-15 14:40:40 +01:00
Matthias Clasen
065f9529ce Remove a no-longer existing symbol 2013-01-15 00:03:58 -05:00
Matthias Clasen
af805e9cb6 Remove some non-warranted checks from builder tests
These tests were making assumptions about the properties of
cell renderers outside of rendering, which we don't give any
guarantees for.
2013-01-14 23:09:40 -05:00
Benjamin Otte
cba4156ef6 scrolledwindow: Use child-visible instead of visible for scrollbars
We want to reserve space for the size of the scrollbars even when they
are not visible. And because toggling visibile to off now returns 0 for
size requests, this won't work anymore.
2013-01-14 18:13:10 +01:00
Benjamin Otte
97ba4b1b8e window: Don't use set_allocation() to store cached values
The window size can be queried on widget->window directly, no need to
store it in widget->allocation.
This change is necessary because gtk_widget_set_allcation() is now
checking invariants that assume it's called from insize
gtk_widget_size_allocate() and that wasn;t the case here.
2013-01-14 18:13:10 +01:00
Cosimo Cecchi
aa77cd6501 range: don't trim the trough rectange by the trough margin
Commit e32da246a8 made GtkRange's trough
respect the CSS margin property, but it also trimmed the box in which
the trough reacts to click events by the margin.
We still want to catch events in that area instead, and just make sure
the margin is applied when drawing (which was already implemented by
that commit).

This commit reverts the parts of
e32da246a8 that didn't involve drawing,
fixing the bug.

https://bugzilla.gnome.org/show_bug.cgi?id=691677
2013-01-14 10:20:43 -05:00
Benjamin Otte
f260affbb8 a11y: Implement get_name() instead of setting variables
This avoids a later free of this const value.
2013-01-14 00:01:44 +01:00
Matthias Clasen
fff4c8e841 Documentation fixes
The documentation for GtkMenuButton was still referring to a
"menu" properties in several places, though it has been renamed
to "popup".
2013-01-13 08:27:20 -05:00
Matthias Clasen
974f8dfc71 Typo fix 2013-01-13 08:27:20 -05:00
Ross Burton
53083ea7b4 build: support cross-compilation by natively building gtk-update-icon-cache
When cross-compiling, instead of depending on a natively built GTK+ (which means
building Glib, ATK, Pango, gdk-pixbuf, libX11...) for gtk-update-icon-cache,
find the host compiler and gdk-pixbuf, and build another gtk-update-icon-cache
with that.

This uses AX_PROG_CC_FOR_BUILD from autostars to find the host compiler, and
assumes that you'd set PKG_CONFIG_FOR_BUILD to a host pkg-config binary.

https://bugzilla.gnome.org/show_bug.cgi?id=691301
2013-01-10 15:00:32 +00:00
William Jon McCann
e8224d138d Use Website instead of Homepage
https://bugzilla.gnome.org/show_bug.cgi?id=691375
2013-01-08 19:45:20 -05:00
Benjamin Otte
ad723bd9a9 widget: Remove leftover debug statement
Seems we didn't hit this very often. :)
2013-01-08 16:10:30 +01:00
Benjamin Otte
b495ce5446 widget: Give some meaning to "visible"
GtkWidget::visible is required for the widget to:
- have a preferred size other than 0/0
- have a size allocated
- return other values than { -1, -1, 1, 1 } from get_allocation()

This is an experimental patch aiming to make concepts and behaviors
inside GTK more concreate. GtkWidget::visible is now essentially what
CSS does for "display: none".

Note that if you want the effect of CSS's "visibility: hidden", you'll
have to use a GtkNotebook with an empty page as the concept of reserving
space but not drawing anything isn't supported natively in GTK.
2013-01-08 14:56:02 +01:00
Benjamin Otte
9be7e3e2d8 treeviewcolumn: Show button if we're visible
Previously, we were happily working with a hidden button.
2013-01-08 14:55:41 +01:00
Benjamin Otte
da100207b3 sizerequest: Make invisible widgets return a 0x0 size. 2013-01-08 12:26:04 +01:00
Benjamin Otte
33e690a9ad tests: Don't use unicode escapes
Otherwise gcc complains that GTK isn't C99.
2013-01-08 12:24:32 +01:00
Benjamin Otte
b867970bf4 tests: return 0; from main()
So that gcc stops complaining.
2013-01-08 12:23:52 +01:00
Benjamin Otte
8a644e4f16 stylecontext: Make font hack not crash
It's a lot uglier now, but it shouldn't crash anymore.

We must update the font description for animations, but we can't free it
on query, because some paths call gtk_style_context_get_font() twice in
a row without stopping the use of the first call. So us just creating a
new font description all the time and unreffing the old one is not a
good idea. So we just mere the new one into the old one.

https://bugzilla.gnome.org/show_bug.cgi?id=691186
2013-01-07 01:11:42 +01:00
Murray Cumming
7114e63cee iconhelper: treat the empty string as a NULL stock-id
https://bugzilla.gnome.org/show_bug.cgi?id=687025
2013-01-04 17:21:11 +01:00
Andrew Potter
00795e8d05 GtkApplication: properly unexport x11 menus
https://bugzilla.gnome.org/show_bug.cgi?id=688362
2013-01-04 15:50:10 +01:00
Fabian Henze
7ace438166 Fix the annotations of gtk_color_chooser_get_rgba()
https://bugzilla.gnome.org/show_bug.cgi?id=687633
2013-01-04 15:42:39 +01:00
Volker Sobek
d2c6a6bdfe docs: fix typo in gtkbuildable
https://bugzilla.gnome.org/show_bug.cgi?id=690305
2013-01-04 15:36:32 +01:00
Tristan Brindle
f48e9b1d20 Add missing annotation for gtk_combo_box_text_get_active_text()
https://bugzilla.gnome.org/show_bug.cgi?id=688140
2013-01-04 15:30:46 +01:00
Benjamin Otte
6b9b925add widget: Fix initial state flags for RTL 2012-12-29 02:33:14 +01:00
Benjamin Otte
3e979d911b widget: Fix state propagation code
Previously, with STATE_FLAGS_REPLACE we would unset _all_ the state
flags on children, not just the ones that do propagate. This caused the
RTL/LTR flags to get lost.
2012-12-29 02:24:27 +01:00
Benjamin Otte
b068b18c78 menu: Huh?
What was that code supposed to achieve? Why are we unsetting flags that
might be useful?
2012-12-29 02:07:09 +01:00
Benjamin Otte
cc986fdc1c widget: Remove underscore prefix from static function 2012-12-29 02:06:51 +01:00
Benjamin Otte
b39bb4400e progressbar: Store activity position as percentage
... instead of in absolute pixels.
2012-12-29 01:00:15 +01:00
Benjamin Otte
02b440b466 progressbar: Remove activity_step from private struct
It's only used locally, so use a local variable
2012-12-29 01:00:15 +01:00
Matthias Clasen
5adecf183b Move single-include guards inside include guards
gcc has optimizations for include guards that only work
if they are outermost in the the header.
https://bugzilla.gnome.org/show_bug.cgi?id=689810
2012-12-28 09:57:56 -05:00
Matthias Clasen
6bc2a2da48 Another trivial sorting fix 2012-12-27 12:15:05 -05:00
Matthias Clasen
38963870eb Rename gtkcolorswatchaccessible.h
Call it gtkcolorswatchaccessibleprivate.h. This matches what we're
doing for non-public widget headers in gtk/.
2012-12-27 12:11:12 -05:00
Matthias Clasen
12f9b81b1e Drop separate scrollbar accessible implementation
It didn't really add anything to the range accessible implementation.
2012-12-27 12:06:23 -05:00
Matthias Clasen
d198ea6296 Install gtk-a11y.h
We add a separate gtk-a11y.h single-include header for
them. This header will work much the same as gtkx.h. It
will be installed in /usr/include/gtk-3.0/gtk, but you
have to include it separately.
2012-12-27 12:05:03 -05:00
Matthias Clasen
5fa4232404 Install a11y headers
We install the headers for the a11y implementations in
/usr/include/gtk-3.0/gtk/a11y/.
2012-12-27 12:05:02 -05:00
Matthias Clasen
c3577c66e5 Add single-include guards to a11y headers
More preparation for installing these headers.
2012-12-27 12:05:02 -05:00
Matthias Clasen
07a00d5939 Fix inter-header includes
Since we are going to install these headers soon, we need
to make their mutual includes work in the installed location
as well. Also, avoid including individual gtk headers, to
avoid trouble with single-include guards.
2012-12-27 12:04:01 -05:00
Matthias Clasen
d2944ce633 More gail removal
Rename GailMisc to GtkMiscImpl.
2012-12-27 11:27:46 -05:00
Matthias Clasen
4cd806ff0c Rename and clean up gailutil 2012-12-27 11:27:45 -05:00
Matthias Clasen
651241b685 Some renaming
Move gail.h to gtkaccessibility.h, and libgail to libgtka11y.
2012-12-27 11:27:45 -05:00
Matthias Clasen
221ac71278 Cosmetics
Replace GAIL in top comments by 'GTK+ - accessibility implementations'.
2012-12-27 11:27:44 -05:00
Matthias Clasen
e4b5e94eb9 Make accessible implementations public
This commit exposes the get_type() functions and standard
headers for accessible implementations. This makes it possible
to derive from the GTK accessible implementations without
GType magic tricks. This is necessary, because we require the
a11y type hierarchy to be parallel to the widget type hierarchy.
So, if you derive a widget and need to adjust its a11y implementation,
you have to be able to derive its accessible implementation.

This commit probably exposes more than is absolutely necessary,
it also exposes accessibles of widgets that are unlikely candidates
for deriving from.
2012-12-27 11:23:22 -05:00
Matthias Clasen
853b5e5fa2 Trivial sorting fix 2012-12-27 01:50:54 -05:00
Paolo Borelli
70a5718b15 Paint GtkFrame background correctly when there is a label 2012-12-23 16:35:55 +01:00
Benjamin Otte
308971cc2e roundedbox: Fix copy-paste error
y coordinates don't care about the right value, they want bottom.
2012-12-21 19:47:40 +01:00
Cosimo Cecchi
81fa183b79 aboutdialog: ensure the credits page uses the "view" style class
Since not every theme renders a background for a GtkViewport (and
Adwaita master doesn't), ensure the grid+viewport we use to emulate a
text view here uses the "view" style class.
2012-12-21 17:55:26 +01:00
Paolo Borelli
751a330ad8 Paint GtkFrame background
It already paints the css border, so let's make it also honor css
background. This is needed to have a box of a different color around
some widgets (e.g. latest gnome-clocks design)
2012-12-21 13:53:02 +01:00
Benjamin Otte
cf712c462d combobox: Don't special-case RTL child positions anymore
If you want to get rounded corners on an hbox, instead of
  :first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
you now need to write:
  :first-child, :last-child:dir(rtl) {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child, :first-child:dir(rtl)
  {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
2012-12-18 18:25:42 +01:00
Benjamin Otte
821a675013 toolbar: Don't special-case RTL toolbar child positions anymore
If you want to get rounded corners on an hbox, instead of
  :first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
you now need to write:
  :first-child, :last-child:dir(rtl) {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child, :first-child:dir(rtl)
  {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
2012-12-18 18:25:42 +01:00
Benjamin Otte
6f86e57c4f box: Don't special-case RTL hbox child positions anymore
If you want to get rounded corners on an hbox, instead of
  :first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
you now need to write:
  :first-child, :last-child:dir(rtl) {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child, :first-child:dir(rtl) {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
2012-12-18 18:25:42 +01:00
Benjamin Otte
52768ee6ec stylecontext: Deprecate direction property
...  and the functions implementing it. Also deprecate the direction
getter on GtkThemingEngine.
2012-12-18 18:25:42 +01:00
Benjamin Otte
a73cc55e02 stylecontext: Use state flags for direction
... instead of using a custom direction member.

And with that, GtkWidget doesn't need to call
gtk_style_context_set_direction() anymore.
2012-12-18 18:25:42 +01:00
Benjamin Otte
1bf3de223a widget: Set state flags for direction 2012-12-18 18:25:42 +01:00
Benjamin Otte
f239edaf9c css: Parse and print the new state flags 2012-12-18 18:25:41 +01:00
Benjamin Otte
26186c74c6 API: Add state flags for RTL and LTR
See http://www.whatwg.org/specs/web-apps/current-work/#pseudo-classes
for the rationale.
2012-12-18 18:25:41 +01:00
Matthias Clasen
f229945dab NotebookPageAccessible: Implement selectable/selected states
The automatic handling for this was removed from atk, so
we need to do it ourselves here.
2012-12-17 23:59:23 -05:00
Matthias Clasen
5bee1a994f GtkMenuItemAccessible: implement selectable/selected states
The automatic handling for this was removed in atk, so
we need to do it ourselves now.
2012-12-17 23:58:24 -05:00
Matthias Clasen
df1d331713 update_type_references: Deal with type_refs_ht being NULL
This can apparently happen, and it was breaking make check
on my system, by causing it to throw  a critical out of
g_hash_table_iter_init from here.
2012-12-17 22:45:08 -05:00
Matthias Clasen
099a2b04a2 Fix up gtk_builder_expose_object addition
It needs an AVAILABLE_IN annotation in the header, and it
needs to be added to the symbols list.
2012-12-17 22:19:46 -05:00
Michael Natterer
597dc649e1 quartz: make setting_same_owner member of GtkClipboardOwner @public
to fix the build, thanks to parafin for the patch.
(cherry picked from commit e3e055f855)
2012-12-17 22:22:21 +01:00
Benjamin Otte
5e12aafacd stylecontext: Fix gtk_style_context_set_background()
This function is just a sophisitcated optimization.

If we know the GDK window's background will be opaque, we mark it as
opaque. This is so GDK can do all the optimizations it does for opaque
windows and be fast.

This is mainly used when scrolling.

The previous code didn't get this right, in particular it didn't enforce
a transparent background when it knew the background was not opaque.
2012-12-17 17:47:20 +01:00
Benjamin Otte
f770e9ac1e menushell: Remove unused variable
Introduced in 531d0dc32a. Welcome to the
club of people not using -Werror Stéphane.
2012-12-17 17:21:07 +01:00
Stéphane Démurget
531d0dc32a gtkmenushell: Fix an endless loop on focus cycle
This is a simple fallout from sealing gtkmenushell, which only appears
when F10 or Shift-F10 is used in a submenu.

https://bugzilla.gnome.org/show_bug.cgi?id=690266
2012-12-17 16:02:54 +01:00
Michael Natterer
343f1706bd gtk: fix scrolling in modal dialogs when event_widget is insensitive
When checking for modal grabs in gtk_main_do_event(), forward
GDK_SCROLL events to event_widget, even if it is insensitive.
2012-12-14 15:53:29 +01:00
Cosimo Cecchi
17a3325b2d cssstyleproperty: remove unused variable 2012-12-13 21:54:50 -05:00
Cosimo Cecchi
3782cf77c3 a11y: fix uninitialized variables compiler warning
The code path where we update the tooltip text property doesn't set
the state and value variables, and so doesn't need to call
notify_state_change().
Return early, and move the if block at the beginning of the function for
clarity.
2012-12-13 21:52:51 -05:00
Alexander Larsson
444a92d6d8 IconHelper: Avoid warnings for non-existing stock ids
There are some registred stock ids like gtk-discards that have no icons,
and you could also pass a non-registred stock id. Both of these means
gtk_style_context_lookup_icon_set returns NULL, which causes
a critical in gtk_icon_set_render_icon_pixbuf.

We avoid this by just making these render as EMPTY.
2012-12-13 10:11:00 +01:00
Alexander Larsson
0cb714fe62 Use GTK_RESIZE_PARENT resize_mode for GtkViewport
We used to use GTK_RESIZE_QUEUE, but that is problematic for e.g
a GtkScrolledWindow with NEVER scroll policies, as size changes
in ancestors will never get propagated to the scrolled window, causing
it to not have the correct size.

This is a slight performance hit, but in practice its not bound to be
problematic. In typical UIs there is only a single "large" GtkScrolledWindow
visible at a time, so a size requeust propagating out of such a window
will only hit the smaller amount of widgetry outside the scrolled window,
and additionally all such widgets will have their size request caches
still valid.

https://bugzilla.gnome.org/show_bug.cgi?id=690099
2012-12-12 15:03:24 +01:00
Matthias Clasen
ea479e6bb9 Trivial whitespace fix 2012-12-11 21:30:40 -05:00
Alexander Larsson
1c05915f51 overlay: Fix child window position/size on realize
We don't get an automatic queue resize on realize anymore, which
was papering over this bug where we did not set the child window
size/position at realize time.
2012-12-11 15:41:50 +01:00
John Ralls
796ae50064 Fix compilation on MacOSX Tiger
NSInteger isn't defined until MacOSX Leopard, so in the 3 files that
use it, include ../gdk/quartz/gdkquartz.h which provides a typedef when
needed.
2012-12-10 16:51:31 -08:00
Juan Pablo Ugarte
a3e4fa3809 Added new function gtk_builder_expose_object() based on the original work by
Marco Diego Aurélio Mesquita on bug #447972
2012-12-10 14:53:53 -03:00
Alexander Larsson
d8fae21b1c css: Avoid looking up the GtkCssStyleProperty class a lot
Instead of constantly looking up the class we just stash it away in
class_init.
2012-12-10 14:49:51 +01:00
Alexander Larsson
a1ee2b7b82 css: Speed up name matching
We use the new g_type_get_type_registration_serial() so that we can
cache and properly invalidate the result of g_type_from_name().

This bumps the glib requirement to 2.35.3 to get the new function.

https://bugzilla.gnome.org/show_bug.cgi?id=689847
2012-12-10 12:57:10 +01:00
Alexander Larsson
089eafb468 css: Clean up tree_match implementations
A bunch of repeated code is broken out into the helper
gtk_css_selector_tree_match_previous().
2012-12-10 12:28:44 +01:00
Alexander Larsson
eb4667b6e1 css: Do get_change directly on the tree without matching first
Rather than first collecting matches and then getting the change
for them we do the change collection directly on the tree. This
is about twice as fast.
2012-12-10 12:11:02 +01:00
Alexander Larsson
03c626bb15 css: Factor out some of the position matching code 2012-12-10 12:11:02 +01:00
Mario Sanchez Prada
57e1e0de94 Add missing NULL-check in GtkEntryAccessible
Only call to atk_object_set_name if gtk_entry_get_icon_name() is not NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=689923
2012-12-09 11:52:11 +01:00
Colin Walters
549a0af12b Fix build by un-translating org.gtk.Settings.FileChooser
At the moment, gtk+ doesn't depend on intltool, which is the program
that knows how to translate schemas.  Attempting to translate them
causes a build failure, so for now, let's leave them in en_US.

https://bugzilla.gnome.org/show_bug.cgi?id=689584
2012-12-07 14:05:58 -05:00
Timothy Arceri
f1532993eb Add summary and description to "show-hidden" key
https://bugzilla.gnome.org/show_bug.cgi?id=689584
2012-12-07 11:57:45 -06:00
Cosimo Cecchi
26ea8e710a scale: render scale mark lines with separator style class
So that the theme can distinguish them from the mark text.
2012-12-07 11:41:03 -05:00
Cosimo Cecchi
b855e91f7a build: fix some GCC warnings 2012-12-07 11:35:06 -05:00
Michael Natterer
9d31a04d12 quartz: fix crash in the recent clipboard "fix", and really fix it
We must not release the GtkClipboardOwner in pasteboardChangedOwner
becaue we don't own a reference to ourselves (NSPasteboard does).
Instead, release the owner right after setting it, transferring
ownership to NSPasteboard

Also, fix repeated setting of the same owner by keeping the
owner around in GtkCLipboard, and re-use it if "user_data"
doesn't change. To avoid clipboard_unset()ting our own contents
in the process, add an ugly "setting_same_owner" boolean to
GtkClipboardOwner, set it during re-setting the same owner,
and avoid calling clipboard_unset() from pasteboardChangedOwner
if it's TRUE.
(cherry picked from commit 4a8df7a33c)
2012-12-07 12:30:15 +01:00
Jasper St. Pierre
34318b9163 gtkcssselector: Fix build
destroy vs. free strikes again
2012-12-06 17:48:15 -05:00
Jasper St. Pierre
736ccb6ce1 gtkcssselector: Don't leak the hash table
We should probably free the memory we allocate. Sounds like a winning
strategy.
2012-12-06 17:39:09 -05:00
Alexander Larsson
4ca293e006 treeview: Don't invalidate whole tree unless needed
We currently invalidate the whole tree every time the style state
changes in the tree view. The primary reason for this is to catch
default font changes as that may affect text cell renderers. But
cell renderers could *potentially* also read other style properties
(although that seems weird and unlikely).

We handle this by invalidating only when some state that affects sizes
is changed. This includes all the font properties.
2012-12-06 22:28:11 +01:00
Alexander Larsson
fd964ca178 textview: Only clear the layout in style_update if the font actually changes 2012-12-06 21:16:19 +01:00
Alexander Larsson
6dfee46cdb css: Add _gtk_css_style_property_affects_font
This checks if a style_update affects the font.
2012-12-06 21:14:02 +01:00
Alexander Larsson
e6de45964d entry: No need to reset layouts on style_updated
With pango handling changes to the PangoLayout there now is no
style changes that can affect the layout for the entry, so we don't
have to reset the layout whenever the style is updated.
2012-12-06 19:54:05 +01:00
Alexander Larsson
bf35c2f044 GtkLabel: Rely on the new pango support for context change tracking
Now that Pango tracks changes to the context automatically there is
no need to do it manually in e.g. style-updated or direction-changed,
in fact the only case we have to care about is when we re-create
the PangoContext due to a screen change, so we only have to clear
the layouts in GtkLabel in screen-changed.

This means we're not clearing all the layouts whenever the state changes,
which happens to every widget when the window is unfocused, which helps
performance a lot.

https://bugzilla.gnome.org/show_bug.cgi?id=340066
2012-12-06 19:54:05 +01:00
Benjamin Otte
9ae9649188 stylecontext: Deprecate gtk_style_context_get_font()
This is for a very simple reason: The getter is returning a const value
and the font isn't const anymore. So we need to store the font
description somewhere but we can't reuse it as it's changing all the
time (yay animations, yay inherited values). Sucks.

So keep the hack in here but deprecate the function.
2012-12-06 02:57:19 +01:00
Benjamin Otte
82a6106920 switch: Remove hack to change text size
The same effect can now be achieved via
  .switch { font-size: smaller; }
so there is no need to hardcode things.
2012-12-06 02:57:18 +01:00
Benjamin Otte
1b1f4da5c7 gtk: Query font size directly
... instead of calling gtk_style_context_get_font() and then
pango_font_description_get_size().
2012-12-06 02:57:18 +01:00
Benjamin Otte
055b5d83d5 gtk: Use gtk_style_context_get()
... instead of soon-to-be-deprecated gtk_style_context_get_font().
2012-12-06 02:57:18 +01:00
Benjamin Otte
7747910b9d gtk: Use context's font
Instead of using gtk_style_context_get_font() in
pango_context_get_metrics(), use pango_context_get_font_description().
The context contains the font description we are about to use after all.
2012-12-06 02:57:18 +01:00
Benjamin Otte
fbbb66ae7d aboutdialog: Add text tag to get small text
This is to get rid of gtk_widget_override_font() and
gtk_style_context_get_font().

FIXME: This should probably be done by the theme somehow?
2012-12-06 02:57:18 +01:00
Benjamin Otte
732e89e4f3 stylecontext: Always recompute font
This is necessary  because values in a GtkCssComputedValues can change
now. So if the font-size is inherited or animated, the cached value will
be outdated.

Fixes the fontchooser preview not updating.
2012-12-06 02:57:18 +01:00
Jasper St. Pierre
7ee5e7af70 treemodelfilter: Make the constructor binding friendly
This means reffing the root in the set property implementation,
rather than in the constructor. We don't need to unref the root
on set, as it's a CONSTRUCT_ONLY property.

https://bugzilla.gnome.org/show_bug.cgi?id=680065
2012-12-05 13:43:19 -05:00
Alexander Larsson
cd016ef8e3 Revert "Don't queue resize for hidden widgets without a size group"
This seems to break redraw of the middle pane in glade.

This reverts commit faaae520c9.
2012-12-04 21:30:04 +01:00
Alexander Larsson
d3377e9d7a Don't unnecessarily queue resize in GtkWindow.style_updated
GtkWindow always queues a resize on style updates if there is
a grip, because it may have been the grip size style properties
that changed. However, even if it *were*, and it likely wasn't
that would not affect the windows size request, so no need
to queue a resize.
2012-12-04 21:24:24 +01:00
Alexander Larsson
faaae520c9 Don't queue resize for hidden widgets without a size group
queue_resize basically tells the parent widget that it may need
to pick a different size/layout. However, for a hidden child widget
that should never be needed. It may be that the widget is in a
sizegroup that has ignore_hidden == FALSE though, so it may
affect the size group calculations.

However, if a widget is not visible and not in a size group then
its safe to avoid the resize, as the widget will be resized on
becoming visible anyway.

This avoids a lot of size allocation for hidden things like menus
and tooltips.
2012-12-04 20:16:44 +01:00
Alexander Larsson
47714f55ee css: Avoid queue_resize in _gtk_widget_style_context_invalidated
We've already emitted style_updated, and the handler for that queues
a resize if necessary.
2012-12-04 20:16:44 +01:00
Alexander Larsson
c3e9112f7f css: Avoid allocations in gtk_css_value_array_compute
Almost all array computations lead to no changes (99% in nautilus)
so we avoid the upfront allocation and delay it until we know its
needed. This drops the allocate/free from the profile.
2012-12-04 20:16:44 +01:00
Alexander Larsson
7ec33e63c0 css: Start array allocation with a better size
All computed values will compute all normal properties at least, so
we might as well allocate these upfront, which leads to a lot less
reallocations.
2012-12-04 20:16:44 +01:00
Alexander Larsson
afc1a143a4 css: Use internal return_if_fail in some commonly called code
These are internal apis, and any external issues should have been
caught by checks at public API points. We use the internal checks
here because these checks show up in a non-neglible way on profiles.
2012-12-04 20:16:44 +01:00
Alexander Larsson
5833b8495e Add internal versions of g_return_[val_]_if_fail
These are only enabled on debug=yes, so not by default
in released tarballs.
2012-12-04 20:16:44 +01:00
Alexander Larsson
c1e9d46c64 css: Return 0 as change for the GtkSettingsStyleProvider 2012-12-04 19:56:18 +01:00
Michael Natterer
f08fc12741 Bug 626499 - GtkClipboard unnotified on change of OS X pasteboard owner
pasteboardChangedOwner is not called as reliably as we'd want to get it,
so keep track of [pasteboard changeCount] and drop clipboard ownership
when a change happened. Also better unset the clipboard content redundantly
in a few places rather than missing one, and reorder the code in
gtk_clipboard_set_contents() so that the new aggressive unsetting
won't unset the clipboard under our feet when we call
[pasteboard declareTypes].
(cherry picked from commit f2b74db5dc)
2012-12-04 14:42:08 +01:00
Pierre-Yves Luyten
c74d79bb55 Ensure GtkColorButton has a dialog when adding a palette
https://bugzilla.gnome.org/show_bug.cgi?id=132333
2012-12-03 23:46:18 +01:00
Kalev Lember
907447c72d gtkroundedbox: Fix a compiler warning
Use the correct enum type.
2012-12-02 19:47:54 +01:00
Benjamin Otte
1460487635 css: Fix order of enum
We switched around the order in gtkcssenumvalue.h, we need to switch
this order, too. Otherwise the parsing code will go bonkers.
2012-12-01 18:01:39 +01:00
Benjamin Otte
1688403ae6 cssvalue: Fix the scaling factors for 'smaller' and 'larger'
They were reversed. Looks like a bad case of copy/paste failure.
2012-12-01 16:27:45 +01:00
Benjamin Otte
5942099f00 cssvalue: Parse font sizes properly
As the last CSS property, font-size now is a proper number (when it's
not a keyword).
2012-12-01 16:27:45 +01:00
Benjamin Otte
891a4ab347 cssvalue: Change order of values
This is necessary so that the (rather stupid) parsing code doesn't parse
"small" and then is happy when it should instead parse "smaller".
2012-12-01 16:27:45 +01:00
Benjamin Otte
a23bc88557 css: Fix dependencies for font lookup
'larger' and 'smaller' depend on the parent value. D'oh.
2012-12-01 16:27:28 +01:00
Kalev Lember
1a61e1ea23 gtkliststore: Add explicit braces to avoid dangling else
Otherwise the following else becomes attached to the wrong if.
2012-12-01 14:02:50 +01:00
Benjamin Otte
0d9d576172 css: Add more features to font-size code
We now support the keywords (like xx-small, medium, larger, smaller...)
and I've changed the default value to be "medium".

This required some shuffling of the "get default font size" code. But
all is well now.
2012-12-01 14:00:24 +01:00
Benjamin Otte
1dd3ee6b59 css: Move default font handling
The default font is no longer handled like a custom style sheet that
overrides everything, but as the initial value. This is the same
behavior as in web browsers.

And it allows the theme to actually use the 'font-family' and
'font-size' properties. Of course, a well behaved theme will respect the
setting as much as possible and for example use relative font sizes
(which aren't yet supported, but will be soon).
2012-12-01 01:49:06 +01:00
Benjamin Otte
3ff7f1fd43 style: Add _gtk_style_provider_private_get_settings()
This gives a GtkSettings object for resolving system-dependant things -
like the default font family and font size.
No code does this yet, but we have an API.

Only GtkSettings implements this.
2012-12-01 01:24:12 +01:00
Benjamin Otte
41f8ba3c35 settings: Implement StyleProvider interface without StyleProperties
I want to deprecate GtkStyleProperties.
2012-12-01 00:56:12 +01:00
Benjamin Otte
fe61e6b3fe settings: Never override some font properties
According to the CSS specification, everything but font-size and
font-family are defined by CSS. So we don't override them anymore.
2012-12-01 00:18:01 +01:00
Benjamin Otte
be53513954 API: Deprecate functions to register custom CSS properties
We should slowly transition code to using the GTK-provided CSS. So here
we go.
2012-11-30 22:45:20 +01:00
Benjamin Otte
fc67f0d4f8 stylecontext: Remove unused private functions 2012-11-30 22:41:22 +01:00
Benjamin Otte
0c12a6ffcb cssstyleproperty: Don't mark border width properties as NO_RESIZE
I was to overeager when marking properties in
66d22f101d apparently.
2012-11-30 20:41:58 +01:00
Benjamin Otte
35362337ec widget: Optimize away unndeeded redraws
If only styles were updated that don't require resizes, don't queue one.
2012-11-30 20:40:18 +01:00
Benjamin Otte
8560ff88cd styleproperty: Add _gtk_css_style_property_changes_affect_size()
This gives fast access to the question of wether a style update requires
a resize.
2012-11-30 20:37:46 +01:00
Benjamin Otte
e0586e3680 stylecontext: Expose a function to get at the current changes 2012-11-30 20:36:57 +01:00
Benjamin Otte
66d22f101d styleproperty: Mark properties as not needing resizes 2012-11-30 20:10:23 +01:00
Benjamin Otte
a5770cef36 styleproperty: Add an affects-size property
This property will be used to avoid gtk_widget_queue_resize() calls in
favor of gtk_widget_queue_draw().
2012-11-30 20:10:23 +01:00
Benjamin Otte
4ccb8e5d33 stylecontext: Pass a bitmask to the changed values 2012-11-30 20:10:23 +01:00
Alexander Larsson
3c279b1492 icon cache: Fix double free
The symbolic icon cache code free crashed with a double free
due to a missing ->next in the loop.
2012-11-30 16:19:13 +01:00
Michael Natterer
9eea724e3b gtk: convert keyvals to unicode before committing to the imcontext
(cherry picked from commit 1eb0d98d73)
2012-11-30 15:10:51 +01:00
Michael Natterer
f619f91a8f gtk: add more OSX special casing for the deadacute and deaddoubleacute keys
So " plus foo prduces foo-with-diaereses and ' plus c produces
c-with-cedilla.
(cherry picked from commit c0102b3089)
2012-11-30 15:09:46 +01:00
Alexander Larsson
3c421db473 css: Allocate the css tree in a single chunk
This gives us several advantages:

* Smaller struct on 64bit (32bit indexes vs 64bit pointers)
* Less overhead for allocation
* Less fragmentation
2012-11-30 14:53:30 +01:00
Alexander Larsson
2dbeabdc58 css: Fix leak of lists while building tree 2012-11-30 14:53:30 +01:00
Alexander Larsson
528e6032ae css: Add accessor functions for traversing css tree
This will let us later change how the tree is stored
2012-11-30 14:53:30 +01:00
Alexander Larsson
42716cb60f css: Add const to _gtk_css_selector_tree_match_all arg 2012-11-30 14:53:30 +01:00
Alexander Larsson
d69c6fff7a css: Don't keep around linear selectors
Now we use the selector tree everywhere, so there is no need to
keep around the linear selectors unless we're using them to
verify the tree correctness, so free them.
2012-11-30 14:53:30 +01:00
Alexander Larsson
c10a0962cf css: Remove gtk_css_ruleset_matches
This is only not needed anymore, and only the VERIFY_TREE code
should access ->selector.
2012-11-30 14:53:30 +01:00
Alexander Larsson
fd4712590a css: Use tree for gtk_css_provider_get_style_property 2012-11-30 14:53:30 +01:00
Alexander Larsson
9b989a1427 css: Implement ruleset_get_change() with the tree
We traverse the tree on the matches instead of using
the linear selectors.
2012-11-30 14:53:30 +01:00
Alexander Larsson
146b6f3a93 css: Ensure the tree built is always the same
We add some "artificial" ordering to the otherwise unordered
tree nodes. This means the tree will be the same every time for the
same input. This is good because e.g. tree order affects the
reordering of the simple selectors, which may affect how
css providers are printed, which need to be consistent for
the css tests to work.
2012-11-30 14:53:30 +01:00
Alexander Larsson
3d5e8f98ec css: Use the tree to print css selectors 2012-11-30 14:53:30 +01:00
Alexander Larsson
6bec577771 css: Track the tree selector matches 2012-11-30 14:53:30 +01:00
Alexander Larsson
f678827918 css: Fix type of GtkCssSelectorRuleSetInfo match
The old type was a leftover from a previous version.
2012-11-30 14:53:30 +01:00
Alexander Larsson
6b85db7555 css: Track parent in the css tree nodes
This way we can reconstruct matched css rules
2012-11-30 14:53:30 +01:00
Alexander Larsson
69feabd139 css: Better tree match verification 2012-11-30 14:53:30 +01:00
Alexander Larsson
0ede06d229 css: Fix up position with region tree matching
This was using the wrong result in case of a match (results from
the position, not the region. Also, the descendant checks were
wrong.
2012-11-30 14:53:30 +01:00
Alexander Larsson
d6932dd823 css: Don't reorder some selectors when building selector tree
When building the tree we generally reorder the selectors inside
the same simple selector in order to pick a good first selector
to balance the tree better. However, some kinds of selectors
can't really be reordered, even thought they are simple.

This is since the matching code for some types handle
the existance of a directly preceeding selector differently:

 REGION and ANY selectors look for a DESCENDANT previous
 POSITION selector look for a REGION previous
2012-11-30 14:53:30 +01:00
Alexander Larsson
63cb467e06 css: Fixed typo in PRINT_TREE debug code 2012-11-30 14:53:30 +01:00
Alexander Larsson
1bfa6593c8 css: Create and use a tree for css selector matching 2012-11-30 14:53:30 +01:00
Alexander Larsson
daefb12a23 css: Add GtkCssSelectorTree creation and matching
From a set of GtkCssSelectors and the rulesets they match to
we create a large decision tree that lets us efficitently match
against all the rules and return the set of matched rulesets.

The tree is created such that at each level we pick the initial rule[1]
in all the considered selectors for that level and use put the
one that is in most selectors in the node. All selectors matching that
are put in the previous part of the tree.
2012-11-30 14:53:29 +01:00
Alexander Larsson
16f2b20f96 css: Add _gtk_css_matcher_matches_any()
This returns true if the matcher matches *anything*. We need
to check this later, because such matchers are dangerous in loops
that iterate over all parents/siblings since such loops would not
terminate.
2012-11-30 14:53:29 +01:00
Alexander Larsson
3b4040d619 css: Track which selectors are "simple" 2012-11-30 14:53:29 +01:00
Alexander Larsson
cfdc68db5c Reuse rendered symbolic icons
With the previous commit all loads of the same icon will share a single
GtkIconInfo, which typicallty means the pixbuf is shared via Info->pixbuf.

However, atm we don't share symbolic icons, which causes these to be re-read
and re-parsed every time. This is especially bad if the icon is used many times
in some form of list. So, we cache the pixbufs and reuse them.

https://bugzilla.gnome.org/show_bug.cgi?id=689081
2012-11-30 11:33:26 +01:00
Alexander Larsson
92e904a257 Cache GtkIconInfo
In order to avoid loading and keeping around the same icon multiple times
we keep a cache of all outstanding GtkIconInfo objects for a given theme.

Additionally we return to the app not the normal pixbuf from the info,
but rather a proxy copy of it sharing the same data, but no extra
reference. This allows us to track when the app is no longer using
the pixbuf, and we can thus ensure that the GtkIconInfo in the cache
stays around for at least as long as the pixbuf is alive.

When the app unrefs the pixbuf we put the Info on a short LRU list
to keep it alive a bit longer, in case the app needs it in a short
while.

https://bugzilla.gnome.org/show_bug.cgi?id=689081
2012-11-30 11:33:26 +01:00
Matthias Clasen
e75860e466 Add a missing va_end call
va_copy must be matched with va_end.
2012-11-29 23:18:49 -05:00
Matthias Clasen
5b9c687595 Avoid unreachable code
Reestablish an else that went missing in commit 5ff328d2. Without
it, the return is reached unconditionally, and the code behind
it is dead.
2012-11-29 23:10:40 -05:00
Matthias Clasen
b3b83545c4 Don't return prematurely
This code was clearly meant to return _after_ the loop.
Don't put the return inside the loop body, then.
2012-11-29 23:10:35 -05:00
Matthias Clasen
c5c7323942 GtkAboutDialog: Initialize a variable
Coverity complains about it being uninitialized, otherwise.
2012-11-29 23:10:34 -05:00
Matthias Clasen
52af9aede6 GtkNotebook: Clarify a switch statement
We were intentionally falling through here, this commit
just adds comments to make that explicit.
2012-11-29 23:10:34 -05:00
Matthias Clasen
4557e4d7a5 GtkCellAccessible: Add missing break statements
This switch was entirely breakless. Amazing accessibility code,
found by Coverity.
2012-11-29 23:10:34 -05:00
Matthias Clasen
9ba32fec6e GtkExpander: Clarify a nested switch
This code confused Coverity into thinking we were falling through,
when we were not. Add a few explicit breaks to clear that up.
2012-11-29 23:10:34 -05:00
Matthias Clasen
6400eeba35 Add a forgotten break in render_border
The GTK_BORDER_STYLE_DOUBLE case was clearly not meant to
fall through to the subsequent cases, yet it did.
Found by Coverity.
2012-11-29 23:10:34 -05:00
Matthias Clasen
a7ed598d37 GtkIconViewAccessible: Fix a copy-paste error
Don't access vadjustment after checking hadjustment for
not being NULL. Found by Coverity.
2012-11-29 23:10:34 -05:00
Matthias Clasen
3519226c5a GtkActionHelper: Fix a copy-paste error
The code clearly meant to reset action->active here.

This was found by Coverity.
2012-11-29 23:10:34 -05:00
Matthias Clasen
bf26d46cb2 gtk_css_value_bg_size_equal: actually compare contain values
Due to a copy-paste error, the code failed to compare the
contain members of value1 and value2.

This was found by Coverity.
2012-11-29 23:10:34 -05:00
Matthias Clasen
ce6f43a522 Don't check the same crossing mode twice
This was broken since commit b2aaa94 in 2008. Its commit message
clearly states that the intention was to check for GTK_GRAB,
GTK_UNGRAB and STATE_CHANGED. Lets do that, then.

This was found by Coverity.
2012-11-29 23:10:34 -05:00
Matthias Clasen
5230cfe805 GtkLabel: Fix a pointless expression
Clearly, what was meant here was that we create a new attribute
list if either of the input attribute lists are non-NULL.
This was found by Coverity.
2012-11-29 23:10:34 -05:00
Timothy Arceri
50acce4074 In the file chooser, use a proper apostrophe rather than a prime mark (tick mark)
https://bugzilla.gnome.org/show_bug.cgi?id=689012
2012-11-29 11:34:29 -06:00
Benjamin Otte
4d0ca91c72 menuitem: Remove unused variables 2012-11-28 21:15:05 +01:00
Marcus Kraßmann
7f3595a6be cssparser: Don't detect /*/ as a comment 2012-11-28 21:11:48 +01:00
Cosimo Cecchi
ea415cd350 menubar: deprecate internal-padding style property
https://bugzilla.gnome.org/show_bug.cgi?id=689168
2012-11-28 10:09:16 -05:00
Cosimo Cecchi
1a79ee4d3e menubar: add support for CSS padding
In preparation for the removal of the internal-padding style property.

https://bugzilla.gnome.org/show_bug.cgi?id=689168
2012-11-28 10:09:16 -05:00
Cosimo Cecchi
01dc23cdec menu: deprecate horizontal-padding and vertical-padding
https://bugzilla.gnome.org/show_bug.cgi?id=689168
2012-11-28 10:09:16 -05:00
Cosimo Cecchi
a69619edbc menuitem: deprecate horizontal-padding style property
https://bugzilla.gnome.org/show_bug.cgi?id=689168
2012-11-28 10:09:16 -05:00
David King
941851fc86 docs: Add gtk-doc comment for GtkTreeRowReference
https://bugzilla.gnome.org/show_bug.cgi?id=93381
2012-11-26 14:12:14 +00:00
Philip Withnall
ceb866dfe6 Bug 595615 — Use proper ellipses
Use ‘…’ instead of ‘...’ in translatable strings.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=595615
2012-11-26 08:59:27 +00:00
Benjamin Otte
239c631ad3 treeview: Delay computing fixed height
In the setter, we only set fixed height mode and queue a revalidation of
the row heights.

https://bugzilla.gnome.org/show_bug.cgi?id=687816
2012-11-26 00:09:35 +01:00
Emmanuele Bassi
4498ff314e sizegroup: Use g_hash_table_add()
This is the function to use when treating hash tables as a set.
2012-11-25 22:58:19 +01:00
Benjamin Otte
87b351e6e6 styleproperty: Use _gtk_css_initial_value_get()
See previous commit(s).
2012-11-25 22:29:14 +01:00
Benjamin Otte
1d805139db cssvalue: Use _gtk_css_initial_value_get() for the inherit value
See previous commit(s).
2012-11-25 22:29:14 +01:00
Benjamin Otte
f204473ee0 cssvalue: Add _gtk_css_initial_value_get()
... so we don't bump a refcount whenever we get the initial singleton.

We want to use this function instead of
_gtk_css_style_property_get_initial_value() everywhere where we compute
values, because some initial values may depend on settings soon.
2012-11-25 15:31:59 +01:00
Benjamin Otte
2ab65ef771 izegroup: Improve performance
Keep a list of all groups and avoid groups we already handled. Speeds up
GtkToolpalette a lot.
2012-11-25 13:32:21 +01:00
Benjamin Otte
da7a4089fe widget: Remove an unneeded queue_resize()
Resizes are queued via
   gtk_widget_propagate_state()
=> gtk_style_context_set_state()
=> gtk_style_context_queue_invalidate()
=> gtk_style_context_validate()
=> _gtk_widget_style_context_invalidated()
so there's no need to queue an extra one.
2012-11-25 04:46:36 +01:00
Benjamin Otte
41486895d5 deprecations: Move files into deprecated/ dir 2012-11-25 04:16:43 +01:00
Benjamin Otte
0862afaded gtkgradient: Deprecate 2012-11-25 03:47:51 +01:00
Benjamin Otte
fb643c1c12 symboliccolor: Deprecate
Symbolic colors are an implementation detail of the CSS engine and have
been superceded by GtkCssColorValue. We don't want them clobbering the
public API. In particular because the only use I could find in the
public API is people using it to shade colors.
2012-11-25 03:43:28 +01:00
Benjamin Otte
df25349d63 themingengine: Do shading with GtkHSLA
... instead of with symbolic colors.
2012-11-25 03:34:02 +01:00
Benjamin Otte
9aac4dffc5 hsla: Add _gtk_hsla_shade()
We use it in multiple places, so better split it out.
2012-11-25 03:25:15 +01:00
Benjamin Otte
4f9a8e6b3d symboliccolor: Remove extra includes
That header was included in way too many places.
2012-11-25 02:59:15 +01:00
Benjamin Otte
42dc0ea0fd styleprovider: Change function prototype
Make _gtk_style_provider_private_get_color() return a GtkCssValue (a
GtkCssColorValue to be exact) instead of GtkSymbolicColor.

With this, the symbolic color usage inside GTK is minimized.
2012-11-25 02:45:10 +01:00