Commit Graph

82 Commits

Author SHA1 Message Date
Matthias Clasen
4e778d7371 Fix a typo 2010-12-04 15:39:14 +01:00
Carlos Garnacho
c9dc09e980 GtkStyleProvider: Pass a GParamSpec in get_style_property().
This is so we can know the owner type of the property, and matching
with the stored strings in GtkCssProvider is direct.
2010-12-04 15:39:13 +01:00
Carlos Garnacho
b613f1f1f2 GtkStyleContext: Also use screen providers for widget style properties. 2010-12-04 15:39:13 +01:00
Carlos Garnacho
bcf81a0e23 Handle looping transition animations. 2010-12-04 15:39:05 +01:00
Carlos Garnacho
c57fdf4c75 GtkStyleContext: Resolve symbolic colors for widget style properties. 2010-12-04 15:39:04 +01:00
Carlos Garnacho
1487b34679 Remove GTK_STATE_LAST.
It didn't turn out to be that useful, nor widely used.
2010-12-04 15:38:56 +01:00
Carlos Garnacho
3f12fc2bd8 GtkStyleContext: Add gtk_style_context_set_background().
This function replaces gtk_style_set_background().
2010-12-04 15:38:54 +01:00
Carlos Garnacho
661a13fe4d GtkStyleContext: Fix check for GtkIconSize in render_icon_pixbuf(). 2010-12-04 15:38:46 +01:00
Carlos Garnacho
405f2f306a GtkStyleContext: restore widget state too in restore(). 2010-12-04 15:38:45 +01:00
Carlos Garnacho
a23863211b GtkStyleContext: Add gtk_render_icon_pixbuf()
This function is similar to gtk_style_render_icon(), which is now
implemented on top of this one.
2010-12-04 15:38:38 +01:00
Carlos Garnacho
80e74d79bb GtkStyleContext: Fix merging of local and global providers. 2010-12-04 15:38:35 +01:00
Carlos Garnacho
2efa2947be Document gtk_render_* functions. 2010-12-04 15:38:34 +01:00
Carlos Garnacho
ebf5bd390f Add gtk_render_activity()
This method will render progress bars and spinners, these should
handle active and inconsistent states' animation progress in order
to perform animations.
2010-12-04 15:38:33 +01:00
Carlos Garnacho
4acc20abc1 s/GtkStyleSet/GtkStyleProperties/
The former name had oddities such as gtk_style_set_set() and such,
so the new name is nicer in that regard and not much longer.
2010-12-04 15:38:29 +01:00
Carlos Garnacho
4e02218f52 Use GdkRGBA all around in GtkStyleContext. 2010-12-04 15:38:25 +01:00
Carlos Garnacho
c9a3da5025 GtkStyleContext: s/set/add/ and s/unset/remove/ for classes/regions.
Several classes and regions may be set to GtkStyleContext, so rename
the functions to be more intuitive.
2010-12-04 15:38:24 +01:00
Carlos Garnacho
d0f681e898 GtkStyleContext: Add gtk_style_context_new(). 2010-12-04 15:38:22 +01:00
Carlos Garnacho
68bfb94f69 Change semantics of the methods to check whether an animation is running.
It actually messed up with the state being actually set, and having a
transition animation running for it. Now this dichotomy is removed, and
gtk_style_context_state_is_running() only checks whether an animation is
running, leaving state checking to flags & GTK_STATE_FLAG_*.
2010-12-04 15:38:22 +01:00
Carlos Garnacho
96c16e246c GtkStyleContext: Actually store region ID when starting an animation. 2010-12-04 15:38:21 +01:00
Carlos Garnacho
a79626b7fb Add theming docs
Both API and file format is documented, there's still missing
a migration doc though.
2010-12-04 15:38:21 +01:00
Carlos Garnacho
59b0fa8133 Remove GtkOrientation parameter from gtk_render_handle().
The case for paned can be guessed out from the height and width,
for handlebox the orientation parameter doesn't make much sense,
and this way it could also be used for resize grips.
2010-12-04 15:38:21 +01:00
Carlos Garnacho
5bbab9872d GtkStyleContext: Cache style properties accross class/region changes. 2010-12-04 15:38:19 +01:00
Carlos Garnacho
88b78953b6 GtkContainer: Add method to get the GtkWidgetPath for a child.
This is now used throughout in order to have the full path for a given widget,
including intermediate named regions, the default implementation just returns
the GtkContainer's path copy, no intermediate regions between.
2010-12-04 15:38:19 +01:00
Carlos Garnacho
c575733eda GtkStyleContext: Fix animation framework to work with the new draw() semantics.
Invalidation region coalescing now happens recursively as draw() runs, and the
widget's x/y as now drawing coordinates are 0,0 based.
2010-12-04 15:38:18 +01:00
Carlos Garnacho
7583f31609 GtkStyleContext: Store animation region for a bunch of paint operations. 2010-12-04 15:38:17 +01:00
Carlos Garnacho
fecc079087 GtkStyleContext: Invalidate whole window if no invalidation region is obtained. 2010-12-04 15:38:17 +01:00
Carlos Garnacho
ac73a8f7a8 GtkStyleContext: Add gtk_style_context_reset_widgets()
This function recalculates the style for all widgets on a screen.
2010-12-04 15:38:15 +01:00
Carlos Garnacho
1e66155aec GtkStyleContext: invalidate context when setting the screen 2010-12-04 15:38:14 +01:00
Carlos Garnacho
49ac732a18 GtkStyleContext: Add gtk_style_context_[add|remove]_provider_for_screen()
These functions allow per-screen style providers. also, the changed signal
will be emitted whenever a style context changes.
2010-12-04 15:38:14 +01:00
Carlos Garnacho
9f84e101bf GtkStyleContext: Add gtk_style_context_invalidate().
This function will regenerate all styling information.
2010-12-04 15:38:12 +01:00
Carlos Garnacho
f058359182 Replace GdkRegion and GdkRectangle with their cairo counterparts. 2010-12-04 15:38:09 +01:00
Carlos Garnacho
c9d626523d Remove gtkalias from style context code. 2010-12-04 15:38:09 +01:00
Carlos Garnacho
0ce649e965 Plug a bunch of leaks. 2010-12-04 15:38:09 +01:00
Carlos Garnacho
61a0544b8b GtkStyleContext: Add animation machinery.
Animation regions are confined through gtk_style_context_[push|pop]_animatable_region,
anything that's painted between these calls will be invalidated if an animation starts
for any of the regions in the stack.

