Commit Graph

344 Commits

Author SHA1 Message Date
Benjamin Otte
b4195cb408 cssmatcher: Handle case of empty widget path
This is tested by the stylecontext test, but doesn't appear in practice.
2012-05-01 03:13:02 +02:00
Benjamin Otte
04c85a5b3b container: Redo style validation handling
Instead of using 1 global queue for both resizes and style validation,
use 2 queues. This makes the code a lot simpler and fixes a bug where we
could accidentally stop restylying for very delayed restyles.
2012-04-17 08:59:23 +02:00
Benjamin Otte
35e36b9fe5 stylecontext: Avoid style_context_save() calls
Introduce style_data_lookup_for_state() that does this.
2012-04-17 08:59:23 +02:00
Benjamin Otte
2179580c8e stylecontext: Pull all the animation code together
We now animate the core style information (see comment in
gtk_style_context_save()). A lot of widgets save + set custom style
classes/states during drawing and so can't be animated. It does work for
labels, menus and buttons though.
2012-04-17 08:59:23 +02:00
Benjamin Otte
60eff87d08 stylecontext: Shuffle around code
This has two goals:

1) Move invalidation code out of a nested if branch. Invalidation is
actually the most important thing this function does.

2) Have the changes bitmask available. It will needed for invalidate
calls to children later.
2012-04-17 08:59:22 +02:00
Benjamin Otte
42d2430498 stylecontext: Add style_info_set_data()
.. to take care of the refcounting properly.
2012-04-17 08:59:22 +02:00
Benjamin Otte
b8c72a0bdb stylecontext: Make StyleInfo keep the next pointer 2012-04-17 08:59:22 +02:00
Benjamin Otte
deefb64661 stylecontext: Make StyleData refcounted
This is needed for animations where we want to keep a custom StyleData
for animations.
2012-04-17 08:59:22 +02:00
Benjamin Otte
fe89e710ea stylecontext: Add public API to stop animations
... and use it.

Of course, there still are no animations, so we don't turn anything off
yet.
2012-04-17 08:59:22 +02:00
Benjamin Otte
a240808824 stylecontext: Add an animating framework
The design principles were:

- synchronized
If multiple style contexts are animating, they should all do an
animation step at the same time.

- degrades well
Even when there's thousands of style contexts all animating at the same
time, the animation steps don't starve the CPU. This is achieved by
making sure the timeout is really fast. It just sets a bunch of flags.

- no hidden bottlenecks
Turning animatability on or off on a style context is O(1).

So far it is unused.
2012-04-17 08:59:22 +02:00
Benjamin Otte
b6594d1ac9 stylecontext: Don't queue a resize when none is needed 2012-04-17 08:59:22 +02:00
Benjamin Otte
e2f89c0c6a stylecontext: Listen to the new changed signal 2012-04-17 08:59:21 +02:00
Benjamin Otte
29fbfcb8f5 stylecontext: Pass time to style_context_validate()
This way, we can ensure that every style context uses the same timestamp
for whatever they do.
2012-04-17 08:59:21 +02:00
Benjamin Otte
aaedc7b67f stylecontext: Compute if things changed before invalidating
This is only a small performance boost by itself, but it's necessary
for animations, so we need it.

Benchmark numbers for my Glade benchmark for interested people:
        GTK 3.4.0    last commit  this commit
Raleigh
  real  0m41.879s    0m10.176s    0m9.900s
  user  0m41.394s    0m9.895s     0m9.628s
  sys   0m0.111s     0m0.096s     0m0.102s

Adwaita                                        (*)
  real  0m51.049s    0m13.432s    0m14.848s    0m12.253s
  user  0m50.487s    0m13.034s    0m13.218s    0m11.927s
  sys   0m0.117s     0m0.151s     0m0.147s     0m0.107s

Ambiance (patched to not use private GTK APIs)
  real  0m52.167s    0m13.115s    0m13.117s    0m12.944s
  user  0m51.576s    0m12.739s    0m12.768s    0m12.651s
  sys   0m0.119s     0m0.137s     0m0.136s     0m0.118s

