Commit Graph

197 Commits

Author SHA1 Message Date
Owen W. Taylor
aed6375a2d Move StIconType to st-types.h from st-texture-cache.h
StIconType will be used by a new StIcon class, so move it to the
header file of common enumerations. Including st-types.h which had
the St single-include check revealed that st-texture-cache.h didn't
have that check and several places were including that directly.
Fix that up.

https://bugzilla.gnome.org/show_bug.cgi?id=633865
2010-11-12 17:36:25 -05:00
Owen W. Taylor
a9a8b1ec6a StIcon: Remove content-image capability
The ability to set a "content image" on an icon relies on the ability
to have custom theme properties of a "border image" (9-slice) type.
We don't have this, and the capability of a bordered image specified
by the theme can be achieved more naturally with standard CSS facilities.

https://bugzilla.gnome.org/show_bug.cgi?id=633865
2010-11-12 17:36:25 -05:00
Owen W. Taylor
b0e713b775 StIcon: use g_strcmp0()
Simplify a check for an unchanged string with g_strcmp0().

https://bugzilla.gnome.org/show_bug.cgi?id=633865
2010-11-12 17:36:25 -05:00
Owen W. Taylor
32fc25a3ac StIcon: Adopt copyright notice to standard
- Replace FSF address with URL
- Remove explicit Authors: list

https://bugzilla.gnome.org/show_bug.cgi?id=633865
2010-11-12 17:36:25 -05:00
Owen W. Taylor
839492f15b Import MxIcon as StIcon
https://bugzilla.gnome.org/show_bug.cgi?id=633865
2010-11-12 17:36:25 -05:00
Owen W. Taylor
86f3a637f1 st_texture_cache_load_from_raw: Don't pointlessly include size in cache key
The texture is independent of the size that the user passed in; so there
is no obvious reason to include the texture in the cache key.

https://bugzilla.gnome.org/show_bug.cgi?id=633595
2010-11-12 17:34:16 -05:00
Owen W. Taylor
ce72aaf008 Fix up copyright and license notices for St
* Make sure all source files have a LGPL copyright header, and standardize
  non-standard variations of the header to a common form.

* Check and update all copyright notices.

* Remove 'Written By:' lines. They are universally incomplete and
  typically indicate only who started a particular file.

https://bugzilla.gnome.org/show_bug.cgi?id=634550
2010-11-12 15:23:28 -05:00
Owen W. Taylor
b856e2990b StScrollView: null out the right variable in dispose
We weren't properly nulling out the vadjustment variable in dispose()
which meant in the case of explicit-destroy followed some time later
by garbage collection and disposing the actor again we would crash.
2010-11-11 08:41:07 -05:00
Owen W. Taylor
f25e6916bd Remove unused StSubtexture 2010-11-10 22:00:11 -05:00
Florian Müllner
ad624d546f st-texture-cache: Fix include
The file gnome-desktop-thumbnail.h was moved from libgnomeui to
libgnome-desktop.

https://bugzilla.gnome.org/show_bug.cgi?id=634555
2010-11-11 01:42:30 +01:00
Dan Winship
35f806df4e St: add keyboard support to StClickable and StButton
Allow triggering clicks with space/return

https://bugzilla.gnome.org/show_bug.cgi?id=633853
2010-11-08 13:06:41 -05:00
Dan Winship
4f1f226828 StButton: fix hover and grab tracking
Use StWidget:track-hover rather than doing it ourselves. Don't assume
that hover is always TRUE after an enter_event or FALSE after a
leave_event, since we have a pointer grab and will be getting other
actors' events.

Don't ungrab the pointer when it leaves the button, since that
destroys the whole point of getting a grab in the first place.

Only consider the button to have been clicked when it has both grab
(meaning the mouse was pressed over the button) and hover (meaning the
mouse was released over the button).

