Commit Graph

33083 Commits

Author SHA1 Message Date
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
Matthias Clasen
256f168525 Obtain the recent files max age setting from xsettings
This will help with implementing desktop-wide policy for
retaining of history.

https://bugzilla.gnome.org/show_bug.cgi?id=689047
2012-11-29 23:10:33 -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
Alan McGovern
149de71624 Fix broken function pointer declarations on windows
Both flashing a window and setting the window opacity were using
incorrect declarations for function pointers. They were missing the
WINAPI annotation as defined in windows.h. As a result, the stack
could be corrupted when these functions were invoked.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=689235
(cherry picked from commit 5637ef1f97)
2012-11-29 15:07:42 +01:00
Michael Natterer
709f12b9ac quartz: add mountain lion as version 8 to enum GdkOSXVersion
Also use GDK_OSX_UNSUPPORTED instead of 0 in gdk_quartz_osx_version().
(cherry picked from commit 9644e910a8)
2012-11-29 15:00:57 +01:00
Michael Natterer
e2144fbb7e quartz: call Gestalt() only once per session in gdk_quartz_osx_version()
Thanks to Paul Davis for pointing this out.
(cherry picked from commit d6533ffc44)
2012-11-29 15:00:38 +01:00
Benjamin Berg
fd301e7847 Use the ppd groups "name" instead of "text" (bug #687065)
This commit fixes a regression caused by a patch to remove Cups 1.2
ifdefs. This resulted in the "installable options" to appear in the
print dialog.
2012-11-29 10:02:08 +01:00
Benjamin Otte
4d0ca91c72 menuitem: Remove unused variables 2012-11-28 21:15:05 +01:00
Benjamin Otte
29c8420746 tests: Add CSS test for comment detection
Tests recent fix.
2012-11-28 21:11:48 +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
Nilamdyuti Goswami
d3051ca79c Assamese translation updated 2012-11-28 13:49:44 +05:30
Nilamdyuti Goswami
9ac005abee Assamese translation updated 2012-11-28 13:47:38 +05:30
Matej Urbančič
943de24211 Updated Slovenian translation 2012-11-26 21:12:00 +01:00
Matej Urbančič
db6d6fcc84 Updated Slovenian translation 2012-11-26 21:07:25 +01: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
Christophe Fergeau
e8659679cd Sanitize memory handling in cups_request_printer_list_cb
gtk+ was trying to display already freed strings, leaking memory,
...I noticed this because I was getting weird blinking characters
as the status of my cups printers, and valgrind confirmed something
was wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=683072
2012-11-26 10:19:31 +01:00
Philip Withnall
693581250e i18n: Update British English translation 2012-11-26 09:00:59 +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
Piotr Drąg
788f1a0934 Updated POTFILES.skip 2012-11-26 00:46:05 +01:00
Benjamin Otte
6b33ee9c53 reftests: Add reftest for broken fixed height mode
https://bugzilla.gnome.org/show_bug.cgi?id=687816
2012-11-26 00:09:35 +01:00