(*) Adwaita and unico currently use custom properties, and
_gtk_css_value_compare() for custom properties always returns FALSE,
which makes this optimization never trigger. So I modified
_gtk_css_value_compare() to return TRUE for these properties instead and
reran the benchmark. Those are the numbers.
2012-04-17 08:59:21 +02:00
Benjamin Otte
33f111a47c widget: Don't cache widget paths all the time
Add an internal API that allows GtkStyleContext to create a widget path
for the widget and with that bypassing gtk_widget_get_path() and that
  function caching the path.
2012-04-17 08:59:21 +02:00
Benjamin Otte
6ac754cdd1 stylecontext: Remove theming_engine cache variable
Instead, look up the variable upon use. This is more correct (for when
the engine changes due to save/restore() shenanigans.

And it removes code that doesn't use the standard code paths.
2012-04-17 08:59:21 +02:00
Benjamin Otte
3ddb104302 stylecontext: Split out a function 2012-04-17 08:59:20 +02:00
Benjamin Otte
0111b9d507 symboliccolor: Treat it as a CssValue
.. now that it is one.
2012-04-17 08:59:20 +02:00
Benjamin Otte
83be7e5dbd symboliccolor: Pass the current color to the resolve function
This way, we can resolve things like
  mix (currentColor, &otherColor);
and therefore parse currentColor as a regular color.
2012-04-17 08:59:19 +02:00
Benjamin Otte
04c5fdaca6 css: Remove old animation code
Deprecate public API where appropriate and make it no-ops.
Remove all calls to it.
Get rid of the 'transition' css property.

For now, this means spinners don't animate anymore.
2012-04-17 08:59:19 +02:00
Benjamin Otte
f785f7177c cssvalue: Add a custom value for repeats
In particular, that's background-repeat and border-image-repeat.

Also, fix up the border-image shorthand to allow any order.
2012-04-17 08:59:18 +02:00
Benjamin Otte
580b5e4a83 stylecontext: Don't queue_resize() all the time
When a parent style context exists, there's no need to queue_resize() on
the widget, because the parent widget will call
gtk_style_context_validate() on us and _then_ we can call queue_resize()
if we have to.
2012-04-17 08:59:17 +02:00
Benjamin Otte
a360e77a7b css: Remove _gtk_css_computed_values_get_value_by_name()
Now that we use an enum for the IDs, we don't need that function
anymore.
2012-04-17 08:59:16 +02:00
Benjamin Otte
31565139ba stylecontext: Convert _gtk_style_context_peek_property()
Take the property id instead of the name.
2012-04-17 08:59:15 +02:00
Benjamin Otte
40982eabbb stylecontext: Keep the main style data around until revalidation 2012-04-17 08:59:15 +02:00
Benjamin Otte
751187aa0c stylecontext: Keep per-styleinfo data
Instead of having one global data structure, keep it per style info.
This means that we can do special tricks on the "global" style data.
2012-04-17 08:59:14 +02:00
Benjamin Otte
a737adadf8 stylecontext: Make style_data_lookup() not take a state anymore
Instead, use the current state of the style context.
2012-04-17 08:59:14 +02:00
Benjamin Otte
58b6d492b8 cssvalue: Add a custom RGBA value
Note: custom CSS properties still use the default GtkCssValue and always
will.
So there is a difference in css values used between those, even though
they both carry a GdkRGBA payload.
2012-04-17 08:59:14 +02:00
Benjamin Otte
a33df2d1d6 cssvalue: Split number values into their own class 2012-04-17 08:59:13 +02:00
Benjamin Otte
5ac9ba714a styleproperty: Make _gtk_style_property_query() take a GValue
... and don't make it return a GtkCssValue. We want to use this for
compat with the old GValue APIs after all...
2012-04-17 08:59:11 +02:00
Benjamin Otte
d5a2392cc7 stylecontext: Don't clear cache when only state changes
This takes more memory, but changes to backdrop or active state are
quite expensive otherwise.
2012-04-17 08:59:11 +02:00
Benjamin Otte
585a1fae4f stylecontext: Really queue style changes
Instead of instantly applying a new style, just mark the context as
invalid. Only apply the new style at layout time.
2012-04-17 08:59:10 +02:00
Benjamin Otte
eb537b60f4 stylecontext: Optimize the common case of "style didn't change" 2012-04-17 08:59:10 +02:00
Benjamin Otte
198cf93f0f stylecontext: On failure, exit the loop, don't try again
Because we will fail again. And then we try again. And then we fail
again. Ad infinitum.
2012-04-17 08:59:09 +02:00
Benjamin Otte
15be680540 stylecontext: Invalidate when setting classes/state/regions
... and nobody has called style_context_save().
2012-04-17 08:59:09 +02:00
Benjamin Otte
44d49c900d stylecontext: Use _gtk_style_context_queue_invalidate() on self 2012-04-17 08:59:09 +02:00
Benjamin Otte
39ff874a11 stylecontext: Introduce _gtk_style_context_queue_invalidate()
This is for only queueing invalidations instead of doing a full
invalidation cycle.
2012-04-17 08:59:09 +02:00
Benjamin Otte
1a51ea3ea3 stylecontext: Keep track of children 2012-04-17 08:59:09 +02:00
Benjamin Otte
7f511f2b33 widget: Don't set widget path on style context
Instead, make the style context use the widget's path. Saves a bunch of
memory.
2012-04-17 08:59:09 +02:00
Benjamin Otte
e5ab48ac59 stylecontext: Notify widget directly of changes
This way, we don't need to g_signal_connect(), which saves a bunch of
memory and performance.
2012-04-17 08:59:08 +02:00
Benjamin Otte
1aa4a196dc stylecontext: Add setter for widget
... and actually set the widget on the style context. Note that this
function does not take a reference on the widget, which is a very good
reason to keep it private.
2012-04-17 08:59:08 +02:00
Benjamin Otte
a94b85d375 css: Make the style provider take a matcher as an input argument 2012-04-17 08:59:07 +02:00
Benjamin Otte
a2ded8b72a styleprovider: Add a custom object for a list of style providers
This way, we don't have to do magic inside GtkStyleContext, but have a
real API.
As a cute bonus, this object implements GtkStyleProvider itself. So we
can just pretend there's only one provider.
2012-04-17 08:59:07 +02:00
Benjamin Otte
015e3a768f stylecontext: Stop querying style providers for icon factories
Nobody implements this feature and I don't wanna maintain it. If it
turns out somebody is using it, we gotta invent something.
2012-04-17 08:59:07 +02:00
Benjamin Otte
461803e407 gtk: Get gtkwidgetpath.h includes out of the public headers
and include them in the C files instead.
2012-03-19 02:26:16 +01:00
Benjamin Otte
f9727ee1bf stylecontext: Get rid of unused parameter
It was always FALSE
2012-03-16 17:53:57 +01:00
Alexander Larsson
616cc5b96d Use GtkCssValue in symbolic color resolving
We now store the symbolic colors as a GtkCssValue which means that
we can reuse the color when resolving and storing the color in
the computed values in the style context.

Additionally we keep a last_resolved GtkCssValue cache in the
GtkSymbolicColor, and if resolving the color returns the same as
last time we reuse the old value. This further increases sharing
of Css Values.
2012-03-08 14:52:10 +01:00
Alexander Larsson
7603e6e473 css: Use GtkCssValues instead of GValue in the css machinery
Also, in places where we're computing a new CssValue based on an
old one, make sure that if nothing changes we're returning a reference
to the old one, rather than creating a new identical instance.
2012-03-08 11:03:57 +01:00
Benjamin Otte
7844e8089c types: Clean up gtkwidget.h includes
In particular gtksettings.h and gtkstylecontext.h needed to be included
in lots of places now.

Also, I order the includes alphabetically in a bunch of headers.
2012-03-03 19:45:03 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Paolo Borelli
f73ff748db Add a deprecation mark to draw_insertion_cursor
This function has been replaced with gtk_render_insertion_cursor, but we
forgot to mark it as deprecated.
2012-02-27 17:48:37 +01:00
Cosimo Cecchi
4e37d56d51 themingengine: move _gtk_theming_engine_set_context to private header
Where it belongs.
2012-02-14 16:36:56 -05:00
Benjamin Otte
a63ff72406 css: Convert border-radius to GtkCssNumber
We can do % now, wohoo!
2012-02-02 03:14:00 +01:00
Benjamin Otte
82c2dad178 themingengine: Add a private function to query lengths 2012-02-02 03:14:00 +01:00
Benjamin Otte
581cc59945 stylecontext: Don't unref animation description
We get it without a ref since 6962b49a99
2012-01-12 01:10:26 +01:00
Benjamin Otte
a815f10299 API: Add gtk_style_context_get_section()
This API allows querying the location where style properties were
defined. An example implementation will be committed soon.
2012-01-11 15:48:54 +01:00
Benjamin Otte
6962b49a99 css: Introduce GtkCssComputedValues
To be used for storing computed values. Is the replacement for
GtkStyleProperties, which is now legacy code.
2012-01-11 15:48:54 +01:00
Benjamin Otte
694a9114af stylecontext: Simplify even more code 2012-01-11 15:48:54 +01:00
Benjamin Otte
f27f8db2d8 stylecontext: Use our own color resolve function
... instead of using the StyleProperties.
2012-01-11 15:48:54 +01:00
Benjamin Otte
abcae0cea4 stylecontext: Simplify function
Also, make it easier to port to what I want to do next. ;)
2012-01-11 15:48:54 +01:00
Benjamin Otte
aa98aca45f styleproperties: Remove color set function
Now that we do resolvage with the style context directly, this is no
longer needed.
2012-01-11 15:48:53 +01:00
Matthias Clasen
2dc10600ea Fix doc markup 2012-01-09 14:13:44 -05:00
Benjamin Otte
2c5a8420b5 Set border-width to 0 in compute function
This reverts commit c276f53796 and
implements the same feature using the compute function.
A nice side effect is that gtk_style_property_get_border() and
gtk_style_property_get("border") to the same thing now.
2012-01-09 18:37:58 +01:00
Benjamin Otte
84d294ee7f stylecontext: NMake safe to call into during lookup
When resolving a lookup, we may want to query the current style context,
as in the next patch. This works now.
2012-01-09 18:37:57 +01:00
Benjamin Otte
2c8ef919ae stylecontext: Add _gtk_style_context_peek_property()
This allows peeking at the computed value for a property. This is useful
for looking at GtkCssImage.
2012-01-09 18:37:56 +01:00
Benjamin Otte
9181282d88 style: Remove GtkStylePropertyContext again
We need to solve this differently. I have no idea yet how, but I'll
invent something later.