Also remove the virtual pressed/released methods, which weren't being
used anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=633853
2010-11-08 13:06:41 -05:00
Dan Winship
4c6dd64e87 StButton: fix code style
https://bugzilla.gnome.org/show_bug.cgi?id=633853
2010-11-08 13:06:41 -05:00
Dan Winship
5a83ef8325 St: add StFocusManager, to handle keyboard navigation
StFocusManager allows setting up "focus groups" in which it will
automatically handle navigation between can_focus widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=621671
2010-10-29 08:38:05 -04:00
Dan Winship
d2b968a7df St: add keyboard focus navigation support
Add StWidget:can-focus, st_widget_navigate_focus(), and
st_container_get_focus_chain(), and implement as needed to allow
keyboard navigation of widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=621671
2010-10-29 08:38:05 -04:00
Neil Roberts
8872913665 StThemeNode: Fix the confusion between border and background
In d66e7dd49 I got confused between border_texture and
background_texture. The background_texture was being created as normal
but in the one place that it gets drawn I accidentally made it use the
border_material instead. This patch makes it create a
background_material similar to the border_material and uses it to
paint.
2010-10-28 21:51:13 +01:00
Neil Roberts
d66e7dd49e st-theme-node-drawing: Don't create lots of one-shot materials
A few places in st-theme-node-drawing create one-shot material, paint
with it and then free it. This is suboptimal with current Cogl because
it will end up compiling an ARBfp program just for that single paint
and then it will throw it away when the material is destroyed.

There is a new function in st-private.c called
_st_create_texture_material. This creates a simple material for a
texture based on a common parent material that points to a dummy
texture. Any materials created with this function are likely to be
able to share the same program unless the material is further modified
to contain a different number of layers. It would be possible to use
cogl_set_source_texture for this instead except that it's not possible
to modify the material's color in that case so we couldn't render the
texture with opacity.

The corner textures are now stored as a handle to a material that
references the texture rather than storing the texure directly. There
is also a separate border_material member which always points to
border_texture as the only layer.

https://bugzilla.gnome.org/show_bug.cgi?id=633340
2010-10-28 20:02:41 +01:00
Giovanni Campagna
a915af4b30 Avoid warnings on leave-event for widgets tracking hover
ClutterCrossingEvent->related can be NULL if the pointer is not under
any actor. Unconditionally set hover to FALSE in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=633028
2010-10-25 15:18:07 +02:00
Dan Winship
8886b7433c StThemeNode: simplify use of get_color/get_double/get_length
Although within St itself there are situations where the semantics of
these functions (return TRUE or FALSE and return the actual value in
an out parameter) is useful, it's mostly just annoying at the
application level, where you generally know that the CSS property is
going to specified, and there is no especially sane fallback if it's
not.

So rename the current methods to lookup_color, lookup_double, and
lookup_length, and add new get_color, get_double, and get_length
methods that don't take an "inherit" parameter, and return their
values directly. (Well, except for get_color, due to the lack of (out
caller-allocates) in gjs.)

And update the code to use either the old or new methods as appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=632590
2010-10-21 15:02:33 -04:00
Dan Winship
33e955770c st_theme_node_get_color: fix inheritance
This wasn't actually recursing if you passed the "inherit" flag

https://bugzilla.gnome.org/show_bug.cgi?id=632590
2010-10-21 09:13:30 -04:00
Ray Strode
a5d4abda00 st-theme: ref items in custom stylesheets list
st-theme stores some loaded stylesheets in a custom
stylesheets list.  When removing items from this list
it unrefs them, but when adding items to the list it
neglects to ref them.  This means that under certain
circumstances the list will contain items that have
already been freed.

https://bugzilla.gnome.org/show_bug.cgi?id=632477
2010-10-18 15:52:38 -04:00
Florian Müllner
42c736614c st-drawing-area: Avoid unnecessary repaints
StDrawingArea uses the member variable needs_repaint to keep track
of whether it needs repainting. The variable is set to TRUE correctly,
e.g. on allocation or style changes - alas, it is never set to FALSE,
resulting in the area being repainted continuously.

https://bugzilla.gnome.org/show_bug.cgi?id=632197
2010-10-15 12:31:34 +02:00
Florian Müllner
3d2d396c09 st-theme-node: Support non-uniform border-radii
Non-uniform border-radii are already supported when using a gradient
background, this patch adds support for solid colors as well.

The currently applied technique of using corner textures and filling
the remaining area with rectangles is extended, so that each corner is
padded with rectangles to the size of the largest corner.

Add border-radius.js to test cases, to test non-uniform border-radii
with both solid color and gradient backgrounds.

https://bugzilla.gnome.org/show_bug.cgi?id=631091
2010-10-05 00:18:49 +02:00
Adel Gadllah
1413fa6e03 Revert "StThemeNodeTransition: work around Cogl bug"
This reverts commit 8f0f159960.

Cogl has been fixed, so it is no longer needed.

