Compare commits

...

92 Commits

Author SHA1 Message Date
Alexander Larsson 21ff39ba8a 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 16:59:08 +01:00
Alexander Larsson 0cf03dd13b 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 16:59:08 +01:00
Alexander Larsson 8751b59b3c 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 16:59:07 +01:00
Alexander Larsson 340c7f9419 css: Short circuit gtk_css_value_initial_compute when possible
For almost all properties the initial value does not need computing.
If we skip computing these then gtk_css_value_initial_compute goes
from > 6% to 2% in my testcase profiles.
2012-12-04 16:59:07 +01:00
Alexander Larsson cdc5053fd9 css: Introduce _gtk_css_value_needs_compute
This returns TRUE for all css values that always compute to themselves
and thus does not need computation. This is useful for the initial
values as these are static and we can avoid computing them in a lot of
cases.
2012-12-04 16:59:07 +01:00
Alexander Larsson ab7e332296 css: Have a separate GtkCssInitialValue per property
This allows us to avoid a lookup in a very common path, and later
cache some more things.
2012-12-04 16:59:07 +01:00
Alexander Larsson 28283e645f 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 16:59:07 +01:00
Alexander Larsson 39d94a73e3 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 16:59:07 +01:00
Alexander Larsson 5952707d87 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 16:59:07 +01:00
Alexander Larsson f0b09f6366 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 16:59:07 +01:00
Marek Kasik 6f69a0fef6 printing: Call mark_printer_active() with correct parameters
Revert the second part of the commit
6ad6f719c6. mark_printer_active()
was called without its second parameter in g_list_free_full().
2012-12-04 15:48:08 +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
Piotr Drąg 9bf091e2ac Updated POTFILES.skip 2012-12-01 21:22:00 +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 d8306aaeb3 reftests: Add a test for the new font size names 2012-12-01 16:27:45 +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
Benjamin Otte cc0b493216 reftests: Fix a reftest
Recent Adwaita changes caused diffs. We don't want that, so we run this
test against the default settings.
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 e36f80f0ef css: Make test pass
The new css tree may change the order of selectors (keeping the
same semantics). This affects how the selectors are printed later,
which causes some css parsing tests to not match the references.

