Commit Graph

5258 Commits

Author SHA1 Message Date
Emmanuele Bassi
b248fbd010 Make clutter-stage-window.h a private header
It should have never been public in the first place; nothing can
implement the ClutterStageWindow interface and use it, so this is
not a break.
2012-03-01 15:07:44 +00:00
Emmanuele Bassi
a1ec559d14 Fix compilation
Hide a symbol if we're not compiling with Wayland compositor support.
2012-03-01 15:07:44 +00:00
Neil Roberts
cfbb7a0fa0 clutter-wayland-surface: Add padding to the class struct
This just adds some padding pointers so that we can later add more
virtual functions without breaking ABI.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:52 +00:00
Neil Roberts
5f654069fe clutter-input-device-wayland: Include clutter-stage-private.h
This was giving a warning about using _clutter_stage_update_state
without declaring it.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
b5c90f6caa wayland-surface: don't queue redraw on buffer attach
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
3c6a0cdc61 evdev: Adds api to release/reclaim the evdev devices
Clutter applications using evdev are typically fullscreen applications
associated with a single virtual termainal. When switching away from
the applications associated tty then Clutter should stop managing all
evdev devices and re-probe for devices when the application regains
focus by switching back to the tty. To facilitate this, this patch
adds clutter_evdev_release_devices() and clutter_evdev_reclaim_devices()
functions.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
1f7968e5f9 wayland/x11: Set constraints on the CoglRenderer
When using the Wayland backend this sets a constraint that the
CoglRenderer selects the Wayland EGL winsys.

When a Wayland compositor display is set it now also sets a constraint
that the render should use EGL because only EGL renderers will set up
the required wl_drm global object.