gtk_style_context_notify_state_change() may be called from widgets to indicate a
change for a given GtkStateType, in that case an animation will be started if there
is an animation description for the widget/state.
2010-12-04 15:37:38 +01:00
Carlos Garnacho
4781f94de2 Move all theming stack to use GtkStateFlags.
This support goes from the theming engines, which are able to retrieve
style for different combined states to the CSS provider, where several
state pseudo-classes may be specified, such as:

GtkButton:active:prelight {}
2010-12-04 15:37:37 +01:00
Carlos Garnacho
2c7c4d9a51 GtkStyleContext: Return insertion position if not found when matching classes/regions 2010-12-04 15:37:37 +01:00
Carlos Garnacho
27c91622f6 Set classes info in GtkWidgetPath. 2010-12-04 15:37:36 +01:00
Carlos Garnacho
2dabf20cfd GtkStyleContext: Add gtk_style_context_list_classes(). 2010-12-04 15:37:36 +01:00
Carlos Garnacho
a3637ec60d s/child class/region/ everywhere.
"Child class" is an invented term anyway, and it conceptually defines
identifiable regions in widgets.
2010-12-04 15:37:35 +01:00
Carlos Garnacho
198d75bea5 GtkStyleContext: Rename internal struct.
GtkStyleRegion has been renamed to GtkStyleInfo, as it doesn't really
have much to do with regions itself, the information it contains does.
This struct is used in save/restore.
2010-12-04 15:37:35 +01:00
Carlos Garnacho
9108739c9b GtkStyleContext: Add gtk_style_context_[gs]et_junction_sides().
These functions will help widgets specify how does one element being painted
relate to other contiguous elements.
2010-12-04 15:37:31 +01:00
Carlos Garnacho
143c4b3b60 GtkStyleContext: Add gtk_style_context_lookup_color().
gtk_style_lookup_color() now uses this function internally.
2010-12-04 15:37:30 +01:00
Carlos Garnacho
dc216ffb00 GtkStyleContext: Add gtk_style_context_[gs]et_direction(). 2010-12-04 15:37:27 +01:00
Carlos Garnacho
c712480912 GtkStyleContext: Add varargs functions for getting widget style properties. 2010-12-04 15:37:23 +01:00
Carlos Garnacho
5f2e8bc0d1 GtkStyleContext: Ensure style rebuilds after adding/removing classes. 2010-12-04 15:37:23 +01:00
Carlos Garnacho
7748b1d2de GtkStyleContext: ensure class lookup return the correct insertion position if not found. 2010-12-04 15:37:22 +01:00
Carlos Garnacho
27f5257d49 GtkStyleContext: Don crash on empty class sets. 2010-12-04 15:37:19 +01:00
Carlos Garnacho
475f0fc266 GtkStyleContext: Add gtk_style_context_save/restore().
This API will be used to have savepoints when adding and removing
style classes information.
2010-12-04 15:37:18 +01:00
Carlos Garnacho
758c3e18cc GtkStyleContext: Add gtk_style_context_[gs]et_screen() 2010-12-04 15:37:17 +01:00
Carlos Garnacho
41650933fd GtkStyleContext: Add priv pointer to object struct. 2010-12-04 15:37:17 +01:00