Commit Graph

5171 Commits

Author SHA1 Message Date
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