The X11 backend now sets the X11 constraint.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
a0d3b01aa9 device-manager-core-x11: Create core input devices as x11
The core input devices when XInput doesn't work were being created as
generic ClutterInputDevices instead of ClutterInputDeviceX11s. This
meant the keycode_to_evdev virtual wouldn't work.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
13e3f9e5f1 Add an input device function to convert keycodes to evdev codes
This adds a virtual function to ClutterInputDevice to translate a
keycode from the hardware_keycode member of ClutterKeyEvent to an
evdev keycode. The function can fail so that input backends that don't
have a sensible way to translate to evdev keycodes can return FALSE.
There are implementations for evdev, wayland and X. The X
implementation assumes that the X server is using an evdev driver in
which case the hardware keycodes are the evdev codes plus 8.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
a3bbcff946 evdev: Associate devices with the first created stage
Because evdev isn't associated with the display system, it doesn't
have any easy way to associate an input device with a stage.
Previously Clutter would never set a stage for an input device and
leave it up to the application to set it. To make it easier for
applications which just have a single fullscreen stage (which is
probably the most common use case for evdev) the device manager now
associates all input devices with the first stage that is created
unless something has already set a stage.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
1bfd1d85eb Updates in line with latest wayland protocol
The shm buffer format enum values were renamed and the explicitly
premultiplied format was dropped since it's now assumed if the buffer
has an alpha component then it's premultiplied.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
6cc58f7d7d clutter-wayland-surface: Remove the pick method
The pick method doesn't do anything special over the default pick
method provided by ClutterActor so there's no need to implement it.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
560f92b698 wayland-surface: removes unused origin variable
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
c1aac36d35 wayland-surface: Adds queue-damage-redraw signal
This adds a signal that's emitted whenever a wayland surface is damaged
that allows sub-classes to override the default handler to change
how clipped redraws are queued if the sub-class doesn't simply draw
a rectangle. The signal can also be used just to track damage.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
b89af8efa3 wayland-surface: Add cogl-texture property
This adds a "cogl-texture" gobject property so that a compositor may
listen for notifications of changes to the texture used to paint.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
8ac2200aac clutter-wayland-surface: Rename the width/height properties
This patch renames the width/height properties to
surface-width/surface-height so that they won't override the
width/height properties of ClutterActor which have different
semantics.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
1b77565e63 configure: Adds xkb-utils automake conditional
This adds a NEEDS_XKB_UTILS automake conditional that's set to true if
either the wayland backend is enabled or the evdev input backend is
enabled since they both depend on clutter-xkb-utils.c and we need
to avoid listing the file twice since that leads to duplicate symbols
and the build fails.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
612bde3c4a wayland-surface: Set actor size on buffer attach
When a new buffer is attached and we update the width and height
properties for the surface we now also call clutter_actor_set_size()

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
0ba6127edc wayland-surface: Adds _get_surface function
This adds a clutter_wayland_surface_get_surface() function for querying
the struct wl_surface * associated with a ClutterWaylandSurface.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
83b94ec27d wayland-surface: Make _set_surface api public
This exposes a clutter_wayland_surface_set_surface() function. The
implementation ignores requests to re-set the same surface and since now
has code to cleanup old surface state before setting the new surface.
(previously the surface was construct only so this wasn't necessary)

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
862eebceb6 wayland-surface: Cleanup properly in _dispose
When disposing a ClutterWaylandSurface we now make sure to unref any
pipeline we created and unref any surface buffer textures we created.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
c7e10024d8 wayland-surface: remove unused damage array
There was a GArray member named damage that wasn't being used which this
patch removes.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:50 +00:00
Robert Bragg
2c9ec271e2 wayland: install wayland compositor headers + pkgconfig file
If wayland compositor support has been enabled then we make sure to
install the corresponding public headers and a
clutter-wayland-compositor.pc pkgconfig file.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:50 +00:00
Emmanuele Bassi
c465881726 docs: Refresh the layout managers example image
Drop the window decoration and pointer; drop the double image for the
FlowLayout class; add an image for the TableLayout class.
2012-02-29 15:20:58 +00:00
Emmanuele Bassi
7713d3bbdc docs: Update the actor example image 2012-02-29 15:20:58 +00:00
Emmanuele Bassi
fde094dce2 build: Remove clutter-version.h.win32.in
The clutter-version.h header file is now completely generic, and does
not need to be masked by a Windows-specific header when building under
MSVC.
2012-02-29 15:20:58 +00:00
Emmanuele Bassi
38bcd86c51 Annotate the exported version variables
When using MSVC we need to annotate the variables that are going to be
exported.
2012-02-29 15:20:57 +00:00
Emmanuele Bassi
80626e7584 actor: Do not check for child destruction in add_child_internal()
We currently check for the IN_DESTRUCTION flag inside the
add_child_internal() function.

This check disallows calling methods that change the stacking order
within the destruction sequence, by triggering a critical warning first,
and leaving the actor in an undefined state, which then ends up being
caught by an assertion.

The reproducible sequence is:

  - actor gets destroyed;
  - another actor, linked to the first, will try to change the
    stacking order of the first actor;
  - changing the stacking order is a composite operation composed
    by the following steps:
    1. ref() the child;
    2. remove_child_internal(), which removes the reference;
    3. add_child_internal(), which adds a reference;
  - the state of the actor is not changed between (2) and (3), as
    it could be an expensive recomputation;
  - if (3) bails out, then the actor is in an undefined state, but
    still alive;
  - the destruction sequence terminates, but the actor is unparented
    while its state indicates being parented instead.
  - assertion failure.

The obvious fix would be to decompose each set_child_*_sibling() method
into proper remove_child()/add_child(), with state validation; this may
cause excessive work, though, and trigger a cascade of other bugs in
code that assumes that a change in the stacking order is an atomic
operation.

Another potential fix is to just remove this check here, and let code
doing stacking order changes inside the destruction sequence of an actor
continue doing the work.

The third fix is to silently bail out early from every
set_child_*_sibling() and set_child_at_index() method, and avoid doing
work.

I have a preference for the second solution, since it involves the least
amount of work, and the least amount of code duplication.

See bug: https://bugzilla.gnome.org/show_bug.cgi?id=670647
2012-02-29 15:20:57 +00:00
Alejandro Piñeiro
6e78ebca95 a11y: Not compute extents for actors without an stage
This solves a crash on GNOME Shell, as compute the extents
for some StWidgets could lead to call st_widget_get_theme_node,
and it is a fatal error to call this on a widget that it not
beed added to a stage.
2012-02-29 15:52:49 +01:00
Alejandro Piñeiro
dde5da1dd8 a11y: Stop to use ClutterActor::name as default accessible-name
ClutterActor::name is mostly used for debugging purposes
2012-02-29 15:52:49 +01:00
Chun-wei Fan
b689737a43 Update clutter-version.h.win32(.in)
Make it like the clutter-version.h.in template.  Since we aren't having
Windows-specific items in here (such as CLUTTER_FLAVOUR), perhaps we
could get the dllexport stuff in clutter-version.h.in, where it can be
used when necessary, and this file would be gone.
2012-02-29 18:10:03 +08:00
Emmanuele Bassi
b9553083e0 docs: Document the versioning macros 2012-02-27 16:47:53 +00:00
Emmanuele Bassi
fb9df4bef2 Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
Emmanuele Bassi
0ee7170dbb Move clutter-util.h into the deprecated section 2012-02-27 15:56:12 +00:00
Emmanuele Bassi
2daf2e8e6b Add a deprecated header for ClutterCairoTexture 2012-02-27 15:49:58 +00:00
Emmanuele Bassi
45d61d795b Add a deprecated header for ClutterTexture 2012-02-27 15:44:38 +00:00
Emmanuele Bassi
3c12b3575d Add deprecated header for ClutterAnimation 2012-02-27 15:38:11 +00:00
Emmanuele Bassi
4ae36f1e5f Add a deprecated header for ClutterAnimatable 2012-02-27 15:21:32 +00:00
Emmanuele Bassi
9613374c73 Add deprecated header for ClutterStageManager 2012-02-27 15:21:32 +00:00
Emmanuele Bassi
d5b565f7b9 Update the deprecation macros
Use the new versioned macros instead of the generic ones.
2012-02-27 15:21:31 +00:00
Emmanuele Bassi
780a11b926 Add flexible versioning scheme
GLib introduced macros that allows defining the lower and upper bounds
of the API to be used by application code.

The lower bound allows to define the minimum version that will trigger
deprecation warnings; the upper bound defines the maximum version that
will trigger compiler warnings for unavailable symbols.

This scheme allows gradually porting application code to a new version
of the API, especially in case of resynchronization after multiple
development cycles.
2012-02-27 15:21:31 +00:00
Emmanuele Bassi
a6b1972d71 Move macros to their own headers 2012-02-27 14:03:57 +00:00
Emmanuele Bassi
e4c948b150 actor: Add a method for computing the default paint volume
Now that ClutterActor has a default paint volume, subclasses may wish
to retrieve it without chaining up to the parent's implementation of
the get_paint_volume() function.

The get_default_paint_volume() returns a ClutterPaintVolume pointer
to the paint volume as computed by the default implementation of the
get_paint_volume() virtual function; it can only be used immediately,
as it's not guaranteed to survive across multiple frames.
2012-02-27 11:59:57 +00:00
Emmanuele Bassi
6a09bf5b52 paint-volume: Add a union method for boxes
Creating PaintVolume instances is not possible, and it's not recommended
anyway. It is, though, necessary to union paint volumes, especially with
2D boxes, in some cases.

Clutter should provide a simple convenience function that allows
unioning volumes to boxes in a moderately efficient way.

https://bugzilla.gnome.org/show_bug.cgi?id=670021
2012-02-27 11:24:08 +00:00
Emmanuele Bassi
f27e575ad4 build: Make abicheck.sh backend-aware
It should be possible to adapt the abicheck.sh script so that it
actually tests the ABI of libclutter-1.0.so taking into account
the backends that were compiled into Clutter, and avoid expected
failures if Clutter was not built with a specific backend.

https://bugzilla.gnome.org/show_bug.cgi?id=670680
2012-02-23 17:32:32 +00:00
Emmanuele Bassi
78b237b535 Clean up the included headers
Especially inside ClutterStage.
2012-02-23 17:21:57 +00:00
Emmanuele Bassi
630282ac77 build: Fix the header order
The "keep the list sorted" comment on the list of headers is there not
for fun, or because I'm anal-retentive like that.
2012-02-23 17:01:40 +00:00
Emmanuele Bassi
39a75436bf docs: Documentation fixes 2012-02-23 12:01:11 +00:00
Emmanuele Bassi
2b35b2a081 docs: Document ClutterTextBuffer structures 2012-02-23 11:54:41 +00:00
Emmanuele Bassi
cf435f9512 Fix compiler warning 2012-02-23 11:31:26 +00:00
Emmanuele Bassi
6575f25e32 docs: "Soft" deprecation of ClutterAlpha
We cannot deprecate ClutterAlpha yet. We cannot also implement
ClutterAlpha in terms of ClutterTimeline, because multiple Alpha
instances can be attached to the same Timeline. So we can start
with a "soft" deprecation: just a warning in the documentation
stating that ClutterAlpha will be deprecated, and removed, in the
future, and that newly-written code should use ClutterTimeline
instead.
2012-02-23 11:23:15 +00:00
Emmanuele Bassi
e5f410d4df Fix the progress function scope annotation 2012-02-23 11:23:15 +00:00
Emmanuele Bassi
f98bb30633 animation: Deprecate Alpha usage
We can use ClutterTimeline and its progress mode inside
ClutterAnimation; obviously, we have to maintain the invariants because
of the ClutterAnimation:alpha property, but if all you set is the :mode
property using one of the Clutter animation modes then we can skip the
ClutterAlpha entirely.
2012-02-23 11:23:15 +00:00
Emmanuele Bassi
7ec975ed3d timeline: Add progress functions
The whole progress computation should not be done using a separate
class: it should be part of the Timeline class.
2012-02-23 11:23:15 +00:00
Emmanuele Bassi
59bd20a94b Move the easing functions to their own file
Instead of having the easing functions be dependent of ClutterAlpha, and
static to the clutter-alpha.c source file, we should make them generic
and move them to their own internal header and source files. This will
allow to re-use them in the near future.
2012-02-23 11:23:15 +00:00
Emmanuele Bassi
1e3debbd9e drag-action: Use the motion event when passing the drag threshold
This avoids a critical warning, but it also makes the dragging more
fluid in case of threshold crossing.

https://bugzilla.gnome.org/show_bug.cgi?id=670402
2012-02-23 10:51:08 +00:00
Robert Bragg
a8e631543e Reduce our internal dependence on the Cogl 1.x api
Since Cogl has started restricting what cogl 1.x api is exposed when
COGL_ENABLE_EXPERIMENTAL_2_0_API is defined and since we build all
Clutter internals with COGL_ENABLE_EXPERIMENTAL_2_0_API defined this
patch makes a first pass at reducing our internal use of the Cogl 1.x
api.

The most notable api that's no longer exposed to us internally is
the cogl_material_ api so this switches all Clutter internals to use the
cogl_pipeline_ api instead. This patch also makes quite a bit of
progress removing internal uses of CoglHandle although there is still
more to go.
2012-02-21 17:46:11 +00:00
Robert Bragg
eff95eba4a Pass context to cogl_texture_pixmap_x11_new() api
The experimental cogl_texture_pixmap_x11_new() api was recently changed
to take an explicit context argument and return a GError on failures.
This updates Clutter's use of the api accordingly.
2012-02-21 17:46:11 +00:00
Robert Bragg
66cc330c0b Loosen the guard around clutter_backend_get_cogl_context
We were only exposing clutter_backend_get_cogl_context() if
COGL_ENABLE_EXPERIMENTAL_2_0_API had been defined but the CoglContext
api is also available if COGL_ENABLE_EXPERIMENTAL_API has been defined.

As it was it meant that code opting into the experimental Cogl api
but not limiting to the 2.0 only api would have to #define
COGL_ENABLE_EXPERIMENTAL_2_0_API before including clutter.h but make
sure it wasn't defined when including cogl.h which was particularly
awkward.
2012-02-21 17:46:11 +00:00
Robert Bragg
671ead6681 Rename cogl_framebuffer_swap_* apis to cogl_onscreen_swap_*
Recently the cogl_framebuffer_swap_* apis were moved into the
cogl_onscreen_* namespace since only CoglOnscreen framebuffers can be
double buffered. This renames all uses of the cogl_framebuffer_swap_*
apis in Clutter.
2012-02-21 17:46:11 +00:00
Robert Bragg
fbf94310fc Pass a CoglContext when calling cogl_pipeline_new
The experimental cogl_pipeline_new() api was recently changed so it
explicitly takes a CoglContext. This updates all calls to
cogl_pipeline_new() in clutter accordingly.
2012-02-21 17:46:11 +00:00
Stefano Facchini
4e345f6edc clutter-drop-action: annotation fixes for some signals
https://bugzilla.gnome.org/show_bug.cgi?id=670433
2012-02-20 13:26:15 +01:00
Alejandro Piñeiro
493461e798 a11y: remove Container explanation
That explanation is outdated after the last changes on clutter
2012-02-15 19:10:24 +01:00
Alejandro Piñeiro
c1d43b70c5 a11y: proper ATK role for ClutterStage
ATK_ROLE_CANVAS is not a suitable role, as the user (in general) can't
draw on the Stage. CallyStage implements AtkWindow, so the proper role
is ATK_ROLE_WINDOW
2012-02-15 19:10:24 +01:00
Alejandro Piñeiro
cc126f55eb a11y: redoing focus stuff
Removing atkcomponent, focus_tracker, etc. Emitting focus state change
from the stage. Now things are more simple, and stop to use some
of the soon-to-be-deprecated signals on ATK.
2012-02-15 19:09:44 +01:00
Emmanuele Bassi
5b4d29bc4a docs: Note when new ClutterBindCoordinate values were added
The shorthands for position and size were added in 1.6.
2012-02-15 17:43:31 +00:00
Adel Gadllah
851d2a42c4 ClutterBindConstraint: Add CLUTTER_BIND_ALL coordinate
Add a CLUTTER_BIND_ALL that binds both size and position.
2012-02-15 17:57:18 +01:00
Emmanuele Bassi
b8e5603a85 x11/stage: Allow setting fullscreen hint before realize
It should be possible to do:

  clutter_stage_set_fullscreen (stage, TRUE);
  clutter_actor_show (stage);

and have the stage be full screen as soon as it is shown.

Currently, we need to call clutter_actor_realize() prior to calling
set_fullscreen(), otherwise the backing X window will not be set,
and ClutterStageX11 will silently discard the change.

If set_fullscreen() was called prior to realization, ClutterStageX11
should delay setting the fullscreen hint until the realize() chain
has been successfully executed.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2515
2012-02-15 14:20:59 +00:00
Lionel Landwerlin
d31bd6fe92 x11: adjust size to minimal size when realizing
If you execute the following sequence :

stage = clutter_stage_new ();
clutter_actor_set_size (stage, 1280, 800);
clutter_actor_realize (stage);

Then you end up creating an onscreen buffer of size 1280x800 but
ClutterStageX11 storing the stage size at 640x480.

This patch resync the 2 implementation by using the ClutterStage's
size in both classes when realizing.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=667540
2012-02-15 11:32:41 +00:00
Emmanuele Bassi
b1ff53d980 effects: Delay the creation of the base pipeline
Unconditionally creating CoglPipeline and CoglSnippets inside the class
initialization functions does not seem to be enough when dealing with
headless builds.

Our last resort is to lazily create the base pipeline the first time we
try to copy it, during the instance initialization.
2012-02-15 09:34:27 +00:00
Jasper St. Pierre
84632d9c1d actor: Correct get_paint_volume for an actor with no children and no clip
We do not need to repaint the entire stage if an actor has no children
and no clip.
2012-02-14 16:20:24 -05:00
Jasper St. Pierre
114250e329 clutter.symbols: Fix up symbols 2012-02-14 16:19:33 -05:00
Emmanuele Bassi
c1a57e537b Do not check for features inside class initialization
The class initialization function may be called when Clutter hasn't been
fully initialized — for instance, when scanning the source with gtk-doc
or with the introspection scanner.
2012-02-14 17:14:25 +00:00
Emmanuele Bassi
f854619bc9 box-layout: Fix allocation brain farts
The allocation code for BoxLayout contains a sequence of brain farts
that make it barely working since the synchronization of the layout
algorithm to the one in GtkBox.

The origin of the layout is inverted, and it doesn't take into
consideration a modified allocation origin (for actors the provide
padding or margin).

The pack-start property is broken, and it only works because we walk the
children list backwards; this horribly breaks when a child changes
visibility. Plus, we count invisible children, which leads to
allocations getting insane origins (either close to -MAX_FLOAT or
MAX_FLOAT).

Finally, the allocation is applied twice even for non-animated cases.

https://bugzilla.gnome.org/show_bug.cgi?id=669291
2012-02-14 16:01:21 +00:00
Alejandro Piñeiro
dbd603c504 ClutterStage: notify "key-focus" change on clutter_stage_emit_key_focus_event 2012-02-14 16:53:54 +01:00
Jasper St. Pierre
0f5ddb6d6c actor: Add freeze/thaw when changing the first/last child
This should improve performance when adding/removing lots
of children.
2012-02-14 10:40:36 -05:00
Rob Bradford
cf735b54df wayland: Add accessor API to permit access to underlying Wayland structures
* clutter_wayland_input_device_get_wl_input_device for the input device
* clutter_wayland_stage_get_wl_surface for the Wayland surface
* clutter_wayland_stage_get_wl_shell_surface for the shell surface
2012-02-14 13:54:15 +00:00
Rob Bradford
84362a8257 build: Install a clutter-wayland pkg-config file 2012-02-14 13:54:15 +00:00
Neil Roberts
3218cd6865 Convert all of the internal shader-based effects to use snippets
This converts the blur, colorize and desaturate effects to use
snippets instead of CoglPrograms. Cogl can handle the snippets much
more efficiently than programs so this should be a performance win. It
also fixes the problem that Cogl would end up recompiling the program
for every instance of the effects because Clutter was not reusing the
same program.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-14 12:09:32 +00:00
Neil Roberts
b4887c3699 blur-effect: Use the texture size to work out the x/y step
The blur effect needs to pass a uniform to the GLSL shader so that it
can know the texture coordinate offset from one texel to another. To
calculate this the blur effect was previously using the allocation
size of the actor rounded up to the next power of two. Presumably the
assumption was that Cogl would round up the size of the texture to the
next power of two when allocating the texture. However this is not be
true if the driver supports NPOT textures. Also it doesn't take into
account the paint volume of the actor which may cause the texture to
be a completely different size. This patch just changes to directly
use the size of the texture.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-14 12:09:31 +00:00
Neil Roberts
041ac40056 offscreen-effect: Add clutter_offscreen_effect_get_texture
Sometimes a subclass of ClutterOffscreenEffect wants to paint with a
completely custom material. In that case it is awkward to modify the
material returned owned by ClutterOffscreenEffect so it makes more
sense to just get the texture and manage its own material.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-14 12:09:18 +00:00
Neil Roberts
0e542aa306 clutter-texture: Don't create a dummy texture
All of the pipelines used for ClutterTexture actors share a common
pipeline ancestor created with cogl_pipeline_copy. Previously this
ancestor had a dummy 1x1 texture attached to it so that it would end
up with the same state as the child pipelines that will render with a
texture. Cogl now has a mechanism to specify that a texture will be
used with a pipeline layer without having to create an actual texture.
This patch makes it use that to avoid having an unused texture.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-14 12:09:18 +00:00
Jasper St. Pierre
e315122895 actor: Allow insert_child_at_index to add a child at the end with an index
If we have N children and the user passes N (or a number beyond N) to
clutter_actor_insert_child_at_index, we should respond by adding the
child at the end, not silently doing nothing.
2012-02-13 17:54:38 -05:00
Emmanuele Bassi
bbb7da03ac Add a note on the paint volume origin
This should avoid trying to fix the origin of a paint volume set from
the allocation's origin, and thus breaking everything.

A PaintVolume for an actor is defined to be relative to the actor's
modelview unless specifically modified by internal functions; the origin
of an actor's allocation is, on the other hand, parent-relative.
2012-02-13 18:21:11 +00:00
Jasper St. Pierre
8512dd2336 actor: Only care about a child's paint volume when clip_to_allocation isn't set
If we're clipping to the allocation, then the child can paint wherever it
wants, and we don't care. The paint volume is the allocation here.
2012-02-13 18:04:12 +00:00
Emmanuele Bassi
b5aa666dcd actor: Remove stray cogl_object_unref()
The outline primitive is static, so unref'ing it makes Clutter crash.
2012-02-13 17:56:12 +00:00
Emmanuele Bassi
3996ae4348 actor: Add destroy_all_children()
There are times when we don't want to remove all children and count of
the reference count to drop to 0 to ensure destruction; there are cases,
such as managed environments, where it's preferable to ensure that the
children of an actor get actually destroyed.
2012-02-13 17:42:07 +00:00
Emmanuele Bassi
bc7959069b Deprecate ClutterStage:color
ClutterActor has a background-color property, now; we should use it for
the Stage, re-implement the color property in terms of background-color.
and deprecate the Stage property.
2012-02-13 17:30:22 +00:00
Emmanuele Bassi
cf9c4e651d timeline: Move deprecated methods into a separate header 2012-02-13 17:30:22 +00:00
Emmanuele Bassi
cf1abda709 animation: Do not use deprecated timeline methods 2012-02-13 17:30:22 +00:00
Emmanuele Bassi
97feb06a6f timeline: Add repeat-count
Being able to easily set the number of repeats has been a request for
the animation framework for some time now. The usual way to implement
this is: connect to the ::completed signal, use a static counter, and
stop the timeline when the counter hits a specific spot.

In the same light as the :auto-reverse property, we can make it easier
to implement this common functionality by adding a :repeat-count
property that, when set, limits the amount of loops that a Timeline can
perform before stopping itself.

In fact, we can implement the :loop property in terms of the
:repeat-count property just by using a sentinel value mapping to
"infinity", and map loop=FALSE to repeat-count=0, and loop=TRUE to
repeat-count=-1.
2012-02-13 17:30:22 +00:00
Emmanuele Bassi
4277468928 timeline: Deprecate the clone() method
The clutter_timeline_clone() method was a pretty dumb idea when it was
introduced, back when we still had the ClutterEffectTemplate and the
clutter_effect_* animation API. It has since become an API wart: we
cannot change or add new properties to be cloned without the risk of
breaking existing code. All in all, cloning a GObject is just a matter
of calling g_object_new() with the wanted properties.

Let's deprecate this throwback of the Olden Days™, so that we can remove
it for good once we break for 2.0.
2012-02-13 17:29:45 +00:00
Emmanuele Bassi
bc2e4ac6c2 Clean up clutter-timeline.h
Re-align everything to allow expansion, and move the only "protected"
function to the clutter-master-clock.h private header.
2012-02-13 13:39:47 +00:00
Jasper St. Pierre
aec65c9198 actor-meta: Correct annotations for vfuncs
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-13 12:00:44 +00:00
Jasper St. Pierre
96031a4f6f actor: Fix some broken annotations
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-13 12:00:38 +00:00
Emmanuele Bassi
d8a51726e1 actor: Implement remove_all_children using ActorIter
The remove_all_children() method is an ideal candidate for using the
ActorIter API; the end result is more compact and easy to follow.
2012-02-13 08:59:09 +00:00
Emmanuele Bassi
8f6da170bc input-device: Do not use weak references with actors
Use the ClutterActor::destroy signal.
2012-02-13 08:52:08 +00:00
Emmanuele Bassi
f024b852f9 stage: Do not use weak refs with actors
ClutterActor provides a signal for notifying destruction: using weak
references is neither indicated nor recommended.
2012-02-13 08:45:22 +00:00
Emmanuele Bassi
519da376f0 stage: Clean up
Remove some ifdeffed out dead code, and some duplication.
2012-02-13 08:44:40 +00:00
Emmanuele Bassi
cd118f0dc0 text: Fix regression
When the ClutterTextBuffer support inside ClutterText was merged, it
introduced a regression that was identified and fixed in bug 659116.

The optimization to not paint empty ClutterText actors is only valid
is the actor is not editable, or if the cursor is not visible.
2012-02-11 16:02:31 +00:00