This only affects win32 theming and that's broken anyway.
2012-01-09 18:37:56 +01:00
Benjamin Otte
4576653006 stylecontext: Export _gtk_style_context_resolve_color()
We'll need it soon.
2012-01-09 18:37:55 +01:00
Benjamin Otte
f2dc63cc6a css: Pass the real context to the CSS lookup
This will be necessary soon.
2012-01-09 18:37:55 +01:00
Benjamin Otte
242893a031 css: Pass the parent context to _gtk_css_lookup_resolve()
This way, we can resolve inherit properties.
2012-01-09 18:37:50 +01:00
Benjamin Otte
b50d2b74d7 API: Add GtkStyleContext::parent
We need this for proper support of CSS inherit.
2012-01-09 18:37:50 +01:00
Benjamin Otte
ba5e7012b1 css: Redo StyleProvider interface
We now use the GtkStleProviderPrivate interface, which hopefully is
faster and more conformant to CSS. Long term, it definitely should be
both.

I would have liked to split this up into multiple commits, but couldn't
find a way.
2012-01-09 18:37:50 +01:00
Benjamin Otte
899a381d31 stylecontext: Separate properties by states
We don't want to mix states the wrong way. And the current approach does
that.
2012-01-09 18:37:49 +01:00
Benjamin Otte
a488d2184a stylecontext: Pass state to style data lookup function 2012-01-09 18:37:49 +01:00
Javier Jardón
d005b01319 gtk/*: Use g_list_free_full() convenience function 2012-01-05 04:22:43 +01:00
Cosimo Cecchi
d80ff7b5f1 stylecontext: always add the ARROW style class when rendering an arrow
When gtk_render_arrow() is called, always add an ARROW style class to
the GtkStyleContext before rendering, so themes can specify a different
color for it.

https://bugzilla.gnome.org/show_bug.cgi?id=665420
2011-12-05 09:37:21 -05:00
Paolo Borelli
2ef5844bac Introduce gtk_render_insertion_cursor
The new function provides an API that takes the PangoLayout and index
as input params, this way it handles strong and weak cursors internally
factoring out all code duplicated in the widgets that need to render
cursors.

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:39 +01:00
Alexander Larsson
c276f53796 Make computed value of border-width 0 if border-style none
From the css docs at http://www.w3.org/TR/CSS2/box.html:

    8.5.1 Border width: 'border-top-width', 'border-right-width', 'border-bottom-width',
    'border-left-width', and 'border-width'

    Computed value:  	absolute length; '0' if the border style is 'none' or 'hidden'
2011-11-25 15:36:08 +01:00
Alexander Larsson
c09148ca09 Add GtkStylePropertyContext and use it in when getting style properties
At the toplevel we have _gtk_theming_engine_get, which lets us pass
in a property context with (atm) the size to get the property for.
Then there is a lot of plumbing to push this down into the lower
layers of the style property code until finally hitting
the property resolvers.

I need this because I will be adding a property resolver for win32
theme parts, and they render differently depending on the size
(i.e. they don't scale linearly). The idea is that the code
to get the background properties will pass in the final size
and we will resolve the theme part specification to that particular
size.

If the old non-context calls are used we just hardcode a size
of 100x100.
2011-11-17 12:27:22 +01:00
Matthias Clasen
98db3dd5dd Move gtk_draw_insertion_cursor out of gtkstyle.[hc]
This function does not use GtkStyle at all and is not deprecated.
2011-11-01 23:51:18 -04:00
Cosimo Cecchi
8d3f7e3a4a stylecontext: add style classes for top/bottom/right/left areas
This is useful to e.g. theme notebook tabs differently according to
their position directly from the CSS sheet.

GtkNotebook support in a separate commit.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Matthias Clasen
21275a1636 Correct the documentation of gtk_render_arrow() x,y arguments
As pointed out in bug 655631, these are the origin, not
the center of the area.
2011-09-04 23:09:57 -04:00
Cosimo Cecchi
7e22b46c1f combobox: add a "combobox-entry" style class for comboboxes with entries
This way themes can use GtkComboBox.combobox-entry to match that
specific case, and GtkComboBox.combobox-entry .button to match the
button/arrow side of the widget.
2011-08-09 16:08:00 +02:00
Benjamin Otte
a2dbfaf43d stylecontext: #include <math.h> when using math functions 2011-07-05 16:08:10 -04:00
Matthias Clasen
1164ceb4fc GtkStyleContext: add some aux. a11y api
This function translates the fg/bg color into atk attributes.
2011-07-05 16:08:07 -04:00
Matthias Clasen
c2449763ce Fix up docs for predefined style classes.
The table was incomplete and out of date. Instead, just
put a list of links in that place, and move all the extra
documentation to the macros. Bug 653785
2011-06-30 19:18:26 -04:00
Matthias Clasen
0725e417c5 Fix css syntax in example 2011-06-18 11:11:47 -04:00
Benjamin Otte
0d253b67f4 css: Make font property a shorthand
... and implement the CSS font properties:
- font-size
- font-style
- font-family
- font-weight
- font-variant

This is the second try at this. The first was backed out previously due
to bugginess. Let's hope this one survives a bit longer.

Also makes the font-family CSS test work again.
2011-06-15 12:52:53 +02:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Cosimo Cecchi
514e77581a stylecontext: add gtk_render_icon() 2011-06-09 23:17:09 +02:00
Benjamin Otte
2e6bb2a0c9 Revert "css: Make font property a shorthand"
The hack in gtk_style_context_get_font() was causing segfaults in
combobox code. This is not acceptable and I'm not awake enough to fix
it, so just reverting until it's fixed sanely is easiest.

This reverts commit cf6bfbdb17.
2011-06-02 02:31:44 +02:00
Benjamin Otte
abeaad6166 stylecontext: Implement the color getters using the regular API
Has two benefits:
1) Less code
2) I can refactor things
2011-06-02 02:03:52 +02:00
Benjamin Otte
cf6bfbdb17 css: Make font property a shorthand
... and implement the CSS font properties:
- font-size
- font-style
- font-family
- font-weight
- font-variant
2011-06-02 02:03:52 +02:00
Benjamin Otte
940cdb4a7f stylecontext: Don't crash when colors are "none"
Instead, use their default value (pink).
2011-06-02 02:03:51 +02:00
Benjamin Otte
21236cf270 style: Make margin a shorthand
... and add the real properties:
- margin-top
- margin-left
- margin-bottom
- margin-right
2011-05-22 05:56:12 +02:00
Benjamin Otte
a35aa96149 style: Make padding a shorthand
... and add the real properties:
- padding-top
- padding-left
- padding-bottom
- padding-right
2011-05-22 05:56:12 +02:00
Benjamin Otte
f5c7cefcca style: Convert border-width to a shorthand
Add the corresponding properties it refers to, too:
- border-top-width
- border-left-width
- border-bottom-width
- border-right-width
2011-05-22 05:56:11 +02:00
Benjamin Otte
5f5cc79623 styleproperties: Adapt _gtk_style_properties_peek_property()
Optionally return the GtkStyleProperty that was looked up. This feature
isn't used yet, but will soon be.
2011-05-21 22:49:43 +02:00
Matthias Clasen
7629ee7ad0 GtkStyleContextPrivate: Improve struct packing 2011-04-12 12:45:51 -04:00
Benjamin Otte
3f491f7157 style: Move private function into private header
The function wasn't exported, so everybody using it would have gotten
linking failures.
2011-03-17 11:59:17 +01:00
Ignacio Casal Quinteiro
0a03e81224 Fix conversion from GdkColor to GdkRGBA 2011-03-06 11:17:06 +01:00
Matthias Clasen
9707d8a3e6 Don't assert on zero width/height in render functions
We can just silently ignore those rendering calls.
https://bugzilla.gnome.org/show_bug.cgi?id=643041
2011-02-28 07:52:59 -05:00
Murray Cumming
8d54fa7102 More tiny documentation typo fixes. 2011-02-23 11:09:20 +01:00
Matthias Clasen
f04504ac94 Allow custom icon size in gtk_render_icon_pixbuf()
Pointed out in bug 642213.
2011-02-14 13:22:28 -05:00
Benjamin Otte
ccc3679a62 stylecontext: Use the common approach for priate pointers
Has two advantages:
1) consistency
2) "print *context->priv" actually works in gdb
2011-02-11 23:21:11 +01:00
Carlos Garnacho
15fdf90265 doc: Add a note about prioritization of GtkStyleProviders
It was unclear in the docs what happened if
gtk_style_context_add_provider() and
gtk_style_context_add_provider_for_screen()
were used with the same priority.
2011-02-08 04:17:56 +01:00
Matthias Clasen
208974636f Set the correct initial value for the direction property 2011-02-07 20:36:46 -05:00
Carlos Garnacho
2be692687f Fix color style properties lookup when the color resolution fails
The cached GValue ended up with a GtkSymbolicColor type, so
the contained value was bogus. Noticed by Mitch.
2011-02-07 19:56:17 +01:00
Carlos Garnacho
217d3fd796 GtkStyleContext is meant to have a GdkScreen
It is used to get the default providers, without them
the style context can't do much. A check for NULL screen
is done before any sensitive call to
gtk_style_context_set_screen(), in the hope that any widget
will open the display before doing anything related to
styling. Fixes bug #641429, reported by Bastien Nocera.
2011-02-06 11:21:42 +01:00
Matthias Clasen
4dc9b294d8 Don't assume a screen exists before realize()
Fix for https://bugzilla.gnome.org/show_bug.cgi?id=641429
2011-02-04 22:03:11 -05:00
Paolo Borelli
001697a22a Move the get_cursor_color in GtkStyleContext
Move the private get_cursor_color method belongs to StyleContext. Change
the api so that retrieving both primary and secondary color is possible.
I left the method private for now, though it should probably be public
as all the other getters.
2011-01-29 13:13:42 +01:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Matthias Clasen
a12dad75a2 Split out private style context api into a private header 2011-01-23 18:29:28 -05:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky
3c8fc21e9b [GI] Fixes of existing incorrect annotations 2011-01-20 13:56:06 +01:00
Carlos Garnacho
0b7496558d Make GtkCssProvider deal with widget types not being in plain CamelCase
Fixes bug #Bug 639754, reported by Kjell Ahlstedt. gtkmm doesn't
use plain CamelCase for its widget type names, so in order to
distinguish widget type names from regions in the CSS parser,
the following checks are now done:

* if it contains an uppercase letter -> widget class (that should
  also work for gtkmm)

* if it's a string compound by lowercase letters and '-' -> it's
  a region, checks have been added in gtk_style_context_add_region()
  and gtk_widget_path_iter_add_region() to ensure this.
2011-01-19 04:28:49 +01:00
Carlos Garnacho
f482d4dc89 Ensure harder a GtkStyleContext has a theming engine anytime 2011-01-17 04:43:42 +01:00
Matthias Clasen
867dc0bd0d Avoid a critical warning during tab DND
https://bugzilla.gnome.org/show_bug.cgi?id=639380
2011-01-14 21:15:06 -05:00
Benjamin Otte
2b0b08a861 stylecontext: Protect the cairo contexts with cairo_save/cairo_restore()
We don't want theme engines to mess up the context we are currently
drawing with.
2011-01-12 11:40:09 +01:00
Milan Bouchet-Valat
44da5a0094 Improve docs about GtkStyleContext padding/border/margin
GTK_STYLE_PROPERTY_BORDER_WIDTH is of style GtkBorder, not gint.

Also make it clearer what the definition and ordering of these 3
properties is. Reorder them in the header to be more logical.
2011-01-11 12:28:54 +01:00
Carlos Garnacho
d5b0ccacce GtkStyleContext: Do not cancel possibly unstarted transitions
It might happen that this overcautious check is done on an animation
that didn't have time to gather invalidation rectangles.
2011-01-10 23:52:21 +01:00
Carlos Garnacho
de36dda925 Add gtk_style_context_scroll_animations()
This function will be needed in widgets like GtkTreeView,
since gdk_window_scroll() doesn't trigger the usual
mechanisms to update the invalidation area, this function
is needed together with it.
2011-01-10 20:49:41 +01:00
Carlos Garnacho
e6277d3b82 Add gtk_style_context_cancel_animations()
This function takes a region ID and cancels all animations
on or beneath that region (as in push/pop_animatable_region).

First user of this is GtkWidget itself, so unmapped widgets
have looping animations cancelled. Fixes bug #638119, reported
by Jesse van den Kieboom.
2011-01-10 03:50:01 +01:00
Carlos Garnacho
2bd221d215 Bug 637910 - GtkSpinner - does not animate
Fix widget-to-window coordinates translation in the
style context animation code.
2010-12-24 19:37:49 +01:00
Carlos Garnacho
ac0353e08a Make gtk_style_context_get_* functions more robust
Even if the default CSS contains values for these, handle non-existing
values as queries might happen on an incomplete style.
2010-12-21 14:44:49 +01:00
Cosimo Cecchi
b792a31995 widgetpath: allow GTypes non-derived from GTK_TYPE_WIDGET
This makes things like GtkCellRenderer or GtkNumerableIcon more easily
themeable.

https://bugzilla.gnome.org/show_bug.cgi?id=637169
2010-12-17 18:30:57 +01:00
Diego Escalante Urrelo
02f92f29d5 gtkstylecontext: fix typos in annotations
Fixes Bug #637256
2010-12-15 00:46:25 +00:00
Carlos Garnacho
99f59d8266 Fix coalescing of state animation areas for multiple window widgets.
Coordinates needed to be translated relative to the window position
in within the widget.
2010-12-13 22:31:27 +01:00
Paolo Borelli
f285a84bd6 Add convenience function for the font description. 2010-12-13 22:31:27 +01:00
Benjamin Otte
3070d6e3d5 Revert "docs: Reinstate pixbufs section in GDK docs"
I committed my whole working tee instead of just one file. Ooops.
This reverts commit ded14b2562.
2010-12-09 23:55:33 +01:00
Benjamin Otte
ded14b2562 docs: Reinstate pixbufs section in GDK docs
It was accidentally removed in 0775b0a858
2010-12-09 11:14:21 +01:00
Carlos Garnacho
4cca7554b8 GtkStyleContext: warn on meaningless coords in gtk_render_* calls 2010-12-05 20:19:55 +01:00
Matthias Clasen
d5df33c75f Fix abi check after recent merges 2010-12-05 12:18:30 -05:00
Carlos Garcia Campos
f261d56da3 GtkStyleContext: invalidate icon caches when resetting widgets 2010-12-04 15:39:56 +01:00
Carlos Garnacho
bacb7906f2 Add helper API for getting colors/borders in GtkStyleContext/GtkThemingEngine 2010-12-04 15:39:55 +01:00
Carlos Garnacho
066f35bf28 Parse user CSS from $XDG_CONFIG_HOME/gtk-3.0/gtk.css 2010-12-04 15:39:53 +01:00
Carlos Garnacho
297fa7a3dd GtkStyleProvider: Add GtkStateFlags parameter to get_style_property().
Widget style properties can now have different values depending on the
current state.
2010-12-04 15:39:51 +01:00
Carlos Garnacho
2ca905db5e GtkStyleContext: Handle directionality when picking next provider. 2010-12-04 15:39:50 +01:00
Carlos Garcia Campos
4aaf193602 docs: gtk_style_context_get_screen() always returns a valid screen 2010-12-04 15:39:49 +01:00
Carlos Garcia Campos
7a5a622998 Check screen really changed before notifying it and invalidating the context 2010-12-04 15:39:49 +01:00
Carlos Garcia Campos
7abf76fbc1 Initialize screen of GtkStyleContext to default screen 2010-12-04 15:39:48 +01:00
Matthias Clasen
ca143b1303 Add list of classes and regions to the docs 2010-12-04 15:39:48 +01:00
Matthias Clasen
e598f17871 Some header cleanups
Move GtkGradient to their own files, also move GtkBorder out of
gtkstyle.h, so that header can be all deprecated.
2010-12-04 15:39:47 +01:00
Carlos Garnacho
62e9188ff3 GtkStyleContext: store layout extents for animation purposes. 2010-12-04 15:39:43 +01:00
Carlos Garnacho
818aca5aee GtkStyleContext: Only allow looping transitions for states being turned on. 2010-12-04 15:39:43 +01:00
Carlos Garnacho
ad6da0cdb8 GtkStyleContext: Stop animations if the window is gone. 2010-12-04 15:39:43 +01:00
Matthias Clasen
0f98b15090 Add illustration to gtk_render_handle docs 2010-12-04 15:39:42 +01:00
Matthias Clasen
3ddee2561b Small doc addition 2010-12-04 15:39:42 +01:00
Matthias Clasen
d1f1af202b Add a frame-gap illustration 2010-12-04 15:39:42 +01:00
Carlos Garnacho
037c982824 GtkStyleContext: Handle empty areas when coalescing invalidation regions. 2010-12-04 15:39:41 +01:00
Matthias Clasen
e57e0e978d Illustrate extension rendering 2010-12-04 15:39:39 +01:00