Fortunately the order is consistent between runs given the same
css, so we just have to switch around the order in some of the
.ref.css files.
2012-11-30 14:53:30 +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
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
146 changed files with 3543 additions and 1166 deletions
+8 -3
View File
@@ -28,9 +28,14 @@ GdkWindow *_gdk_root = NULL;
GdkOSXVersion
gdk_quartz_osx_version (void)
{
gint minor;
OSErr err = Gestalt (gestaltSystemVersionMinor, &minor);
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
static gint32 minor = GDK_OSX_UNSUPPORTED;
if (minor == GDK_OSX_UNSUPPORTED)
{
OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
}
if (minor < GDK_OSX_MIN)
return GDK_OSX_UNSUPPORTED;
+2 -1
View File
@@ -48,7 +48,8 @@ typedef enum
GDK_OSX_LEOPARD = 5,
GDK_OSX_SNOW_LEOPARD = 6,
GDK_OSX_LION = 7,
GDK_OSX_CURRENT = 7,
GDK_OSX_MOUNTAIN_LION = 8,
GDK_OSX_CURRENT = 8,
GDK_OSX_NEW = 99
} GdkOSXVersion;
+3 -2
View File
@@ -27,6 +27,7 @@
#include "config.h"
#include <stdlib.h>
#include <windows.h>
#include "gdk.h"
#include "gdkwindowimpl.h"
@@ -1533,7 +1534,7 @@ gdk_win32_window_set_urgency_hint (GdkWindow *window,
gboolean urgent)
{
FLASHWINFO flashwinfo;
typedef BOOL (*PFN_FlashWindowEx) (FLASHWINFO*);
typedef BOOL (WINAPI *PFN_FlashWindowEx) (FLASHWINFO*);
PFN_FlashWindowEx flashWindowEx = NULL;
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -3264,7 +3265,7 @@ gdk_win32_window_set_opacity (GdkWindow *window,
gdouble opacity)
{
LONG exstyle;
typedef BOOL (*PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
typedef BOOL (WINAPI *PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
PFN_SetLayeredWindowAttributes setLayeredWindowAttributes = NULL;
g_return_if_fail (GDK_IS_WINDOW (window));
+4 -2
View File
@@ -82,7 +82,8 @@ static const char gdk_settings_names[] =
"Gtk/VisibleFocus\0" "gtk-visible-focus\0"
"Gtk/ShellShowsAppMenu\0" "gtk-shell-shows-app-menu\0"
"Gtk/ShellShowsMenubar\0" "gtk-shell-shows-menubar\0"
"Gtk/EnablePrimaryPaste\0" "gtk-enable-primary-paste\0";
"Gtk/EnablePrimaryPaste\0" "gtk-enable-primary-paste\0"
"Gtk/RecentFilesMaxAge\0" "gtk-recent-files-max-age\0";
@@ -140,5 +141,6 @@ static const struct
{ 1767, 1784 },
{ 1802, 1824 },
{ 1849, 1871 },
{ 1895, 1918 }
{ 1895, 1918 },
{ 1943, 1965 }
};
+3
View File
@@ -287,10 +287,13 @@ gtk_cell_accessible_action_do_action (AtkAction *action,
{
case 0:
_gtk_cell_accessible_parent_expand_collapse (parent, cell);
break;
case 1:
_gtk_cell_accessible_parent_edit (parent, cell);
break;
case 2:
_gtk_cell_accessible_parent_activate (parent, cell);
break;
default:
return FALSE;
}
+1 -1
View File
@@ -708,7 +708,7 @@ gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item)
if (icon_view->priv->hadjustment)
visible_rect.x += gtk_adjustment_get_value (icon_view->priv->hadjustment);
visible_rect.y = 0;
if (icon_view->priv->hadjustment)
if (icon_view->priv->vadjustment)
visible_rect.y += gtk_adjustment_get_value (icon_view->priv->vadjustment);
visible_rect.width = allocation.width;
visible_rect.height = allocation.height;
+1
View File
@@ -499,6 +499,7 @@ gtk_widget_accessible_notify_gtk (GObject *obj,
gtk_widget_accessible_update_tooltip (GTK_WIDGET_ACCESSIBLE (atk_obj),
widget);
}
else
return;
atk_object_notify_state_change (atk_obj, state, value);
+2
View File
@@ -2395,6 +2395,8 @@ create_credits_page (GtkAboutDialog *about)
gtk_widget_set_valign (grid, GTK_ALIGN_START);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), grid);
row = 0;
if (priv->authors != NULL)
add_credits_section (about, GTK_GRID (grid), &row, _("Created by"), priv->authors);
+1 -1
View File
@@ -189,7 +189,7 @@ gtk_action_helper_action_removed (GtkActionHelper *helper)
if (helper->active)
{
helper->enabled = FALSE;
helper->active = FALSE;
gtk_action_helper_report_change (helper, PROP_ACTIVE);
}
+41 -22
View File
@@ -45,6 +45,7 @@ struct _GtkClipboard
GObject parent_instance;
NSPasteboard *pasteboard;
NSInteger change_count;
GdkAtom selection;
@@ -76,13 +77,18 @@ struct _GtkClipboardClass
GdkEventOwnerChange *event);
};
static void gtk_clipboard_class_init (GtkClipboardClass *class);
static void gtk_clipboard_finalize (GObject *object);
static void gtk_clipboard_owner_change (GtkClipboard *clipboard,
GdkEventOwnerChange *event);
static void clipboard_unset (GtkClipboard *clipboard);
static GtkClipboard *clipboard_peek (GdkDisplay *display,
GdkAtom selection,
gboolean only_if_exists);
@interface GtkClipboardOwner : NSObject {
GtkClipboard *clipboard;
GtkClipboardGetFunc get_func;
GtkClipboardClearFunc clear_func;
gpointer user_data;
}
@end
@@ -117,10 +123,15 @@ struct _GtkClipboardClass
}
}
/* pasteboardChangedOwner is not called immediately, and it's not called
* reliably. It is somehow documented in the apple api docs, but the docs
* suck and don't really give clear instructions. Therefore we track
* changeCount in several places below and clear the clipboard if it
* changed.
*/
- (void)pasteboardChangedOwner:(NSPasteboard *)sender
{
if (clear_func)
clear_func (clipboard, user_data);
clipboard_unset (clipboard);
[self release];
}
@@ -139,15 +150,6 @@ struct _GtkClipboardClass
@end
static void gtk_clipboard_class_init (GtkClipboardClass *class);
static void gtk_clipboard_finalize (GObject *object);
static void gtk_clipboard_owner_change (GtkClipboard *clipboard,
GdkEventOwnerChange *event);
static void clipboard_unset (GtkClipboard *clipboard);
static GtkClipboard *clipboard_peek (GdkDisplay *display,
GdkAtom selection,
gboolean only_if_exists);
static const gchar clipboards_owned_key[] = "gtk-clipboards-owned";
static GQuark clipboards_owned_key_id = 0;
@@ -360,6 +362,15 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard,
}
}
/* call declareTypes before setting the clipboard members because
* declareTypes might clear the clipboard
*/
types = _gtk_quartz_target_entries_to_pasteboard_types (targets, n_targets);
clipboard->change_count = [clipboard->pasteboard declareTypes: [types allObjects]
owner: owner];
[types release];
[pool release];
clipboard->user_data = user_data;
clipboard->have_owner = have_owner;
if (have_owner)
@@ -371,12 +382,6 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard,
gtk_target_list_unref (clipboard->target_list);
clipboard->target_list = gtk_target_list_new (targets, n_targets);
types = _gtk_quartz_target_entries_to_pasteboard_types (targets, n_targets);
[clipboard->pasteboard declareTypes:[types allObjects] owner:owner];
[types release];
[pool release];
return TRUE;
}
@@ -420,6 +425,12 @@ gtk_clipboard_get_owner (GtkClipboard *clipboard)
{
g_return_val_if_fail (clipboard != NULL, NULL);
if (clipboard->change_count < [clipboard->pasteboard changeCount])
{
clipboard_unset (clipboard);
clipboard->change_count = [clipboard->pasteboard changeCount];
}
if (clipboard->have_owner)
return clipboard->user_data;
else
@@ -473,6 +484,8 @@ clipboard_unset (GtkClipboard *clipboard)
void
gtk_clipboard_clear (GtkClipboard *clipboard)
{
clipboard_unset (clipboard);
[clipboard->pasteboard declareTypes:nil owner:nil];
}
@@ -656,6 +669,12 @@ gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GtkSelectionData *selection_data = NULL;
if (clipboard->change_count < [clipboard->pasteboard changeCount])
{
clipboard_unset (clipboard);
clipboard->change_count = [clipboard->pasteboard changeCount];
}
if (target == gdk_atom_intern_static_string ("TARGETS"))
{
NSArray *types = [clipboard->pasteboard types];
+33 -26
View File
@@ -584,36 +584,42 @@ dialog_response (GtkDialog *dialog,
}
}
/* Create the dialog and connects its buttons */
static void
ensure_dialog (GtkColorButton *button)
{
GtkWidget *parent, *dialog;
if (button->priv->cs_dialog != NULL)
return;
parent = gtk_widget_get_toplevel (GTK_WIDGET (button));
button->priv->cs_dialog = dialog = gtk_color_chooser_dialog_new (button->priv->title, NULL);
if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
{
if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (dialog)))
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
gtk_window_set_modal (GTK_WINDOW (dialog),
gtk_window_get_modal (GTK_WINDOW (parent)));
}
g_signal_connect (dialog, "response",
G_CALLBACK (dialog_response), button);
g_signal_connect (dialog, "destroy",
G_CALLBACK (dialog_destroy), button);
}
static void
gtk_color_button_clicked (GtkButton *b)
{
GtkColorButton *button = GTK_COLOR_BUTTON (b);
GtkWidget *dialog;
/* if dialog already exists, make sure it's shown and raised */
if (!button->priv->cs_dialog)
{
/* Create the dialog and connects its buttons */
GtkWidget *parent;
parent = gtk_widget_get_toplevel (GTK_WIDGET (button));
button->priv->cs_dialog = dialog = gtk_color_chooser_dialog_new (button->priv->title, NULL);
if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
{
if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (dialog)))
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
gtk_window_set_modal (GTK_WINDOW (dialog),
gtk_window_get_modal (GTK_WINDOW (parent)));
}
g_signal_connect (dialog, "response",
G_CALLBACK (dialog_response), button);
g_signal_connect (dialog, "destroy",
G_CALLBACK (dialog_destroy), button);
}
ensure_dialog (button);
gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (button->priv->cs_dialog),
button->priv->use_alpha);
@@ -962,8 +968,9 @@ gtk_color_button_add_palette (GtkColorChooser *chooser,
{
GtkColorButton *button = GTK_COLOR_BUTTON (chooser);
if (button->priv->cs_dialog)
gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (button->priv->cs_dialog),
ensure_dialog (button);
gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (button->priv->cs_dialog),
orientation, colors_per_line, n_colors, colors);
}
+33 -13
View File
@@ -51,32 +51,51 @@ gtk_css_value_array_compute (GtkCssValue *value,
GtkCssDependencies *dependencies)
{
GtkCssValue *result;
gboolean changed = FALSE;
guint i;
GtkCssValue *i_value;
guint i, j;
GtkCssDependencies child_deps;
if (value->n_values == 0)
return _gtk_css_value_ref (value);
result = _gtk_css_array_value_new_from_array (value->values, value->n_values);
result = NULL;
for (i = 0; i < value->n_values; i++)
{
result->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, values, parent_values, &child_deps);
i_value = _gtk_css_value_compute (value->values[i], property_id, provider, values, parent_values, &child_deps);
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
changed |= (result->values[i] != value->values[i]);
if (result == NULL &&
i_value != value->values[i])
{
result = _gtk_css_array_value_new_from_array (value->values, value->n_values);
for (j = 0; j < i; j++)
_gtk_css_value_ref (result->values[j]);
}
if (result != NULL)
result->values[i] = i_value;
else
_gtk_css_value_unref (i_value);
}
if (!changed)
{
_gtk_css_value_unref (result);
return _gtk_css_value_ref (value);
}
if (result == NULL)
return _gtk_css_value_ref (value);
return result;
}
static gboolean
gtk_css_value_array_needs_compute (const GtkCssValue *value)
{
guint i;
for (i = 0; i < value->n_values; i++)
{
if (_gtk_css_value_needs_compute (value->values[i]))
return TRUE;
}
return FALSE;
}
static gboolean
gtk_css_value_array_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -318,6 +337,7 @@ gtk_css_value_array_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_ARRAY = {
gtk_css_value_array_free,
gtk_css_value_array_compute,
gtk_css_value_array_needs_compute,
gtk_css_value_array_equal,
gtk_css_value_array_transition,
gtk_css_value_array_print
+10 -1
View File
@@ -69,12 +69,20 @@ gtk_css_value_bg_size_compute (GtkCssValue *value,
value->y ? y : NULL);
}
static gboolean
gtk_css_value_bg_size_needs_compute (const GtkCssValue *value)
{
return
_gtk_css_value_needs_compute (value->x) ||
_gtk_css_value_needs_compute (value->y);
}
static gboolean
gtk_css_value_bg_size_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
{
return value1->cover == value2->cover &&
value2->contain == value2->contain &&
value1->contain == value2->contain &&
(value1->x == value2->x ||
(value1->x != NULL && value2->x != NULL &&
_gtk_css_value_equal (value1->x, value2->x))) &&
@@ -150,6 +158,7 @@ gtk_css_value_bg_size_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_BG_SIZE = {
gtk_css_value_bg_size_free,
gtk_css_value_bg_size_compute,
gtk_css_value_bg_size_needs_compute,
gtk_css_value_bg_size_equal,
gtk_css_value_bg_size_transition,
gtk_css_value_bg_size_print
+15
View File
@@ -76,6 +76,20 @@ gtk_css_value_border_compute (GtkCssValue *value,
return computed;
}
static gboolean
gtk_css_value_border_needs_compute (const GtkCssValue *value)
{
guint i;
for (i = 0; i < 4; i++)
{
if (_gtk_css_value_needs_compute (value->values[i]))
return TRUE;
}
return FALSE;
}
static gboolean
gtk_css_value_border_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -136,6 +150,7 @@ gtk_css_value_border_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_BORDER = {
gtk_css_value_border_free,
gtk_css_value_border_compute,
gtk_css_value_border_needs_compute,
gtk_css_value_border_equal,
gtk_css_value_border_transition,
gtk_css_value_border_print
+7
View File
@@ -334,6 +334,12 @@ gtk_css_value_color_compute (GtkCssValue *value,
return resolved;
}
static gboolean
gtk_css_value_color_needs_compute (const GtkCssValue *value)
{
return TRUE;
}
static gboolean
gtk_css_value_color_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -449,6 +455,7 @@ gtk_css_value_color_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_COLOR = {
gtk_css_value_color_free,
gtk_css_value_color_compute,
gtk_css_value_color_needs_compute,
gtk_css_value_color_equal,
gtk_css_value_color_transition,
gtk_css_value_color_print
+18 -16
View File
@@ -19,6 +19,7 @@
#include "config.h"
#include "gtkprivate.h"
#include "gtkcsscomputedvaluesprivate.h"
#include "gtkcssanimationprivate.h"
@@ -120,9 +121,9 @@ _gtk_css_computed_values_compute_value (GtkCssComputedValues *values,
GtkCssDependencies dependencies;
GtkCssValue *value;
g_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
g_return_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider));
g_return_if_fail (parent_values == NULL || GTK_IS_CSS_COMPUTED_VALUES (parent_values));
gtk_internal_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
gtk_internal_return_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider));
gtk_internal_return_if_fail (parent_values == NULL || GTK_IS_CSS_COMPUTED_VALUES (parent_values));
/* http://www.w3.org/TR/css3-cascade/#cascade
* Then, for every element, the value for each property can be found
@@ -136,7 +137,7 @@ _gtk_css_computed_values_compute_value (GtkCssComputedValues *values,
if (_gtk_css_style_property_is_inherit (prop))
specified = _gtk_css_inherit_value_new ();
else
specified = _gtk_css_initial_value_new ();
specified = _gtk_css_initial_value_new (prop);
}
else
_gtk_css_value_ref (specified);
@@ -154,8 +155,8 @@ _gtk_css_computed_values_set_animated_value (GtkCssComputedValues *values,
guint id,
GtkCssValue *value)
{
g_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
g_return_if_fail (value != NULL);
gtk_internal_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
gtk_internal_return_if_fail (value != NULL);
if (values->animated_values == NULL)
values->animated_values = g_ptr_array_new_with_free_func ((GDestroyNotify)_gtk_css_value_unref);
@@ -175,10 +176,11 @@ _gtk_css_computed_values_set_value (GtkCssComputedValues *values,
GtkCssDependencies dependencies,
GtkCssSection *section)
{
g_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
gtk_internal_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
if (values->values == NULL)
values->values = g_ptr_array_new_with_free_func ((GDestroyNotify)_gtk_css_value_unref);
values->values = g_ptr_array_new_full (_gtk_css_style_property_get_n_properties (),
(GDestroyNotify)_gtk_css_value_unref);
if (id >= values->values->len)
g_ptr_array_set_size (values->values, id + 1);
@@ -216,7 +218,7 @@ GtkCssValue *
_gtk_css_computed_values_get_value (GtkCssComputedValues *values,
guint id)
{
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
gtk_internal_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
if (values->animated_values &&
id < values->animated_values->len &&
@@ -230,7 +232,7 @@ GtkCssValue *
_gtk_css_computed_values_get_intrinsic_value (GtkCssComputedValues *values,
guint id)
{
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
gtk_internal_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
if (values->values == NULL ||
id >= values->values->len)
@@ -243,7 +245,7 @@ GtkCssSection *
_gtk_css_computed_values_get_section (GtkCssComputedValues *values,
guint id)
{
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
gtk_internal_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
if (values->sections == NULL ||
id >= values->sections->len)
@@ -528,8 +530,8 @@ _gtk_css_computed_values_advance (GtkCssComputedValues *values,
GSList *list;
guint i;
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
g_return_val_if_fail (timestamp >= values->current_time, NULL);
gtk_internal_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
gtk_internal_return_val_if_fail (timestamp >= values->current_time, NULL);
values->current_time = timestamp;
old_computed_values = values->animated_values;
@@ -578,7 +580,7 @@ _gtk_css_computed_values_is_static (GtkCssComputedValues *values)
{
GSList *list;
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), TRUE);
gtk_internal_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), TRUE);
for (list = values->animations; list; list = list->next)
{
@@ -592,7 +594,7 @@ _gtk_css_computed_values_is_static (GtkCssComputedValues *values)
void
_gtk_css_computed_values_cancel_animations (GtkCssComputedValues *values)
{
g_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
gtk_internal_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
if (values->animated_values)
{
@@ -610,7 +612,7 @@ _gtk_css_computed_values_compute_dependencies (GtkCssComputedValues *values,
{
GtkBitmask *changes;
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), _gtk_bitmask_new ());
gtk_internal_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), _gtk_bitmask_new ());
changes = _gtk_bitmask_copy (parent_changes);
changes = _gtk_bitmask_intersect (changes, values->depends_on_parent);
+9
View File
@@ -60,6 +60,14 @@ gtk_css_value_corner_compute (GtkCssValue *corner,
return _gtk_css_corner_value_new (x, y);
}
static gboolean
gtk_css_value_corner_needs_compute (const GtkCssValue *corner)
{
return
_gtk_css_value_needs_compute (corner->x) ||
_gtk_css_value_needs_compute (corner->y);
}
static gboolean
gtk_css_value_corner_equal (const GtkCssValue *corner1,
const GtkCssValue *corner2)
@@ -104,6 +112,7 @@ gtk_css_value_corner_print (const GtkCssValue *corner,
static const GtkCssValueClass GTK_CSS_VALUE_CORNER = {
gtk_css_value_corner_free,
gtk_css_value_corner_compute,
gtk_css_value_corner_needs_compute,
gtk_css_value_corner_equal,
gtk_css_value_corner_transition,
gtk_css_value_corner_print
+7
View File
@@ -211,6 +211,8 @@ gtk_css_custom_property_create_initial_value (GParamSpec *pspec)
* </note>
*
* Since: 3.0
*
* Deprecated: 3.8: Code should use the default properties provided by CSS.
**/
void
gtk_theming_engine_register_property (const gchar *name_space,
@@ -260,6 +262,8 @@ gtk_theming_engine_register_property (const gchar *name_space,
* a theming engine, you want to use that function instead.
*
* Since: 3.0
*
* Deprecated: 3.8: Code should use the default properties provided by CSS.
**/
void
gtk_style_properties_register_property (GtkStylePropertyParser parse_func,
@@ -303,6 +307,9 @@ gtk_style_properties_register_property (GtkStylePropertyParser parse_func,
* Returns: %TRUE if the property is registered, %FALSE otherwise
*
* Since: 3.0
*
* Deprecated: 3.8: This code could only look up custom properties and
* those are deprecated.
**/
gboolean
gtk_style_properties_lookup_property (const gchar *property_name,
+7
View File
@@ -60,6 +60,12 @@ gtk_css_value_ease_compute (GtkCssValue *value,
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_ease_needs_compute (const GtkCssValue *value)
{
return FALSE;
}
static gboolean
gtk_css_value_ease_equal (const GtkCssValue *ease1,
const GtkCssValue *ease2)
@@ -138,6 +144,7 @@ gtk_css_value_ease_print (const GtkCssValue *ease,
static const GtkCssValueClass GTK_CSS_VALUE_EASE = {
gtk_css_value_ease_free,
gtk_css_value_ease_compute,
gtk_css_value_ease_needs_compute,
gtk_css_value_ease_equal,
gtk_css_value_ease_transition,
gtk_css_value_ease_print
+7
View File
@@ -45,6 +45,12 @@ gtk_css_value_engine_compute (GtkCssValue *value,
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_engine_needs_compute (const GtkCssValue *value)
{
return FALSE;
}
static gboolean
gtk_css_value_engine_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -80,6 +86,7 @@ gtk_css_value_engine_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_ENGINE = {
gtk_css_value_engine_free,
gtk_css_value_engine_compute,
gtk_css_value_engine_needs_compute,
gtk_css_value_engine_equal,
gtk_css_value_engine_transition,
gtk_css_value_engine_print
+170 -1
View File
@@ -19,7 +19,9 @@
#include "gtkcssenumvalueprivate.h"
#include "gtkstylepropertyprivate.h"
#include "gtkcsscomputedvaluesprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkstyleproviderprivate.h"
/* repeated API */
@@ -46,6 +48,12 @@ gtk_css_value_enum_compute (GtkCssValue *value,
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_enum_needs_compute (const GtkCssValue *value)
{
return FALSE;
}
static gboolean
gtk_css_value_enum_equal (const GtkCssValue *enum1,
const GtkCssValue *enum2)
@@ -74,6 +82,7 @@ gtk_css_value_enum_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_BORDER_STYLE = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
@@ -124,11 +133,165 @@ _gtk_css_border_style_value_get (const GtkCssValue *value)
return value->value;
}
/* GtkCssFontSize */
/* XXX: Kinda bad to have that machinery here, nobody expects vital font
* size code to appear in gtkcssvalueenum.c.
*/
#define DEFAULT_FONT_SIZE 10
double
_gtk_css_font_size_get_default (GtkStyleProviderPrivate *provider)
{
GtkSettings *settings;
PangoFontDescription *description;
char *font_name;
double font_size;
settings = _gtk_style_provider_private_get_settings (provider);
if (settings == NULL)
return DEFAULT_FONT_SIZE;
g_object_get (settings, "gtk-font-name", &font_name, NULL);
description = pango_font_description_from_string (font_name);
g_free (font_name);
if (description == NULL)
return DEFAULT_FONT_SIZE;
if (pango_font_description_get_set_fields (description) & PANGO_FONT_MASK_SIZE)
font_size = (double) pango_font_description_get_size (description) / PANGO_SCALE;
else
font_size = DEFAULT_FONT_SIZE;
pango_font_description_free (description);
return font_size;
}
static GtkCssValue *
gtk_css_value_font_size_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssComputedValues *values,
GtkCssComputedValues *parent_values,
GtkCssDependencies *dependencies)
{
double font_size;
switch (value->value)
{
case GTK_CSS_FONT_SIZE_XX_SMALL:
font_size = _gtk_css_font_size_get_default (provider) * 3. / 5;
break;
case GTK_CSS_FONT_SIZE_X_SMALL:
font_size = _gtk_css_font_size_get_default (provider) * 3. / 4;
break;
case GTK_CSS_FONT_SIZE_SMALL:
font_size = _gtk_css_font_size_get_default (provider) * 8. / 9;
break;
default:
g_assert_not_reached ();
/* fall thru */
case GTK_CSS_FONT_SIZE_MEDIUM:
font_size = _gtk_css_font_size_get_default (provider);
break;
case GTK_CSS_FONT_SIZE_LARGE:
font_size = _gtk_css_font_size_get_default (provider) * 6. / 5;
break;
case GTK_CSS_FONT_SIZE_X_LARGE:
font_size = _gtk_css_font_size_get_default (provider) * 3. / 2;
break;
case GTK_CSS_FONT_SIZE_XX_LARGE:
font_size = _gtk_css_font_size_get_default (provider) * 2;
break;
case GTK_CSS_FONT_SIZE_SMALLER:
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
if (parent_values)
font_size = _gtk_css_number_value_get (_gtk_css_computed_values_get_value (parent_values, GTK_CSS_PROPERTY_FONT_SIZE), 100);
else
font_size = _gtk_css_font_size_get_default (provider);
/* XXX: This is what WebKit does... */
font_size /= 1.2;
break;
case GTK_CSS_FONT_SIZE_LARGER:
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
if (parent_values)
font_size = _gtk_css_number_value_get (_gtk_css_computed_values_get_value (parent_values, GTK_CSS_PROPERTY_FONT_SIZE), 100);
else
font_size = _gtk_css_font_size_get_default (provider);
/* XXX: This is what WebKit does... */
font_size *= 1.2;
break;
}
return _gtk_css_number_value_new (font_size, GTK_CSS_PX);
}
static gboolean
gtk_css_value_font_size_needs_compute (const GtkCssValue *value)
{
return TRUE;
}
static const GtkCssValueClass GTK_CSS_VALUE_FONT_SIZE = {
gtk_css_value_enum_free,
gtk_css_value_font_size_compute,
gtk_css_value_font_size_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
};
static GtkCssValue font_size_values[] = {
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_SMALLER, "smaller" },
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_LARGER, "larger" },
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_XX_SMALL, "xx-small" },
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_X_SMALL, "x-small" },
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_SMALL, "small" },
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_MEDIUM, "medium" },
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_LARGE, "large" },
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_X_LARGE, "x-large" },
{ &GTK_CSS_VALUE_FONT_SIZE, 1, GTK_CSS_FONT_SIZE_XX_LARGE, "xx-large" }
};
GtkCssValue *
_gtk_css_font_size_value_new (GtkCssFontSize font_size)
{
g_return_val_if_fail (font_size < G_N_ELEMENTS (font_size_values), NULL);
return _gtk_css_value_ref (&font_size_values[font_size]);
}
GtkCssValue *
_gtk_css_font_size_value_try_parse (GtkCssParser *parser)
{
guint i;
g_return_val_if_fail (parser != NULL, NULL);
for (i = 0; i < G_N_ELEMENTS (font_size_values); i++)
{
if (_gtk_css_parser_try (parser, font_size_values[i].name, TRUE))
return _gtk_css_value_ref (&font_size_values[i]);
}
return NULL;
}
GtkCssFontSize
_gtk_css_font_size_value_get (const GtkCssValue *value)
{
g_return_val_if_fail (value->class == &GTK_CSS_VALUE_FONT_SIZE, GTK_CSS_FONT_SIZE_MEDIUM);
return value->value;
}
/* PangoStyle */
static const GtkCssValueClass GTK_CSS_VALUE_FONT_STYLE = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
@@ -177,6 +340,7 @@ _gtk_css_font_style_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
@@ -224,6 +388,7 @@ _gtk_css_font_variant_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_FONT_WEIGHT = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
@@ -292,6 +457,7 @@ _gtk_css_font_weight_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_AREA = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
@@ -346,6 +512,7 @@ _gtk_css_area_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_DIRECTION = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
@@ -401,6 +568,7 @@ _gtk_css_direction_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_PLAY_STATE = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
@@ -454,6 +622,7 @@ _gtk_css_play_state_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_FILL_MODE = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_needs_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
+5
View File
@@ -31,6 +31,11 @@ GtkCssValue * _gtk_css_border_style_value_new (GtkBorderStyle border
GtkCssValue * _gtk_css_border_style_value_try_parse (GtkCssParser *parser);
GtkBorderStyle _gtk_css_border_style_value_get (const GtkCssValue *value);
GtkCssValue * _gtk_css_font_size_value_new (GtkCssFontSize size);
GtkCssValue * _gtk_css_font_size_value_try_parse (GtkCssParser *parser);
GtkCssFontSize _gtk_css_font_size_value_get (const GtkCssValue *value);
double _gtk_css_font_size_get_default (GtkStyleProviderPrivate *provider);
GtkCssValue * _gtk_css_font_style_value_new (PangoStyle style);
GtkCssValue * _gtk_css_font_style_value_try_parse (GtkCssParser *parser);
PangoStyle _gtk_css_font_style_value_get (const GtkCssValue *value);
+7
View File
@@ -59,6 +59,12 @@ gtk_css_value_image_compute (GtkCssValue *value,
return _gtk_css_image_value_new (computed);
}
static gboolean
gtk_css_value_image_needs_compute (const GtkCssValue *value)
{
return _gtk_css_image_value_get_image (value) != NULL;
}
static gboolean
gtk_css_value_image_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -95,6 +101,7 @@ gtk_css_value_image_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_IMAGE = {
gtk_css_value_image_free,
gtk_css_value_image_compute,
gtk_css_value_image_needs_compute,
gtk_css_value_image_equal,
gtk_css_value_image_transition,
gtk_css_value_image_print
+8 -1
View File
@@ -48,7 +48,7 @@ gtk_css_value_inherit_compute (GtkCssValue *value,
}
else
{
return _gtk_css_value_compute (_gtk_css_initial_value_get (),
return _gtk_css_value_compute (_gtk_css_initial_value_get (_gtk_css_style_property_lookup_by_id (property_id)),
property_id,
provider,
values,
@@ -57,6 +57,12 @@ gtk_css_value_inherit_compute (GtkCssValue *value,
}
}
static gboolean
gtk_css_value_inherit_needs_compute (const GtkCssValue *value)
{
return TRUE;
}
static gboolean
gtk_css_value_inherit_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -83,6 +89,7 @@ gtk_css_value_inherit_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_INHERIT = {
gtk_css_value_inherit_free,
gtk_css_value_inherit_compute,
gtk_css_value_inherit_needs_compute,
gtk_css_value_inherit_equal,
gtk_css_value_inherit_transition,
gtk_css_value_inherit_print
+62 -5
View File
@@ -19,10 +19,16 @@
#include "gtkcssinitialvalueprivate.h"
#include "gtkcssarrayvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssstringvalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkstyleproviderprivate.h"
struct _GtkCssValue {
GTK_CSS_VALUE_BASE
GtkCssStyleProperty *property;
gboolean needs_compute;
};
static void
@@ -40,7 +46,43 @@ gtk_css_value_initial_compute (GtkCssValue *value,
GtkCssComputedValues *parent_values,
GtkCssDependencies *dependencies)
{
return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
GtkSettings *settings;
if (!value->needs_compute)
return _gtk_css_value_ref (_gtk_css_style_property_get_initial_value (value->property));
switch (property_id)
{
case GTK_CSS_PROPERTY_FONT_FAMILY:
settings = _gtk_style_provider_private_get_settings (provider);
if (settings)
{
PangoFontDescription *description;
char *font_name;
GtkCssValue *value;
g_object_get (settings, "gtk-font-name", &font_name, NULL);
description = pango_font_description_from_string (font_name);
g_free (font_name);
if (description == NULL)
break;
if (pango_font_description_get_set_fields (description) & PANGO_FONT_MASK_FAMILY)
{
value = _gtk_css_array_value_new (_gtk_css_string_value_new (pango_font_description_get_family (description)));
pango_font_description_free (description);
return value;
}
pango_font_description_free (description);
}
break;
default:
break;
}
return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (value->property),
property_id,
provider,
values,
@@ -48,6 +90,12 @@ gtk_css_value_initial_compute (GtkCssValue *value,
dependencies);
}
static gboolean
gtk_css_value_initial_needs_compute (const GtkCssValue *value)
{
return TRUE;
}
static gboolean
gtk_css_value_initial_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -74,6 +122,7 @@ gtk_css_value_initial_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_INITIAL = {
gtk_css_value_initial_free,
gtk_css_value_initial_compute,
gtk_css_value_initial_needs_compute,
gtk_css_value_initial_equal,
gtk_css_value_initial_transition,
gtk_css_value_initial_print
@@ -82,13 +131,21 @@ static const GtkCssValueClass GTK_CSS_VALUE_INITIAL = {
static GtkCssValue initial = { &GTK_CSS_VALUE_INITIAL, 1 };
GtkCssValue *
_gtk_css_initial_value_new (void)
_gtk_css_initial_value_new (GtkCssStyleProperty *property)
{
return _gtk_css_value_ref (&initial);
return _gtk_css_value_ref (_gtk_css_initial_value_get (property));
}
GtkCssValue *
_gtk_css_initial_value_get (void)
_gtk_css_initial_value_get (GtkCssStyleProperty *property)
{
return &initial;
if (property->css_initial_value == NULL)
{
property->css_initial_value = g_new0 (GtkCssValue, 1);
*property->css_initial_value = initial;
property->css_initial_value->property = property;
property->css_initial_value->needs_compute =
_gtk_css_value_needs_compute (_gtk_css_style_property_get_initial_value (property));
}
return property->css_initial_value;
}
+3 -3
View File
@@ -21,11 +21,11 @@
#define __GTK_CSS_INITIAL_VALUE_PRIVATE_H__
#include "gtkcssvalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
G_BEGIN_DECLS
GtkCssValue * _gtk_css_initial_value_new (void);
GtkCssValue * _gtk_css_initial_value_get (void);
GtkCssValue * _gtk_css_initial_value_new (GtkCssStyleProperty *property);
GtkCssValue * _gtk_css_initial_value_get (GtkCssStyleProperty *property);
G_END_DECLS
+3
View File
@@ -185,6 +185,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_WIDGET_PATH = {
gtk_css_matcher_widget_path_has_regions,
gtk_css_matcher_widget_path_has_region,
gtk_css_matcher_widget_path_has_position,
FALSE
};
gboolean
@@ -288,6 +289,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_ANY = {
gtk_css_matcher_any_has_regions,
gtk_css_matcher_any_has_region,
gtk_css_matcher_any_has_position,
TRUE
};
void
@@ -406,6 +408,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_SUPERSET = {
gtk_css_matcher_superset_has_regions,
gtk_css_matcher_superset_has_region,
gtk_css_matcher_superset_has_position,
FALSE
};
void
+7
View File
@@ -50,6 +50,7 @@ struct _GtkCssMatcherClass {
gboolean forward,
int a,
int b);
gboolean is_any;
};
struct _GtkCssMatcherWidgetPath {
@@ -146,6 +147,12 @@ _gtk_css_matcher_has_position (const GtkCssMatcher *matcher,
return matcher->klass->has_position (matcher, forward, a, b);
}
static inline gboolean
_gtk_css_matcher_matches_any (const GtkCssMatcher *matcher)
{
return matcher->klass->is_any;
}
G_END_DECLS
+61 -4
View File
@@ -20,6 +20,7 @@
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssenumvalueprivate.h"
#include "gtkcssinitialvalueprivate.h"
#include "gtkstylepropertyprivate.h"
struct _GtkCssValue {
@@ -34,6 +35,26 @@ gtk_css_value_number_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static double
get_base_font_size (guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssComputedValues *values,
GtkCssComputedValues *parent_values,
GtkCssDependencies *dependencies)
{
if (property_id == GTK_CSS_PROPERTY_FONT_SIZE)
{
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
if (parent_values)
return _gtk_css_number_value_get (_gtk_css_computed_values_get_value (parent_values, GTK_CSS_PROPERTY_FONT_SIZE), 100);
else
return _gtk_css_font_size_get_default (provider);
}
*dependencies = GTK_CSS_DEPENDS_ON_FONT_SIZE;
return _gtk_css_number_value_get (_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_FONT_SIZE), 100);
}
static GtkCssValue *
gtk_css_value_number_compute (GtkCssValue *number,
guint property_id,
@@ -48,6 +69,11 @@ gtk_css_value_number_compute (GtkCssValue *number,
g_assert_not_reached();
/* fall through */
case GTK_CSS_PERCENT:
/* percentages for font sizes are computed, other percentages aren't */
if (property_id == GTK_CSS_PROPERTY_FONT_SIZE)
return _gtk_css_number_value_new (number->value / 100.0 *
get_base_font_size (property_id, provider, values, parent_values, dependencies),
GTK_CSS_PX);
case GTK_CSS_NUMBER:
case GTK_CSS_PX:
case GTK_CSS_DEG:
@@ -73,16 +99,14 @@ gtk_css_value_number_compute (GtkCssValue *number,
GTK_CSS_PX);
break;
case GTK_CSS_EM:
*dependencies = GTK_CSS_DEPENDS_ON_FONT_SIZE;
return _gtk_css_number_value_new (number->value *
_gtk_css_number_value_get (_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_FONT_SIZE), 100),
get_base_font_size (property_id, provider, values, parent_values, dependencies),
GTK_CSS_PX);
break;
case GTK_CSS_EX:
/* for now we pretend ex is half of em */
*dependencies = GTK_CSS_DEPENDS_ON_FONT_SIZE;
return _gtk_css_number_value_new (number->value * 0.5 *
_gtk_css_number_value_get (_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_FONT_SIZE), 100),
get_base_font_size (property_id, provider, values, parent_values, dependencies),
GTK_CSS_PX);
case GTK_CSS_RAD:
return _gtk_css_number_value_new (number->value * 360.0 / (2 * G_PI),
@@ -99,6 +123,38 @@ gtk_css_value_number_compute (GtkCssValue *number,
}
}
static gboolean
gtk_css_value_number_needs_compute (const GtkCssValue *number)
{
switch (number->unit)
{
default:
g_assert_not_reached();
/* fall through */
case GTK_CSS_PERCENT:
/* percentages for font sizes are computed, other percentages aren't */
return TRUE;
case GTK_CSS_NUMBER:
case GTK_CSS_PX:
case GTK_CSS_DEG:
case GTK_CSS_S:
return FALSE;
case GTK_CSS_PT:
case GTK_CSS_PC:
case GTK_CSS_IN:
case GTK_CSS_CM:
case GTK_CSS_MM:
case GTK_CSS_EM:
case GTK_CSS_EX:
case GTK_CSS_RAD:
case GTK_CSS_GRAD:
case GTK_CSS_TURN:
case GTK_CSS_MS:
return TRUE;
}
}
static gboolean
gtk_css_value_number_equal (const GtkCssValue *number1,
const GtkCssValue *number2)
@@ -156,6 +212,7 @@ gtk_css_value_number_print (const GtkCssValue *number,
static const GtkCssValueClass GTK_CSS_VALUE_NUMBER = {
gtk_css_value_number_free,
gtk_css_value_number_compute,
gtk_css_value_number_needs_compute,
gtk_css_value_number_equal,
gtk_css_value_number_transition,
gtk_css_value_number_print
+1 -1
View File
@@ -257,7 +257,7 @@ gtk_css_parser_skip_comment (GtkCssParser *parser)
parser->data++;
if (parser->data[-2] == '*')
if (len > 0 && parser->data[-2] == '*')
return TRUE;
if (parser->data[0] == '*')
_gtk_css_parser_error (parser, "'/*' in comment block");
+9
View File
@@ -60,6 +60,14 @@ gtk_css_value_position_compute (GtkCssValue *position,
return _gtk_css_position_value_new (x, y);
}
static gboolean
gtk_css_value_position_needs_compute (const GtkCssValue *position)
{
return
_gtk_css_value_needs_compute (position->x) ||
_gtk_css_value_needs_compute (position->y);
}
static gboolean
gtk_css_value_position_equal (const GtkCssValue *position1,
const GtkCssValue *position2)
@@ -155,6 +163,7 @@ done:
static const GtkCssValueClass GTK_CSS_VALUE_POSITION = {
gtk_css_value_position_free,
gtk_css_value_position_compute,
gtk_css_value_position_needs_compute,
gtk_css_value_position_equal,
gtk_css_value_position_transition,
gtk_css_value_position_print
+99 -29
View File
@@ -986,6 +986,7 @@ struct _WidgetPropertyValue {
struct GtkCssRuleset
{
GtkCssSelector *selector;
GtkCssSelectorTree *selector_match;
WidgetPropertyValue *widget_style;
PropertyValue *styles;
GtkBitmask *set_styles;
@@ -1011,6 +1012,7 @@ struct _GtkCssProviderPrivate
GHashTable *keyframes;
GArray *rulesets;
GtkCssSelectorTree *tree;
GResource *resource;
};
@@ -1271,17 +1273,10 @@ gtk_css_ruleset_add (GtkCssRuleset *ruleset,
ruleset->styles[i].section = NULL;
}
static gboolean
gtk_css_ruleset_matches (GtkCssRuleset *ruleset,
const GtkCssMatcher *matcher)
{
return _gtk_css_selector_matches (ruleset->selector, matcher);
}
static GtkCssChange
gtk_css_ruleset_get_change (GtkCssRuleset *ruleset)
{
return _gtk_css_selector_get_change (ruleset->selector);
return _gtk_css_selector_tree_match_get_change (ruleset->selector_match);
}
static void
@@ -1409,6 +1404,43 @@ gtk_css_provider_init (GtkCssProvider *css_provider)
(GDestroyNotify) _gtk_css_value_unref);
}
static void
verify_tree_match_results (GtkCssProvider *provider,
const GtkCssMatcher *matcher,
GPtrArray *tree_rules)
{
#ifdef VERIFY_TREE
GtkCssProviderPrivate *priv = provider->priv;
GtkCssRuleset *ruleset;
gboolean should_match;
int i, j;
for (i = 0; i < priv->rulesets->len; i++)
{
gboolean found = FALSE;
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
for (j = 0; j < tree_rules->len; j++)
{
if (ruleset == tree_rules->pdata[j])
{
found = TRUE;
break;
}
}
should_match = _gtk_css_selector_matches (ruleset->selector, matcher);
if (found != !!should_match)
{
g_error ("expected rule '%s' to %s, but it %s\n",
_gtk_css_selector_to_string (ruleset->selector),
should_match ? "match" : "not match",
found ? "matched" : "didn't match");
}
}
#endif
}
static gboolean
gtk_css_provider_get_style_property (GtkStyleProvider *provider,
GtkWidgetPath *path,
@@ -1419,6 +1451,7 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
GtkCssProvider *css_provider = GTK_CSS_PROVIDER (provider);
GtkCssProviderPrivate *priv = css_provider->priv;
WidgetPropertyValue *val;
GPtrArray *tree_rules;
GtkCssMatcher matcher;
gboolean found = FALSE;
gchar *prop_name;
@@ -1427,22 +1460,20 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
if (!_gtk_css_matcher_init (&matcher, path, state))
return FALSE;
tree_rules = _gtk_css_selector_tree_match_all (priv->tree, &matcher);
verify_tree_match_results (css_provider, &matcher, tree_rules);
prop_name = g_strdup_printf ("-%s-%s",
g_type_name (pspec->owner_type),
pspec->name);
for (i = priv->rulesets->len - 1; i >= 0; i--)
for (i = tree_rules->len - 1; i >= 0; i--)
{
GtkCssRuleset *ruleset;
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
GtkCssRuleset *ruleset = tree_rules->pdata[i];
if (ruleset->widget_style == NULL)
continue;
if (!gtk_css_ruleset_matches (ruleset, &matcher))
continue;
for (val = ruleset->widget_style; val != NULL; val = val->next)
{
if (strcmp (val->name, prop_name) == 0)
@@ -1469,6 +1500,7 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
}
g_free (prop_name);
g_ptr_array_free (tree_rules, TRUE);
return found;
}
@@ -1506,17 +1538,19 @@ gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
GtkCssProviderPrivate *priv;
GtkCssRuleset *ruleset;
guint j;
int i;
GPtrArray *tree_rules;
css_provider = GTK_CSS_PROVIDER (provider);
priv = css_provider->priv;
if (priv->rulesets->len == 0)
return;
tree_rules = _gtk_css_selector_tree_match_all (priv->tree, matcher);
verify_tree_match_results (css_provider, matcher, tree_rules);
for (ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, priv->rulesets->len - 1);
ruleset >= &g_array_index (priv->rulesets, GtkCssRuleset, 0);
ruleset--)
for (i = tree_rules->len - 1; i >= 0; i--)
{
ruleset = tree_rules->pdata[i];
if (ruleset->styles == NULL)
continue;
@@ -1524,9 +1558,6 @@ gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
ruleset->set_styles))
continue;
if (!gtk_css_ruleset_matches (ruleset, matcher))
continue;
for (j = 0; j < ruleset->n_styles; j++)
{
GtkCssStyleProperty *prop = ruleset->styles[j].property;
@@ -1544,6 +1575,8 @@ gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
if (_gtk_bitmask_is_empty (_gtk_css_lookup_get_missing (lookup)))
break;
}
g_ptr_array_free (tree_rules, TRUE);
}
static GtkCssChange
@@ -1553,26 +1586,29 @@ gtk_css_style_provider_get_change (GtkStyleProviderPrivate *provider,
GtkCssProvider *css_provider;
GtkCssProviderPrivate *priv;
GtkCssChange change = 0;
GPtrArray *tree_rules;
int i;
css_provider = GTK_CSS_PROVIDER (provider);
priv = css_provider->priv;
for (i = priv->rulesets->len - 1; i >= 0; i--)
tree_rules = _gtk_css_selector_tree_match_all (priv->tree, matcher);
verify_tree_match_results (css_provider, matcher, tree_rules);
for (i = tree_rules->len - 1; i >= 0; i--)
{
GtkCssRuleset *ruleset;
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
ruleset = tree_rules->pdata[i];
if (ruleset->styles == NULL)
continue;
if (!gtk_css_ruleset_matches (ruleset, matcher))
continue;
change |= gtk_css_ruleset_get_change (ruleset);
}
g_ptr_array_free (tree_rules, TRUE);
return change;
}
@@ -1599,6 +1635,7 @@ gtk_css_provider_finalize (GObject *object)
gtk_css_ruleset_clear (&g_array_index (priv->rulesets, GtkCssRuleset, i));
g_array_free (priv->rulesets, TRUE);
_gtk_css_selector_tree_free (priv->tree);
g_hash_table_destroy (priv->symbolic_colors);
g_hash_table_destroy (priv->keyframes);
@@ -1736,6 +1773,9 @@ gtk_css_provider_reset (GtkCssProvider *css_provider)
for (i = 0; i < priv->rulesets->len; i++)
gtk_css_ruleset_clear (&g_array_index (priv->rulesets, GtkCssRuleset, i));
g_array_set_size (priv->rulesets, 0);
_gtk_css_selector_tree_free (priv->tree);
priv->tree = NULL;
}
static void
@@ -2370,8 +2410,38 @@ static void
gtk_css_provider_postprocess (GtkCssProvider *css_provider)
{
GtkCssProviderPrivate *priv = css_provider->priv;
GtkCssSelectorTreeBuilder *builder;
guint i;
g_array_sort (priv->rulesets, gtk_css_provider_compare_rule);
builder = _gtk_css_selector_tree_builder_new ();
for (i = 0; i < priv->rulesets->len; i++)
{
GtkCssRuleset *ruleset;
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
_gtk_css_selector_tree_builder_add (builder,
ruleset->selector,
&ruleset->selector_match,
ruleset);
}
priv->tree = _gtk_css_selector_tree_builder_build (builder);
_gtk_css_selector_tree_builder_free (builder);
#ifndef VERIFY_TREE
for (i = 0; i < priv->rulesets->len; i++)
{
GtkCssRuleset *ruleset;
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
_gtk_css_selector_free (ruleset->selector);
ruleset->selector = NULL;
}
#endif
}
static gboolean
@@ -2820,7 +2890,7 @@ gtk_css_ruleset_print (const GtkCssRuleset *ruleset,
WidgetPropertyValue *widget_value;
guint i;
_gtk_css_selector_print (ruleset->selector, str);
_gtk_css_selector_tree_match_print (ruleset->selector_match, str);
g_string_append (str, " {\n");
+8
View File
@@ -44,6 +44,12 @@ gtk_css_value_repeat_compute (GtkCssValue *value,
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_repeat_needs_compute (const GtkCssValue *value)
{
return FALSE;
}
static gboolean
gtk_css_value_repeat_equal (const GtkCssValue *repeat1,
const GtkCssValue *repeat2)
@@ -116,6 +122,7 @@ gtk_css_value_border_repeat_print (const GtkCssValue *repeat,
static const GtkCssValueClass GTK_CSS_VALUE_BACKGROUND_REPEAT = {
gtk_css_value_repeat_free,
gtk_css_value_repeat_compute,
gtk_css_value_repeat_needs_compute,
gtk_css_value_repeat_equal,
gtk_css_value_repeat_transition,
gtk_css_value_background_repeat_print
@@ -124,6 +131,7 @@ static const GtkCssValueClass GTK_CSS_VALUE_BACKGROUND_REPEAT = {
static const GtkCssValueClass GTK_CSS_VALUE_BORDER_REPEAT = {
gtk_css_value_repeat_free,
gtk_css_value_repeat_compute,
gtk_css_value_repeat_needs_compute,
gtk_css_value_repeat_equal,
gtk_css_value_repeat_transition,
gtk_css_value_border_repeat_print
+7
View File
@@ -44,6 +44,12 @@ gtk_css_value_rgba_compute (GtkCssValue *value,
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_rgba_needs_compute (const GtkCssValue *value)
{
return FALSE;
}
static gboolean
gtk_css_value_rgba_equal (const GtkCssValue *rgba1,
const GtkCssValue *rgba2)
@@ -80,6 +86,7 @@ gtk_css_value_rgba_print (const GtkCssValue *rgba,
static const GtkCssValueClass GTK_CSS_VALUE_RGBA = {
gtk_css_value_rgba_free,
gtk_css_value_rgba_compute,
gtk_css_value_rgba_needs_compute,
gtk_css_value_rgba_equal,
gtk_css_value_rgba_transition,
gtk_css_value_rgba_print
+987 -56
View File
File diff suppressed because it is too large Load Diff
+18 -1
View File
@@ -24,6 +24,8 @@
G_BEGIN_DECLS
typedef struct _GtkCssSelector GtkCssSelector;
typedef struct _GtkCssSelectorTree GtkCssSelectorTree;
typedef struct _GtkCssSelectorTreeBuilder GtkCssSelectorTreeBuilder;
GtkCssSelector * _gtk_css_selector_parse (GtkCssParser *parser);
void _gtk_css_selector_free (GtkCssSelector *selector);
@@ -32,12 +34,27 @@ char * _gtk_css_selector_to_string (const GtkCssSelector *sel
void _gtk_css_selector_print (const GtkCssSelector *selector,
GString *str);
GtkCssChange _gtk_css_selector_get_change (const GtkCssSelector *selector);
gboolean _gtk_css_selector_matches (const GtkCssSelector *selector,
const GtkCssMatcher *matcher);
int _gtk_css_selector_compare (const GtkCssSelector *a,
const GtkCssSelector *b);
void _gtk_css_selector_tree_free (GtkCssSelectorTree *tree);
GPtrArray * _gtk_css_selector_tree_match_all (const GtkCssSelectorTree *tree,
const GtkCssMatcher *matcher);
void _gtk_css_selector_tree_match_print (const GtkCssSelectorTree *tree,
GString *str);
GtkCssChange _gtk_css_selector_tree_match_get_change (const GtkCssSelectorTree *tree);
GtkCssSelectorTreeBuilder *_gtk_css_selector_tree_builder_new (void);
void _gtk_css_selector_tree_builder_add (GtkCssSelectorTreeBuilder *builder,
GtkCssSelector *selectors,
GtkCssSelectorTree **selector_match,
gpointer match);
GtkCssSelectorTree * _gtk_css_selector_tree_builder_build (GtkCssSelectorTreeBuilder *builder);
void _gtk_css_selector_tree_builder_free (GtkCssSelectorTreeBuilder *builder);
G_END_DECLS
#endif /* __GTK_CSS_SELECTOR_PRIVATE_H__ */
+15
View File
@@ -72,6 +72,20 @@ gtk_css_value_shadows_compute (GtkCssValue *value,
return result;
}
static gboolean
gtk_css_value_shadows_needs_compute (const GtkCssValue *value)
{
guint i;
for (i = 0; i < value->len; i++)
{
if (_gtk_css_value_needs_compute (value->values[i]))
return TRUE;
}
return FALSE;
}
static gboolean
gtk_css_value_shadows_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -181,6 +195,7 @@ gtk_css_value_shadows_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_SHADOWS = {
gtk_css_value_shadows_free,
gtk_css_value_shadows_compute,
gtk_css_value_shadows_needs_compute,
gtk_css_value_shadows_equal,
gtk_css_value_shadows_transition,
gtk_css_value_shadows_print
+13
View File
@@ -94,6 +94,18 @@ gtk_css_value_shadow_compute (GtkCssValue *shadow,
return gtk_css_shadow_value_new (hoffset, voffset, radius, spread, shadow->inset, color);
}
static gboolean
gtk_css_value_shadow_needs_compute (const GtkCssValue *shadow)
{
return
_gtk_css_value_needs_compute (shadow->hoffset) ||
_gtk_css_value_needs_compute (shadow->voffset) ||
_gtk_css_value_needs_compute (shadow->radius) ||
_gtk_css_value_needs_compute (shadow->spread) ||
_gtk_css_value_needs_compute (shadow->color);
}
static gboolean
gtk_css_value_shadow_equal (const GtkCssValue *shadow1,
const GtkCssValue *shadow2)
@@ -154,6 +166,7 @@ gtk_css_value_shadow_print (const GtkCssValue *shadow,
static const GtkCssValueClass GTK_CSS_VALUE_SHADOW = {
gtk_css_value_shadow_free,
gtk_css_value_shadow_compute,
gtk_css_value_shadow_needs_compute,
gtk_css_value_shadow_equal,
gtk_css_value_shadow_transition,
gtk_css_value_shadow_print
+2 -2
View File
@@ -102,7 +102,7 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
*/
for (i = 0; i < shorthand->subproperties->len; i++)
{
data[i] = _gtk_css_initial_value_new ();
data[i] = _gtk_css_initial_value_new (shorthand->subproperties->pdata[i]);
}
}
else if (_gtk_css_parser_try (parser, "inherit", TRUE))
@@ -135,7 +135,7 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
for (i = 0; i < shorthand->subproperties->len; i++)
{
if (data[i] == NULL)
data[i] = _gtk_css_initial_value_new ();
data[i] = _gtk_css_initial_value_new (shorthand->subproperties->pdata[i]);
}
result = _gtk_css_array_value_new_from_array (data, shorthand->subproperties->len);
+3 -3
View File
@@ -565,8 +565,8 @@ parse_background (GtkCssShorthandProperty *shorthand,
{
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
g_ptr_array_unref (arrays[i]);
return FALSE;
}
return FALSE;
}
for (i = 0; i < 6; i++)
@@ -668,8 +668,8 @@ parse_transition (GtkCssShorthandProperty *shorthand,
{
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
g_ptr_array_unref (arrays[i]);
return FALSE;
}
return FALSE;
}
for (i = 0; i < 4; i++)
@@ -784,8 +784,8 @@ parse_animation (GtkCssShorthandProperty *shorthand,
{
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
g_ptr_array_unref (arrays[i]);
return FALSE;
}
return FALSE;
}
for (i = 0; i < 6; i++)
+8
View File
@@ -44,6 +44,12 @@ gtk_css_value_string_compute (GtkCssValue *value,
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_string_needs_compute (const GtkCssValue *value)
{
return FALSE;
}
static gboolean
gtk_css_value_string_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -150,6 +156,7 @@ gtk_css_value_ident_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_STRING = {
gtk_css_value_string_free,
gtk_css_value_string_compute,
gtk_css_value_string_needs_compute,
gtk_css_value_string_equal,
gtk_css_value_string_transition,
gtk_css_value_string_print
@@ -158,6 +165,7 @@ static const GtkCssValueClass GTK_CSS_VALUE_STRING = {
static const GtkCssValueClass GTK_CSS_VALUE_IDENT = {
gtk_css_value_string_free,
gtk_css_value_string_compute,
gtk_css_value_string_needs_compute,
gtk_css_value_string_equal,
gtk_css_value_string_transition,
gtk_css_value_ident_print
+45 -1
View File
@@ -38,6 +38,7 @@
enum {
PROP_0,
PROP_ANIMATED,
PROP_AFFECTS_SIZE,
PROP_ID,
PROP_INHERIT,
PROP_INITIAL
@@ -45,6 +46,8 @@ enum {
G_DEFINE_TYPE (GtkCssStyleProperty, _gtk_css_style_property, GTK_TYPE_STYLE_PROPERTY)
static GtkBitmask *_properties_affecting_size = NULL;
static void
gtk_css_style_property_constructed (GObject *object)
{
@@ -54,6 +57,9 @@ gtk_css_style_property_constructed (GObject *object)
property->id = klass->style_properties->len;
g_ptr_array_add (klass->style_properties, property);
if (property->affects_size)
_properties_affecting_size = _gtk_bitmask_set (_properties_affecting_size, property->id, TRUE);
G_OBJECT_CLASS (_gtk_css_style_property_parent_class)->constructed (object);
}
@@ -70,6 +76,9 @@ gtk_css_style_property_set_property (GObject *object,
case PROP_ANIMATED:
property->animated = g_value_get_boolean (value);
break;
case PROP_AFFECTS_SIZE:
property->affects_size = g_value_get_boolean (value);
break;
case PROP_INHERIT:
property->inherit = g_value_get_boolean (value);
break;
@@ -96,6 +105,9 @@ gtk_css_style_property_get_property (GObject *object,
case PROP_ANIMATED:
g_value_set_boolean (value, property->animated);
break;
case PROP_AFFECTS_SIZE:
g_value_set_boolean (value, property->affects_size);
break;
case PROP_ID:
g_value_set_boolean (value, property->id);
break;
@@ -218,7 +230,7 @@ gtk_css_style_property_parse_value (GtkStyleProperty *property,
/* the initial value can be explicitly specified with the
* initial keyword which all properties accept.
*/
return _gtk_css_initial_value_new ();
return _gtk_css_initial_value_new (style_property);
}
else if (_gtk_css_parser_try (parser, "inherit", TRUE))
{
@@ -251,6 +263,13 @@ _gtk_css_style_property_class_init (GtkCssStylePropertyClass *klass)
P_("Set if the value can be animated"),
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
PROP_AFFECTS_SIZE,
g_param_spec_boolean ("affects-size",
P_("Affects size"),
P_("Set if the value affects the sizing of elements"),
TRUE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
PROP_ID,
g_param_spec_uint ("id",
@@ -278,6 +297,8 @@ _gtk_css_style_property_class_init (GtkCssStylePropertyClass *klass)
property_class->parse_value = gtk_css_style_property_parse_value;
klass->style_properties = g_ptr_array_new ();
_properties_affecting_size = _gtk_bitmask_new ();
}
static GtkCssValue *
@@ -381,6 +402,23 @@ _gtk_css_style_property_is_animated (GtkCssStyleProperty *property)
return property->animated;
}
/**
* _gtk_css_style_property_affects_size:
* @property: the property
*
* Queries if the given @property affects the size of elements. This is
* used for optimizations inside GTK, where a gtk_widget_queue_resize()
* can be avoided if the property does not affect size.
*
* Returns: %TRUE if the property affects sizing of elements.
**/
gboolean
_gtk_css_style_property_affects_size (GtkCssStyleProperty *property)
{
g_return_val_if_fail (GTK_IS_CSS_STYLE_PROPERTY (property), FALSE);
return property->affects_size;
}
/**
* _gtk_css_style_property_get_id:
* @property: the property
@@ -415,3 +453,9 @@ _gtk_css_style_property_get_initial_value (GtkCssStyleProperty *property)
return property->initial_value;
}
gboolean
_gtk_css_style_property_changes_affect_size (const GtkBitmask *changes)
{
return _gtk_bitmask_intersects (changes, _properties_affecting_size);
}
+58 -55
View File
@@ -65,7 +65,8 @@
typedef enum {
GTK_STYLE_PROPERTY_INHERIT = (1 << 0),
GTK_STYLE_PROPERTY_ANIMATED = (1 << 1)
GTK_STYLE_PROPERTY_ANIMATED = (1 << 1),
GTK_STYLE_PROPERTY_NO_RESIZE = (1 << 2)
} GtkStylePropertyFlags;
static void
@@ -87,6 +88,7 @@ gtk_css_style_property_register (const char * name,
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
"value-type", value_type,
"affects-size", (flags & GTK_STYLE_PROPERTY_NO_RESIZE) ? FALSE : TRUE,
"animated", (flags & GTK_STYLE_PROPERTY_ANIMATED) ? TRUE : FALSE,
"inherit", (flags & GTK_STYLE_PROPERTY_INHERIT) ? TRUE : FALSE,
"initial-value", initial_value,
@@ -160,7 +162,7 @@ assign_border (GtkCssStyleProperty *property,
const GtkBorder *border = g_value_get_boxed (value);
if (border == NULL)
return _gtk_css_initial_value_new ();
return _gtk_css_initial_value_new (property);
else
return _gtk_css_border_value_new (_gtk_css_number_value_new (border->top, GTK_CSS_PX),
_gtk_css_number_value_new (border->right, GTK_CSS_PX),
@@ -646,15 +648,17 @@ static GtkCssValue *
font_size_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
gdouble d;
GtkCssValue *value;
if (!_gtk_css_parser_try_double (parser, &d))
{
_gtk_css_parser_error (parser, "Expected a number");
return NULL;
}
value = _gtk_css_font_size_value_try_parse (parser);
if (value)
return value;
return _gtk_css_number_value_new (d, GTK_CSS_PX);
return _gtk_css_number_value_parse (parser,
GTK_CSS_PARSE_LENGTH
| GTK_CSS_PARSE_PERCENT
| GTK_CSS_POSITIVE_ONLY
| GTK_CSS_NUMBER_AS_PIXELS);
}
static GtkCssValue *
@@ -864,7 +868,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("color",
GTK_CSS_PROPERTY_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
color_parse,
color_query,
color_assign,
@@ -876,15 +880,14 @@ _gtk_css_style_property_init_properties (void)
font_size_parse,
query_length_as_double,
assign_length_from_double,
/* XXX: This should be 'normal' */
_gtk_css_number_value_new (10.0, GTK_CSS_PX));
_gtk_css_font_size_value_new (GTK_CSS_FONT_SIZE_MEDIUM));
/* properties that aren't referenced when computing values
* start here */
gtk_css_style_property_register ("background-color",
GTK_CSS_PROPERTY_BACKGROUND_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
color_parse,
color_query,
color_assign,
@@ -926,7 +929,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("text-shadow",
GTK_CSS_PROPERTY_TEXT_SHADOW,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
shadow_value_parse,
NULL,
NULL,
@@ -935,7 +938,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("icon-shadow",
GTK_CSS_PROPERTY_ICON_SHADOW,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
shadow_value_parse,
NULL,
NULL,
@@ -944,7 +947,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("box-shadow",
GTK_CSS_PROPERTY_BOX_SHADOW,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
shadow_value_parse,
NULL,
NULL,
@@ -1020,7 +1023,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-top-style",
GTK_CSS_PROPERTY_BORDER_TOP_STYLE,
GTK_TYPE_BORDER_STYLE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_border_style,
query_border_style,
assign_border_style,
@@ -1036,7 +1039,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-left-style",
GTK_CSS_PROPERTY_BORDER_LEFT_STYLE,
GTK_TYPE_BORDER_STYLE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_border_style,
query_border_style,
assign_border_style,
@@ -1052,7 +1055,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-bottom-style",
GTK_CSS_PROPERTY_BORDER_BOTTOM_STYLE,
GTK_TYPE_BORDER_STYLE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_border_style,
query_border_style,
assign_border_style,
@@ -1068,7 +1071,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-right-style",
GTK_CSS_PROPERTY_BORDER_RIGHT_STYLE,
GTK_TYPE_BORDER_STYLE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_border_style,
query_border_style,
assign_border_style,
@@ -1085,7 +1088,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-top-left-radius",
GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
border_corner_radius_value_parse,
NULL,
NULL,
@@ -1094,7 +1097,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-top-right-radius",
GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
border_corner_radius_value_parse,
NULL,
NULL,
@@ -1103,7 +1106,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-bottom-right-radius",
GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
border_corner_radius_value_parse,
NULL,
NULL,
@@ -1112,7 +1115,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-bottom-left-radius",
GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
border_corner_radius_value_parse,
NULL,
NULL,
@@ -1122,7 +1125,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-style",
GTK_CSS_PROPERTY_OUTLINE_STYLE,
GTK_TYPE_BORDER_STYLE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_border_style,
query_border_style,
assign_border_style,
@@ -1138,7 +1141,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-offset",
GTK_CSS_PROPERTY_OUTLINE_OFFSET,
G_TYPE_INT,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
outline_parse,
query_length_as_int,
assign_length_from_int,
@@ -1147,7 +1150,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-clip",
GTK_CSS_PROPERTY_BACKGROUND_CLIP,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_css_area,
NULL,
NULL,
@@ -1155,7 +1158,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-origin",
GTK_CSS_PROPERTY_BACKGROUND_ORIGIN,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_css_area,
NULL,
NULL,
@@ -1163,7 +1166,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-size",
GTK_CSS_PROPERTY_BACKGROUND_SIZE,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
background_size_parse,
NULL,
NULL,
@@ -1171,7 +1174,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-position",
GTK_CSS_PROPERTY_BACKGROUND_POSITION,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
background_position_parse,
NULL,
NULL,
@@ -1181,7 +1184,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-top-color",
GTK_CSS_PROPERTY_BORDER_TOP_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
color_parse,
color_query,
color_assign,
@@ -1189,7 +1192,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-right-color",
GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
color_parse,
color_query,
color_assign,
@@ -1197,7 +1200,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-bottom-color",
GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
color_parse,
color_query,
color_assign,
@@ -1205,7 +1208,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-left-color",
GTK_CSS_PROPERTY_BORDER_LEFT_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
color_parse,
color_query,
color_assign,
@@ -1213,7 +1216,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-color",
GTK_CSS_PROPERTY_OUTLINE_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
color_parse,
color_query,
color_assign,
@@ -1222,7 +1225,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-repeat",
GTK_CSS_PROPERTY_BACKGROUND_REPEAT,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
background_repeat_value_parse,
NULL,
NULL,
@@ -1231,7 +1234,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-image",
GTK_CSS_PROPERTY_BACKGROUND_IMAGE,
CAIRO_GOBJECT_TYPE_PATTERN,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
background_image_value_parse,
background_image_value_query,
background_image_value_assign,
@@ -1240,7 +1243,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-image-source",
GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE,
CAIRO_GOBJECT_TYPE_PATTERN,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
css_image_value_parse,
css_image_value_query,
css_image_value_assign,
@@ -1248,7 +1251,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-image-repeat",
GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
border_image_repeat_parse,
NULL,
NULL,
@@ -1258,7 +1261,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-image-slice",
GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE,
GTK_TYPE_BORDER,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
border_image_slice_parse,
query_border,
assign_border,
@@ -1269,7 +1272,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-image-width",
GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH,
GTK_TYPE_BORDER,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
border_image_width_parse,
query_border,
assign_border,
@@ -1281,7 +1284,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("transition-property",
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
transition_property_parse,
NULL,
NULL,
@@ -1289,7 +1292,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("transition-duration",
GTK_CSS_PROPERTY_TRANSITION_DURATION,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
transition_time_parse,
NULL,
NULL,
@@ -1297,7 +1300,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("transition-timing-function",
GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
transition_timing_function_parse,
NULL,
NULL,
@@ -1306,7 +1309,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("transition-delay",
GTK_CSS_PROPERTY_TRANSITION_DELAY,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
transition_time_parse,
NULL,
NULL,
@@ -1315,7 +1318,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-name",
GTK_CSS_PROPERTY_ANIMATION_NAME,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
transition_property_parse,
NULL,
NULL,
@@ -1323,7 +1326,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-duration",
GTK_CSS_PROPERTY_ANIMATION_DURATION,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
transition_time_parse,
NULL,
NULL,
@@ -1331,7 +1334,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-timing-function",
GTK_CSS_PROPERTY_ANIMATION_TIMING_FUNCTION,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
transition_timing_function_parse,
NULL,
NULL,
@@ -1340,7 +1343,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-iteration-count",
GTK_CSS_PROPERTY_ANIMATION_ITERATION_COUNT,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
iteration_count_parse,
NULL,
NULL,
@@ -1348,7 +1351,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-direction",
GTK_CSS_PROPERTY_ANIMATION_DIRECTION,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_css_direction,
NULL,
NULL,
@@ -1356,7 +1359,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-play-state",
GTK_CSS_PROPERTY_ANIMATION_PLAY_STATE,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_css_play_state,
NULL,
NULL,
@@ -1364,7 +1367,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-delay",
GTK_CSS_PROPERTY_ANIMATION_DELAY,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
transition_time_parse,
NULL,
NULL,
@@ -1372,7 +1375,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-fill-mode",
GTK_CSS_PROPERTY_ANIMATION_FILL_MODE,
G_TYPE_NONE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
parse_css_fill_mode,
NULL,
NULL,
@@ -1381,7 +1384,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("engine",
GTK_CSS_PROPERTY_ENGINE,
GTK_TYPE_THEMING_ENGINE,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
engine_parse,
engine_query,
engine_assign,
@@ -1391,7 +1394,7 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("gtk-key-bindings",
GTK_CSS_PROPERTY_GTK_KEY_BINDINGS,
G_TYPE_PTR_ARRAY,
0,
GTK_STYLE_PROPERTY_NO_RESIZE,
bindings_value_parse,
bindings_value_query,
bindings_value_assign,
+7
View File
@@ -49,6 +49,9 @@ struct _GtkCssStyleProperty
guint id;
guint inherit :1;
guint animated :1;
guint affects_size :1;
GtkCssValue *css_initial_value; /* Used to quickly find the GCssInitialValue for a property */
GtkCssStylePropertyParseFunc parse_value;
GtkCssStylePropertyQueryFunc query_value;
@@ -71,6 +74,7 @@ GtkCssStyleProperty * _gtk_css_style_property_lookup_by_id (guint
gboolean _gtk_css_style_property_is_inherit (GtkCssStyleProperty *property);
gboolean _gtk_css_style_property_is_animated (GtkCssStyleProperty *property);
gboolean _gtk_css_style_property_affects_size (GtkCssStyleProperty *property);
guint _gtk_css_style_property_get_id (GtkCssStyleProperty *property);
GtkCssValue * _gtk_css_style_property_get_initial_value
(GtkCssStyleProperty *property);
@@ -78,6 +82,9 @@ GtkCssValue * _gtk_css_style_property_get_initial_value
void _gtk_css_style_property_print_value (GtkCssStyleProperty *property,
GtkCssValue *value,
GString *string);
gboolean _gtk_css_style_property_changes_affect_size
(const GtkBitmask *changes);
G_END_DECLS
+7
View File
@@ -47,6 +47,12 @@ gtk_css_value_typed_compute (GtkCssValue *value,
return _gtk_css_style_compute_value (provider, values, parent_values, custom->pspec->value_type, value, dependencies);
}
static gboolean
gtk_css_value_typed_needs_compute (const GtkCssValue *value)
{
return TRUE;
}
static gboolean
gtk_css_value_typed_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@@ -73,6 +79,7 @@ gtk_css_value_typed_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_TYPED = {
gtk_css_value_typed_free,
gtk_css_value_typed_compute,
gtk_css_value_typed_needs_compute,
gtk_css_value_typed_equal,
gtk_css_value_typed_transition,
gtk_css_value_typed_print
+14
View File
@@ -161,6 +161,20 @@ typedef enum /*< skip >*/ {
GTK_CSS_FILL_BOTH
} GtkCssFillMode;
typedef enum /*< skip >*/ {
/* relative font sizes */
GTK_CSS_FONT_SIZE_SMALLER,
GTK_CSS_FONT_SIZE_LARGER,
/* absolute font sizes */
GTK_CSS_FONT_SIZE_XX_SMALL,
GTK_CSS_FONT_SIZE_X_SMALL,
GTK_CSS_FONT_SIZE_SMALL,
GTK_CSS_FONT_SIZE_MEDIUM,
GTK_CSS_FONT_SIZE_LARGE,
GTK_CSS_FONT_SIZE_X_LARGE,
GTK_CSS_FONT_SIZE_XX_LARGE
} GtkCssFontSize;
/* for the order in arrays */
typedef enum /*< skip >*/ {
GTK_CSS_TOP,
+34 -12
View File
@@ -17,6 +17,7 @@
#include "config.h"
#include "gtkprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtkcsscomputedvaluesprivate.h"
@@ -45,7 +46,7 @@ _gtk_css_value_alloc (const GtkCssValueClass *klass,
GtkCssValue *
_gtk_css_value_ref (GtkCssValue *value)
{
g_return_val_if_fail (value != NULL, NULL);
gtk_internal_return_val_if_fail (value != NULL, NULL);
g_atomic_int_add (&value->ref_count, 1);
@@ -93,10 +94,10 @@ _gtk_css_value_compute (GtkCssValue *value,
{
GtkCssDependencies fallback;
g_return_val_if_fail (value != NULL, NULL);
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
g_return_val_if_fail (parent_values == NULL || GTK_IS_CSS_COMPUTED_VALUES (parent_values), NULL);
gtk_internal_return_val_if_fail (value != NULL, NULL);
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
gtk_internal_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
gtk_internal_return_val_if_fail (parent_values == NULL || GTK_IS_CSS_COMPUTED_VALUES (parent_values), NULL);
if (dependencies == NULL)
dependencies = &fallback;
@@ -105,12 +106,33 @@ _gtk_css_value_compute (GtkCssValue *value,
return value->class->compute (value, property_id, provider, values, parent_values, dependencies);
}
/**
* _gtk_css_value_needs_compute:
* @value: the value to check or %null
*
* Checks whether a particular css value *really* needs computation.
* A lot of css values are "absolute" (like say "10 px") and never need
* any computation done. Such a value would always just return itself
* as the computed value. This can be used in some cases to avoid
* repeated computations.
*
* Returns: %false if computing this value always returns itself, %false otherwise
**/
gboolean
_gtk_css_value_needs_compute (GtkCssValue *value)
{
if (value == NULL)
return FALSE;
return value->class->needs_compute (value);
}
gboolean
_gtk_css_value_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
{
g_return_val_if_fail (value1 != NULL, FALSE);
g_return_val_if_fail (value2 != NULL, FALSE);
gtk_internal_return_val_if_fail (value1 != NULL, FALSE);
gtk_internal_return_val_if_fail (value2 != NULL, FALSE);
if (value1 == value2)
return TRUE;
@@ -141,8 +163,8 @@ _gtk_css_value_transition (GtkCssValue *start,
guint property_id,
double progress)
{
g_return_val_if_fail (start != NULL, FALSE);
g_return_val_if_fail (end != NULL, FALSE);
gtk_internal_return_val_if_fail (start != NULL, FALSE);
gtk_internal_return_val_if_fail (end != NULL, FALSE);
if (start->class != end->class)
return NULL;
@@ -155,7 +177,7 @@ _gtk_css_value_to_string (const GtkCssValue *value)
{
GString *string;
g_return_val_if_fail (value != NULL, NULL);
gtk_internal_return_val_if_fail (value != NULL, NULL);
string = g_string_new (NULL);
_gtk_css_value_print (value, string);
@@ -175,8 +197,8 @@ void
_gtk_css_value_print (const GtkCssValue *value,
GString *string)
{
g_return_if_fail (value != NULL);
g_return_if_fail (string != NULL);
gtk_internal_return_if_fail (value != NULL);
gtk_internal_return_if_fail (string != NULL);
value->class->print (value, string);
}
+2
View File
@@ -46,6 +46,7 @@ struct _GtkCssValueClass {
GtkCssComputedValues *values,
GtkCssComputedValues *parent_values,
GtkCssDependencies *dependencies);
gboolean (* needs_compute) (const GtkCssValue *value);
gboolean (* equal) (const GtkCssValue *value1,
const GtkCssValue *value2);
GtkCssValue * (* transition) (GtkCssValue *start,
@@ -71,6 +72,7 @@ GtkCssValue *_gtk_css_value_compute (GtkCssValue
GtkCssComputedValues *values,
GtkCssComputedValues *parent_values,
GtkCssDependencies *dependencies);
gboolean _gtk_css_value_needs_compute (GtkCssValue *value);
gboolean _gtk_css_value_equal (const GtkCssValue *value1,
const GtkCssValue *value2);
gboolean _gtk_css_value_equal0 (const GtkCssValue *value1,
+4 -2
View File
@@ -1251,6 +1251,7 @@ get_next_site (GtkExpander *expander,
case GTK_DIR_RIGHT:
return FOCUS_WIDGET;
}
break;
case FOCUS_WIDGET:
switch (direction)
{
@@ -1264,8 +1265,8 @@ get_next_site (GtkExpander *expander,
return FOCUS_LABEL;
case GTK_DIR_RIGHT:
return ltr ? FOCUS_LABEL : FOCUS_NONE;
break;
}
break;
case FOCUS_LABEL:
switch (direction)
{
@@ -1279,8 +1280,8 @@ get_next_site (GtkExpander *expander,
return FOCUS_CHILD;
case GTK_DIR_RIGHT:
return ltr ? FOCUS_CHILD : FOCUS_WIDGET;
break;
}
break;
case FOCUS_CHILD:
switch (direction)
{
@@ -1293,6 +1294,7 @@ get_next_site (GtkExpander *expander,
case GTK_DIR_RIGHT:
return FOCUS_NONE;
}
break;
}
g_assert_not_reached ();
+3 -3
View File
@@ -3865,7 +3865,7 @@ copy_file_clear_cb (GtkClipboard *clipboard,
g_slist_free (selected_files);
}
/* Callback used when the "Copy file's location" menu item is activated */
/* Callback used when the "Copy files location" menu item is activated */
static void
copy_file_location_cb (GtkMenuItem *item,
GtkFileChooserDefault *impl)
@@ -4107,7 +4107,7 @@ file_list_drag_motion_cb (GtkWidget *widget,
return TRUE;
}
/* Sensitizes the "Copy file's location" context menu item if there is actually
/* Sensitizes the "Copy files location" context menu item if there is actually
* a selection active.
*/
static void
@@ -4176,7 +4176,7 @@ file_list_build_popup_menu (GtkFileChooserDefault *impl)
impl->browse_files_popup_menu_visit_file_item = file_list_add_image_menu_item (impl, GTK_STOCK_DIRECTORY, _("_Visit this file"),
G_CALLBACK (visit_file_cb));
impl->browse_files_popup_menu_copy_file_location_item = file_list_add_image_menu_item (impl, GTK_STOCK_COPY, _("_Copy file's location"),
impl->browse_files_popup_menu_copy_file_location_item = file_list_add_image_menu_item (impl, GTK_STOCK_COPY, _("_Copy files location"),
G_CALLBACK (copy_file_location_cb));
impl->browse_files_popup_menu_add_shortcut_item = file_list_add_image_menu_item (impl, GTK_STOCK_ADD, _("_Add to Bookmarks"),
+501 -100
View File
@@ -24,6 +24,7 @@
#endif
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <glib.h>
#include <glib/gstdio.h>
@@ -160,9 +161,18 @@ typedef enum
HAS_ICON_FILE = 1 << 3
} IconSuffix;
#define INFO_CACHE_LRU_SIZE 32
#if 0
#define DEBUG_CACHE(args) g_print args
#else
#define DEBUG_CACHE(args)
#endif
struct _GtkIconThemePrivate
{
GHashTable *info_cache;
GList *info_cache_lru;
gchar *current_theme;
gchar *fallback_theme;
gchar **search_path;
@@ -197,10 +207,31 @@ struct _GtkIconThemePrivate
gulong reset_styles_idle;
};
typedef struct {
gchar **icon_names;
gint size;
GtkIconLookupFlags flags;
} IconInfoKey;
typedef struct _SymbolicPixbufCache SymbolicPixbufCache;
struct _SymbolicPixbufCache {
GdkPixbuf *pixbuf;
GdkPixbuf *proxy_pixbuf;
GdkRGBA fg;
GdkRGBA success_color;
GdkRGBA warning_color;
GdkRGBA error_color;
SymbolicPixbufCache *next;
};
struct _GtkIconInfo
{
/* Information about the source
*/
IconInfoKey key;
GtkIconTheme *in_cache;
gchar *filename;
GFile *icon_file;
GLoadableIcon *loadable;
@@ -231,9 +262,12 @@ struct _GtkIconInfo
* the icon.
*/
GdkPixbuf *pixbuf;
GdkPixbuf *proxy_pixbuf;
GError *load_error;
gdouble scale;
SymbolicPixbufCache *symbolic_pixbuf_cache;
GtkRequisition *symbolic_pixbuf_size;
};
@@ -330,6 +364,8 @@ static BuiltinIcon *find_builtin_icon (const gchar *icon_name,
gint size,
gint *min_difference_p,
gboolean *has_larger_p);
static void remove_from_lru_cache (GtkIconTheme *icon_theme,
GtkIconInfo *icon_info);
static guint signal_changed = 0;
@@ -339,6 +375,46 @@ static GHashTable *icon_theme_builtin_icons;
GtkIconCache *_builtin_cache = NULL;
static GList *builtin_dirs = NULL;
static guint
icon_info_key_hash (gconstpointer _key)
{
const IconInfoKey *key = _key;
guint h = 0;
int i;
for (i = 0; key->icon_names[i] != NULL; i++)
h ^= g_str_hash (key->icon_names[i]);
h ^= key->size * 0x10001;
h ^= key->flags * 0x1000010;
return h;
}
static gboolean
icon_info_key_equal (gconstpointer _a,
gconstpointer _b)
{
const IconInfoKey *a = _a;
const IconInfoKey *b = _b;
int i;
if (a->size != b->size)
return FALSE;
if (a->flags != b->flags)
return FALSE;
for (i = 0;
a->icon_names[i] != NULL &&
b->icon_names[i] != NULL; i++)
{
if (strcmp (a->icon_names[i], b->icon_names[i]) != 0)
return FALSE;
}
return a->icon_names[i] == NULL && b->icon_names[i] == NULL;
}
G_DEFINE_TYPE (GtkIconTheme, gtk_icon_theme, G_TYPE_OBJECT)
/**
@@ -641,6 +717,25 @@ pixbuf_supports_svg (void)
return found_svg;
}
/* The icon info was removed from the icon_info_hash hash table */
static void
icon_info_uncached (GtkIconInfo *icon_info)
{
GtkIconTheme *icon_theme = icon_info->in_cache;
DEBUG_CACHE (("removing %p (%s %d 0x%x) from cache (icon_them: %p) (cache size %d)\n",
icon_info,
g_strjoinv (",", icon_info->key.icon_names),
icon_info->key.size, icon_info->key.flags,
icon_theme,
icon_theme != NULL ? g_hash_table_size (icon_theme->priv->info_cache) : 0));
icon_info->in_cache = NULL;
if (icon_theme != NULL)
remove_from_lru_cache (icon_theme, icon_info);
}
static void
gtk_icon_theme_init (GtkIconTheme *icon_theme)
{
@@ -653,6 +748,9 @@ gtk_icon_theme_init (GtkIconTheme *icon_theme)
GtkIconThemePrivate);
icon_theme->priv = priv;
priv->info_cache = g_hash_table_new_full (icon_info_key_hash, icon_info_key_equal, NULL,
(GDestroyNotify)icon_info_uncached);
priv->custom_theme = FALSE;
xdg_data_dirs = g_get_system_data_dirs ();
@@ -712,6 +810,8 @@ do_theme_change (GtkIconTheme *icon_theme)
{
GtkIconThemePrivate *priv = icon_theme->priv;
g_hash_table_remove_all (priv->info_cache);
if (!priv->themes_valid)
return;
@@ -755,6 +855,9 @@ gtk_icon_theme_finalize (GObject *object)
icon_theme = GTK_ICON_THEME (object);
priv = icon_theme->priv;
g_hash_table_destroy (priv->info_cache);
g_assert (priv->info_cache_lru == NULL);
if (priv->reset_styles_idle)
{
g_source_remove (priv->reset_styles_idle);
@@ -1306,6 +1409,173 @@ ensure_valid_themes (GtkIconTheme *icon_theme)
priv->loading_themes = FALSE;
}
/* The LRU cache is a short list of IconInfos that are kept
alive even though their IconInfo would otherwise have
been freed, so that we can avoid reloading these
constantly.
We put infos on the lru list when nothing otherwise
references the info. So, when we get a cache hit
we remove it from the list, and when the proxy
pixmap is released we put it on the list.
*/
static void
ensure_lru_cache_space (GtkIconTheme *icon_theme)
{
GtkIconThemePrivate *priv = icon_theme->priv;
GList *l;
/* Remove last item if LRU full */
l = g_list_nth (priv->info_cache_lru, INFO_CACHE_LRU_SIZE - 1);
if (l)
{
GtkIconInfo *icon_info = l->data;
DEBUG_CACHE (("removing (due to out of space) %p (%s %d 0x%x) from LRU cache (cache size %d)\n",
icon_info,
g_strjoinv (",", icon_info->key.icon_names),
icon_info->key.size, icon_info->key.flags,
g_list_length (priv->info_cache_lru)));
priv->info_cache_lru = g_list_delete_link (priv->info_cache_lru, l);
gtk_icon_info_free (icon_info);
}
}
static void
add_to_lru_cache (GtkIconTheme *icon_theme,
GtkIconInfo *icon_info)
{
GtkIconThemePrivate *priv = icon_theme->priv;
DEBUG_CACHE (("adding %p (%s %d 0x%x) to LRU cache (cache size %d)\n",
icon_info,
g_strjoinv (",", icon_info->key.icon_names),
icon_info->key.size, icon_info->key.flags,
g_list_length (priv->info_cache_lru)));
g_assert (g_list_find (priv->info_cache_lru, icon_info) == NULL);
ensure_lru_cache_space (icon_theme);
/* prepend new info to LRU */
priv->info_cache_lru = g_list_prepend (priv->info_cache_lru,
gtk_icon_info_copy (icon_info));
}
static void
ensure_in_lru_cache (GtkIconTheme *icon_theme,
GtkIconInfo *icon_info)
{
GtkIconThemePrivate *priv = icon_theme->priv;
GList *l;
l = g_list_find (priv->info_cache_lru, icon_info);
if (l)
{
/* Move to front of LRU if already in it */
priv->info_cache_lru = g_list_remove_link (priv->info_cache_lru, l);
priv->info_cache_lru = g_list_concat (l, priv->info_cache_lru);
}
else
add_to_lru_cache (icon_theme, icon_info);
}
static void
remove_from_lru_cache (GtkIconTheme *icon_theme,
GtkIconInfo *icon_info)
{
GtkIconThemePrivate *priv = icon_theme->priv;
if (g_list_find (priv->info_cache_lru, icon_info))
{
DEBUG_CACHE (("removing %p (%s %d 0x%x) from LRU cache (cache size %d)\n",
icon_info,
g_strjoinv (",", icon_info->key.icon_names),
icon_info->key.size, icon_info->key.flags,
g_list_length (priv->info_cache_lru)));
priv->info_cache_lru = g_list_remove (priv->info_cache_lru, icon_info);
gtk_icon_info_free (icon_info);
}
}
static SymbolicPixbufCache *
symbolic_pixbuf_cache_new (GdkPixbuf *pixbuf,
const GdkRGBA *fg,
const GdkRGBA *success_color,
const GdkRGBA *warning_color,
const GdkRGBA *error_color,
SymbolicPixbufCache *next)
{
SymbolicPixbufCache *cache;
cache = g_new0 (SymbolicPixbufCache, 1);
cache->pixbuf = g_object_ref (pixbuf);
if (fg)
cache->fg = *fg;
if (success_color)
cache->success_color = *success_color;
if (warning_color)
cache->warning_color = *warning_color;
if (error_color)
cache->error_color = *error_color;
cache->next = next;
return cache;
}
static gboolean
rgba_matches (const GdkRGBA *a, const GdkRGBA *b)
{
GdkRGBA transparent = { 0 };
/* For matching we treat unset colors as transparent rather
than default, which works as well, because transparent
will never be used for real symbolic icon colors */
if (a == NULL)
a = &transparent;
return
fabs(a->red - b->red) < 0.0001 &&
fabs(a->green - b->green) < 0.0001 &&
fabs(a->blue - b->blue) < 0.0001 &&
fabs(a->alpha - b->alpha) < 0.0001;
}
static SymbolicPixbufCache *
symbolic_pixbuf_cache_matches (SymbolicPixbufCache *cache,
const GdkRGBA *fg,
const GdkRGBA *success_color,
const GdkRGBA *warning_color,
const GdkRGBA *error_color)
{
while (cache != NULL)
{
if (rgba_matches (fg, &cache->fg) &&
rgba_matches (success_color, &cache->success_color) &&
rgba_matches (warning_color, &cache->warning_color) &&
rgba_matches (error_color, &cache->error_color))
return cache;
cache = cache->next;
}
return NULL;
}
static void
symbolic_pixbuf_cache_free (SymbolicPixbufCache *cache)
{
SymbolicPixbufCache *next;
while (cache != NULL)
{
next = cache->next;
g_object_unref (cache->pixbuf);
g_free (cache);
cache = next;
}
}
static GtkIconInfo *
choose_icon (GtkIconTheme *icon_theme,
const gchar *icon_names[],
@@ -1319,9 +1589,31 @@ choose_icon (GtkIconTheme *icon_theme,
gboolean allow_svg;
gboolean use_builtin;
gint i;
IconInfoKey key;
priv = icon_theme->priv;
ensure_valid_themes (icon_theme);
key.icon_names = (char **)icon_names;
key.size = size;
key.flags = flags;
icon_info = g_hash_table_lookup (priv->info_cache, &key);
if (icon_info != NULL)
{
DEBUG_CACHE (("cache hit %p (%s %d 0x%x) (cache size %d)\n",
icon_info,
g_strjoinv (",", icon_info->key.icon_names),
icon_info->key.size, icon_info->key.flags,
g_hash_table_size (priv->info_cache)));
icon_info = gtk_icon_info_copy (icon_info);
remove_from_lru_cache (icon_theme, icon_info);
return icon_info;
}
if (flags & GTK_ICON_LOOKUP_NO_SVG)
allow_svg = FALSE;
else if (flags & GTK_ICON_LOOKUP_FORCE_SVG)
@@ -1330,8 +1622,6 @@ choose_icon (GtkIconTheme *icon_theme,
allow_svg = priv->pixbuf_supports_svg;
use_builtin = flags & GTK_ICON_LOOKUP_USE_BUILTIN;
ensure_valid_themes (icon_theme);
/* for symbolic icons, do a search in all registered themes first;
* a theme that inherits them from a parent theme might provide
@@ -1417,10 +1707,21 @@ choose_icon (GtkIconTheme *icon_theme,
}
out:
if (icon_info)
if (icon_info)
{
icon_info->desired_size = size;
icon_info->forced_size = (flags & GTK_ICON_LOOKUP_FORCE_SIZE) != 0;
icon_info->key.icon_names = g_strdupv ((char **)icon_names);
icon_info->key.size = size;
icon_info->key.flags = flags;
icon_info->in_cache = icon_theme;
DEBUG_CACHE (("adding %p (%s %d 0x%x) to cache (cache size %d)\n",
icon_info,
g_strjoinv (",", icon_info->key.icon_names),
icon_info->key.size, icon_info->key.flags,
g_hash_table_size (priv->info_cache)));
g_hash_table_insert (priv->info_cache, &icon_info->key, icon_info);
}
else
{
@@ -2735,7 +3036,12 @@ gtk_icon_info_free (GtkIconInfo *icon_info)
icon_info->ref_count--;
if (icon_info->ref_count > 0)
return;
if (icon_info->in_cache)
g_hash_table_remove (icon_info->in_cache->priv->info_cache, &icon_info->key);
g_strfreev (icon_info->key.icon_names);
g_free (icon_info->filename);
g_clear_object (&icon_info->icon_file);
@@ -2749,6 +3055,8 @@ gtk_icon_info_free (GtkIconInfo *icon_info)
if (icon_info->symbolic_pixbuf_size)
gtk_requisition_free (icon_info->symbolic_pixbuf_size);
symbolic_pixbuf_cache_free (icon_info->symbolic_pixbuf_cache);
g_slice_free (GtkIconInfo, icon_info);
}
@@ -3095,6 +3403,22 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info,
return TRUE;
}
static void
proxy_pixbuf_destroy (guchar *pixels, gpointer data)
{
GtkIconInfo *icon_info = data;
GtkIconTheme *icon_theme = icon_info->in_cache;
g_assert (icon_info->proxy_pixbuf != NULL);
icon_info->proxy_pixbuf = NULL;
/* Keep it alive a bit longer */
if (icon_theme != NULL)
ensure_in_lru_cache (icon_theme, icon_info);
gtk_icon_info_free (icon_info);
}
/**
* gtk_icon_info_load_icon:
* @icon_info: a #GtkIconInfo structure from gtk_icon_theme_lookup_icon()
@@ -3140,7 +3464,28 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info,
return NULL;
}
return g_object_ref (icon_info->pixbuf);
/* Instead of returning the pixbuf directly we
return a proxy to it that we don't own (but that
shares the data with the one we own). This way
we can know when it is freed and ensure the
IconInfo is alive (and thus cached) while
the pixbuf is still alive. */
if (icon_info->proxy_pixbuf != NULL)
return g_object_ref (icon_info->proxy_pixbuf);
icon_info->proxy_pixbuf =
gdk_pixbuf_new_from_data (gdk_pixbuf_get_pixels (icon_info->pixbuf),
gdk_pixbuf_get_colorspace (icon_info->pixbuf),
gdk_pixbuf_get_has_alpha (icon_info->pixbuf),
gdk_pixbuf_get_bits_per_sample (icon_info->pixbuf),
gdk_pixbuf_get_width (icon_info->pixbuf),
gdk_pixbuf_get_height (icon_info->pixbuf),
gdk_pixbuf_get_rowstride (icon_info->pixbuf),
proxy_pixbuf_destroy,
gtk_icon_info_copy (icon_info));
return icon_info->proxy_pixbuf;
}
static gchar *
@@ -3162,40 +3507,109 @@ gdk_rgba_to_css (const GdkRGBA *color)
(gint)(color->blue * 255));
}
static void
proxy_symbolic_pixbuf_destroy (guchar *pixels, gpointer data)
{
GtkIconInfo *icon_info = data;
GtkIconTheme *icon_theme = icon_info->in_cache;
SymbolicPixbufCache *symbolic_cache;
for (symbolic_cache = icon_info->symbolic_pixbuf_cache;
symbolic_cache != NULL;
symbolic_cache = symbolic_cache->next)
{
if (symbolic_cache->proxy_pixbuf != NULL &&
gdk_pixbuf_get_pixels (symbolic_cache->proxy_pixbuf) == pixels)
break;
}
g_assert (symbolic_cache != NULL);
g_assert (symbolic_cache->proxy_pixbuf != NULL);
symbolic_cache->proxy_pixbuf = NULL;
/* Keep it alive a bit longer */
if (icon_theme != NULL)
ensure_in_lru_cache (icon_theme, icon_info);
gtk_icon_info_free (icon_info);
}
static GdkPixbuf *
symbolic_cache_get_proxy (SymbolicPixbufCache *symbolic_cache,
GtkIconInfo *icon_info)
{
if (symbolic_cache->proxy_pixbuf)
return g_object_ref (symbolic_cache->proxy_pixbuf);
symbolic_cache->proxy_pixbuf =
gdk_pixbuf_new_from_data (gdk_pixbuf_get_pixels (symbolic_cache->pixbuf),
gdk_pixbuf_get_colorspace (symbolic_cache->pixbuf),
gdk_pixbuf_get_has_alpha (symbolic_cache->pixbuf),
gdk_pixbuf_get_bits_per_sample (symbolic_cache->pixbuf),
gdk_pixbuf_get_width (symbolic_cache->pixbuf),
gdk_pixbuf_get_height (symbolic_cache->pixbuf),
gdk_pixbuf_get_rowstride (symbolic_cache->pixbuf),
proxy_symbolic_pixbuf_destroy,
gtk_icon_info_copy (icon_info));
return symbolic_cache->proxy_pixbuf;
}
static GdkPixbuf *
_gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
const gchar *css_fg,
const gchar *css_success,
const gchar *css_warning,
const gchar *css_error,
const GdkRGBA *fg,
const GdkRGBA *success_color,
const GdkRGBA *warning_color,
const GdkRGBA *error_color,
GError **error)
{
GInputStream *stream;
GdkPixbuf *pixbuf;
gchar *css_fg;
gchar *css_success;
gchar *css_warning;
gchar *css_error;
gchar *data;
gchar *success, *warning, *err;
gchar *width, *height, *uri;
SymbolicPixbufCache *symbolic_cache;
symbolic_cache = symbolic_pixbuf_cache_matches (icon_info->symbolic_pixbuf_cache,
fg, success_color, warning_color, error_color);
if (symbolic_cache)
return symbolic_cache_get_proxy (symbolic_cache, icon_info);
/* css_fg can't possibly have failed, otherwise
* that would mean we have a broken style */
g_return_val_if_fail (css_fg != NULL, NULL);
g_return_val_if_fail (fg != NULL, NULL);
success = warning = err = NULL;
css_fg = gdk_rgba_to_css (fg);
css_success = css_warning = css_error = NULL;
if (warning_color)
css_warning = gdk_rgba_to_css (warning_color);
if (error_color)
css_error = gdk_rgba_to_css (error_color);
if (success_color)
css_success = gdk_rgba_to_css (success_color);
if (!css_success)
{
GdkColor success_default_color = { 0, 0x4e00, 0x9a00, 0x0600 };
success = gdk_color_to_css (&success_default_color);
css_success = gdk_color_to_css (&success_default_color);
}
if (!css_warning)
{
GdkColor warning_default_color = { 0, 0xf500, 0x7900, 0x3e00 };
warning = gdk_color_to_css (&warning_default_color);
css_warning = gdk_color_to_css (&warning_default_color);
}
if (!css_error)
{
GdkColor error_default_color = { 0, 0xcc00, 0x0000, 0x0000 };
err = gdk_color_to_css (&error_default_color);
css_error = gdk_color_to_css (&error_default_color);
}
if (!icon_info->symbolic_pixbuf_size)
@@ -3233,21 +3647,22 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
" fill: ", css_fg," !important;\n"
" }\n"
" .warning {\n"
" fill: ", css_warning ? css_warning : warning," !important;\n"
" fill: ", css_warning, " !important;\n"
" }\n"
" .error {\n"
" fill: ", css_error ? css_error : err," !important;\n"
" fill: ", css_error ," !important;\n"
" }\n"
" .success {\n"
" fill: ", css_success ? css_success : success," !important;\n"
" fill: ", css_success, " !important;\n"
" }\n"
" </style>\n"
" <xi:include href=\"", uri, "\"/>\n"
"</svg>",
NULL);
g_free (warning);
g_free (err);
g_free (success);
g_free (css_fg);
g_free (css_warning);
g_free (css_error);
g_free (css_success);
g_free (width);
g_free (height);
g_free (uri);
@@ -3261,7 +3676,16 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
error);
g_object_unref (stream);
return pixbuf;
if (pixbuf != NULL)
{
icon_info->symbolic_pixbuf_cache =
symbolic_pixbuf_cache_new (pixbuf, fg, success_color, warning_color, error_color,
icon_info->symbolic_pixbuf_cache);
return symbolic_cache_get_proxy (icon_info->symbolic_pixbuf_cache, icon_info);
}
return NULL;
}
/**
@@ -3310,11 +3734,6 @@ gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
gboolean *was_symbolic,
GError **error)
{
GdkPixbuf *pixbuf;
gchar *css_fg;
gchar *css_success;
gchar *css_warning;
gchar *css_error;
gchar *icon_uri;
gboolean is_symbolic;
@@ -3334,29 +3753,10 @@ gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
if (!is_symbolic)
return gtk_icon_info_load_icon (icon_info, error);
css_fg = gdk_rgba_to_css (fg);
css_success = css_warning = css_error = NULL;
if (warning_color)
css_warning = gdk_rgba_to_css (warning_color);
if (error_color)
css_error = gdk_rgba_to_css (error_color);
if (success_color)
css_success = gdk_rgba_to_css (success_color);
pixbuf = _gtk_icon_info_load_symbolic_internal (icon_info,
css_fg, css_success,
css_warning, css_error,
error);
g_free (css_fg);
g_free (css_warning);
g_free (css_success);
g_free (css_error);
return pixbuf;
return _gtk_icon_info_load_symbolic_internal (icon_info,
fg, success_color,
warning_color, error_color,
error);
}
/**
@@ -3390,11 +3790,15 @@ gtk_icon_info_load_symbolic_for_context (GtkIconInfo *icon_info,
gboolean *was_symbolic,
GError **error)
{
GdkPixbuf *pixbuf;
GdkRGBA *color = NULL;
GdkRGBA rgba;
gchar *css_fg = NULL, *css_success;
gchar *css_warning, *css_error;
GdkRGBA fg;
GdkRGBA *fgp;
GdkRGBA success_color;
GdkRGBA *success_colorp;
GdkRGBA warning_color;
GdkRGBA *warning_colorp;
GdkRGBA error_color;
GdkRGBA *error_colorp;
GtkStateFlags state;
gchar *icon_uri;
gboolean is_symbolic;
@@ -3415,36 +3819,40 @@ gtk_icon_info_load_symbolic_for_context (GtkIconInfo *icon_info,
if (!is_symbolic)
return gtk_icon_info_load_icon (icon_info, error);
fgp = success_colorp = warning_colorp = error_colorp = NULL;
state = gtk_style_context_get_state (context);
gtk_style_context_get (context, state, "color", &color, NULL);
if (color)
{
css_fg = gdk_rgba_to_css (color);
fg = *color;
fgp = &fg;
gdk_rgba_free (color);
}
css_success = css_warning = css_error = NULL;
if (gtk_style_context_lookup_color (context, "success_color", &success_color))
success_colorp = &success_color;
if (gtk_style_context_lookup_color (context, "success_color", &rgba))
css_success = gdk_rgba_to_css (&rgba);
if (gtk_style_context_lookup_color (context, "warning_color", &warning_color))
warning_colorp = &warning_color;
if (gtk_style_context_lookup_color (context, "warning_color", &rgba))
css_warning = gdk_rgba_to_css (&rgba);
if (gtk_style_context_lookup_color (context, "error_color", &error_color))
error_colorp = &error_color;
if (gtk_style_context_lookup_color (context, "error_color", &rgba))
css_error = gdk_rgba_to_css (&rgba);
return _gtk_icon_info_load_symbolic_internal (icon_info,
fgp, success_colorp,
warning_colorp, error_colorp,
error);
}
pixbuf = _gtk_icon_info_load_symbolic_internal (icon_info,
css_fg, css_success,
css_warning, css_error,
error);
g_free (css_fg);
g_free (css_success);
g_free (css_warning);
g_free (css_error);
return pixbuf;
static GdkRGBA *
color_to_rgba (GdkColor *color, GdkRGBA *rgba)
{
rgba->red = color->red / 65535.0;
rgba->green = color->green / 65535.0;
rgba->blue = color->blue / 65535.0;
rgba->alpha = 1.0;
return rgba;
}
/**
@@ -3479,13 +3887,14 @@ gtk_icon_info_load_symbolic_for_style (GtkIconInfo *icon_info,
gboolean *was_symbolic,
GError **error)
{
GdkPixbuf *pixbuf;
GdkColor success_color;
GdkColor warning_color;
GdkColor error_color;
GdkColor *fg;
gchar *css_fg, *css_success;
gchar *css_warning, *css_error;
GdkColor color;
GdkRGBA fg;
GdkRGBA success_color;
GdkRGBA *success_colorp;
GdkRGBA warning_color;
GdkRGBA *warning_colorp;
GdkRGBA error_color;
GdkRGBA *error_colorp;
gchar *icon_uri;
gboolean is_symbolic;
@@ -3505,31 +3914,23 @@ gtk_icon_info_load_symbolic_for_style (GtkIconInfo *icon_info,
if (!is_symbolic)
return gtk_icon_info_load_icon (icon_info, error);
fg = &style->fg[state];
css_fg = gdk_color_to_css (fg);
color_to_rgba (&style->fg[state], &fg);
css_success = css_warning = css_error = NULL;
success_colorp = warning_colorp = error_colorp = NULL;
if (gtk_style_lookup_color (style, "success_color", &success_color))
css_success = gdk_color_to_css (&success_color);
if (gtk_style_lookup_color (style, "success_color", &color))
success_colorp = color_to_rgba (&color, &success_color);
if (gtk_style_lookup_color (style, "warning_color", &warning_color))
css_warning = gdk_color_to_css (&warning_color);
if (gtk_style_lookup_color (style, "warning_color", &color))
warning_colorp = color_to_rgba (&color, &warning_color);
if (gtk_style_lookup_color (style, "error_color", &error_color))
css_error = gdk_color_to_css (&error_color);
if (gtk_style_lookup_color (style, "error_color", &color))
error_colorp = color_to_rgba (&color, &error_color);
pixbuf = _gtk_icon_info_load_symbolic_internal (icon_info,
css_fg, css_success,
css_warning, css_error,
error);
g_free (css_fg);
g_free (css_success);
g_free (css_warning);
g_free (css_error);
return pixbuf;
return _gtk_icon_info_load_symbolic_internal (icon_info,
&fg, success_colorp,
warning_colorp, error_colorp,
error);
}
/**
+38 -12
View File
@@ -371,28 +371,54 @@ check_quartz_special_cases (GtkIMContextSimple *context_simple,
gint n_compose)
{
GtkIMContextSimplePrivate *priv = context_simple->priv;
guint value = 0;
if (n_compose == 2 &&
priv->compose_buffer[1] == GDK_KEY_space)
if (n_compose == 2)
{
gunichar value = 0;
switch (priv->compose_buffer[0])
{
case GDK_KEY_dead_doubleacute:
value = '"'; break;
}
switch (priv->compose_buffer[1])
{
case GDK_KEY_dead_doubleacute:
case GDK_KEY_space:
value = GDK_KEY_quotedbl; break;
if (value > 0)
{
gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple), value);
priv->compose_buffer[0] = 0;
case 'a': value = GDK_KEY_adiaeresis; break;
case 'A': value = GDK_KEY_Adiaeresis; break;
case 'e': value = GDK_KEY_ediaeresis; break;
case 'E': value = GDK_KEY_Ediaeresis; break;
case 'i': value = GDK_KEY_idiaeresis; break;
case 'I': value = GDK_KEY_Idiaeresis; break;
case 'o': value = GDK_KEY_odiaeresis; break;
case 'O': value = GDK_KEY_Odiaeresis; break;
case 'u': value = GDK_KEY_udiaeresis; break;
case 'U': value = GDK_KEY_Udiaeresis; break;
case 'y': value = GDK_KEY_ydiaeresis; break;
case 'Y': value = GDK_KEY_Ydiaeresis; break;
}
break;
GTK_NOTE (MISC, g_print ("quartz: U+%04X\n", value));
return TRUE;
case GDK_KEY_dead_acute:
switch (priv->compose_buffer[1])
{
case 'c': value = GDK_KEY_ccedilla; break;
case 'C': value = GDK_KEY_Ccedilla; break;
}
break;
}
}
if (value > 0)
{
gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple),
gdk_keyval_to_unicode (value));
priv->compose_buffer[0] = 0;
GTK_NOTE (MISC, g_print ("quartz: U+%04X\n", value));
return TRUE;
}
return FALSE;
}
+1 -1
View File
@@ -3384,7 +3384,7 @@ gtk_label_ensure_layout (GtkLabel *label)
pango_attr_list_insert (attrs, attribute);
}
}
else if (priv->markup_attrs && priv->markup_attrs)
else if (priv->markup_attrs || priv->attrs)
attrs = pango_attr_list_new ();
else
attrs = NULL;
+6 -4
View File
@@ -2437,10 +2437,12 @@ list_store_start_element (GMarkupParseContext *context,
else if (strcmp (element_name, "row") == 0)
;
else if (strcmp (element_name, "column") == 0)
for (i = 0; names[i]; i++)
if (strcmp (names[i], "type") == 0)
data->column_type_names = g_slist_prepend (data->column_type_names,
g_strdup (values[i]));
{
for (i = 0; names[i]; i++)
if (strcmp (names[i], "type") == 0)
data->column_type_names = g_slist_prepend (data->column_type_names,
g_strdup (values[i]));
}
else if (strcmp (element_name, "columns") == 0)
;
else if (strcmp (element_name, "data") == 0)
+56 -83
View File
@@ -641,15 +641,6 @@ gtk_menu_class_init (GtkMenuClass *class)
-1, G_MAXINT, -1,
GTK_PARAM_READWRITE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("vertical-padding",
P_("Vertical Padding"),
P_("Extra space at the top and bottom of the menu"),
0,
G_MAXINT,
1,
GTK_PARAM_READABLE));
/**
* GtkMenu:reserve-toggle-size:
*
@@ -671,6 +662,15 @@ gtk_menu_class_init (GtkMenuClass *class)
TRUE,
GTK_PARAM_READWRITE));
/**
* GtkMenu:horizontal-padding:
*
* Extra space at the left and right edges of the menu.
*
* Deprecated: 3.8: use the standard padding CSS property (through objects
* like #GtkStyleContext and #GtkCssProvider); the value of this style
* property is ignored.
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("horizontal-padding",
P_("Horizontal Padding"),
@@ -678,7 +678,27 @@ gtk_menu_class_init (GtkMenuClass *class)
0,
G_MAXINT,
0,
GTK_PARAM_READABLE));
GTK_PARAM_READABLE |
G_PARAM_DEPRECATED));
/**
* GtkMenu:vertical-padding:
*
* Extra space at the top and bottom of the menu.
*
* Deprecated: 3.8: use the standard padding CSS property (through objects
* like #GtkStyleContext and #GtkCssProvider); the value of this style
* property is ignored.
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("vertical-padding",
P_("Vertical Padding"),
P_("Extra space at the top and bottom of the menu"),
0,
G_MAXINT,
1,
GTK_PARAM_READABLE |
G_PARAM_DEPRECATED));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("vertical-offset",
@@ -2510,8 +2530,6 @@ gtk_menu_realize (GtkWidget *widget)
gint border_width;
GtkWidget *child;
GList *children;
guint vertical_padding;
guint horizontal_padding;
GtkBorder arrow_border, padding;
g_return_if_fail (GTK_IS_MENU (widget));
@@ -2542,19 +2560,14 @@ gtk_menu_realize (GtkWidget *widget)
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
context = gtk_widget_get_style_context (widget);
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,
"horizontal-padding", &horizontal_padding,
NULL);
gtk_widget_get_allocation (widget, &allocation);
attributes.x = border_width + padding.left + horizontal_padding;
attributes.y = border_width + padding.top + vertical_padding;
attributes.x = border_width + padding.left;
attributes.y = border_width + padding.top;
attributes.width = allocation.width -
(2 * (border_width + horizontal_padding)) - padding.left - padding.right;
(2 * border_width) - padding.left - padding.right;
attributes.height = allocation.height -
(2 * (border_width + vertical_padding)) - padding.top - padding.bottom;
(2 * border_width) - padding.top - padding.bottom;
get_arrows_border (menu, &arrow_border);
attributes.y += arrow_border.top;
@@ -2572,9 +2585,9 @@ gtk_menu_realize (GtkWidget *widget)
attributes.x = 0;
attributes.y = 0;
attributes.width = allocation.width + (2 * (border_width + horizontal_padding)) +
attributes.width = allocation.width + (2 * border_width) +
padding.left + padding.right;
attributes.height = priv->requested_height - (2 * (border_width + vertical_padding)) +
attributes.height = priv->requested_height - (2 * border_width) +
padding.top + padding.bottom;
attributes.width = MAX (1, attributes.width);
@@ -2690,7 +2703,6 @@ calculate_line_heights (GtkMenu *menu,
GtkMenuShell *menu_shell;
GtkWidget *child, *widget;
GList *children;
guint horizontal_padding;
guint border_width;
guint n_columns;
gint n_heights;
@@ -2708,13 +2720,10 @@ calculate_line_heights (GtkMenu *menu,
n_columns = gtk_menu_get_n_columns (menu);
avail_width = for_width - (2 * priv->toggle_size + priv->accel_size) * n_columns;
gtk_widget_style_get (GTK_WIDGET (menu),
"horizontal-padding", &horizontal_padding,
NULL);
get_menu_padding (widget, &padding);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
avail_width -= (border_width + horizontal_padding) * 2 + padding.left + padding.right;
avail_width -= (border_width) * 2 + padding.left + padding.right;
for (children = menu_shell->priv->children; children; children = children->next)
{
@@ -2770,8 +2779,6 @@ gtk_menu_size_allocate (GtkWidget *widget,
gint x, y, i;
gint width, height;
guint border_width;
guint vertical_padding;
guint horizontal_padding;
GtkBorder padding;
g_return_if_fail (GTK_IS_MENU (widget));
@@ -2783,11 +2790,6 @@ gtk_menu_size_allocate (GtkWidget *widget,
gtk_widget_set_allocation (widget, allocation);
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,
"horizontal-padding", &horizontal_padding,
NULL);
get_menu_padding (widget, &padding);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
@@ -2798,16 +2800,15 @@ gtk_menu_size_allocate (GtkWidget *widget,
NULL);
/* refresh our cached height request */
priv->requested_height = (2 * (border_width + vertical_padding)) +
padding.top + padding.bottom;
priv->requested_height = (2 * border_width) + padding.top + padding.bottom;
for (i = 0; i < priv->heights_length; i++)
priv->requested_height += priv->heights[i];
x = border_width + padding.left + horizontal_padding;
y = border_width + padding.top + vertical_padding;
width = allocation->width - (2 * (border_width + horizontal_padding)) -
x = border_width + padding.left;
y = border_width + padding.top;
width = allocation->width - (2 * border_width) -
padding.left - padding.right;
height = allocation->height - (2 * (border_width + vertical_padding)) -
height = allocation->height - (2 * border_width) -
padding.top - padding.bottom;
if (menu_shell->priv->active)
@@ -2937,22 +2938,18 @@ get_arrows_visible_area (GtkMenu *menu,
GtkArrowPlacement arrow_placement;
GtkWidget *widget = GTK_WIDGET (menu);
guint border_width;
guint vertical_padding;
guint horizontal_padding;
gint scroll_arrow_height;
GtkBorder menu_padding;
gtk_widget_style_get (widget,
"vertical-padding", &vertical_padding,
"horizontal-padding", &horizontal_padding,
"scroll-arrow-vlength", &scroll_arrow_height,
"arrow-placement", &arrow_placement,
NULL);
get_menu_padding (widget, &menu_padding);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
border->x = border_width + menu_padding.left + horizontal_padding;
border->y = border_width + menu_padding.top + vertical_padding;
border->x = border_width + menu_padding.left;
border->y = border_width + menu_padding.top;
border->width = gdk_window_get_width (gtk_widget_get_window (widget));
border->height = gdk_window_get_height (gtk_widget_get_window (widget));
@@ -3137,7 +3134,6 @@ gtk_menu_get_preferred_width (GtkWidget *widget,
GList *children;
guint max_toggle_size;
guint max_accel_width;
guint horizontal_padding;
guint border_width;
gint child_min, child_nat;
gint min_width, nat_width;
@@ -3226,16 +3222,10 @@ gtk_menu_get_preferred_width (GtkWidget *widget,
nat_width += 2 * max_toggle_size + max_accel_width;
nat_width *= gtk_menu_get_n_columns (menu);
gtk_widget_style_get (GTK_WIDGET (menu),
"horizontal-padding", &horizontal_padding,
NULL);
get_menu_padding (widget, &padding);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
min_width += (2 * (border_width + horizontal_padding)) +
padding.left + padding.right;
nat_width += (2 * (border_width + horizontal_padding)) +
padding.left + padding.right;
min_width += (2 * border_width) + padding.left + padding.right;
nat_width += (2 * border_width) + padding.left + padding.right;
priv->toggle_size = max_toggle_size;
priv->accel_size = max_accel_width;
@@ -3277,16 +3267,14 @@ gtk_menu_get_preferred_height_for_width (GtkWidget *widget,
GtkMenu *menu = GTK_MENU (widget);
GtkMenuPrivate *priv = menu->priv;
guint *min_heights, *nat_heights;
guint vertical_padding, border_width;
guint border_width;
gint n_heights, i;
gint min_height, nat_height;
gtk_widget_style_get (widget, "vertical-padding", &vertical_padding, NULL);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
get_menu_padding (widget, &padding);
min_height = nat_height = (border_width + vertical_padding) * 2 +
padding.top + padding.bottom;
min_height = nat_height = (2 * border_width) + padding.top + padding.bottom;
n_heights =
calculate_line_heights (menu, for_size, &min_heights, &nat_heights);
@@ -3868,7 +3856,6 @@ get_arrows_sensitive_area (GtkMenu *menu,
GdkWindow *window;
gint width, height;
guint border;
guint vertical_padding;
gint win_x, win_y;
gint scroll_arrow_height;
GtkBorder padding;
@@ -3878,12 +3865,11 @@ get_arrows_sensitive_area (GtkMenu *menu,
height = gdk_window_get_height (window);
gtk_widget_style_get (widget,
"vertical-padding", &vertical_padding,
"scroll-arrow-vlength", &scroll_arrow_height,
"arrow-placement", &arrow_placement,
NULL);
border = gtk_container_get_border_width (GTK_CONTAINER (menu)) + vertical_padding;
border = gtk_container_get_border_width (GTK_CONTAINER (menu));
get_menu_padding (widget, &padding);
gdk_window_get_position (window, &win_x, &win_y);
@@ -4845,8 +4831,6 @@ gtk_menu_scroll_to (GtkMenu *menu,
gint view_width, view_height;
gint border_width;
gint menu_height;
guint vertical_padding;
guint horizontal_padding;
gboolean double_arrows;
widget = GTK_WIDGET (menu);
@@ -4858,23 +4842,17 @@ gtk_menu_scroll_to (GtkMenu *menu,
view_width = gtk_widget_get_allocated_width (widget);
view_height = gtk_widget_get_allocated_height (widget);
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,
"horizontal-padding", &horizontal_padding,
NULL);
get_menu_padding (widget, &padding);
double_arrows = get_double_arrows (menu);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
view_width -= (2 * (border_width + horizontal_padding)) + padding.left + padding.right;
view_height -= (2 * (border_width + vertical_padding)) + padding.top + padding.bottom;
menu_height = priv->requested_height - (2 * (border_width + vertical_padding)) -
padding.top - padding.bottom;
view_width -= (2 * border_width) + padding.left + padding.right;
view_height -= (2 * border_width) + padding.top + padding.bottom;
menu_height = priv->requested_height - (2 * border_width) - padding.top - padding.bottom;
x = border_width + padding.left + horizontal_padding;
y = border_width + padding.top + vertical_padding;
x = border_width + padding.left;
y = border_width + padding.top;
if (double_arrows && !priv->tearoff_active)
{
@@ -5071,23 +5049,18 @@ gtk_menu_scroll_item_visible (GtkMenuShell *menu_shell,
if (compute_child_offset (menu, menu_item,
&child_offset, &child_height, &last_child))
{
guint vertical_padding;
gboolean double_arrows;
GtkBorder padding;
y = priv->scroll_offset;
height = gdk_window_get_height (gtk_widget_get_window (widget));
gtk_widget_style_get (widget,
"vertical-padding", &vertical_padding,
NULL);
double_arrows = get_double_arrows (menu);
get_menu_padding (widget, &padding);
height -= 2 * gtk_container_get_border_width (GTK_CONTAINER (menu)) +
padding.top + padding.bottom +
2 * vertical_padding;
padding.top + padding.bottom;
if (child_offset < y)
{
/* Ignore the enter event we might get if the pointer
+48 -33
View File
@@ -51,9 +51,6 @@
#include "gtkprivate.h"
#include "gtktypebuiltins.h"
#define BORDER_SPACING 0
#define DEFAULT_IPADDING 1
/* Properties */
enum {
PROP_0,
@@ -219,14 +216,24 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
GTK_SHADOW_OUT,
GTK_PARAM_READABLE));
/**
* GtkMenuBar:internal-padding:
*
* Amount of border space between the menubar shadow and the menu items
*
* Deprecated: 3.8: use the standard padding CSS property (through objects
* like #GtkStyleContext and #GtkCssProvider); the value of this style
* property is ignored.
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("internal-padding",
P_("Internal padding"),
P_("Amount of border space between the menubar shadow and the menu items"),
0,
G_MAXINT,
DEFAULT_IPADDING,
GTK_PARAM_READABLE));
0,
GTK_PARAM_READABLE |
G_PARAM_DEPRECATED));
g_type_class_add_private (gobject_class, sizeof (GtkMenuBarPrivate));
}
@@ -332,10 +339,12 @@ gtk_menu_bar_size_request (GtkWidget *widget,
GtkMenuShell *menu_shell;
GtkWidget *child;
GList *children;
gint ipadding;
guint border_width;
gboolean use_toggle_size, use_maximize;
gint child_minimum, child_natural;
GtkStyleContext *context;
GtkBorder border;
GtkStateFlags flags;
*minimum = 0;
*natural = 0;
@@ -391,19 +400,28 @@ gtk_menu_bar_size_request (GtkWidget *widget,
}
}
gtk_widget_style_get (widget, "internal-padding", &ipadding, NULL);
context = gtk_widget_get_style_context (widget);
flags = gtk_widget_get_state_flags (widget);
gtk_style_context_get_padding (context, flags, &border);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
*minimum += border.left + border.right;
*natural += border.left + border.right;
}
else
{
*minimum += border.top + border.bottom;
*natural += border.top + border.bottom;
}
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu_bar));
*minimum += (border_width + ipadding + BORDER_SPACING) * 2;
*natural += (border_width + ipadding + BORDER_SPACING) * 2;
*minimum += border_width * 2;
*natural += border_width * 2;
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
{
GtkStyleContext *context;
GtkBorder border;
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget),
&border);
gtk_style_context_get_border (context, flags, &border);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
@@ -462,7 +480,6 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
GtkWidget *child;
GList *children;
GtkAllocation remaining_space;
gint ipadding;
guint border_width;
GArray *requested_sizes;
gint toggle_size;
@@ -484,28 +501,26 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
if (menu_shell->priv->children)
{
gtk_widget_style_get (widget, "internal-padding", &ipadding, NULL);
GtkStyleContext *context;
GtkStateFlags flags;
GtkBorder border;
context = gtk_widget_get_style_context (widget);
flags = gtk_widget_get_state_flags (widget);
gtk_style_context_get_padding (context, flags, &border);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu_bar));
remaining_space.x = (border_width +
ipadding +
BORDER_SPACING);
remaining_space.y = (border_width +
ipadding +
BORDER_SPACING);
remaining_space.x = (border_width + border.left);
remaining_space.y = (border_width + border.top);
remaining_space.width = allocation->width -
2 * (border_width + ipadding + BORDER_SPACING);
2 * (border_width) - border.left - border.right;
remaining_space.height = allocation->height -
2 * (border_width + ipadding + BORDER_SPACING);
2 * (border_width) - border.top - border.bottom;
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
{
GtkStyleContext *context;
GtkBorder border;
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget),
&border);
gtk_style_context_get_border (context, flags, &border);
remaining_space.x += border.left;
remaining_space.y += border.top;
+20 -94
View File
@@ -464,14 +464,24 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
GTK_PARAM_READABLE),
gtk_rc_property_parse_enum);
/**
* GtkMenuItem:horizontal-padding:
*
* Padding to left and right of the menu item.
*
* Deprecated: 3.8: use the standard padding CSS property (through objects
* like #GtkStyleContext and #GtkCssProvider); the value of this style
* property is ignored.
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("horizontal-padding",
"Horizontal Padding",
"Padding to left and right of the menu item",
0,
G_MAXINT,
3,
GTK_PARAM_READABLE));
0,
GTK_PARAM_READABLE |
G_PARAM_DEPRECATED));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("toggle-spacing",
@@ -839,35 +849,16 @@ gtk_menu_item_get_preferred_width (GtkWidget *widget,
GtkWidget *child;
GtkWidget *parent;
guint accel_width;
guint horizontal_padding;
guint border_width;
GtkPackDirection pack_dir;
GtkPackDirection child_pack_dir;
gint min_width, nat_width;
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
min_width = nat_width = 0;
gtk_widget_style_get (widget,
"horizontal-padding", &horizontal_padding,
NULL);
bin = GTK_BIN (widget);
parent = gtk_widget_get_parent (widget);
if (GTK_IS_MENU_BAR (parent))
{
pack_dir = gtk_menu_bar_get_pack_direction (GTK_MENU_BAR (parent));
child_pack_dir = gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR (parent));
}
else
{
pack_dir = GTK_PACK_DIRECTION_LTR;
child_pack_dir = GTK_PACK_DIRECTION_LTR;
}
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
context = gtk_widget_get_style_context (widget);
@@ -875,13 +866,8 @@ gtk_menu_item_get_preferred_width (GtkWidget *widget,
gtk_style_context_get_padding (context, state, &padding);
min_width = (border_width * 2) + padding.left + padding.right;
if ((pack_dir == GTK_PACK_DIRECTION_LTR || pack_dir == GTK_PACK_DIRECTION_RTL) &&
(child_pack_dir == GTK_PACK_DIRECTION_LTR || child_pack_dir == GTK_PACK_DIRECTION_RTL))
min_width += 2 * horizontal_padding;
nat_width = min_width;
child = gtk_bin_get_child (bin);
if (child != NULL && gtk_widget_get_visible (child))
@@ -936,10 +922,7 @@ gtk_menu_item_real_get_height (GtkWidget *widget,
GtkWidget *child;
GtkWidget *parent;
guint accel_width;
guint horizontal_padding;
guint border_width;
GtkPackDirection pack_dir;
GtkPackDirection child_pack_dir;
gint min_height, nat_height;
gint avail_size = 0;
@@ -949,39 +932,16 @@ gtk_menu_item_real_get_height (GtkWidget *widget,
state = gtk_widget_get_state_flags (widget);
gtk_style_context_get_padding (context, state, &padding);
gtk_widget_style_get (widget,
"horizontal-padding", &horizontal_padding,
NULL);
bin = GTK_BIN (widget);
parent = gtk_widget_get_parent (widget);
if (GTK_IS_MENU_BAR (parent))
{
pack_dir = gtk_menu_bar_get_pack_direction (GTK_MENU_BAR (parent));
child_pack_dir = gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR (parent));
}
else
{
pack_dir = GTK_PACK_DIRECTION_LTR;
child_pack_dir = GTK_PACK_DIRECTION_LTR;
}
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
min_height = (border_width * 2) + padding.top + padding.bottom;
if ((pack_dir == GTK_PACK_DIRECTION_TTB || pack_dir == GTK_PACK_DIRECTION_BTT) &&
(child_pack_dir == GTK_PACK_DIRECTION_TTB || child_pack_dir == GTK_PACK_DIRECTION_BTT))
min_height += 2 * horizontal_padding;
if (for_size != -1)
{
avail_size = for_size;
avail_size -= (border_width * 2) + padding.left + padding.right;
if ((pack_dir == GTK_PACK_DIRECTION_LTR || pack_dir == GTK_PACK_DIRECTION_RTL) &&
(child_pack_dir == GTK_PACK_DIRECTION_LTR || child_pack_dir == GTK_PACK_DIRECTION_RTL))
avail_size -= 2 * horizontal_padding;
}
nat_height = min_height;
@@ -1492,7 +1452,6 @@ gtk_menu_item_size_allocate (GtkWidget *widget,
GtkBin *bin;
GtkAllocation child_allocation;
GtkTextDirection direction;
GtkPackDirection pack_dir;
GtkPackDirection child_pack_dir;
GtkWidget *child;
GtkWidget *parent;
@@ -1507,12 +1466,10 @@ gtk_menu_item_size_allocate (GtkWidget *widget,
parent = gtk_widget_get_parent (widget);
if (GTK_IS_MENU_BAR (parent))
{
pack_dir = gtk_menu_bar_get_pack_direction (GTK_MENU_BAR (parent));
child_pack_dir = gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR (parent));
}
else
{
pack_dir = GTK_PACK_DIRECTION_LTR;
child_pack_dir = GTK_PACK_DIRECTION_LTR;
}
@@ -1524,17 +1481,12 @@ gtk_menu_item_size_allocate (GtkWidget *widget,
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
guint horizontal_padding;
guint border_width;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_style_context_get_padding (context, state, &padding);
gtk_widget_style_get (widget,
"horizontal-padding", &horizontal_padding,
NULL);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
child_allocation.x = border_width + padding.left;
child_allocation.y = border_width + padding.top;
@@ -1544,19 +1496,6 @@ gtk_menu_item_size_allocate (GtkWidget *widget,
child_allocation.height = allocation->height - (border_width * 2) -
padding.top - padding.bottom;
if ((pack_dir == GTK_PACK_DIRECTION_LTR || pack_dir == GTK_PACK_DIRECTION_RTL) &&
(child_pack_dir == GTK_PACK_DIRECTION_LTR || child_pack_dir == GTK_PACK_DIRECTION_RTL))
{
child_allocation.x += horizontal_padding;
child_allocation.width -= 2 * horizontal_padding;
}
else if ((pack_dir == GTK_PACK_DIRECTION_TTB || pack_dir == GTK_PACK_DIRECTION_BTT) &&
(child_pack_dir == GTK_PACK_DIRECTION_TTB || child_pack_dir == GTK_PACK_DIRECTION_BTT))
{
child_allocation.y += horizontal_padding;
child_allocation.height -= 2 * horizontal_padding;
}
if (child_pack_dir == GTK_PACK_DIRECTION_LTR ||
child_pack_dir == GTK_PACK_DIRECTION_RTL)
{
@@ -1726,26 +1665,20 @@ gtk_menu_item_draw (GtkWidget *widget,
{
gint arrow_x, arrow_y;
gint arrow_size;
guint horizontal_padding;
GtkTextDirection direction;
gdouble angle;
direction = gtk_widget_get_direction (widget);
gtk_widget_style_get (widget,
"horizontal-padding", &horizontal_padding,
NULL);
get_arrow_size (widget, child, &arrow_size, NULL);
if (direction == GTK_TEXT_DIR_LTR)
{
arrow_x = x + w - horizontal_padding - arrow_size;
arrow_x = x + w - arrow_size;
angle = G_PI / 2;
}
else
{
arrow_x = x + horizontal_padding;
arrow_x = x;
angle = (3 * G_PI) / 2;
}
@@ -1757,24 +1690,22 @@ gtk_menu_item_draw (GtkWidget *widget,
{
gboolean wide_separators;
gint separator_height;
guint horizontal_padding;
gtk_widget_style_get (widget,
"wide-separators", &wide_separators,
"separator-height", &separator_height,
"horizontal-padding", &horizontal_padding,
NULL);
if (wide_separators)
gtk_render_frame (context, cr,
x + horizontal_padding + padding.left,
x + padding.left,
y + padding.top,
w - (2 * horizontal_padding) - padding.left - padding.right,
w - padding.left - padding.right,
separator_height);
else
gtk_render_line (context, cr,
x + horizontal_padding + padding.left,
x + padding.left,
y + padding.top,
x + w - horizontal_padding - padding.right - 1,
x + w - padding.right - 1,
y + padding.top);
}
@@ -2125,8 +2056,6 @@ get_offsets (GtkMenu *menu,
gint *horizontal_offset,
gint *vertical_offset)
{
gint vertical_padding;
gint horizontal_padding;
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
@@ -2134,8 +2063,6 @@ get_offsets (GtkMenu *menu,
gtk_widget_style_get (GTK_WIDGET (menu),
"horizontal-offset", horizontal_offset,
"vertical-offset", vertical_offset,
"horizontal-padding", &horizontal_padding,
"vertical-padding", &vertical_padding,
NULL);
context = gtk_widget_get_style_context (GTK_WIDGET (menu));
@@ -2143,8 +2070,7 @@ get_offsets (GtkMenu *menu,
gtk_style_context_get_padding (context, state, &padding);
*vertical_offset -= padding.top;
*vertical_offset -= vertical_padding;
*horizontal_offset += horizontal_padding;
*horizontal_offset += padding.left;
}
static void
+1 -1
View File
@@ -1107,7 +1107,7 @@ gtk_menu_shell_leave_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
if (event->mode == GDK_CROSSING_GTK_GRAB ||
event->mode == GDK_CROSSING_GTK_GRAB ||
event->mode == GDK_CROSSING_GTK_UNGRAB ||
event->mode == GDK_CROSSING_STATE_CHANGED)
return TRUE;
+2
View File
@@ -2504,6 +2504,7 @@ gtk_notebook_size_allocate (GtkWidget *widget,
{
case GTK_POS_TOP:
child_allocation.y += priv->cur_page->requisition.height;
/* fall thru */
case GTK_POS_BOTTOM:
child_allocation.height =
MAX (1, child_allocation.height -
@@ -2511,6 +2512,7 @@ gtk_notebook_size_allocate (GtkWidget *widget,
break;
case GTK_POS_LEFT:
child_allocation.x += priv->cur_page->requisition.width;
/* fall thru */
case GTK_POS_RIGHT:
child_allocation.width =
MAX (1, child_allocation.width -
+10
View File
@@ -37,6 +37,16 @@ G_BEGIN_DECLS
#define GTK_PARAM_WRITABLE G_PARAM_WRITABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
#define GTK_PARAM_READWRITE G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
#ifdef G_DISABLE_CAST_CHECKS
/* This is true for debug no and minimum */
#define gtk_internal_return_if_fail(__expr) G_STMT_START{ (void)0; }G_STMT_END
#define gtk_internal_return_val_if_fail(__expr, __val) G_STMT_START{ (void)0; }G_STMT_END
#else
/* This is true for debug yes */
#define gtk_internal_return_if_fail(__expr) g_return_if_fail(__expr)
#define gtk_internal_return_val_if_fail(__expr, __val) g_return_val_if_fail(__expr, __val)
#endif
const gchar * _gtk_get_datadir (void);
const gchar * _gtk_get_libdir (void);
const gchar * _gtk_get_sysconfdir (void);
+1 -1
View File
@@ -284,7 +284,7 @@ _gtk_rounded_box_guess_length (const GtkRoundedBox *box,
GtkCssSide side)
{
double length;
GtkCssCorner before, after;
GtkCssSide before, after;
before = side;
after = (side + 1) % 4;
+4 -92
View File
@@ -114,7 +114,6 @@ struct _GtkSettingsPrivate
GdkScreen *screen;
GtkCssProvider *theme_provider;
GtkCssProvider *key_theme_provider;
GtkStyleProperties *style;
};
typedef enum
@@ -1410,98 +1409,21 @@ gtk_settings_class_init (GtkSettingsClass *class)
g_type_class_add_private (class, sizeof (GtkSettingsPrivate));
}
static void
settings_ensure_style (GtkSettings *settings)
{
GtkSettingsPrivate *priv = settings->priv;
PangoFontDescription *font_desc;
gchar *font_name;
if (priv->style)
return;
priv->style = gtk_style_properties_new ();
g_object_get (settings,
"gtk-font-name", &font_name,
NULL);
font_desc = pango_font_description_from_string (font_name);
/* Unset normal attributes from this description,
* so they do not override theme values */
if (pango_font_description_get_weight (font_desc) == PANGO_WEIGHT_NORMAL)
pango_font_description_unset_fields (font_desc,
PANGO_FONT_MASK_WEIGHT);
if (pango_font_description_get_stretch (font_desc) == PANGO_STRETCH_NORMAL)
pango_font_description_unset_fields (font_desc,
PANGO_FONT_MASK_STRETCH);
if (pango_font_description_get_variant (font_desc) == PANGO_VARIANT_NORMAL)
pango_font_description_unset_fields (font_desc,
PANGO_FONT_MASK_VARIANT);
if (pango_font_description_get_style (font_desc) == PANGO_STYLE_NORMAL)
pango_font_description_unset_fields (font_desc,
PANGO_FONT_MASK_STYLE);
gtk_style_properties_set (priv->style, 0,
"font", font_desc,
NULL);
pango_font_description_free (font_desc);
g_free (font_name);
}
static void
gtk_settings_provider_iface_init (GtkStyleProviderIface *iface)
{
}
static GtkCssValue *
gtk_settings_style_provider_get_color (GtkStyleProviderPrivate *provider,
const char *name)
static GtkSettings *
gtk_settings_style_provider_get_settings (GtkStyleProviderPrivate *provider)
{
GtkSettings *settings = GTK_SETTINGS (provider);
settings_ensure_style (settings);
return _gtk_style_provider_private_get_color (GTK_STYLE_PROVIDER_PRIVATE (settings->priv->style), name);
}
static void
gtk_settings_style_provider_lookup (GtkStyleProviderPrivate *provider,
const GtkCssMatcher *matcher,
GtkCssLookup *lookup)
{
GtkSettings *settings = GTK_SETTINGS (provider);
settings_ensure_style (settings);
_gtk_style_provider_private_lookup (GTK_STYLE_PROVIDER_PRIVATE (settings->priv->style),
matcher,
lookup);
}
static GtkCssChange
gtk_settings_style_provider_get_change (GtkStyleProviderPrivate *provider,
const GtkCssMatcher *matcher)
{
GtkSettings *settings = GTK_SETTINGS (provider);
settings_ensure_style (settings);
return _gtk_style_provider_private_get_change (GTK_STYLE_PROVIDER_PRIVATE (settings->priv->style),
matcher);
return GTK_SETTINGS (provider);
}
static void
gtk_settings_provider_private_init (GtkStyleProviderPrivateInterface *iface)
{
iface->get_color = gtk_settings_style_provider_get_color;
iface->lookup = gtk_settings_style_provider_lookup;
iface->get_change = gtk_settings_style_provider_get_change;
iface->get_settings = gtk_settings_style_provider_get_settings;
}
static void
@@ -1522,8 +1444,6 @@ gtk_settings_finalize (GObject *object)
settings_update_provider (priv->screen, &priv->theme_provider, NULL);
settings_update_provider (priv->screen, &priv->key_theme_provider, NULL);
g_clear_object (&priv->style);
G_OBJECT_CLASS (gtk_settings_parent_class)->finalize (object);
}
@@ -1729,14 +1649,6 @@ gtk_settings_get_property (GObject *object,
static void
settings_invalidate_style (GtkSettings *settings)
{
GtkSettingsPrivate *priv = settings->priv;
if (priv->style)
{
g_object_unref (priv->style);
priv->style = NULL;
}
_gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (settings));
}
+24
View File
@@ -123,6 +123,29 @@ gtk_style_cascade_provider_iface_init (GtkStyleProviderIface *iface)
iface->get_style_property = gtk_style_cascade_get_style_property;
}
static GtkSettings *
gtk_style_cascade_get_settings (GtkStyleProviderPrivate *provider)
{
GtkStyleCascade *cascade = GTK_STYLE_CASCADE (provider);
GtkStyleCascadeIter iter;
GtkSettings *settings;
GtkStyleProvider *item;
for (item = gtk_style_cascade_iter_init (cascade, &iter);
item;
item = gtk_style_cascade_iter_next (cascade, &iter))
{
if (!GTK_IS_STYLE_PROVIDER_PRIVATE (item))
continue;
settings = _gtk_style_provider_private_get_settings (GTK_STYLE_PROVIDER_PRIVATE (item));
if (settings)
return settings;
}
return NULL;
}
static GtkCssValue *
gtk_style_cascade_get_color (GtkStyleProviderPrivate *provider,
const char *name)
@@ -233,6 +256,7 @@ static void
gtk_style_cascade_provider_private_iface_init (GtkStyleProviderPrivateInterface *iface)
{
iface->get_color = gtk_style_cascade_get_color;
iface->get_settings = gtk_style_cascade_get_settings;
iface->get_keyframes = gtk_style_cascade_get_keyframes;
iface->lookup = gtk_style_cascade_lookup;
iface->get_change = gtk_style_cascade_get_change;
+35 -17
View File
@@ -372,7 +372,7 @@ struct _GtkStyleContextPrivate
GtkCssChange relevant_changes;
GtkCssChange pending_changes;
guint invalidating_context : 1;
const GtkBitmask *invalidating_context;
guint invalid : 1;
};
@@ -2222,17 +2222,6 @@ _gtk_style_context_peek_property (GtkStyleContext *context,
return _gtk_css_computed_values_get_value (data->store, property_id);
}
double
_gtk_style_context_get_number (GtkStyleContext *context,
guint property_id,
double one_hundred_percent)
{
GtkCssValue *value;
value = _gtk_style_context_peek_property (context, property_id);
return _gtk_css_number_value_get (value, one_hundred_percent);
}
const GValue *
_gtk_style_context_peek_style_property (GtkStyleContext *context,
GType widget_type,
@@ -2971,7 +2960,8 @@ gtk_style_context_update_cache (GtkStyleContext *context,
}
static void
gtk_style_context_do_invalidate (GtkStyleContext *context)
gtk_style_context_do_invalidate (GtkStyleContext *context,
const GtkBitmask *changes)
{
GtkStyleContextPrivate *priv;
@@ -2983,11 +2973,11 @@ gtk_style_context_do_invalidate (GtkStyleContext *context)
if (priv->invalidating_context)
return;
priv->invalidating_context = TRUE;
priv->invalidating_context = changes;
g_signal_emit (context, signals[CHANGED], 0);
priv->invalidating_context = FALSE;
priv->invalidating_context = NULL;
}
static GtkBitmask *
@@ -3177,7 +3167,7 @@ _gtk_style_context_validate (GtkStyleContext *context,
}
if (!_gtk_bitmask_is_empty (changes) || (change & GTK_CSS_CHANGE_FORCE_INVALIDATE))
gtk_style_context_do_invalidate (context);
gtk_style_context_do_invalidate (context, changes);
change = _gtk_css_change_for_child (change);
for (list = priv->children; list; list = list->next)
@@ -3226,10 +3216,18 @@ _gtk_style_context_queue_invalidate (GtkStyleContext *context,
void
gtk_style_context_invalidate (GtkStyleContext *context)
{
GtkBitmask *changes;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
gtk_style_context_clear_cache (context);
gtk_style_context_do_invalidate (context);
changes = _gtk_bitmask_new ();
changes = _gtk_bitmask_invert_range (changes,
0,
_gtk_css_style_property_get_n_properties ());
gtk_style_context_do_invalidate (context, changes);
_gtk_bitmask_free (changes);
}
/**
@@ -4503,6 +4501,26 @@ gtk_draw_insertion_cursor (GtkWidget *widget,
draw_arrow);
}
/**
* _gtk_style_context_get_changes:
* @context: the context to query
*
* Queries the context for the changes for the currently executing
* GtkStyleContext::invalidate signal. If no signal is currently
* emitted, this function returns %NULL.
*
* FIXME 4.0: Make this part of the signal.
*
* Returns: %NULL or the currently invalidating changes
**/
const GtkBitmask *
_gtk_style_context_get_changes (GtkStyleContext *context)
{
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
return context->priv->invalidating_context;
}
static AtkAttributeSet *
add_attribute (AtkAttributeSet *attributes,
AtkTextAttribute attr,
+3 -3
View File
@@ -27,11 +27,11 @@ G_BEGIN_DECLS
void _gtk_style_context_set_widget (GtkStyleContext *context,
GtkWidget *widget);
const GtkBitmask *
_gtk_style_context_get_changes (GtkStyleContext *context);
GtkCssValue * _gtk_style_context_peek_property (GtkStyleContext *context,
guint property_id);
double _gtk_style_context_get_number (GtkStyleContext *context,
guint property_id,
double one_hundred_percent);
const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context,
GType widget_type,
GtkStateFlags state,
+2
View File
@@ -66,8 +66,10 @@ typedef gboolean (* GtkStylePropertyParser) (const gchar *string,
GType gtk_style_properties_get_type (void) G_GNUC_CONST;
/* Next 2 are implemented in gtkcsscustomproperty.c */
GDK_DEPRECATED_IN_3_8
void gtk_style_properties_register_property (GtkStylePropertyParser parse_func,
GParamSpec *pspec);
GDK_DEPRECATED_IN_3_8
gboolean gtk_style_properties_lookup_property (const gchar *property_name,
GtkStylePropertyParser *parse_func,
GParamSpec **pspec);
+15
View File
@@ -125,3 +125,18 @@ _gtk_style_provider_private_changed (GtkStyleProviderPrivate *provider)
g_signal_emit (provider, signals[CHANGED], 0);
}
GtkSettings *
_gtk_style_provider_private_get_settings (GtkStyleProviderPrivate *provider)
{
GtkStyleProviderPrivateInterface *iface;
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
if (!iface->get_settings)
return NULL;
return iface->get_settings (provider);
}
+2
View File
@@ -41,6 +41,7 @@ struct _GtkStyleProviderPrivateInterface
GtkCssValue * (* get_color) (GtkStyleProviderPrivate *provider,
const char *name);
GtkSettings * (* get_settings) (GtkStyleProviderPrivate *provider);
GtkCssKeyframes * (* get_keyframes) (GtkStyleProviderPrivate *provider,
const char *name);
void (* lookup) (GtkStyleProviderPrivate *provider,
@@ -55,6 +56,7 @@ struct _GtkStyleProviderPrivateInterface
GType _gtk_style_provider_private_get_type (void) G_GNUC_CONST;
GtkSettings * _gtk_style_provider_private_get_settings (GtkStyleProviderPrivate *provider);
GtkCssValue * _gtk_style_provider_private_get_color (GtkStyleProviderPrivate *provider,
const char *name);
GtkCssKeyframes * _gtk_style_provider_private_get_keyframes(GtkStyleProviderPrivate *provider,
+1 -10
View File
@@ -355,16 +355,6 @@ _gtk_theming_engine_peek_property (GtkThemingEngine *engine,
return _gtk_style_context_peek_property (engine->priv->context, property_id);
}
double
_gtk_theming_engine_get_number (GtkThemingEngine *engine,
guint property_id,
double one_hundred_percent)
{
g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), 0.0);
return _gtk_style_context_get_number (engine->priv->context, property_id, one_hundred_percent);
}
/**
* gtk_theming_engine_get_property:
* @engine: a #GtkThemingEngine
@@ -1656,6 +1646,7 @@ render_border (cairo_t *cr,
2 * other_border[GTK_CSS_LEFT]);
render_frame_fill (cr, &other_box, other_border, colors, dont_draw);
}
break;
case GTK_BORDER_STYLE_GROOVE:
case GTK_BORDER_STYLE_RIDGE:
{
+1
View File
@@ -182,6 +182,7 @@ struct _GtkThemingEngineClass
GType gtk_theming_engine_get_type (void) G_GNUC_CONST;
/* function implemented in gtkcsscustomproperty.c */
GDK_DEPRECATED_IN_3_8
void gtk_theming_engine_register_property (const gchar *name_space,
GtkStylePropertyParser parse_func,
GParamSpec *pspec);
-3
View File
@@ -29,9 +29,6 @@ void _gtk_theming_engine_paint_spinner (cairo_t *cr,
GtkCssValue *_gtk_theming_engine_peek_property (GtkThemingEngine *engine,
guint property_id);
double _gtk_theming_engine_get_number (GtkThemingEngine *engine,
guint property_id,
double one_hundred_percent);
void _gtk_theming_engine_set_context (GtkThemingEngine *engine,
GtkStyleContext *context);
GtkStyleContext *_gtk_theming_engine_get_context (GtkThemingEngine *engine);
+21 -7
View File
@@ -35,6 +35,7 @@
#include "gtkcontainer.h"
#include "gtkaccelmapprivate.h"
#include "gtkclipboard.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkiconfactory.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
@@ -853,6 +854,8 @@ gtk_widget_draw_marshallerv (GClosure *closure,
param_types);
cairo_restore (cr);
va_end (args_copy);
}
static void
@@ -4651,7 +4654,9 @@ gtk_widget_queue_resize (GtkWidget *widget)
if (gtk_widget_get_realized (widget))
gtk_widget_queue_draw (widget);
_gtk_size_group_queue_resize (widget, 0);
if (gtk_widget_get_visible (widget) ||
widget->priv->have_size_groups)
_gtk_size_group_queue_resize (widget, 0);
}
/**
@@ -6714,15 +6719,27 @@ gtk_widget_real_style_updated (GtkWidget *widget)
if (widget->priv->context)
{
const GtkBitmask *changes = _gtk_style_context_get_changes (widget->priv->context);
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget) &&
!gtk_widget_get_app_paintable (widget))
gtk_style_context_set_background (widget->priv->context,
widget->priv->window);
}
if (widget->priv->anchored)
gtk_widget_queue_resize (widget);
if (widget->priv->anchored)
{
if (changes && _gtk_css_style_property_changes_affect_size (changes))
gtk_widget_queue_resize (widget);
else
gtk_widget_queue_draw (widget);
}
}
else
{
if (widget->priv->anchored)
gtk_widget_queue_resize (widget);
}
}
static gboolean
@@ -13950,9 +13967,6 @@ _gtk_widget_style_context_invalidated (GtkWidget *widget)
*/
widget->priv->style_update_pending = TRUE;
}
if (widget->priv->anchored)
gtk_widget_queue_resize (widget);
}
/**
-1
View File
@@ -5735,7 +5735,6 @@ gtk_window_style_updated (GtkWidget *widget)
rect.width, rect.height);
set_grip_shape (window);
gtk_widget_queue_resize (widget);
}
}
@@ -2210,7 +2210,8 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
as inactive if it is in the list, emitting a printer_removed signal */
if (removed_printer_checklist != NULL)
{
g_list_free_full (removed_printer_checklist, (GDestroyNotify) mark_printer_inactive);
g_list_foreach (removed_printer_checklist, (GFunc) mark_printer_inactive, backend);
g_list_free (removed_printer_checklist);
list_has_changed = TRUE;
}
@@ -3169,7 +3170,7 @@ value_is_off (const char *value)
static char *
ppd_group_name (ppd_group_t *group)
{
return group->text;
return group->name;
}
static int
+2
View File
@@ -53,6 +53,8 @@ tests/reftests/css-multi-state.ref.ui
tests/reftests/css-multi-state.ui
tests/reftests/entry-progress-coloring.ref.ui
tests/reftests/entry-progress-coloring.ui
tests/reftests/font-sizes-names.ref.ui
tests/reftests/font-sizes-names.ui
tests/reftests/grid-empty-with-spacing.ui
tests/reftests/grid-wfh.ref.ui
tests/reftests/grid-wfh.ui
+302 -302
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -54,6 +54,8 @@ tests/reftests/css-multi-state.ref.ui
tests/reftests/css-multi-state.ui
tests/reftests/entry-progress-coloring.ref.ui
tests/reftests/entry-progress-coloring.ui
tests/reftests/font-sizes-names.ref.ui
tests/reftests/font-sizes-names.ui
tests/reftests/grid-empty-with-spacing.ui
tests/reftests/grid-wfh.ref.ui
tests/reftests/grid-wfh.ui
+1 -1
View File
@@ -1566,7 +1566,7 @@ msgid "_Visit this file"
msgstr "_زُر هذا الملف"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "ا_نسخ موقع الملف"
#: ../gtk/gtkfilechooserdefault.c:4179
+82 -71
View File
@@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: as\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gtk"
"%2b&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2012-11-20 21:08+0000\n"
"PO-Revision-Date: 2012-11-23 20:16+0530\n"
"POT-Creation-Date: 2012-11-26 20:07+0000\n"
"PO-Revision-Date: 2012-11-28 13:46+0530\n"
"Last-Translator: Nilamdyuti Goswami <ngoswami@redhat.com>\n"
"Language-Team: as_IN <kde-i18n-doc@kde.org>\n"
"Language: as_IN\n"
@@ -780,8 +780,9 @@ msgid "Backslash"
msgstr "Backslash"
#: ../gtk/gtkappchooserbutton.c:290
msgid "Other application..."
msgstr "বেলেগ এপ্লিকেচন..."
#| msgid "Other application..."
msgid "Other application…"
msgstr "অন্য এপ্লিকেচন…"
#: ../gtk/gtkappchooserdialog.c:137
msgid "Failed to look for applications online"
@@ -1025,8 +1026,9 @@ msgstr "অবৈধ"
#. * acelerator.
#.
#: ../gtk/gtkcellrendereraccel.c:416 ../gtk/gtkcellrendereraccel.c:747
msgid "New accelerator..."
msgstr "নতন বেগবৰ্দ্ধক..."
#| msgid "New accelerator..."
msgid "New accelerator…"
msgstr "নতুন ত্বৰক…"
#: ../gtk/gtkcellrendererprogress.c:372 ../gtk/gtkcellrendererprogress.c:462
#, c-format
@@ -1327,8 +1329,9 @@ msgid "mm"
msgstr "mm"
#: ../gtk/gtkcustompaperunixdialog.c:605
msgid "Margins from Printer..."
msgstr "মুদ্ৰকৰ পৰা প্ৰান্তিক অংশ..."
#| msgid "Margins from Printer..."
msgid "Margins from Printer…"
msgstr "প্ৰিন্টাৰৰ পৰা সীমা…"
#: ../gtk/gtkcustompaperunixdialog.c:771
#, c-format
@@ -1433,8 +1436,9 @@ msgid "(None)"
msgstr "(একো নাই)"
#: ../gtk/gtkfilechooserbutton.c:2046
msgid "Other..."
msgstr "অন্য..."
#| msgid "Other..."
msgid "Other…"
msgstr "অন্য…"
#: ../gtk/gtkfilechooserdefault.c:152
msgid "Type name of new folder"
@@ -1543,8 +1547,9 @@ msgid "Remove"
msgstr "আঁতৰাই দিয়ক"
#: ../gtk/gtkfilechooserdefault.c:3389
msgid "Rename..."
msgstr "পুনঃ নামকৰণ..."
#| msgid "Rename..."
msgid "Rename…"
msgstr "পুনঃ নামকৰণ কৰক…"
#. Accessible object name for the file chooser's shortcuts pane
#: ../gtk/gtkfilechooserdefault.c:3553
@@ -1569,7 +1574,7 @@ msgid "_Visit this file"
msgstr "এই ফাইল ভ্ৰমণ কৰক (_V)"
#: ../gtk/gtkfilechooserdefault.c:4179
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "ফাইলৰ অৱস্থান কপি কৰক (_C)"
#: ../gtk/gtkfilechooserdefault.c:4182
@@ -1786,8 +1791,9 @@ msgid "Copy _Link Address"
msgstr "সংযোগ ঠিকনা নকল কৰক ( )"
#: ../gtk/gtk-launch.c:71
msgid "APPLICATION [URI...] - launch an APPLICATION with URI."
msgstr "APPLICATION [URI...] - URI ৰ সৈতে এটা APPLICATION লঞ্চ কৰক।"
#| msgid "APPLICATION [URI...] - launch an APPLICATION with URI."
msgid "APPLICATION [URI…] — launch an APPLICATION with URI."
msgstr "APPLICATION [URI…] — URI ৰ সৈতে এটা APPLICATION লঞ্চ কৰক।"
#. Translators: this message will appear after the usage string
#. and before the list of options.
@@ -2051,8 +2057,9 @@ msgstr ""
" তল: %s %s"
#: ../gtk/gtkpagesetupunixdialog.c:845 ../gtk/gtkprintunixdialog.c:3329
msgid "Manage Custom Sizes..."
msgstr "পছন্দৰ আয়তন পৰিচালনা কৰক..."
#| msgid "Manage Custom Sizes"
msgid "Manage Custom Sizes…"
msgstr "স্বনিৰ্বাচিত আকাৰসমূহ ব্যৱস্থাপনা কৰক…"
#: ../gtk/gtkpagesetupunixdialog.c:896
msgid "_Format for:"
@@ -2234,8 +2241,9 @@ msgid "Getting printer information failed"
msgstr "প্ৰিনটাৰৰ তথ্য পোৱাত ব্যৰ্থ"
#: ../gtk/gtkprintunixdialog.c:1916
msgid "Getting printer information..."
msgstr "মূদ্ৰকৰ তথ্য পোৱা হৈছে"
#| msgid "Getting printer information..."
msgid "Getting printer information…"
msgstr "প্ৰিন্টাৰ তথ্য প্ৰাপ্ত কৰা হৈছে…"
#: ../gtk/gtkprintunixdialog.c:2184
msgid "Printer"
@@ -2311,42 +2319,42 @@ msgstr "সাধাৰণ"
#. * multiple pages on a sheet when printing
#.
#: ../gtk/gtkprintunixdialog.c:3058
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3686
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3691
msgid "Left to right, top to bottom"
msgstr "বাওঁ ফালৰ পৰা সোঁ ফাললৈ, ওপৰৰ পৰা তললৈ"
#: ../gtk/gtkprintunixdialog.c:3058
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3686
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3691
msgid "Left to right, bottom to top"
msgstr "বাওঁ ফালৰ পৰা সোঁ ফাললৈ, তলৰ পৰা ওপৰলৈ"
#: ../gtk/gtkprintunixdialog.c:3059
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3687
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3692
msgid "Right to left, top to bottom"
msgstr "সোঁ ফালৰ পৰা বাওঁ ফাললৈ, ওপৰৰ পৰা তললৈ"
#: ../gtk/gtkprintunixdialog.c:3059
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3687
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3692
msgid "Right to left, bottom to top"
msgstr "সোঁ ফালৰ পৰা বাওঁ ফাললৈ, তলৰ পৰা ওপৰলৈ"
#: ../gtk/gtkprintunixdialog.c:3060
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3688
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3693
msgid "Top to bottom, left to right"
msgstr "ওপৰৰ পৰা তললৈ, বাওঁ ফালৰ পৰা সোঁ ফাললৈ"
#: ../gtk/gtkprintunixdialog.c:3060
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3688
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3693
msgid "Top to bottom, right to left"
msgstr "ওপৰৰ পৰা তললৈ, সোঁ ফালৰ পৰা বাওঁ ফাললৈ"
#: ../gtk/gtkprintunixdialog.c:3061
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3689
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3694
msgid "Bottom to top, left to right"
msgstr "তলৰ পৰা ওপৰলৈ, বাওঁ ফালৰ পৰা সোঁ ফাললৈ"
#: ../gtk/gtkprintunixdialog.c:3061
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3689
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3694
msgid "Bottom to top, right to left"
msgstr "তলৰ পৰা ওপৰলৈ, সোঁ ফালৰ পৰা বাওঁ ফাললৈ"
@@ -2354,7 +2362,7 @@ msgstr "তলৰ পৰা ওপৰলৈ, সোঁ ফালৰ পৰা
#. * dialog that controls in what order multiple pages are arranged
#.
#: ../gtk/gtkprintunixdialog.c:3065 ../gtk/gtkprintunixdialog.c:3078
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3766
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3771
msgid "Page Ordering"
msgstr "পৃষ্ঠা শৃংখলাবদ্ধ কৰা"
@@ -4519,169 +4527,169 @@ msgstr "ৰখোৱা হৈছে ; কাৰ্য্য গ্ৰহণ ক
msgid "Rejecting Jobs"
msgstr "কাৰ্য্য গ্ৰহণ কৰা হোৱা নাই"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2909
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2914
msgid "Two Sided"
msgstr "দ্বিপাৰ্শ্বিক"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2910
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2915
msgid "Paper Type"
msgstr "কাগজৰ ধৰণ"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2911
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2916
msgid "Paper Source"
msgstr "কাগজৰ উৎস"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2912
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2917
msgid "Output Tray"
msgstr "নিৰ্গমৰ ডলা"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2913
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2918
msgid "Resolution"
msgstr "বিশ্লেষণ"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2914
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2919
msgid "GhostScript pre-filtering"
msgstr "GhostScript প্ৰি-ফিল্টাৰিং"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2923
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2928
msgid "One Sided"
msgstr "একপাক্ষিক"
#. Translators: this is an option of "Two Sided"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2925
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2930
msgid "Long Edge (Standard)"
msgstr "দীৰ্ঘ প্ৰান্ত (প্ৰমিত মান)"
#. Translators: this is an option of "Two Sided"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2927
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2932
msgid "Short Edge (Flip)"
msgstr "ক্ষুদ্ৰ প্ৰান্ত (উলট)"
#. Translators: this is an option of "Paper Source"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2929
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2931
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2939
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2934
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2936
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2944
msgid "Auto Select"
msgstr "স্বয়ং বাছক"
#. Translators: this is an option of "Paper Source"
#. Translators: this is an option of "Resolution"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2933
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2935
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2937
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2941
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3429
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2938
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2940
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2942
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2946
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3434
msgid "Printer Default"
msgstr "মুদ্ৰক অবিকল্পিত"
#. Translators: this is an option of "GhostScript"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2943
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2948
msgid "Embed GhostScript fonts only"
msgstr "শুধুমাত্ৰ GhostScript ফন্ট এমবেড কৰা হ'ব"
#. Translators: this is an option of "GhostScript"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2945
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2950
msgid "Convert to PS level 1"
msgstr "PS লেভেল ১এ ৰূপান্তৰ কৰা হ'ব"
#. Translators: this is an option of "GhostScript"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2947
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2952
msgid "Convert to PS level 2"
msgstr "PS লেভেল ২এ ৰূপান্তৰ কৰা হ'ব"
#. Translators: this is an option of "GhostScript"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2949
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2954
msgid "No pre-filtering"
msgstr "প্ৰি-ফিল্টাৰিং বিহীন"
#. Translators: "Miscellaneous" is the label for a button, that opens
#. up an extra panel of settings in a print dialog.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2958
#: ../modules/printbackends/cups/gtkprintbackendcups.c:2963
msgid "Miscellaneous"
msgstr "বিবিধ"
#. Translators: These strings name the possible values of the
#. * job priority option in the print dialog
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3681
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3686
msgid "Urgent"
msgstr "অতি আৱশ্যক"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3681
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3686
msgid "High"
msgstr "তীব্ৰ"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3681
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3686
msgid "Medium"
msgstr "মধ্যমীয়া"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3681
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3686
msgid "Low"
msgstr "নিম্ন"
#. Translators, this string is used to label the job priority option
#. * in the print dialog
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3711
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3716
msgid "Job Priority"
msgstr "কাৰ্য্যৰ শ্ৰেষ্ঠতা"
#. Translators, this string is used to label the billing info entry
#. * in the print dialog
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3722
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3727
msgid "Billing Info"
msgstr "সাধনীৰ তথ্য"
#. Translators, these strings are names for various 'standard' cover
#. * pages that the printing system may support.
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3737
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3742
msgid "None"
msgstr "একো নাই"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3737
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3742
msgid "Classified"
msgstr "শ্ৰেণীভুক্ত"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3737
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3742
msgid "Confidential"
msgstr "গুপুত"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3737
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3742
msgid "Secret"
msgstr "গোপণীয়"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3737
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3742
msgid "Standard"
msgstr "মানদণ্ড স্বৰূপ"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3737
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3742
msgid "Top Secret"
msgstr "পৰম গোপণীয়"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3737
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3742
msgid "Unclassified"
msgstr "শ্ৰেণীভুক্ত নকৰা"
#. Translators, this string is used to label the pages-per-sheet option
#. * in the print dialog
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3748
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3753
msgid "Pages per Sheet"
msgstr "প্ৰতিটো পাতৰ পৃষ্ঠা"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the front cover page.
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3808
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3813
msgid "Before"
msgstr "আগৰ"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the back cover page.
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3823
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3828
msgid "After"
msgstr "পিছৰ"
@@ -4689,14 +4697,14 @@ msgstr "পিছৰ"
#. * a print job is printed. Possible values are 'now', a specified time,
#. * or 'on hold'
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3843
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3848
msgid "Print at"
msgstr "-ইয়াত মুদ্ৰণ"
#. Translators: this is the name of the option that allows the user
#. * to specify a time when a print job will be printed.
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3854
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3859
msgid "Print at time"
msgstr "এই সময়ত মুদ্ৰণ কৰক"
@@ -4704,17 +4712,17 @@ msgstr "এই সময়ত মুদ্ৰণ কৰক"
#. * size. The two placeholders are replaced with the width and height
#. * in points. E.g: "Custom 230.4x142.9"
#.
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3889
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3894
#, c-format
msgid "Custom %sx%s"
msgstr "নিজৰ পছন্দৰ %sx%s"
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3970
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3975
msgid "Printer Profile"
msgstr "প্ৰিন্টাৰ আলেখ্য"
#. TRANSLATORS: this is when color profile information is unavailable
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3977
#: ../modules/printbackends/cups/gtkprintbackendcups.c:3982
msgid "Unavailable"
msgstr "উপলব্ধ নাই"
@@ -4814,6 +4822,9 @@ msgstr "test-output.%s"
msgid "Print to Test Printer"
msgstr "পৰীক্ষণ মূদ্ৰকলৈ মূদ্ৰণ কৰক"
#~ msgid "Manage Custom Sizes..."
#~ msgstr "পছন্দৰ আয়তন পৰিচালনা কৰক..."
#~ msgid "Select a folder"
#~ msgstr "এটা ফোল্ডাৰ বাছক"
+1 -1
View File
@@ -1559,7 +1559,7 @@ msgid "_Visit this file"
msgstr "_Наведаць гэты файл"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Скапіраваць размяшчэнне файла"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1577,7 +1577,7 @@ msgid "_Visit this file"
msgstr "_Отваряне на файла"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "Копиране на _местоположението на файла"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1609,7 +1609,7 @@ msgstr "চিহ্নিত ফাইল পরিদর্শন করুন
#: ../gtk/gtkfilechooserdefault.c:4176
#| msgid "Copy _Location"
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "ফাইলের অবস্থান কপি করুন (_C)"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1264,7 +1264,7 @@ msgstr ""
#: ../gtk/gtkfilechooserdefault.c:4176
#, fuzzy
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "Eilañ al lec'hiadur"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1596,7 +1596,7 @@ msgid "_Visit this file"
msgstr "_Visita aquest fitxer"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Copia la ubicació del fitxer"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1595,7 +1595,7 @@ msgid "_Visit this file"
msgstr "_Visita este fitxer"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Copia la ubicació del fitxer"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1654,7 +1654,7 @@ msgid "_Visit this file"
msgstr "Bu dosyeni _ziyaret et"
#: ../gtk/gtkfilechooserdefault.c:4174
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "Dosyeniñ qonumnı _kopiyala"
#: ../gtk/gtkfilechooserdefault.c:4177
+1 -1
View File
@@ -1571,7 +1571,7 @@ msgid "_Visit this file"
msgstr "Podí_vat se na tento soubor"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "Kopírovat _umístění souboru"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1595,7 +1595,7 @@ msgid "_Visit this file"
msgstr "_Gå til denne fil"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "Kopiér filens _placering"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1594,7 +1594,7 @@ msgid "_Visit this file"
msgstr "Zu dieser Datei _gehen"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "O_rt der Datei kopieren"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1574,7 +1574,7 @@ msgid "_Visit this file"
msgstr "_Επίσκεψη αυτού του αρχείου"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Αντιγραφή τοποθεσίας αρχείου"
#: ../gtk/gtkfilechooserdefault.c:4179
+2 -2
View File
@@ -1563,8 +1563,8 @@ msgid "_Visit this file"
msgstr "_Visit this file"
#: ../gtk/gtkfilechooserdefault.c:4179
msgid "_Copy file's location"
msgstr "_Copy file's location"
msgid "_Copy files location"
msgstr "_Copy files location"
#: ../gtk/gtkfilechooserdefault.c:4182
msgid "_Add to Bookmarks"
+1 -1
View File
@@ -1570,7 +1570,7 @@ msgid "_Visit this file"
msgstr "_Viziti ĉi tiun dosieron"
#: ../gtk/gtkfilechooserdefault.c:4174
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Kopii lokon de dosiero"
#: ../gtk/gtkfilechooserdefault.c:4177
+1 -1
View File
@@ -1578,7 +1578,7 @@ msgid "_Visit this file"
msgstr "_Visitar este archivo"
#: ../gtk/gtkfilechooserdefault.c:4178
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Copiar la ubicación del archivo"
#: ../gtk/gtkfilechooserdefault.c:4181
+1 -1
View File
@@ -1281,7 +1281,7 @@ msgstr "Faili pole võimalik valida"
msgid "_Visit this file"
msgstr "_Külasta seda faili"
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "Kopeeri _asukoht"
msgid "_Add to Bookmarks"
+1 -1
View File
@@ -1567,7 +1567,7 @@ msgid "_Visit this file"
msgstr "_Bisitatu fitxategi hau"
#: ../gtk/gtkfilechooserdefault.c:4173
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Kopiatu fitxategiaren helbidea"
#: ../gtk/gtkfilechooserdefault.c:4176
+1 -1
View File
@@ -1566,7 +1566,7 @@ msgid "_Visit this file"
msgstr "_مشاهده این پرونده"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_رونوشت از مکان پرونده"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1595,7 +1595,7 @@ msgid "_Visit this file"
msgstr "Näytä tie_dosto tiedostonhallinnassa"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "Ko_pioi tiedoston sijainti"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1584,7 +1584,7 @@ msgid "_Visit this file"
msgstr "C_onsulter ce fichier"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Copier l'emplacement du fichier"
#: ../gtk/gtkfilechooserdefault.c:4179
+1 -1
View File
@@ -1576,7 +1576,7 @@ msgid "_Visit this file"
msgstr "_Visitar este ficheiro"
#: ../gtk/gtkfilechooserdefault.c:4178
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "_Copiar a localización do ficheiro"
#: ../gtk/gtkfilechooserdefault.c:4181
+1 -1
View File
@@ -1588,7 +1588,7 @@ msgid "_Visit this file"
msgstr "આ ફાઇલની મુલાકાત લો (_V)"
#: ../gtk/gtkfilechooserdefault.c:4176
msgid "_Copy file's location"
msgid "_Copy files location"
msgstr "ફાઇલનાં સ્થાનની નકલ કરો (_C)"
#: ../gtk/gtkfilechooserdefault.c:4179

Some files were not shown because too many files have changed in this diff Show More