https://bugzilla.gnome.org/show_bug.cgi?id=629616
2010-09-24 17:31:41 +02:00
Dan Winship
a6e4bab990 Add symbolic icons to TextureCache's load_icon_name()
Icons can be loaded as St.Icon.SYMBOLIC, FULLCOLOR, APPLICATION or
DOCUMENT. The first will look for a symbolic equivalent, the second
looks for a full-color version (and does fallback, eg, from
"drive-harddisk-usb" to "drive-harddisk"). APPLICATION and DOCUMENT do
full-color icons without fallback (as specified by the icon spec).

And update various callers to use the right flags.

Based on a patch from Matt Novenstern.

https://bugzilla.gnome.org/show_bug.cgi?id=621311
2010-09-24 10:57:27 -04:00
Owen W. Taylor
8f0f159960 StThemeNodeTransition: work around Cogl bug
Switch to using the layer combine constant rather than the material
primary color for representing the opacity of the material; this
avoids triggering a Cogl bug where changing the primary color corrupts
the layer state.

https://bugzilla.gnome.org/show_bug.cgi?id=629616
2010-09-23 12:44:07 -04:00
Florian Müllner
652ce3ce8c introspection: Fix annotations
The scanner got more strict, now some annotations need fixing.
2010-09-15 03:02:26 +02:00
Adel Gadllah
25f907ffb1 St: Use a local material template
To be consistent with what we do with the shadow
material, use the same pattern in setup_framebuffer().
2010-09-14 00:00:34 +02:00
Florian Müllner
1034798969 st-shadows: Use a template material when creating shadows
To avoid recompiling shadows each time a new shadow is created,
use a copy of a static template material.

See http://bugzilla.clutter-project.org/show_bug.cgi?id=2280#c5.

https://bugzilla.gnome.org/show_bug.cgi?id=629383
2010-09-13 18:11:03 +02:00
Florian Müllner
862f1ea18c st: Use template material for transitions
To avoid compiling a new shader each time a transition is started,
use a copy of a static template material.

See http://bugzilla.clutter-project.org/show_bug.cgi?id=2280#c5.

https://bugzilla.gnome.org/show_bug.cgi?id=629384
2010-09-13 17:50:05 +02:00
Maxim Ermilov
4f61f9a43d remove scrollbar-[width/height]
1. They are useless
2. We can get its value from get_preferred_[width/height] in StScrollBar
https://bugzilla.gnome.org/show_bug.cgi?id=624893
2010-09-10 05:57:36 +04:00
Maxim Ermilov
d6995194dd add get_preferred_[width/height] to StScrollBar
https://bugzilla.gnome.org/show_bug.cgi?id=624893
2010-09-10 05:57:15 +04:00
Maxim Ermilov
ab25b8ab69 change parent class of StScrollBar from StBin to StWidget
1. It doesn't have child
2. It work like StWidget without child
https://bugzilla.gnome.org/show_bug.cgi?id=624893
2010-09-10 05:56:07 +04:00
Maxim Ermilov
178c8c50a0 Fix build with recent gtk3
use new keysyms names
https://bugzilla.gnome.org/show_bug.cgi?id=629128
2010-09-09 18:34:09 +04:00
Colin Walters
dddd97f6df introspection: Build with --warn-all --warn-error
* Use --warn-all, --warn-error
* Fix various broken gtk-doc
* Drop unused shell_get_event_related
* For header defines, we currently require them to end in _H to be skipped
* Drop the no-longer-necessary fix-meta-rectangle.py hack
* Move to the convention of using -private.h for headers that are,
  well, private.
* Add shell-wm-private.h
2010-09-07 13:07:52 -04:00
Florian Müllner
a243ba6693 [StLabel] Implement text-shadow property
Use the existing shadow code to add a drop shadow to the underlying
ClutterText actor if the text-shadow property is specified.

https://bugzilla.gnome.org/show_bug.cgi?id=624384
2010-09-02 21:49:59 +02:00
Florian Müllner
ba1da9deb9 [StThemeNode] Make shadow helper functions semi-public
Move shadow helper functions from st-theme-node-drawing to st-private
to make them available to widgets which want to add shadows to internal
actors.
Also add a new helper function for creating the shadow material from a
ClutterActor.

https://bugzilla.gnome.org/show_bug.cgi?id=624384
2010-09-02 21:49:59 +02:00
Florian Müllner
29781b2e5c [StThemeNode] Add text-shadow property
Reorganize the existing code which parses the -st-shadow property
to allow parsing different shadow properties and add support for
the text-shadow property.

https://bugzilla.gnome.org/show_bug.cgi?id=624384
2010-09-02 21:49:59 +02:00
Florian Müllner
e942444630 [StShadow] Add reference counting
If a shadow property is inherited from a parent, multiple StThemeNodes
share a common StShadow. It would be possible to use st_shadow_copy()
for this purpose, but proper reference counting is nicer.

https://bugzilla.gnome.org/show_bug.cgi?id=624384
2010-09-02 21:49:59 +02:00
Adel Gadllah
9f9067e29b [StThemeNode] Add basic background-position support
Add basic support for background-position, which only supports absolute
values.

Also don't require an unit to be specified for 0 (because the unit does not
really matter here 0 is 0 regardless of the unit).

https://bugzilla.gnome.org/show_bug.cgi?id=624375
2010-09-01 18:13:43 +02:00
Owen W. Taylor
5e7c25e136 Notice style transitions that don't change how StThemeNode paints
Add st_theme_node_paint_equal() and use that to do two things:

 1) Avoid animating transitions where nothing changes.
 2) Copy cached painting state from the old theme node to the new
    theme node.

https://bugzilla.gnome.org/show_bug.cgi?id=627083
2010-08-30 13:40:12 -04:00
Florian Müllner
5bd977dd3c [transitions] Do not recreate FBOs on opacity changes
Creating an FBO may be expensive, so we should avoid the operation
if possible. When transitioning between theme nodes, the widget's
opacity is used to paint to the offscreen textures which are blended
together - this means that the textures have to be recreated each time
the widget's opacity changes. It is much more effective to paint the
textures at full opacity and respect the widget's paint opacity when
blending the textures together.

https://bugzilla.gnome.org/show_bug.cgi?id=627085
2010-08-23 18:41:34 +02:00
Florian Müllner
766b5b801c [St] Remove _st_actor_contains()
The function has been upstreamed as clutter_actor_contains() - with
the switch to clutter-1.4 it is now available to the Shell, so it
is no longer necessary to keep a copy in-tree.

https://bugzilla.gnome.org/show_bug.cgi?id=626512
2010-08-10 15:03:13 +02:00
Florian Müllner
0905940ef8 [StContainer] Add :first-child, :last-child pseudo classes
Add support for the CSS :first-child and :last-child properties to
StContainer, and thus to all containers in St and ShellGenericContainer.

The internal ordering of the container's children is used to determine
the child to which to attach the pseudo class, not the children's
positions. This means that containers where positions can differ from
the ordering (ShellGenericContainer / StGroup) may behave unexpectedly,
so some caution is required.

https://bugzilla.gnome.org/show_bug.cgi?id=625316
2010-08-05 19:05:18 +02:00
Adel Gadllah
7fa9e88294 [St] Remove unused width/height from st_theme_node_transition_paint
We query the texture size here but never actually use it.

https://bugzilla.gnome.org/show_bug.cgi?id=625713
2010-08-01 12:10:53 +02:00
Adel Gadllah
b237cf9a63 Use CoglHandle rather than CoglHandle*
This breaks building on 1.4, and has always been wrong anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=624571
2010-07-26 21:55:25 +02:00
Florian Müllner
02ebd44851 [shadows] Fix shadows with small blur radius
There's an assertion in calculate_gaussian_kernel() to avoid a division
by zero - due to an unnecessary cast from float to int this assertion
is triggered incorrectly for small (but non-zero) values, e.g. a blur
radius of 1px.
2010-07-25 00:37:12 +02:00
Dan Winship
1b03d5cb45 [St] fix a bug noticed by gcc -O3
https://bugzilla.gnome.org/show_bug.cgi?id=623295
2010-07-12 14:24:16 -04:00
Giovanni Campagna
97f883b10e Implement "text-align"
"text-align" allows setting the alignment of text, with respect to
other lines and allocated space, without requiring a reference to
the ClutterText (which is private for most widgets).
If not specified, all text is left-aligned.

https://bugzilla.gnome.org/show_bug.cgi?id=622447
2010-06-25 22:43:14 +02:00
Florian Müllner
35764fa09e Move Tweener.slowDownFactor into St
It has probably crossed the line to evil by a mile or so, but here
it is: a Tweener.slowDownFactor replacement used by all animations
without exception.
While at it, update Tweener to use the new setTimeScale() upstream
function instead of adjusting the timeline directly.

https://bugzilla.gnome.org/show_bug.cgi?id=622249
2010-06-21 16:19:25 +02:00