Commit Graph

5363 Commits

Author SHA1 Message Date
Emmanuele Bassi
ba093ed5e7 box: Proxy the Actor's background color properties
ClutterBox's color and color-set properties can be implemented as
proxies for the ClutterActor's newly added background-color and
background-color-set properties, respectively.

This also allows us to get rid of the paint() implementation inside
ClutterBox altogether.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
98a8feae64 actor: Background color
Each actor should have a background color property, disabled by default.

This property allows us to cover 99% of the use cases for
ClutterRectangle, and brings us one step closer to being able to
instantiate ClutterActor directly.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
7d88a70b78 actor: Cosmetic fixes to internal add/remove child
Avoid code duplication all over the place.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
3f877a3d71 group: Use the default paint() implementation
ClutterActor's paint implementation is perfectly fine for ClutterGroup:
it paints the actor's children, which is exactly what ClutteGroup does.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
798a2e5297 actor: Minor cosmetic fixes to the header 2012-01-16 23:35:15 +00:00
Emmanuele Bassi
b869019eb2 group: Do not override Container
Let ClutterActor do all the work.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
ef3dc2d1ba actor: Make Actor.add_child and Container.add_actor idempotent
And make sure that overriding Container and calling
clutter_actor_add_child() will result in the same sequence of operations
as the current set_parent()+queue_relayout()+signal_emit pattern.

Existing containers can continue using:

        clutter_actor_set_parent (child, CLUTTER_ACTOR (container));
        clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
        g_signal_emit_by_name (container, "actor-added", child);

and newly written containers overriding Container.add() can simply call:

        clutter_actor_add_child (CLUTTER_ACTOR (container), child);

instead.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
2894587b22 actor: Do not leak the layout manager 2012-01-16 23:35:15 +00:00
Emmanuele Bassi
038aadfa72 box: Drop Container interface overrides
And defer as much as possible to ClutterActor's default implementation
for basically everything.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
b773785533 actor: Implement Container::sort_depth_order
There's no reason this vfunc should be left out.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
86ec629776 actor: Add child insertion methods
We should allow inserting children at given indices, and at given
stacking positions (relative or not to other children).
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
37d46649ce actor: Adjust the preferred size too
Don't adjust just the allocation: we need to adjust the preferred size
of the actor to account for the margin.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
bf27575187 actor: Maintain invariants in add_child/remove_child
We need to queue a relayout when removing a visible child from a visible
parent.

We also need to insert the child at the right position (depending on the
depth) so that newly added actors will be painted on top.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
9d9e98968f actor: More cleanups to the Private data structure
Try to document it properly. We can also remove some things that are
properly encapsulated through functions, like the redraw clip volume.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
9132769767 actor: Store the fixed sizes into LayoutInfo
Remove four more floats from ClutterActorPrivate.

The fixed minimum and natural sizes should be stored inside the
ClutterLayoutInfo structure, along with the fixed position.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
b4d3b52b62 actor: Update the underallocations check
Add a failsafe against a NULL parent, to avoid a segfault when calling
clutter_actor_allocate() on the Stage.

We also need to deal with floating point values: straight comparison is
not going to cut it.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
409c3ed8ff actor: Adjust the allocation prior to call allocate()
ClutterActor has various properties controlling the allocation:

  - x-align, y-align
  - margin-top, margin-bottom, margin-left, margin-right

These properties should adjust the ClutterActorBox passed from the
parent actor to its children when calling clutter_actor_allocate(),
so that the child can just allocate its children at the right origin
with the right available size.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
a85c53ea0b actor: Clean up property installation 2012-01-16 23:35:14 +00:00
Emmanuele Bassi
a2a38ee797 actor: Add margin properties
The actor class should be able to hold the margin offsets like it does
for expand and alignment flags.

Instead of filling the private data structure with data, we should be
able to use an ancillary data structure, given that all this data is
optional and might never be set in the first place.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
c8659b6ca5 actor: Add [xy]-align
Allow an actor to define how it should occupy the extra space given to
by its parent during the allocation.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
4453ee7266 actor: Provide Container::raise/lower implementations 2012-01-16 23:35:13 +00:00
Emmanuele Bassi
752151bc97 actor: Remove is-a(Container) checks
All actors are now Container implementations, so there's no need to add
a type check.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
f2609dcca4 actor: Add [xy]-expand properties 2012-01-16 23:35:13 +00:00
Emmanuele Bassi
d5086da3fd box: Defer to ClutterActor
Use the default implementation inside ClutterActor instead of our own,
wherever possible.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
1c40151d0e actor: Default to a fixed layout manager
In case no layout manager was set during construction, we fall back to a
FixedLayout. The FixedLayout has the property of making the fixed
positioning and sizing API, as well as the various Constraints, work
out of the box.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
11e876c86b actor: Add :layout-manager
Now that ClutterActor implements the Container contract we can actually
defer the size negotiation to a ClutterLayoutManager directly from the
default implementation of the Actor's virtual functions.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
b45d78e6a1 actor: Provide a default Container implementation
We can provide most of the ClutterContainer implementation directly
within ClutterActor — basically removing the need of having the
Container interface in the first place. For backward compatibility
reasons we can keep the interface, but let Actor implement it directly.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
8462b5ba45 Do not use set_parent()/unparent() internally
Use add_child()/remove_child() instead.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
53aa64aeb9 actor: Provide add/remove child and get children methods
Let's try and move away from the reverse implicit scene graph build API,
which we mutuated from GTK+, towards a more traditional node/child API.

The set_parent()/unparent() API is confusing, unless you know the
history; having a add_child()/remove_child() methods pair makes it more
explicit.

We can easily implement the old set_parent()/unparent() pair in terms of
the newly add_child()/remove_child() one.
2012-01-16 23:35:13 +00:00
Neil Roberts
0396d3e7e6 Remove use of CoglVector3
Cogl has removed the CoglVector3 type in favour of directly using an
array of 3 floats.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-01-16 21:06:19 +00:00
Emmanuele Bassi
7c14ba7d37 actor: Clean up the debug node for out-of-band transforms
Enclose the check inside a #ifdef CLUTTER_ENABLE_DEBUG ... #endif, so
that we can compile it out; also, use g_string_append() instead of the
g_string_append_printf() function, given that we're just concatenating
strings.
2012-01-16 11:04:44 +00:00
Emmanuele Bassi
646cf236a5 backend: Remove ClutterBackend::redraw
The ::redraw virtual function was a throwback from olden times, and has
been thoroughly replaced by the equivalent vfunc on the StageWindow
interface. We can safely remove it, now, and simplify the flow of the
redraw code inside ClutterStage.
2012-01-12 13:35:09 +00:00
Emmanuele Bassi
0c365f9f4c gesture-action: Protect against NULL pointers 2012-01-12 10:49:16 +00:00
Emmanuele Bassi
3b9b69ef54 gesture-action: Use the event propagation macros 2012-01-12 10:49:02 +00:00
Emmanuele Bassi
99f7d627af text: Use the event and source symbolic macros
Instead of boolean values.
2012-01-12 10:40:38 +00:00
Emmanuele Bassi
21149adb12 drop-action: Use the event propagation macros 2012-01-12 10:39:59 +00:00
Emmanuele Bassi
81694d0dd9 drag-action: Use the new event propagation macros 2012-01-12 10:34:50 +00:00
Emmanuele Bassi
cce2e25ac7 deform-effect: Check against NULL pointers
Do not try to disconnect signal handlers from NULL pointers.
2012-01-12 10:34:26 +00:00
Emmanuele Bassi
20e63532a4 click-action: Use the new symbolic event propagation macros 2012-01-12 10:27:17 +00:00
Emmanuele Bassi
dbf3b607bf click-action: Be resilient against NULL pointers
Do not try to disconnect signal handlers from NULL pointers.
2012-01-12 10:26:47 +00:00
Rob Bradford
4afe793eed build: Add infrastructure for inserting Requires.private into pkg-config files 2012-01-11 12:23:46 +00:00
Rob Bradford
a9e6137f47 wayland: Attach cursor buffer to input device when it enters the surface
The Wayland semantics mean that we must attach a buffer to the input device
when the pointer enters the surface to provide a cursor.
2012-01-10 17:30:57 +00:00
Rob Bradford
e1434cebdb wayland: Load a buffer from well known location for the cursor
Semantic changes to Wayland means that we cannot rely on the compositor
setting a pointer buffer for us if set it to nil. The first part of fixing
this is to create an shm buffer containing the bytes for our cursor.

The best way to do this currently is to load the cursor from the well known
location where weston instals its cursor images. The code to implemente this
was derivedlifted from the Wayland backend in GTK+.
2012-01-10 17:29:32 +00:00
Emmanuele Bassi
d8e855e585 osx: Use Lucida Grande as the default font
Instead of falling back to the generic "Sans".
2012-01-07 10:42:09 +00:00
Emmanuele Bassi
95d3e0f962 actor: Change the point of emission of ::destroy
Currently, we're emitting the ClutterActor::destroy at the end of the
dispose implementation - right before we chain up to the parent
implementation.

The point of emission makes the ::destroy signal handlers able to just
use the actor pointer - as the actor state will have been mostly cleared
by the time application can run. This (undocumented) behaviour severely
limits the amount of things you can do inside a ::destroy signal
handler, thus making the ::destroy signal just a weird weak reference,
instead of a proper way to break application reference cycles.

Given that this change relaxes some of the conditions, this change
should be safe - obviously, if anything happens, we'll back it out; the
conformance and interactive tests confirm that, for common patterns of
usage, this change does not break existing code.
2012-01-06 14:09:11 +00:00
Emmanuele Bassi
fa39f67eab actor: Use g_clear_object()
GLib has a nice, atomic object clearing function that allows us to drop
code looking like:

  if (priv->object != NULL)
    {
      g_object_unref (priv->object);
      priv->object = NULL;
    }

from the ::dispose implementation.
2012-01-06 14:02:54 +00:00
Emmanuele Bassi
f5fffb355b Move Perspective and Fog definitions to clutter-types.h
Since we reference the types from multiple files.
2012-01-03 13:50:06 +00:00
Emmanuele Bassi
6184bf1b6e Add symbolic constants for event propagation
I always have to think twice before returning a value from an event
signal handler, and I've been writing them for the past 10 years, so
it's conceivable that application developers that start with Clutter
will find them confusing as well.

Simple symbolic names should be easier to use.
2012-01-03 12:05:10 +00:00
Emmanuele Bassi
e689d01800 stage: Deprecate :use-fog and :fog
The depth cueing through GL fog has been broken for a long while, now.

The fog-related API in Clutter is ridiculously limited, and harks back
to simpler times; the ClutterFog structure is not enough to express all
the GL fog machinery, and required application code to connect to the
Stage's paint implementation and drop into Cogl directly.

Additionally, the fixed pipeline fog machinery in GL simply does not
work with premultiplied alpha, unless you use a shader - and in that
case it would only work for textures. Let's deprecate it, and just
don't do anything if somebody has the brilliant idea of setting the
:use-fog property to TRUE.
2011-12-30 10:26:12 +00:00
Emmanuele Bassi
65889fa075 box: Remove the sentinel annotation
Sadly, we need to remove the G_GNUC_NULL_TERMINATED annotation from
ClutterBox packing API; the compiler will otherwise emit a warning
for perfectly legal statements like:

  clutter_box_pack (box, child, NULL);

because of the missing sentinel.

See also: g_object_new().
2011-12-30 09:51:36 +00:00
Emmanuele Bassi
7d4a9c6f1e Add diagnostic mode
GLib has a "diagnostic mode" switch that can be checked to enable debug
messages on deprecated properties and signals, as these are purely
run-time constructs, and as such cannot be caught by compiler warnings.
The diagnostic mode is toggled by a simple environment variable, and
can be used to ease porting of application code.

We can use something similar to mark deprecated virtual functions and
other run-time constructs; to avoid collisions, we should use our own
environment variable, CLUTTER_ENABLE_DIAGNOSTIC.
2011-12-28 09:37:53 +00:00
Jasper St. Pierre
b882fcd825 clutter-text: Fix memory leak 2011-12-19 09:46:44 -05:00
Chun-wei Fan
23960328d5 Update clutter.symbols...
...For the addition of queue_redraw_with_clip (commit f0a246cd)
2011-12-13 12:44:27 +08:00
Emmanuele Bassi
f0468cf828 wayland/surface: Use queue_redraw_with_clip()
Just like the X11 texture-pixmap actor.

https://bugzilla.gnome.org/show_bug.cgi?id=660997
2011-12-12 17:29:58 +00:00
Emmanuele Bassi
30c464e68f x11/texture-pixmap: Use ClutterActor.queue_redraw_with_clip()
Instead of using a PaintVolume for a 2D region, and an internal
function, use the newly added queue_redraw_with_clip() method.

This removes the last bit of internal API usage in the
ClutterX11TexturePixmap actor.

https://bugzilla.gnome.org/show_bug.cgi?id=660997
2011-12-12 17:29:58 +00:00
Emmanuele Bassi
749fe38fec x11/stage: Use ClutterActor.queue_redraw_with_clip()
Instead of using a paint volume for a 2D region, use the newly added
queue_redraw_with_clip() method.

https://bugzilla.gnome.org/show_bug.cgi?id=660997
2011-12-12 17:29:58 +00:00
Emmanuele Bassi
f0a246cdc6 actor: Add queue_redraw_with_clip()
Add a public version of the clipped queue redraw, using a 2D clip. This
allows implementing actors with trackable 2D clipped regions, like the
ClutterX11TexturePixmap, outside of Clutter itself.

https://bugzilla.gnome.org/show_bug.cgi?id=660997
2011-12-12 17:29:58 +00:00
Emmanuele Bassi
79c04bd133 fixed-layout: Use a better quark name
The "fixed-container" name is far too generic, and it may very likely
lead to collisions with application code.
2011-12-09 16:24:04 +00:00
Rob Bradford
320356e97f wayland: Refine enter/leave event handling
The Wayland protocol now has events represent when a pointer enters the
surface and when it leaves again.

For leaves the surface is not set in the event, for enters the surface is set.
Simply use this to determine whether to emit CLUTTER_ENTER or CLUTTER_LEAVE.
2011-12-08 17:44:53 +00:00
Rob Bradford
34cc45dae5 wayland: Update to latest Wayland API (wl_shell_surface transition)
Previously the wl_shell object held the methods that allowed a client to
request changes to the shell's state associated with a surface. These methods
have now been moved to a wl_shell_surface object.

This change allows configure events to be handled inside the stage rather than
the backend.
2011-12-08 17:44:53 +00:00
Robert Bragg
3e85ad6b95 build: make internal option_xkb_* symbols static
This makes the option_xkb_* symbols declared for the evdev device manager
and the wayland device manager private so we don't get symbol collisions
if both of these backends are enabled.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-08 16:13:38 +00:00
Robert Bragg
fd8965a710 xkb-utils: Adds #ifdef guards for repeat includes
This adds #ifdef/#define repeat include guards for clutter-xkb-utils.h

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-08 16:13:38 +00:00
Robert Bragg
d8e76c3415 eglnative: fix building eglnative BE with evdev support
this fixes how clutter-device-manager-evdev.h is included to fix a build
problem caused by not being able to find the header.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-08 16:13:37 +00:00
Robert Bragg
602a89afa8 evdev: fixes evdev build issues + don't ref default stage
This updates the evdev input backend code to compile and also updates
the code to not refer to the default stage and instead check for a
stage to be associated with the input device. If no stage is currently
associated with a device generating events then the events are dropped
on the floor.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-08 16:13:37 +00:00
Robert Bragg
86f2aed570 input: adds internal _clutter_input_device_get_stage api
This adds internal api to be able to query the stage currently
associated with a given input device so input backends shouldn't need to
refer to the default stage.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-08 16:13:37 +00:00
Robert Bragg
16ed7677e0 Adds wayland-surface actor for wayland compositors
This adds a --enable-wayland-compositor configure option which will add
support for a ClutterWaylandSurface actor which can be used to aid in
writing Wayland compositors using Clutter by providing a ClutterActor to
represent Wayland client surfaces.

Notably this configure option isn't tied into any particular backend
since conceptually the compositor support can be used in conjunction
with any clutter backend that has corresponding Cogl support.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-08 16:13:37 +00:00
Robert Bragg
07c6f96cb4 wayland: Updates client side wayland support
This updates Wayland support in line with upstream changes to the Wayland
API and protocol.

This update means we no longer use the Cogl stub winsys so a lot of code
that had to manually interact with EGL and implement a swap_buffers
mechanism could be removed and instead we now depend on Cogl to handle
those things for us.

This update also adds an input device manager consistent with other
clutter backends.

Note: to use the client side "wayland" clutter backend you need to have
built Cogl with --enable-wayland-egl-platform. If Cogl has been built
with support for multiple winsys backends then you should run
applications with COGL_RENDERER=EGL in the environment.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-08 16:13:37 +00:00
Chun-wei Fan
6ad1afd803 clutter/Makefile.am: Update gen-enums.bat generation
It's $(srcdir)/win32/clutter-win32.h, not $(srcdir)/clutter-win32.h

Sorry!
2011-12-08 17:40:22 +08:00
Chun-wei Fan
7a70e1f08b clutter/Makefile.am-Create batch to gen enums (VS Support)
Generate a .bat file to generate the clutter-enum-types.[ch] for use
during the Visual C++ build process, which will greatly simplify the
maintenanace of the VS build files as public headers are added or removed
during the development process.
2011-12-08 17:04:46 +08:00
Emmanuele Bassi
158245fda3 backend: Fix em computation for non-absolute fonts
If a font description is not set to have an absolute size then we were
using the wrong transformation for points to device units.
2011-12-05 11:43:48 +00:00
Emmanuele Bassi
943a65b476 backend: Return the correct default resolution
If ClutterSettings:font-dpi is set to -1 then the default resolution
should be returned by ClutterBackend — i.e. 96.0.
2011-12-05 11:42:49 +00:00
Jasper St. Pierre
f7bb1e879e main: Fix keyboard event emission for non-reactive actors
This is an innocent copy-paste issue that ended up breaking a few things

https://bugzilla.gnome.org/show_bug.cgi?id=664582
2011-12-01 13:05:22 -05:00
Emmanuele Bassi
1dc7c45438 x11: Do not try to access private structures
ClutterInputDeviceX11 has been made private, so we cannot access it from
outside of clutter-input-device-core-x11.c. We should have simple
accessors for the min/max keycode, which is the only detail that we use.
2011-12-01 13:44:21 +00:00
Manuel Osdoba
67cdbbaf51 Currently Clutter only prints out a warning message in case some shader effects fail to compile
Clutter-WARNING **: Unable to compile the GLSL
shader: Fragment shader failed to compile with the following errors:

The attached patch (against current git) should print out more
information what makes it easier to answer user feedback.

https://bugzilla.gnome.org/show_bug.cgi?id=664252
2011-12-01 10:57:22 +00:00
Bastian Winkler
6336883da7 path: Fix introspection annotations
Add out annotations for clutter_path_get_node() and
clutter_path_get_position()

https://bugzilla.gnome.org/show_bug.cgi?id=664336
2011-12-01 10:55:13 +00:00
Emmanuele Bassi
dc77a5ef31 docs: Fix up the state.set_key() comment 2011-12-01 10:39:11 +00:00
Jeremy Moles
1e05e8ceaf Adds (allow-none) as source_target for clutter_state_set_key
While working through the Python3/pygobject bindings, I came across a missing
(allow-none) in clutter_state_set_key(). This allows the API to specify to None
as the source_target.

https://bugzilla.gnome.org/show_bug.cgi?id=664996
2011-12-01 10:36:38 +00:00
Neil Roberts
627a1b1977 effects: Use effect_queue_repaint instead of actor_queue_redraw
The builtin effects ClutterColorizeEffect, ClutterDesaturateEffect and
ClutterShaderEffect all have properties which only affect the
rendering of the final texture not the contents of it. When these
properties are updated we should queue a repaint of the effect not
the actor so that we don't waste time repainting the contents of the
offscreen buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=665052

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-11-28 18:30:18 +00:00
Neil Roberts
c687ece72d Fix building with profiling enabled
There was an #ifdef'd section of code for profiling that was using the
wrong variable name so it would not build.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-11-28 16:27:57 +00:00
Neil Roberts
a2774fb0dc offscreen-effect: Track the size of the actor separately
Previously the offscreen effect was keeping track of the size of the
texture so that it could detect when a different size is requested and
create a new texture. However this breaks if a subclass overrides
create_texture to make the texture bigger because in that case the
size of the texture will always be different from the calculated size
of the actor. This patch makes it also track the size of the fbo that
was requested before being passed through create_texture() and it
instead uses that to detect when a new FBO is needed.

https://bugzilla.gnome.org/show_bug.cgi?id=665040

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-11-28 15:42:35 +00:00
Emmanuele Bassi
24623c43a8 timeline: Add custom parser for "markers"
It should be possible to define markers in ClutterScript when
describing a ClutterTimeline.

The syntax is a trivial:

  "markers" : [
    { "name", <marker-name>, "time" : <msecs> }
  ]

While at it, we should document it inside the API reference, as well
as fleshing out the ClutterTimeline description.
2011-11-27 12:19:39 +00:00
Bastian Winkler
d82bf70d49 script: Don't skip introspection for connect_signals_full()
To allow language bindings to properly override Script.connect_signals()
they'll need access access to Script.connect_signals_full().

Thanks to Jeremy Moles for reporting.
2011-11-25 10:54:54 +01:00
Emmanuele Bassi
49355f3287 pc: Fix unexpanded variables
PkgConfig doesn't like those.
2011-11-23 17:30:13 +00:00
Emmanuele Bassi
a13b095dc2 build: Fix distcheck 2011-11-22 13:53:08 +00:00
Florian Müllner
02a020a7fd Add missing include
clutter-profile.h used to be included via clutter-debug.h, but no
more (8a4dc3c011) ...
2011-11-18 22:06:30 +01:00
Emmanuele Bassi
6e15fd930a debug: Simple whitespace cleanups 2011-11-18 17:54:19 +00:00
Emmanuele Bassi
8a4dc3c011 debug: Clean up profile/debug symbols
Since we have a _clutter_debug_message() function compiled in
unconditionally we have no further need for the equivalent conditional
version defined in clutter-profile.[ch]: we can simply do the work in
one function.
2011-11-18 17:44:42 +00:00
Emmanuele Bassi
92585be4d8 debug: Remove CLUTTER_GLERR
The macro hasn't been used in a long while, as Cogl had its own version
of it; and Clutter hasn't been using pure GL for some time now.
2011-11-18 17:32:01 +00:00
Emmanuele Bassi
2d76407016 debug: Remove CLUTTER_MARK
The debug macro is seldom used, and it's a bit lame at that.
2011-11-18 17:30:39 +00:00
Emmanuele Bassi
90f37d5636 cairo-texture: Skip ::draw emission for 0x0 surfaces
This also avoids an assertion failure.
2011-11-18 17:23:56 +00:00
Chun-wei Fan
d3a9bf201b Merge branch 'master' into msvc-support-master 2011-11-16 09:15:16 +08:00
Emmanuele Bassi
bf9339b8f4 Deprecate some more old, useless API
We still ship clutter_get_show_fps() and clutter_get_debug_enabled() as
public entry points. Yet another case of missing API review prior to the
1.0 release, so really the bucket stops around my desk.

Let's deprecate these two useless functions, and reduce the API
footprint of Clutter.
2011-11-15 17:58:25 +00:00
Emmanuele Bassi
66d46fd55e Deprecate clutter_get_timestamp()
This function should have never been made public in the first place; its
output depends on a configuration option of Clutter, and it's basically
useful only for internal debugging.
2011-11-15 17:47:00 +00:00
Emmanuele Bassi
59f395d856 Rework debug output
Make it consistent across the various build options (with or without
profiling enabled), and add a timestamp using the monotonic clock to
every debug message.
2011-11-15 17:39:49 +00:00
Emmanuele Bassi
c6e487a5c1 Remove CLUTTER_TIMESTAMP debug macro
It's pretty much unused, and it doesn't print out really informative
messages. We should make CLUTTER_NOTE print out a decent timestamp
instead.
2011-11-15 16:07:13 +00:00
Emmanuele Bassi
8b2df7ced9 Remove the GTimer used by clutter_get_timestamp()
Use g_get_monotonic_time() instead, which does the right thing.
2011-11-15 15:34:51 +00:00
Emmanuele Bassi
f63891f030 texture: Do not use clutter_get_timestamp()
The clutter_get_timestamp() output depends on whether Clutter was
compiled with debugging support — it's meant to be used only by the
debugging notes, and it should not be used for anything else.
2011-11-15 14:59:50 +00:00
Neil Roberts
58b6ad787b deform-effect: Use CoglPipeline instead of setting legacy state
Instead of calling cogl_set_depth_test_enabled and
cogl_set_backface_culling_enabled ClutterDeformEffect now uses the
experimental CoglPipeline API. Those global state functions will soon
be deprecated in Cogl and they are implemented by flushing a temporary
override pipline which isn't ideal.

Using the new culling API we can also avoid having a separate buffer
of indices for the back of the texture by just changing the culling
mode to cull front baces instead of the back.

https://bugzilla.gnome.org/show_bug.cgi?id=663636
2011-11-15 11:15:00 +00:00
Neil Roberts
8a752d674b deform-effect: Use CoglPrimitives instead of CoglVertexBuffers
This changes ClutterDeformEffect to use a CoglAttributeBuffer with a
CoglPrimitive instead of the old CoglVertexBuffer. The old vertex
buffer code is now implemented in terms of the attribute buffer code
and it will eventually be deprecated. Using CoglPrimitives should be
slightly more efficient.

This also changes the struct we store the vertices to be
CoglVertexP3T2C4 instead of CoglTextureVertex. The latter is
technically not compatible with neither vertex buffers nor attribute
buffers because it contains a CoglColor and the internal members of
that are private so it is not valid to assume it contains 4 bytes and
use that as an attribute. Also it contains padding so it ends up
redundantly creating a larger buffer. CoglTextureVertex is in the
public API for the deform_vertex virtual so we still have to maintain
that. Instead of directly manipulating the array to upload, the
application is now passed a stack allocated temporary struct which
gets converted to a CoglVertexP3T2C4. This also means that we can map
the buffer as write only and still let the application read-write the
vertex.

The paint debug code to draw line strips for the deform mesh was
previously trying to set a red source material. However this wasn't
working because the material color was being overwritten by the color
attribute in the vertex buffer. This patch fixes that by creating a
seperate primitive for the lines and not adding the color
attribute. The lines code was also drawing both the front and back
indices. I don't think that entirely makes sense so I've just changed
it to draw only the front indices. Maybe painting both would make more
sense if backface culling was still enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=663636
2011-11-15 11:14:59 +00:00
Chun-wei Fan
8d0c68347a Merge branch 'master' into msvc-support-master 2011-11-15 14:20:22 +08:00
Emmanuele Bassi
b281f2090a Store the master clock pointer in the main context
Let's try and move all singletons into ClutterMainContext.
2011-11-14 17:16:27 +00:00
Emmanuele Bassi
f1ebfe30ce stage-manager: Store the stage manager into the main context
Use the main context to store the stage manager singleton, instead of a
static pointer inside clutter-stage-manager.c.
2011-11-14 15:43:20 +00:00
Chun-wei Fan
96d4e527ea Merge branch 'master' into msvc-support-master 2011-11-14 22:57:50 +08:00
Lionel Landwerlin
e7720c4156 deform-effect: do not redraw actor on invalidate
When invalidating the deform effect, we are invalidating the vertices
shaping the deformation of an actor. Therefore, there is no need to
trigger a redraw of the associated actor, we can just repaint the
effect.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=663720
2011-11-14 12:01:07 +00:00
Emmanuele Bassi
b5ac927763 stage: Clean up
Improve the consistency of the code.
2011-11-14 11:46:02 +00:00
Emmanuele Bassi
b2d1dfa932 stage: Deprecate clutter_stage_queue_redraw()
It's a wrapper around clutter_actor_queue_redraw().
2011-11-14 11:45:14 +00:00
Emmanuele Bassi
f5d011cb67 Merge branch 'deprecate-default-stage'
* deprecate-default-stage:
  evdev: do not associate device with stage
  evdev: don't even process events without a default stage
  docs: Note default stage deprecation in README
  docs: Remove clutter_stage_get_default()
  stage: Deprecate the default stage
  script: Do not use clutter_stage_get_default()
  cally/actor: Do not use the default stage as a fallback
  Try to mop up the default stage mess
  performance/*: Do not use clutter_stage_get_default()
  interactive/*: Do not use clutter_stage_get_default()
  Merge with a11y
  micro-bench/*: Do not use clutter_stage_get_default()
  accessibility/*: Do not use clutter_stage_get_default()
  conform/*: Do not use clutter_stage_get_default()
2011-11-14 11:07:54 +00:00
Chun-wei Fan
bbe54aa2ec Fix clutter-bakend-win32.c
The VBLANK environmental variable is done universally in clutter-main.c
as in commits e8562089 (main: Add a sync-to-vblank global flag) and
db211a21 (Remove per-backend CLUTTER_VBLANK envvar), so remove these things
here as well.

https://bugzilla.gnome.org/show_bug.cgi?id=663999
2011-11-14 11:06:28 +00:00
Chun-wei Fan
2628ba70cd Fix clutter-bakend-win32.c
The VBLANK environmental variable is done universally in clutter-main.c
as in commits e8562089 (main: Add a sync-to-vblank global flag) and
db211a21 (Remove per-backend CLUTTER_VBLANK envvar), so remove these things
here as well.
2011-11-14 13:36:52 +08:00
Chun-wei Fan
ebf3147a00 clutter-config.h.win32: Add CLUTTER_INPUT_NULL 2011-11-14 13:33:04 +08:00
Chun-wei Fan
145685b099 Update config.h.win32.in/clutter-config.h.win32
-Make the contents of config.h.win32.in more like config.h.in
-Define CLUTTER_INPUT_WIN32 accordingly (no GDK3 defines yet, until
 GDK3 on Windows is more stable)
2011-11-14 12:49:52 +08:00
Chun-wei Fan
1b7249a247 Merge branch 'master' into msvc-support-master 2011-11-14 11:40:49 +08:00
Chun-wei Fan
c52d06a5b9 Update clutter-config.h.win32
The CLUTTER_WINDOWING_WIN32 needs to be in-sync with what is in
configure.ac, due to the implementation of multiple backends.
2011-11-12 12:03:53 +08:00
Rico Tzschichholz
b12a94dc27 docs: fix some headers paths 2011-11-10 19:05:39 +01:00
Lionel Landwerlin
213e6e4a16 evdev: do not associate device with stage
Their might not be any stage at that time, so this avoids to create a
default one.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=651718
2011-11-10 15:41:41 +00:00
Lionel Landwerlin
5705d08b5d evdev: don't even process events without a default stage
The evdev system is a bit different from other input systems in
Clutter because it's completly decorrelated from anything graphic.

In the case of embedded devices with no proper windowing system, you
might want to not implicitly create a default stage when you're
receiving the first input event.

This patch changes this behavior by not forwarding any event if you
don't have a default stage.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=651718
2011-11-10 15:39:16 +00:00
Emmanuele Bassi
26aa4b5290 docs: Remove clutter_stage_get_default()
A lot of the example code in the cookbook and the API reference still
uses the default stage — sometimes as if it were a non-default one,
which once again demonstrates how the default stage was a flawed concept
that just confused people.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
0c18dc6bf9 stage: Deprecate the default stage
Deprecate the clutter_stage_get_default() function, as well as the
clutter_stage_is_default() one, and replace its internal usage.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
2288d708e2 script: Do not use clutter_stage_get_default()
It's about to go away, so we should use the StageManager API instead.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
b1ccd262b1 cally/actor: Do not use the default stage as a fallback
Using the default stage as a fallback is wrong in all circumstances.

In this specific case, if an actor is not associated to a stage then it
cannot possibly be the key focus.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
26f4467392 Try to mop up the default stage mess
The default stage was a neat concept when we started Clutter out,
somewhere in the Jurassic era; a singleton instance that gets created at
initialization time, and remains the same for the entire duration of the
process.

Worked well enough when Clutter was a small library meant to be used to
write fullscreen media browsers, but since the introduction of multiple
stages, and Clutter being used to create all sorts of applications, the
default stage is just a vestigial remainder of that past, like an
appendix; something that complicates the layout of the code and
introduces weird behaviour, so that you notice its existence only when
something goes wrong.

Some platforms we do support, though, only have one framebuffer, so it
makes sense for them to have only one stage.

At this point, the only sane thing to do is to go through the same code
paths on all platforms, and that code path is the stage instance
creation and initialization — i.e. clutter_stage_new() (or
g_object_new() with CLUTTER_TYPE_STAGE).

For platforms that support multiple stages, nothing has changed: the stage
created by clutter_stage_get_default() will be set as the default one;
if nobody calls it, the default stage is never created, and it just
lives on as a meaningless check.

For platforms that only support one stage, clutter_stage_new() and
clutter_stage_get_default() will behave exactly the same the first time
they are called: both will create a stage, and set it as the default.
Calling clutter_stage_new() a second time is treated as a programmer
error, and will result in Clutter aborting. This is a behavioural change
because the existing behaviour or creating a new ClutterStage instance
with the same ClutterStageWindow private implementation is, simply put,
utterly braindamaged and I should have *never* had written it, and I
apologize for it. In my defence, I didn't know any better at the time.

This is the first step towards the complete deprecation of
clutter_stage_get_default() and clutter_stage_is_default(), which will
come later.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
6d68ac2e8b osx: Clean up the backend implementation
Instead of implementing create_stage() and a constructor for
ClutterStageOSX, we can use the default implementations in
ClutterBackend, and spare us some code duplication.
2011-11-10 14:55:04 +00:00
Emmanuele Bassi
88b27beea4 wayland/backend: Remove create_stage()
The create_stage() implementation in ClutterBackendWayland isn't doing
anything special, so we can fall back to the default one.
2011-11-10 14:55:04 +00:00
Emmanuele Bassi
17c89bd0a0 backend: Clean up the device manager creation
Create the device manager during the event initialization, where it
makes sense.

This allows us to get rid of the per-backend get_device_manager()
virtual function, and just store the DeviceManager pointer into the
ClutterBackend structure.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
cd1e8da07f */backend: Clean up the stage creation
Use the default implementation of create_stage() wherever possible.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
828ca2982f backend: Provide a default create_stage()
We can now safely create a ClutterStageWindow in the shared code path,
instead of deferring to the backend.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
9c038ebefb stage-window: Add :backend and :wrapper properties
All StageWindow implementation already have back pointers, but we need a
unified API to actually set them from the generic code path; we can use
properties on the StageWindow interface — though this requires fixing
all backends at the same time, to avoid GObject complaining.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
f3c89e82b3 gdk/backend: Fix an invalid chain up 2011-11-10 14:55:03 +00:00
Emmanuele Bassi
b980d2dc17 */backend: Store the StageWindow implementation type 2011-11-10 14:55:03 +00:00
Emmanuele Bassi
6082be409e backend: Store the type of the StageWindow implementation
We can use it later on to create it and provide a default create_stage()
implementation.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
04a2b5f42b egl/backend: Clean up
The "EGL native" backend is just a short-hand for a pure Cogl backend,
using whatever input mechanism was enabled at run-time.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
89e26497de Add a CEx100-specific backend
Instead of piggybacking on the EGL backend, let's create a small
ClutterBackend for the CEx100 platforms. This allows us to handle the
CEx100-specific details in a much cleaner way.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
5c9cafb411 cogl/backend: Remove the ClutterBackendCogl class
All the functionality that ClutterBackendCogl provided has been moved
into ClutterBackend itself, so there is no need to have this class
around in the source.

Cogl-based backends can derive directly from ClutterBackend.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
5ac0cf1c28 cogl/backend: Remove pre/post_parse
The CLUTTER_VBLANK environment variable is now handled in the common
code path.
2011-11-10 14:55:02 +00:00
Emmanuele Bassi
db211a2131 Remove per-backend CLUTTER_VBLANK envvar
We have a global flag we can use.
2011-11-10 14:55:02 +00:00
Emmanuele Bassi
e8562089f6 main: Add a sync-to-vblank global flag
It replaces the per-backend CLUTTER_VBLANK environment variable.
2011-11-10 14:55:02 +00:00
Emmanuele Bassi
80fdbeb954 backend: Provide a default get_features() implementation
Continue gutting ClutterBackendCogl; get_features() is the last bit that
still does something, but now we can use the Cogl API.
2011-11-10 14:42:41 +00:00
Emmanuele Bassi
b97324ee9f win32/backend: Use the default context creation
The win32 backend doesn't do anything special on context creation, so we
can just use the default implementation provided by ClutterBackend.
2011-11-10 14:42:41 +00:00
Emmanuele Bassi
6ec7a28802 gdk/backend: Use the context creation hooks
Same as it has happened to the X11 backend.
2011-11-10 14:42:41 +00:00
Emmanuele Bassi
68e8ef0103 x11/backend: Use the context creation hooks
Don't replace create_context(): given that the X11 backend already uses
Cogl for the context creation, we can just provide the right data
structures ourselves.
2011-11-10 14:42:40 +00:00
Emmanuele Bassi
a918ac92cb backend: Provide a default create_context()
Since we use Cogl for the context creation we can now provide a default
context creation that should just work, plus a couple of hooks to allow
plugging into the creation sequence for platforms supported by Cogl that
require special handling — like foreign displays or alpha-enabled swap
chains.

The various backends have now two choices: either replace the
create_context() in its entirety, or plug themselves into the default
context creation.
2011-11-10 14:42:40 +00:00
Emmanuele Bassi
5b1b936491 backend: Fix up the input backend detection ordering
And add a missing 'else' in the OSX check, to avoid a g_error().
2011-11-10 14:42:40 +00:00
Emmanuele Bassi
1f8915d2c8 Add a 'null' input backend symbol
We should have an input backend symbol that thoroughly disables all
input event handling.
2011-11-10 14:42:40 +00:00
Emmanuele Bassi
adb6ffbd0e backend: Unify the event initialization
Input backends are, in some cases, independent from the windowing system
backends; we can initialize input handling using a model similar to what
we use for windowing backends, including an environment variable and
compile-/run-time checks.

This model allows us to remove the backend-specific init_events(), and
use a generic implementation directly inside the base ClutterBackend
class, thus further reducing the backend-specific code that every
platform has to implement.

This requires some minor surgery to every single backend, to make sure
that the function exposed to initialize the event loop is similar and
performs roughly the same operations.
2011-11-10 14:42:40 +00:00
Emmanuele Bassi
84d208b2c6 win32/backend: Remove ensure_context()
We have a fallback, now.
2011-11-10 14:42:40 +00:00
Emmanuele Bassi
672ab70144 win32/stage: Implement get_active_framebuffer() 2011-11-10 14:42:40 +00:00
Emmanuele Bassi
42af690255 wayland/backend: Remove empty ensure_context()
There is a default fallback, now.
2011-11-10 14:42:40 +00:00
Emmanuele Bassi
0c02e8adb3 cogl/backend: Remove ensure_context()
We have a default implementation for it, now.
2011-11-10 14:42:40 +00:00
Emmanuele Bassi
790c0d1f91 backend: Provide an implementation of ensure_backend()
We can do it for all Cogl-based backends.
2011-11-10 14:42:39 +00:00
Emmanuele Bassi
0550a8b99d color: Validate hex formats
Right now, we pass through to Pango unrecognized hexadecimal formats
when parsing colors from strings. Since we parse all possible formats
ourselves, we can do validation ourselves as well, and avoid the Pango
path.
2011-11-10 14:13:45 +00:00
Jasper St. Pierre
b96773f9c9 clutter-stage-x11: Make sure to set geometry x and y
Otherwise, we could be dealing with uninitialized values, causing
havoc all over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=663733
2011-11-10 12:57:34 +00:00
Craig R. Hughes
33303f92f3 Minor whitespace fix for clutter color parsing of hsla(h,s,l,a)
Previously, if there was whitespace between "l" and the comma before the
alpha value, parsing would fail.  This patch allows that whitespace
making it consistent with whitespace being allowed everywhere else.

https://bugzilla.gnome.org/show_bug.cgi?id=663594
2011-11-10 12:57:34 +00:00
Matthias Clasen
d596401a3c cally: Use the proper role for password entries
https://bugzilla.gnome.org/show_bug.cgi?id=663332
2011-11-10 12:57:34 +00:00
Emmanuele Bassi
7b5e5b7727 main: Add a debug note when reading the settings file
So that's easier to track in the debug log.
2011-11-09 09:09:37 +00:00
Chun-wei Fan
63dbcc245c Merge branch 'master' into msvc-support-master 2011-11-09 00:30:32 +08:00
Emmanuele Bassi
ba8d682c09 actor: Deprecate [sg]et_geometry()
These methods are short-hands for accessing the position and size,
which are already shorthands for accessing the various dimensional
and positional attributes. Plus, they use ClutterGeometry, which is a
fairly bad data type for a rectangle.
2011-11-08 14:46:55 +00:00
Emmanuele Bassi
101f39ea92 Replace usage of [sg]et_geometry()
The set_geometry() and get_geometry() methods are going to be
deprecated.
2011-11-08 14:46:16 +00:00
Emmanuele Bassi
4fe7a77302 Replace ClutterGeometry with cairo_rectangle_int_t
We still use ClutterGeometry internally in a couple of places, but we
should really move away from that flawed rectangle data type, and use
the Cairo one.

Sadly, we still have some public API that we cannot remove yet.
2011-11-08 14:20:32 +00:00
Emmanuele Bassi
76e85f68ea build: Remove mention of missing file
There is no clutter-event-gdk.h in the build.
2011-11-08 11:19:22 +00:00
Emmanuele Bassi
67d5a4993c main: Deprecate clutter_set_default_frame_rate()
Setting the default frame rate does not do anything even remotely
useful, unless synchronization to the vertical refresh rate is also
disabled - which can only be done through environment variable or
through configuration file. Having a programmatic way to change the
default frame rate is, thus, completely pointless.

Changing the default frame rate through environment variable and
configuration file is still allowed.
2011-11-07 20:31:15 +00:00
Chun-wei Fan
bd9dbe870a Add GDK-specific symbols to clutter.symbols
A GDK backend for clutter was added in commits 610a9c17
(Add A new GDK backend) and f14cbf5b (gdk: Allow disabling event retrieval)

These are not included in the Win32 builds for the moment as GDK3 is
quite unstable on Windows at this time
2011-11-07 12:44:44 +08:00
Chun-wei Fan
73fa9eec5f Update clutter-version.h.win32.in
-Update clutter-version.h.win32.in to reflect the state of
 clutter-version.h.in commit 21a24c86 (updated in commit 8249e488)
-Also add clutter_check_windowing_backend to clutter.symbols as a result.
2011-11-07 12:12:53 +08:00
Chun-wei Fan
bb9e452a36 Merge branch 'master' into msvc-support-master 2011-11-07 11:42:16 +08:00
Emmanuele Bassi
e0bfdbfeba osx/stage: Fix compilation
We need to include clutter-stage-window.h.
2011-11-04 12:03:13 +00:00
Colin Walters
6f8f8295c0 build: Ensure libdir exists before installing to it 2011-11-03 14:45:29 -04:00
Emmanuele Bassi
683642ba54 docs: Fixes for the API reference build 2011-11-03 16:05:36 +00:00
Emmanuele Bassi
7ab84f981c Remove CLUTTER_DISABLE_DEPRECATED from the build flags
We don't use it any more.
2011-11-03 15:35:01 +00:00
Emmanuele Bassi
2403d4875b Remove CLUTTER_DISABLE_DEPRECATED guard
Except for macros, we now entirely depend on the deprecation warnings
instead of a guard.
2011-11-03 15:32:04 +00:00
Emmanuele Bassi
9ea2bb694e docs: Fix a wrongly named argument 2011-11-03 15:16:02 +00:00
Emmanuele Bassi
98b467f9b8 stage: Move the deprecated macros to a separate header
The clutter-stage.h header still has a bunch of macros that have, for
reasons unknown[*], survived the 1.0 API cut and have long since been
deprecated. Let's hide them under the deprecated/ carpet and let us
never speak of them ever again.

[*] pretty sure alcohol or other psychotropic substances were involved
but I take the 5th on that.
2011-11-03 15:13:54 +00:00
Emmanuele Bassi
0157615fae build: Fix compilation 2011-11-03 15:03:16 +00:00
Emmanuele Bassi
11420a7057 group: Move deprecated macro into its own header 2011-11-03 15:02:35 +00:00
Emmanuele Bassi
530b07f12b Don't use a -deprecated suffix for headers
They are already in the deprecated/ directory, the suffix is redundant,
and there is no chance of collision.
2011-11-03 14:49:56 +00:00
Emmanuele Bassi
142cd0bf82 Move clutter-keysyms-compat.h to the deprecated section
No reason to have it lingering in the main section.
2011-11-03 14:42:39 +00:00
Emmanuele Bassi
983510fad4 x11/backend: Use an internal GError
Don't just return the error from Cogl, but proxy it so that it has the
correct error domain and code.
2011-11-03 14:02:43 +00:00
Emmanuele Bassi
8249e48802 Clean up the windowing system defines
Instead of defining new symbols for the windowing systems enabled at
configure time, we can reuse the same symbols for both the compile time
and run time checks, e.g.:

  #ifdef CLUTTER_WINDOWING_X11
    if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
      /* use the clutter_x11_* API */
    else
  #endif
  #ifdef CLUTTER_WINDOWING_WIN32
    if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WIN32))
      /* use the clutter_win32_* API */
  #endif

This scheme allows us to ensure that the input system namespace is free
for us to use and select at run time in later versions of Clutter.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
98c177def5 Clean up the backend creation
Move it to its own function.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
3987db1659 build: Make sure to remove colliding shared libraries
The compatibility links should take over any existing installed
shared library with the same soname, to avoid ldd creating stale
links.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
4b0d7f2929 build: Improve the compat libs rule
Use the same commands libtool uses when installing symbolic links for
the shared libraries.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
8eb71af23d gdk/events: Clean up the event handling code
We need debugging notes, to see what's happening when handling events.

We need to queue a (clipped) redraw when receiving a GDK_EXPOSE event.

We need to check the device (both master and source) of the event using
the GdkEvent API, and pass them to the ClutterEvent using the
corresponding Clutter API.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
405e72f2e4 egl: First attempt at cleaning up the EGL native backend
At least, let's make it compile when built along with the other
backends. In reality, it still needs to be verified as working.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
19508132df build: Move EGL-related files under egl/
Including the clutter-cex100.h.in header.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
4ee00b67b5 build: Move clutter-event-tslib.c out of egl/
Prepare for a full tslib device manager.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
6e9f474d90 Coding style and cosmetic fixes 2011-11-03 13:45:20 +00:00
Emmanuele Bassi
fedfac3b7c Remove the X11-specific bit in ClutterStageCogl
Let's use a new virtual function in ClutterStageWindow to check whether
a platform-specific implementation does support clipped redraws.
2011-11-03 13:45:19 +00:00
Emmanuele Bassi
f58d393187 gdk: Fix Stage foreign window support
The code is generally wrong, and does not work. We need to skip the
GdkWindow creation when we have a foreing window, but we still need to
create the Cogl onscreen buffer and connect it to the GdkWindow's native
resource.
2011-11-03 13:45:19 +00:00
Emmanuele Bassi
f14cbf5bdb gdk: Allow disabling event retrieval
Just like the other backends can disable the internal event handling,
and use clutter_<backend>_handle_event() to do the native → Clutter
event translation.
2011-11-03 13:45:19 +00:00
Emmanuele Bassi
a73f1e6768 Cosmetic fixes 2011-11-03 13:45:19 +00:00
Emmanuele Bassi
21a24c862e Allow checking the backend type at run-time
Portable code should be allowed to check type backend currently being
used, so that it can use platform-specific API (not just Clutter's).

We don't want to go down the GDK route, with public types for
ClutterBackend and ClutterStageWindow implementations, and use the type
system, e.g.:

  #ifdef GDK_WINDOWING_X11
    if (GDK_IS_WINDOW_X11 (window))
      use_x11_api (window);
    else
  #endif
  #ifdef GDK_WINDOWING_WIN32
    if (GDK_IS_WINDOW_WIN32 (window))
      use_win32_api (window);
    else
  #endif
    g_critical ("Unsupported backend");

This system would make us expose the backend system, and we want to
still reserve us the option to change the backend system to increase its
granularity — e.g. choosing different input event systems regardless of
the windowing system.

This commit adds a simple function that checks the backend type against
a symbolic constant — the same constant string that can be used to
select the backend at run-time through the CLUTTER_BACKEND environment
variable.
2011-11-03 13:45:19 +00:00
Emmanuele Bassi
a09bbffd92 Implement multi-backend support
The Clutter backend split is opaque enough that should allow us to just
build all possible backends inside the same shared object, and select
the wanted backend at initialization time.

This requires some work in the build system, as well as the
initialization code, to remove duplicate functions that might cause
conflicts at build and link time. We also need to defer all the checks
of the internal state of the platform-specific API to run-time type
checks.
2011-11-03 13:45:19 +00:00
Giovanni Campagna
9c102b7c51 Rework the interaction between the Cogl and GDK / X11 backends.
Previously, the Cogl backend was at times a subclass of the X11
backend, and at times a standalone one. Now it is the other way
round, with GDK and X11 backends providing the concrete classes,
layered on top of the generic Cogl backend. A new EglNative backend
was introduced for direct to framebuffer rendering. This greatly
simplifies the API design (at the expense of some casts needed)
and reduces the amount of #ifdefs, without duplicating code.

https://bugzilla.gnome.org/show_bug.cgi?id=657434
2011-11-03 13:45:17 +00:00
Giovanni Campagna
610a9c17ba Add a new GDK backend
This commit introduces a new flavour for Clutter, that uses GDK
for handling all window system specific interactions (except for
creating the cogl context, as cogl does not know about GDK), including
in particular events. This is not compatible with the X11 (glx)
flavour, and this is reflected by the different soname (libclutter-gdk-1.0.so),
as all X11 specific functions and classes are not available. If you
wish to be compatible, you should check for CLUTTER_WINDOWING_X11.
Other than that, this backend should be on feature parity with X11,
including XInput 2, XSettings and EMWH (with much, much less code)

https://bugzilla.gnome.org/show_bug.cgi?id=657434
2011-11-03 13:42:13 +00:00
Robert Bragg
db53ca382c cogl: fallback to non-transparent stages if unsupported
If our check of the CoglOnscreenTemplate during initialization fails
then we disable the request for an alpha component in the swap chain and
try the check again.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-11-02 17:38:56 +00:00
Emmanuele Bassi
4ce95306a3 tslib: Remove mention of clutter-stage-egl.h
That header has long since disappeared from the build.
2011-11-02 13:00:47 +00:00
Emmanuele Bassi
0b4b19700f utils: Remove CLUTTER_DISABLE_DEPRECATED
We use deprecation warnings now.
2011-11-02 13:00:47 +00:00
Emmanuele Bassi
377a292b4e texture: Remove CLUTTER_DISABLE_DEPRECATED
We use deprecation warnings now.
2011-11-02 13:00:46 +00:00
Emmanuele Bassi
4a4289cfa5 stage-manager: Remove CLUTTER_DISABLE_DEPRECATED
We use deprecation warnings now.
2011-11-02 13:00:46 +00:00
Emmanuele Bassi
1ba9a123ed cairo-texture: Remove CLUTTER_DISABLE_DEPRECATED
We use deprecation warnings now.
2011-11-02 13:00:46 +00:00
Emmanuele Bassi
f4d8ba7db4 animatable: Remove CLUTTER_DISABLE_DEPRECATED
We use deprecation warnings, now.
2011-11-02 13:00:46 +00:00
Emmanuele Bassi
f4e971a7e5 cairo-texture: Use an internal function for create_region()
Avoid double argument checking, and a deprecation warning when
implementing create() as a wrapper around create_region(), by using
a simple internal function.
2011-11-02 13:00:46 +00:00
Emmanuele Bassi
b19c919645 actor: Move deprecated symbols into separate headers
The clutter-actor.h header is already pretty big, so let's try to keep
the deprecated symbols out of it.
2011-11-02 13:00:46 +00:00
Emmanuele Bassi
40d703a005 backend: Move deprecated symbols to a separate header 2011-11-02 13:00:46 +00:00
Emmanuele Bassi
a39be454cf main: Move deprecated symbols to a separate header
The number of deprecations in clutter-main.h makes the header harder to
parse, and more confusing. We can use a separate header under the
deprecated subdirectory to hold all the deprecated symbols.
2011-11-02 13:00:46 +00:00
Robert Bragg
6e28121ff3 cogl: include <cogl/cogl-xlib.h> for xlib specific symbols
Since Xlib.h is such a terrible citizen when it comes to symbol
namespacing it's not desirable to include Xlib.h if it is not absolutely
required. Cogl now has a standalone cogl-xlib.h that should be included
whenever any xlib specific symbols are required.

This patch updates clutter to include <cogl/cogl-xlib.h> wherever
clutter needs to use xlib specific cogl apis.

Acked-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-11-01 16:24:00 +00:00
Emmanuele Bassi
0bfda78615 profile: Disable deprecation warnings
We use an atexit() handler to print out the profile report coming from
Uprof. The g_atexit() call has been deprecated by GLib, but since this
use case is pretty specific and it's not meant to be turned on by
default (or distributed) then we can safely disable the deprecation
warnings inside clutter-profile.c.
2011-10-31 10:39:46 +00:00
Emmanuele Bassi
09de87b0e5 backend: Remove atexit handlers
The g_atexit() function has been deprecated in GLib as it is a fairly
bad idea in basically all cases.

We could probably use a GCC destructor if we didn't care about
portability, but for the time being we just remove the atexit() handler
that disposed the backend.
2011-10-31 10:33:46 +00:00
Emmanuele Bassi
d97a8c431b cairo-texture: Drop the half pixel rounding
Calling ceilf() should be enough.

https://bugzilla.gnome.org/show_bug.cgi?id=661887
2011-10-31 10:33:46 +00:00
Chun-wei Fan
0406e235bf Merge branch 'master' into msvc-support-master 2011-10-26 12:55:05 +08:00
Emmanuele Bassi
81a82867e1 docs: Clarify CLUTTER_ACTOR_IS_MAPPED
There are a couple of gotchas in the 'mapped' flag that are not properly
documented, or are documented only in the actor_invariants.txt file; we
should have a proper description in the API reference as well, to avoid
confusion.
2011-10-25 11:35:04 +01:00
Chun-wei Fan
8c196c9403 Bug 662071-[Win32]-Don't init the Big Clutter Lock
Since the Windows GUI system is assuming multithreadedness, initializing
locks after entering the GUI portion on Windows is likely to cause
problems[1][2], which results many Clutter programs to crash due to
releasing resources that they did not own.

[1]: Multi-threaded use of GTK+ on Win32 in README.win32 of GTK+
     source package
[2]: Explanation of Windows GUI system regarding its multithreadness
     assumptions-
     http://mail.gnome.org/archives/gtk-list/2011-June/msg00005.html
2011-10-25 01:27:51 +08:00
Chun-wei Fan
7c6038d77b Bug 662071-[Win32]-Don't init the Big Clutter Lock
Since the Windows GUI system is assuming multithreadedness, initializing
locks after entering the GUI portion on Windows is likely to cause
problems[1][2], which results many Clutter programs to crash due to
releasing resources that they did not own.

[1]: Multi-threaded use of GTK+ on Win32 in README.win32 of GTK+
     source package
[2]: Explanation of Windows GUI system regarding its multithreadness
     assumptions-
     http://mail.gnome.org/archives/gtk-list/2011-June/msg00005.html
2011-10-25 00:13:53 +08:00
Chun-wei Fan
0f9eded1c3 Revert "Don't init the Big Clutter Lock on Win32"
This reverts commit f6acae9f3d.
2011-10-25 00:01:24 +08:00
Chun-wei Fan
f6acae9f3d Don't init the Big Clutter Lock on Win32
Since the Windows GUI system is assuming multithreadedness, initializing
locks after entering the GUI portion on Windows is likely to cause
problems[1][2], which results many Clutter programs to crash due to
releasing resources that they did not own.

[1]: Multi-threaded use of GTK+ on Win32 in README.win32 of GTK+ source package
[2]: Explanation of Windows GUI system regarding its multithreadness
     assumtopns-http://lists-archives.org/gtk/12724-compiling-a-gtk-application-on-windows.html
2011-10-24 17:17:39 +08:00
Emmanuele Bassi
5540e6bd9c docs: Document the behaviour in case of init failure
Or, better, the fact that the behaviour of any Clutter function will be
undefined in case the initialization fails.

The value returned by clutter_init() and friends has to be handled
properly.
2011-10-21 21:19:27 +01:00
Chun-wei Fan
fedca055e9 Revert "Revert "Deprecate clutter_threads_init()""
This reverts commit 5419c11c99.

This is another part to attempt to investigate on error 0xC0000264
on Windows
2011-10-21 17:44:27 +08:00
Chun-wei Fan
e0ad11a193 Revert "clutter-main.c: Fix multiple declarations"
This reverts commit 3d74552684.

This is a part to attempt to further investigate about the 0xC0000264 error
on Windows
2011-10-21 17:43:21 +08:00
Chun-wei Fan
3d74552684 clutter-main.c: Fix multiple declarations
clutter_threads_impl_lock/clutter_threads_impl_unlock was accidently
defined 2 times during the revert-fix that.
2011-10-20 15:42:55 +08:00
Chun-wei Fan
d6af2e54c8 Merge branch 'master' into msvc-support-master 2011-10-20 15:41:46 +08:00
Chun-wei Fan
5419c11c99 Revert "Deprecate clutter_threads_init()"
This reverts commit 7e3a75c66b.

Conflicts:

	clutter/clutter-main.c
	clutter/clutter-main.h
2011-10-20 15:17:25 +08:00
Robert Bragg
63cc5ab698 blur: don't accumulate texture padding twice
This removes the create_texture implementation for ClutterBlurEffect
because we already account for padding in the get_paint_volume
implementation so we were creating textures larger than necessary.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-10-19 15:27:03 +01:00
Emmanuele Bassi
a18a8a3ae2 Avoid the shadowing of 'clone'
The clone() call can creep into the build environment, so it's a good
thing to avoid using 'clone' as a variable name.
2011-10-19 15:23:55 +01:00
Chun-wei Fan
e33a6219d8 Merge branch 'master' into msvc-support-master 2011-10-18 15:48:17 +08:00
Emmanuele Bassi
8083dd5178 docs: Improve documentation of LayoutManager
Especially with regards to layout properties and their usage inside a
ClutterScript UI definition.
2011-10-17 11:48:47 +01:00
Chun-wei Fan
8b5d255a2b Update clutter.symbols
_clutter_shader_release_all is removed...
2011-10-17 18:37:32 +08:00
Emmanuele Bassi
be4007ef53 Remove mentions of clutter_redraw() 2011-10-17 10:25:07 +01:00
Emmanuele Bassi
146e15297f debug: Clean up debugging notes 2011-10-17 10:24:25 +01:00
Chun-wei Fan
b1780711f7 Merge branch 'master' into msvc-support-master 2011-10-17 15:52:57 +08:00
Emmanuele Bassi
1e51961f7a align-constraint: Add CLUTTER_ALIGN_BOTH
Just like ClutterBindConstraint has two shorthand enumerations for binding
position and size and avoid using multiple instances, ClutterAlignConstraint
should have a way to align an actor with the same alignment factor on both
axis at the same time; this is especially useful for centering actors.
2011-10-15 18:36:27 +01:00
Emmanuele Bassi
7f3363e1db Tag all deprecated symbols using CLUTTER_DEPRECATED
This requires some minor surgery in the build to disable the deprecation
warnings in the deprecated classes.
2011-10-14 11:34:38 +01:00
Emmanuele Bassi
a063f09611 debug: Move paint-deform-tiles to CLUTTER_PAINT
The CLUTTER_DEBUG class of debugging flags is meant for debugging notes,
while the CLUTTER_PAINT debugging flags are for changing the output of
the paint cycle. Painting the DeformEffect tiles should go in the latter.
2011-10-13 11:38:27 +01:00
Emmanuele Bassi
ef1a3a5477 docs: Include test-threads.c in the API reference
We can use the test-threads.c interactive test as part of the documentation
on how to use threads with Clutter.
2011-10-13 10:42:30 +01:00
Emmanuele Bassi
e0283993f4 Avoid using deprecated API internally
Use the proper API to implement deprecated functions.
2011-10-12 16:44:55 +01:00
Emmanuele Bassi
72da6f808e texture: Disable deprecation warnings
Sadly, ClutterTexture is still using internally deprecated API, like
clutter_actor_get_shader().
2011-10-12 12:36:41 +01:00
Chun-wei Fan
0ee89f1788 clutter-backend-win32.c: Include clutter-shader.h
This is needed for _clutter_shader_release_all to avoid C4013
errors/warnings (a.k.a implicit declaration of ...)
2011-10-12 17:50:32 +08:00
Emmanuele Bassi
53d9e88135 Remove _clutter_shader_release_all()
This function is called when the backend is being disposed - as a way
of releasing all ClutterShader. This doesn't take into account three
things:

  - ClutterShader is deprecated
  - the Backend is *never* disposed
  - once the process terminates, all its resources are automatically
    released by the OS

So the _clutter_shader_release_all() function is a pointless exercise
in futility.
2011-10-12 10:36:17 +01:00
Chun-wei Fan
a2bd2afb93 clutter/Makefile.am
The previous update on clutter-timeout-interval.[ch] is wrong, so correct
that and add $(deprecated_c_priv) to the VS sources list.  Sorry.
2011-10-12 17:33:33 +08:00
Chun-wei Fan
15cafc4c77 clutter/Makefile.am: Update formatting from last commit 2011-10-12 17:30:08 +08:00
Chun-wei Fan
830d6887cd clutter/Makefile.am: Made up for missed sources
The clutter/deprecated/clutter-timeout-interval.c is missed from the
deprecated_c sources list...
2011-10-12 17:26:31 +08:00
Chun-wei Fan
e0de326b2a clutter/clutter-keysyms-table.c: Fix function name
The function name is clutter_unicode_to_keysym, not
clutter_unicode_to_keyval
2011-10-12 17:25:37 +08:00
Chun-wei Fan
cb98da4a9d Update clutter.symbols 2011-10-12 17:24:36 +08:00
Chun-wei Fan
762a4350d1 Update VS support
-clutter/Makefile.am: Include the deprecated sources as well
-clutter.vc(x)projin: Add clutter/deprecated into the "Additional Include
 Directories"
2011-10-12 17:02:08 +08:00
Chun-wei Fan
72bedbc4e9 Update clutter.symbols
For deprecation of APIs, in commits
522b8be3 (clutter_get_input_device_for_id())
6ef09dd1 (clutter_clear_glyph_cache())
01080dc5 (clutter_[sg]et_font_flags())
2011-10-12 16:17:27 +08:00
Chun-wei Fan
bd991e625b Merge branch 'master' into msvc-support-master 2011-10-12 14:37:19 +08:00
Emmanuele Bassi
193b345786 Remove some compiler warnings
Some issues found using clang as the compiler.
2011-10-11 23:42:23 +01:00
Emmanuele Bassi
2ede853ea3 Fix included header 2011-10-11 23:11:56 +01:00
Emmanuele Bassi
af7afc29a7 Add a Clutter-specific deprecation macro for symbols
Just like GLIB_DEPRECATED and GLIB_DEPRECATED_FOR, Clutter should have
its own wrappers for G_DEPRECATED and G_DEPRECATED_FOR, to allow opting
out of deprecation warnings.

Deprecation warnings are enabled by default, now, even when building
Clutter.
2011-10-11 23:03:09 +01:00
Emmanuele Bassi
b34e89e0c5 Fix duplicate typedef of ClutterAlpha
Caught on OS X but not on my Fedora machine. Weird.
2011-10-11 23:02:17 +01:00
Emmanuele Bassi
7bd5659962 Do not leak strings from GKeyFile
The string getters always copy, so we need to free the returned
values.
2011-10-11 22:45:14 +01:00
Emmanuele Bassi
809298b5a2 Move more typedefs into clutter-types.h 2011-10-11 17:59:50 +01:00
Emmanuele Bassi
d28e04be72 Move all enumerations to a separate file
This should allow sharing types, and we can avoid glib-mkenums thrawling
the whole repository for enumerations.
2011-10-11 17:59:46 +01:00
Emmanuele Bassi
a21f1d1580 Move clutter-fixed.[ch] to the deprecated section 2011-10-11 17:58:40 +01:00
Emmanuele Bassi
62d72b8690 Move ClutterBehaviour to the deprecated section 2011-10-11 17:58:40 +01:00
Emmanuele Bassi
e268201221 Minor header surgery to ClutterBehaviour
This moves a couple of definitions to the common types header, and makes
sure that ClutterBehaviour subclasses include clutter-behaviour.h first,
so that their types can be fully expanded without necessarily have the
ClutterBehaviour header header included by their public headers. This is
the necessary prelude to have clutter-behaviour.[ch] moved to the
deprecated section.
2011-10-11 17:58:40 +01:00
Emmanuele Bassi
bcd7845d91 Move ClutterBehaviour subclasses to the deprecated section
Moving ClutterBehaviour itself will require some minor header surgery,
so we'll do that next.
2011-10-11 17:58:40 +01:00
Emmanuele Bassi
e57f8c26f6 Move ClutterShader to the deprecated section 2011-10-11 17:58:40 +01:00
Emmanuele Bassi
4b33a9c5f4 Move ClutterScore to the deprecated section 2011-10-11 17:58:39 +01:00
Emmanuele Bassi
4b748f4334 Move timeout pool to the deprecated section 2011-10-11 17:58:39 +01:00
Emmanuele Bassi
50cda9fed1 build: Move deprecated code into its own prefix
The code that has been deprecated should live into its own directory,
both in the repository and when installed. This should make it clear
which functionality is actually maintained and which is not.

We start with an oldie: the frame source API.
2011-10-11 17:58:35 +01:00
Emmanuele Bassi
372b39fd63 Add more sections to the Clutter configuration file
On top of the existing "Settings" group in the settings.ini file we
should have two more groups:

  Environment   - contains all the configuration possible through
                  environment variables
  Debug         - contains all the possible debug variables
2011-10-11 17:52:17 +01:00
Emmanuele Bassi
f5eee5aec7 Add a configuration file for ClutterSettings
ClutterSettings should be able to load its initial state by using
configuration files in SYSCONFDIR and XDG_CONFIG_HOME. This allows
Clutter to have a system (and user) configuration on platforms that
do not have XSETTINGS bridges.
2011-10-11 17:20:20 +01:00
Emmanuele Bassi
01080dc5f3 Deprecate clutter_[sg]et_font_flags()
We already have two mechanisms for controlling the font rendering
quality on a per-application basis:

  • ClutterSettings properties
  • clutter_backend_set_font_options()

The font flags were always a stop-gap solution, and one that tried to
simplify a fairly complex issue beyond the point of actually being
useful.

https://bugzilla.gnome.org/show_bug.cgi?id=660786
2011-10-11 17:19:42 +01:00
Emmanuele Bassi
6ef09dd15b Deprecate clutter_clear_glyph_cache()
This is a wrapper function for API that has long since been public.
2011-10-11 17:19:08 +01:00
Emmanuele Bassi
522b8be306 Deprecate clutter_get_input_device_for_id()
We have the ClutterDeviceManager methods for that.
2011-10-11 17:19:08 +01:00
Emmanuele Bassi
b6dd306998 Clean up grab implementation
The grab API is a relic of Clutter 0.6, and hasn't been through proper
vetting in a *long* time — mostly due to the fact that we don't really
like grabs, and point to the ::captured-event as a way to implement
"soft grabs" in toolkits and applications.

The implementation of full and device grabs uses weak references on
actors instead of using the ::destroy signal, which is meant exactly for
the case of releasing pointers to actors when they are disposed.

The API naming scheme is also fairly broken, especially for
device-related grabs.

Finally, keyboard device grabs are just not implemented.

We can, in one go, clean up this mess and deprecate a bunch of badly
named API by introducing generic device grab/ungrab methods on
ClutterInputDevice, and re-implement the current API on top of them.
2011-10-11 17:15:34 +01:00
Chun-wei Fan
93f2b3d60d Update clutter.symbols
Due to an added API in commits 25b7b30c (clutter_unicode_to_keysym)
2011-10-11 17:24:58 +08:00
Chun-wei Fan
1cf7128540 Merge branch 'master' into msvc-support-master 2011-10-11 17:19:45 +08:00
Emmanuele Bassi
33846dcf4d Deprecate clutter_redraw()
It's just a badly named proxy to clutter_stage_ensure_redraw().
2011-10-10 15:48:43 +01:00
Emmanuele Bassi
51ca20e81e Cosmetic fixes 2011-10-10 15:42:36 +01:00
Emmanuele Bassi
b5109e852a animation: Use the timeline's new-frame signal
Instead of using the ClutterAlpha's notify::alpha. This makes the code
less dependent on GObject's property notification.
2011-10-07 16:56:21 +01:00
Emmanuele Bassi
7e3a75c66b Deprecate clutter_threads_init()
GLib deprecated g_thread_init(), and threading support is initialized
by GObject, so Clutter already runs with threading support enabled. We
can drop the clutter_threads_init() call requirement, and initialize the
Big Clutter Lock™ on clutter_init(). This reduces the things that have
to be done when dealing with threads with Clutter, and the things that
can possibly go wrong.
2011-10-07 15:57:32 +01:00
Emmanuele Bassi
32b8217027 Use a static mutex for the default Clutter lock
The Big Clutter Lock™ can now be a static GMutex, since GLib supports
them. We can also drop a bunch of checks given the recent changes in
GLib threading API.
2011-10-07 15:10:37 +01:00
Emmanuele Bassi
389d247278 texture: Drop G_MUTEX_INIT
The static initializer for GMutex has been removed from GLib.

The g_thread_supported() call can also be removed: threading is always
enabled in GLib ≥ 2.31.
2011-10-07 15:09:47 +01:00
Marc-André Lureau
6d974f278e Mark clutter_state_set_key() source_state_name as nullable
https://bugzilla.gnome.org/show_bug.cgi?id=661022
2011-10-07 12:11:52 +01:00
Zan Dobersek
25b7b30ccc Add clutter_unicode_to_keyval function
This commit introduces a unicode-to-keyval conversion function that
performs identical action as the gdk version of that function. Also
added is the necessary table holding all the conversion values.

https://bugzilla.gnome.org/show_bug.cgi?id=661015
2011-10-07 12:11:20 +01:00
Sunjin Yang
5dbc00e625 box-layout: Plug memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=660985
2011-10-07 11:53:02 +01:00
Chun-wei Fan
d86a6d8df4 Update clutter.symbols
...Due to the addtion of clutter_actor_has_actions,
   clutter_actor_has_contraints and clutter_actor_has_effects APIs
2011-10-06 12:53:41 +08:00
Chun-wei Fan
b55656b698 Merge branch 'master' into msvc-support-master 2011-10-06 12:04:30 +08:00
Emmanuele Bassi
938fcc60f0 Deprecate the GParamSpec for CoglFixed
The fixed-point API is not used anywhere, and it's pretty much useless
to have a fixed-point type for properties.
2011-10-04 10:32:27 +01:00
Håkon Løvdal
839b939d36 spelling fix: timeour -> timeout 2011-10-03 15:58:42 +01:00
Adel Gadllah
d331e92742 clutter-actor-meta: Fix _clutter_meta_group_has_metas_no_internal
This function is backwards i.e it is supposed to check for metas that
are *not* internal, hence the name.

https://bugzilla.gnome.org/show_bug.cgi?id=660623
2011-10-01 12:40:11 +02:00
Emmanuele Bassi
6377d3646b paint-volume: Don't try to complete a completed volume
If we do project() → get_bounding_box(), we'll try to complete the
volume twice, which whacks out all the lazily computed vertices.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-30 17:05:15 +01:00
Neil Roberts
8b995a9457 clutter-shader-effect: Add a get_static_shader_source virtual
This is used as an alternative to calling
clutter_shader_effect_set_shader_source. A ClutterShaderEffect
subclass is now expected to implement this method to return the source
for the effect that will be used for all instances of this
subclass. It is only called once regardless of the number of instances
created. That way Clutter can avoid recompiling the shader source for
every new instance of the effect.

https://bugzilla.gnome.org/show_bug.cgi?id=660512

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-30 11:51:37 +01:00
Adel Gadllah
e8ec7ebed0 ClutterActor: Add clutter_actor_has_actions
Adds an efficent way to query whether an actor has any
applied actions.

https://bugzilla.gnome.org/show_bug.cgi?id=660471
2011-09-29 19:34:32 +02:00
Adel Gadllah
e81800607c ClutterActor: Add clutter_actor_has_contraints
Adds an efficent way to query whether an actor has any
applied constraints.

https://bugzilla.gnome.org/show_bug.cgi?id=660471
2011-09-29 19:34:31 +02:00
Adel Gadllah
bed2d9e787 ClutterActor: Add clutter_actor_has_effects
Adds an efficent way to query whether an actor has any
applied effects.

https://bugzilla.gnome.org/show_bug.cgi?id=660471
2011-09-29 19:34:24 +02:00
Chun-wei Fan
f0dfd8ab07 Merge branch 'master' into msvc-support-master
Conflicts:
	tests/interactive/Makefile.am
2011-09-29 16:33:02 +08:00
Emmanuele Bassi
b1fbbe23b4 Revert "Add lightness, brightness, and contrast effects"
Discussed a bit with Neil, and I might have jumped the gun a little.
We might want a different API for 1.10. See comment 12 on:

https://bugzilla.gnome.org/show_bug.cgi?id=656156

This reverts commit 4829ae1c79.
2011-09-28 15:54:32 +01:00
Joseph Scheuhammer
4829ae1c79 Add lightness, brightness, and contrast effects
Added three classes for new clutter effects:  inverse lightness,
modify brightness, and modify contrast.

https://bugzilla.gnome.org/show_bug.cgi?id=656156
2011-09-28 10:32:15 -04:00
Emmanuele Bassi
56c7d9b0b3 texture: Simplify asynchronous loading code
The asynchronous loading code could do with some modernization.

First of all, we should drop the internal GMutex held when manipulating
the boolean flags: it's far too expensive for its role, and modern GLib
provides us with bitlocks that are quite a lot faster.

Then we should consolidate most of the implementation into something
smaller and more manageable.
2011-09-28 13:52:53 +01:00
Emmanuele Bassi
11c585c420 texture: Remove GStaticMutex
It's now possible to statically initialize a GMutex.
2011-09-28 13:52:53 +01:00
Tomeu Vizoso
39db46123e Add paint-deform-tiles option to CLUTTER_DEBUG
To make easier to visualize the triangles in a ClutterDeformEffect

https://bugzilla.gnome.org/show_bug.cgi?id=660354
2011-09-28 14:28:04 +02:00
Chun-wei Fan
9e822d9ae4 Merge branch 'master' into msvc-support-master 2011-09-27 14:35:26 +08:00
Emmanuele Bassi
1776ac8ed5 Remove internal usage of ClutterGeometry in StageWindow
The ClutterGeometry type is a poor substitute of cairo_rectangle_int_t,
with unsigned integers for width and height to complicate matters.

Let's remove the internal usage of ClutterGeometry and switch to the
rectangle type from Cairo.

https://bugzilla.gnome.org/show_bug.cgi?id=656663
2011-09-26 12:05:55 +01:00
Colin Walters
d3bafc4b09 clutter-main: Reword translator comment for default:LTR
This makes it much clearer, and fixes some typos in the original.

https://bugzilla.gnome.org/show_bug.cgi?id=659893
2011-09-23 17:48:34 +01:00
Alexandre Franke
a23e59bd66 Mark forgotten string as translatable
https://bugzilla.gnome.org/show_bug.cgi?id=659928
2011-09-23 17:48:34 +01:00
Neil Roberts
f8d808f140 Add a CLUTTER_PAINT debug option to enable continous redrawing
When testing the performance of an application, it's often useful to
force it to continuously redraw instead of going idle to help measure
the frame rate. This just adds a CLUTTER_PAINT=continuous-redraw which
causes the master clock to queue a redraw on all of the stages
just before it prepares its source.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-23 15:31:50 +01:00
Neil Roberts
c67d3e5b52 clutter-offscreen-effect: Apply matrix expansion to proj not mv
When the viewport gets expanded because the actor extends off the edge
of the screen, instead of applying the transformation to the root of
the modelview transformation it is now applied to the end of the
projection transformation. This should end up with the same
transformation. This fixes a problem when the offscreen effects are
nested and the inner effect would try to pick up the current modelview
transformation to rescale it to fit the new viewport size. In this
case the modelview would have already been scaled for the size of the
outer viewport so it would end up wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=659601

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-22 12:28:59 +01:00
Emmanuele Bassi
8051c47664 Fix typo in ClutterSettings:password-hint-time blurb 2011-09-19 23:14:04 +01:00
Emmanuele Bassi
93ece6dd7b text: Implement password hint
A ClutterText in password mode should have the ability to show the last
input character. This feature allows easier password entry on platforms
with unreliable keyboards, such as touchscreens or small devices.

https://bugzilla.gnome.org/show_bug.cgi?id=652588
2011-09-19 20:26:37 +01:00
Emmanuele Bassi
07912a147d settings: Add password-hint-time property
Add a setting that controls whether ClutterText actors in password mode
should display the last input character for a defined time. This helps
on touch-based interfaces.

https://bugzilla.gnome.org/show_bug.cgi?id=652588
2011-09-19 20:26:37 +01:00
Tomeu Vizoso
4396bec330 Queue a redraw when removing an effect by name
https://bugzilla.gnome.org/show_bug.cgi?id=659501
2011-09-19 20:01:32 +01:00
Craig R. Hughes
fcc2ab7be5 Fix calculation of duration for ClutterState default transitions
https://bugzilla.gnome.org/show_bug.cgi?id=659200
2011-09-19 18:29:39 +01:00
Robert Bragg
96866804f0 actor: consider empty pv ok in set_default_paint_volume
In _clutter_actor_set_default_paint_volume we were returning FALSE if an
actor has an empty allocation because we were claiming it doesn't have a
paint-volume. Actually an empty/degenerate pv is valid and has different
semantics to returning FALSE because FALSE means the pv is unknown and
so Clutter will have to assume the worst - that the pv is basically
un-bounded.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-19 14:52:46 +01:00
Robert Bragg
239fc43c5f stage: implicitly clip to stage window bounds
This implicitly intersects any clip for redrawing with the stage window
bounds. Without this we were sometimes trying to set huge off screen
scissors leading to undefined clipping results.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-19 14:48:31 +01:00
Robert Bragg
662d12aeff actor: add oob-transform opt to catch out-of-band transforms
Out-of-band transforms are considered to be all actor transforms done
directly with the Cogl API instead of via ClutterActor::apply_transform.

By running with CLUTTER_DEBUG=oob-transform then Clutter will explicitly
try to detect when un-expected transforms have been applied to the
modelview matrix stack.

Out-of-band transforms can lead to awkward bugs in Clutter applications
because Clutter itself doesn't know about them and this can disrupt
Clutter's input handling and calculations of actor paint-volumes
which can lead to visual artifacts.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-19 14:48:06 +01:00
Chun-wei Fan
9f12ec534e msvc-support: Recover wrecked branch
Recover the branch! :|
2011-09-16 17:25:47 +08:00
Rui Matos
41bd15226f text: We still have to paint the actor if the cursor is visible
https://bugzilla.gnome.org/show_bug.cgi?id=659116
2011-09-15 10:43:04 +01:00
Jasper St. Pierre
1883ee13f9 text: Take out a nonsense fallback
Invisible text is the best surprise for an update!

https://bugzilla.gnome.org/show_bug.cgi?id=659069
2011-09-14 21:49:45 -04:00
Emmanuele Bassi
a9a104e109 docs: Fixes for cross-references 2011-09-12 13:12:14 +01:00
Emmanuele Bassi
7ace3c2fdd docs: Fix clutter_box_packv() link 2011-09-12 12:36:31 +01:00
Emmanuele Bassi
27502af591 actor: Pack bitfields in ClutterActorPrivate
Bitfields should go at the end, to avoid holes in the middle of the
struct.
2011-09-12 11:33:18 +01:00
Matthias Clasen
5781beb22d cally: Fix up event listener registration minimally
For god-knows-what reason, at-spi is trying various formats
of strings when registering listeners, triggering an ugly

(gnome-shell:4411): Clutter-WARNING **: invalid object type create

warning in .xsession-errors. Stop doing that.

Also don't leak temporary string arrays that are a side-effect
of passing parameters around as formatted strings.

https://bugzilla.gnome.org/show_bug.cgi?id=658721
2011-09-11 10:57:25 -04:00
Emmanuele Bassi
c5ba998d64 stage: Protect call to unrealize() in dispose
Do not call ClutterStageWindow::unrealize() if the Stage has already
been unrealized.
2011-09-09 13:53:33 +01:00
Emmanuele Bassi
598e7a4a7e cogl/stage: Protect against multiple invocation of unrealize() 2011-09-09 13:52:55 +01:00
Emmanuele Bassi
bcd37e2e3d script: Hide private symbols
A bunch of private functions we use when parsing got exposed accidentaly
to the list of public symbols by virtue of not having the leading '_'
that we use to filter them out of the shared object — all the while the
header that declares them is a private, non installed one.

Let's rectify this situation with a bit of minor surgery on the code.
2011-09-07 16:14:10 +01:00
Emmanuele Bassi
9f70ea8dee text: Pack all bitfields at the end of the private structure
Don't leave them in the middle, to avoid holes.
2011-09-07 15:37:09 +01:00
Emmanuele Bassi
0c22246bea text: Clear up priv->text checks
The priv->text field cannot ever be NULL, so we don't need to check for
that in a series of places. We also need to assert() that pre-condition
in the couple of places where we set the contents of the ClutterText
actor, namely in set_text_internal() and set_markup_internal().

Based on a patch by: Dan Winship <danw@gnome.org>

http://bugzilla.clutter-project.org/show_bug.cgi?id=2629
2011-09-07 15:37:09 +01:00
Emmanuele Bassi
320bdeac03 text: Consistently protect against NULL strings
When calling clutter_text_set_text_internal() or
clutter_text_set_markup_internal() we need to make sure to pass a
non-NULL string.
2011-09-07 15:37:09 +01:00
Emmanuele Bassi
2af7ac4c13 actor: Fix annotations for out Vertex parameters 2011-09-07 13:00:35 +01:00
Emmanuele Bassi
0bd1e47b22 text: Make :use-markup set idempotent
Setting :use-markup and :text is currently not idempotent, and it
depends on the ordering, e.g.:

  g_object_set (actor, "use-markup", TRUE, "text", value, NULL);

does not yield the same results as:

  g_object_set (actor, "text", value, "use-markup", TRUE, NULL);

This is particularly jarring when using ClutterText from ClutterScript,
but in general GObject properties should not rely on the order when used
from g_object_set().

The fix is to store the contents of the ClutterText as a separate string
from the displayed text, and use the contents, instead of the displayed
text, when toggling the :use-markup property.

Let's also add a unit test for good measure, to try and catch
regressions.

https://bugzilla.gnome.org/show_bug.cgi?id=651940
2011-09-07 13:00:35 +01:00
Emmanuele Bassi
967bd3ac58 docs: Update test-easing and xinclude it into ClutterAnimation
The easing test is a nice example of what ClutterAnimation and
clutter_actor_animate() can do. The "tween ball to the pointer
event coordinates" is a bit of a staple in animation libraries
and their documentation.
2011-09-05 17:22:15 +01:00
Emmanuele Bassi
7024f1cd02 static-colors: Simplify the defines
Use a "private" macro to simplify the defined static colors.
2011-09-05 17:22:14 +01:00
Emmanuele Bassi
359ed2b29f text: Make :line-wrap actually work
When we paint a ClutterText we ask the actor for a PangoLayout that fits
inside the actor's allocation - both width and height.

Sadly, whenever a height is set on a PangoLayout, Pango will wrap its
contents - regardless of whether the layout should actually wrap or not.

This means that in certain easy to exploit cases, Clutter will paint a
Text actor with its contents wrapping even if the :wrap property is set
to FALSE.

In order to fix this we need to encode some more cases inside the
::paint implementation of ClutterText, and ask the cache for a layout
that is sized as the allocation's width, but not as its height; we also
need to perform a clip if we detect that the PangoLayout's logical size
is going to overflow the allocated size. This clip might cause some
performance issue, given that clipping breaks batching in the Cogl
journal; hopefully all clips for text are going to be screen-aligned, so
at the end of the batch it'll just scissor them out.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2339
2011-09-05 17:22:14 +01:00
Dan Winship
73d3026dd1 clutter-flow-layout: fix non-0,0 offset allocation
https://bugzilla.gnome.org/show_bug.cgi?id=649631
2011-09-05 12:21:18 -04:00
Emmanuele Bassi
a676ae67f7 docs: Fix up deprecation notice for BehaviourScale 2011-09-02 15:51:56 +01:00
Emmanuele Bassi
4255a75940 docs: Fix the ClutterTimeline:auto-reverse link 2011-09-02 15:49:05 +01:00
Emmanuele Bassi
79e152b7a0 docs: Inline test-constraints.c inside BindConstraint's description 2011-09-02 15:48:27 +01:00
Emmanuele Bassi
0d6208f36e docs: Inline test-drop.c into DropAction's description
Also, mention that DropAction only works with DragAction.
2011-09-02 15:22:08 +01:00
Emmanuele Bassi
8775642e82 docs: Include test-drag as the DragAction example 2011-09-02 14:53:56 +01:00
Emmanuele Bassi
66607dec4d bind: Check that the source is not contained inside the actor
Like commit d0439cfb586ca14282c89035119a4acbc0295df7 for
AlignConstraint, let's check that the BindConstraint source is not
a child or a grandchild of the actor attached to the Constraint.
2011-09-02 14:53:55 +01:00
Emmanuele Bassi
e6dbdb444d align: Check that source is not contained inside the actor
AlignConstraint won't work if the source is a child or a grandchild of
the ClutterActorMeta:actor to which it has been attached to: the
allocation flows from the parent to its children, not the other way
around; in order to avoid weirdness, we better document and check
that when we set the actor and when we set the source.
2011-09-02 14:53:55 +01:00
Emmanuele Bassi
83060b30d1 docs: Remove mentions of "frames" in Timeline
We still have some really old naming lying around.
2011-09-02 13:54:57 +01:00
Emmanuele Bassi
63a05fca9d Lock the main context when modifying the repaint functions list
The repaint functions list can (and should) be manipulated from
different threads, but it currently doesn't prevent multiple threads
from accessing it concurrently. We should have a simple lock and take it
when adding and removing elements from the list; the invocation is still
performed under the Big Clutter Lock™, so it doesn't require special
handling.
2011-09-01 17:12:46 +01:00
Robert Bragg
0aacbd47b7 actor: make offscreen_redirect prop take flags + default off
Because we have had several reports about significant performance
regressions since we enabled offscreen redirection by default for
handling correct opacity we are now turning this feature off by default.

We feel that clutter should prioritize performance over correctness in
this case. Correct opacity is still possible if required but the
overhead of the numerous offscreen allocations as well as the cost of
many render target switches per-frame seems too high relative the
improvement in quality for many cases.

On reviewing the offscreen_redirect property so we have a way to
disable redirection by default we realized that it makes more sense for
it to take a set of flags instead of an enum so we can potentially
extend the number of things that might result in offscreen redirection.

We removed the ability to say REDIRECT_ALWAYS_FOR_OPACITY, since it
seems that implies you don't trust the implementation of an actor's
has_overlaps() vfunc which doesn't seem right.

The default value if actor::redirect_offscreen is now 0 which
effectively means don't ever redirect the actor offscreen.
2011-08-30 16:20:16 +01:00
Emmanuele Bassi
d847d43f70 actions/drag: Be more reliable when destroying the drag handle
Whenever the drag handle gets destroyed mid-drag we need to cancel any
current drag operation and reset the state of the DragAction.

https://bugzilla.gnome.org/show_bug.cgi?id=657681
2011-08-30 13:33:20 +01:00
Alejandro Piñeiro
f1a7cd7c0f Merge branch 'atkwindow' 2011-08-30 12:26:35 +02:00
Emmanuele Bassi
368c916c7f layout-managers: Take into account the allocations's origin
If an actor using a LayoutManager has attributes like margin or padding
then it'll have to shave them from the available allocation before
passing it to the LayoutManager::allocate() implementation. Layout
managers should, thus, not assume that the origin of the allocation is
in (0, 0), but take into account that the passed ActorBox might have a
different origin.

https://bugzilla.gnome.org/show_bug.cgi?id=649631
2011-08-29 22:43:42 +01:00
Emmanuele Bassi
3314385119 box: Munge the allocation passed to the layout manager
The actor is in charge of providing to the LayoutManager the available
allocation. ClutterBox should not just pass the box it got from its
parent: it should, instead, provide a normalized box, with an origin in
(0, 0) and the available size.

https://bugzilla.gnome.org/show_bug.cgi?id=649631
2011-08-29 22:39:14 +01:00
Emmanuele Bassi
96810e1d4d build: Add -lm to clutter's LIBADD rule
We need to explicitly link against libm when building Clutter, since we
use libm API.

https://bugzilla.gnome.org/show_bug.cgi?id=657529
2011-08-29 22:17:53 +01:00
Robert Bragg
2f18855659 Adds experimental clutter_backend_get_cogl_context API
This adds experimental API to be able to get the CoglContext associated
with the ClutterBackend. The CoglContext is required to use some of the
experimental 2.0 Cogl API.

Note: Since CoglContext is itself experimental API this API should
considered experimental too. This patch introduces a
CLUTTER_ENABLE_EXPERIMENTAL_API #ifdef guard which anyone wanting to use
this API must define so it's explicitly clear to developers that they
are playing with experimental API.

Note: This API is not yet supported on OSX because OSX still uses the
stub Cogl winsys and the Clutter backend doesn't explicitly create a
CoglContext.

Note: even though this is experimental API we still promise that it
wont be changed during a stable release cycle. This means for example
that you can depend on this for the lifetime of the clutter-1.8 stable
release cycle.
2011-08-24 16:24:39 +01:00
Alejandro Piñeiro
7635cb6f17 a11y: We don't need to explicitly manage window events 2011-08-23 17:22:17 +02:00
Alejandro Piñeiro
a9690a4a5e a11y: Using AtkWindow on cally-stage 2011-08-23 17:22:11 +02:00
Emmanuele Bassi
2559fb1d0d actor: Add a comment on the unmapping order
Let's add a comment to avoid reshuffling the unmap() implementation and
end up triggering these bugs:

  http://bugzilla.clutter-project.org/show_bug.cgi?id=2621
  https://bugzilla.gnome.org/show_bug.cgi?id=652036
2011-08-23 10:58:09 +01:00
Emmanuele Bassi
d691c9cbe3 x11/settings: Add Fontconfig/Timestamp key
The XSETTINGS key that matches the :fontconfig-timestamp property on
ClutterSettings.
2011-08-18 15:36:20 +01:00
Emmanuele Bassi
7d4f371ee9 settings: Add ClutterSettings:fontconfig-timestamp
The :fontconfig-timestamp is a write-only property that will get updated
by the underlying platform whenever the fontconfig configuration has
been changed — i.e. when the fontconfig caches should be rebuilt after
the user has installed a new font.
2011-08-18 15:33:39 +01:00
Robert Bragg
397fe1b5b6 text: Implement Scriptable interface for font-description
This makes ClutterText implement the Scriptable interface so that we can
have a custom property parser and setter for the font-description
property. This works by simply passing the string description through
to clutter_text_set_font_name.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-08-16 18:06:44 +01:00
Robert Bragg
ccb740f167 actor: Don't update last-paint-volume during picking
Actually this change has two notable effects; firstly we no longer
perform culling during picking and secondly we avoid updating the
last-paint-volume of an actor when picking.

We shouldn't perform culling during picking until clutter-stage.c is
updated to setup the clipping planes appropriately.

Since the last-paint-volume is intended to represent the visible region
of the actor the last time it was painted on screen it doesn't make
sense to update this during off screen pick renders since we are liable
to end up with a last-paint-volume that maps to an actors new position
when we next come to paint for real.

This fixes a bug in gnome-shell with dragging dash icons leaving a
messy trail on the screen.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-08-15 18:25:43 +01:00
Robert Bragg
d2763fd8a4 stage-cogl: pass top-left relative swap_region coords
All 2D coordinate spaces in Cogl have their origin at the top-left so we
shouldn't be flipping the coordinates we pass to
cogl_framebuffer_swap_region to be relative to the bottom of the
framebuffer.

This bumps the Cogl version requirement to 1.7.5 since we've had to fix
a bug in the semantics of cogl_framebuffer_swap_region.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-08-12 15:42:42 +01:00
Alejo Pacin
694649e50c a11y: Notify ATK_STATE_SHOWING state change
https://bugzilla.gnome.org/show_bug.cgi?id=648633
2011-08-04 12:59:50 +02:00
Neil Roberts
91ace65cae clutter-stage-win32: Fix name cogl_win32_onscreen_set_foreign_window
Since commit 38b67e2884 of Cogl the naming scheme for winsys-specific
API has changed to be cogl_win32_onscreen_* instead of
cogl_onscreen_win32_* so it wouldn't build on Windows.
2011-07-31 18:00:51 +01:00
Kirk A. Baker
01fd673505 osx: Avoid leaks in Stage::realize
clutter_stage_osx_realize() can now be called multiple times without
leaking views and windows.

https://bugzilla.gnome.org/show_bug.cgi?id=655307
2011-07-29 13:58:06 +01:00
Kirk A. Baker
e144378f5a osx: Implement windowDidResignKey
Added isHiding field to _ClutterStageOSX to allow windowDidResignKey
delegate to not order full screen window back whilst the full screen
window was being hidden.  This caused other application windows to be
hidden.  Also added code to keep hidden stage windows from being listed
in the application's Windows menu.

https://bugzilla.gnome.org/show_bug.cgi?id=655311
2011-07-29 13:58:01 +01:00
Kirk A. Baker
6f6b27fac5 osx: Add windowDidChangeScreen delegate
Added -windowDidChangeScreen: delegate to handle condition where moving
host window to a different screen would cause pick errors to be output.
The delegate just causes the stage to be redrawn which re-creates the
pick buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=655306
2011-07-29 13:57:13 +01:00
Emmanuele Bassi
7139ada809 model: Remove an unused variable 2011-07-29 13:17:11 +01:00
Evan Nemerson
a6bd11ac62 introspection: add missing introspection data from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=655387
2011-07-29 13:06:51 +01:00
Emmanuele Bassi
fe66575a2c docs: Update with the newly added Animatable symbol 2011-07-29 11:53:16 +01:00
Emmanuele Bassi
f28c1d2d2a state: Use the Animatable interface
The Animatable interface allows object classes to provide and animate
properties outside of the usual GObject property introspection API.

This change allows ClutterState to defer to the animatable objects the
property introspection and animation, just like ClutterAnimation does.
2011-07-29 11:44:28 +01:00
Emmanuele Bassi
8b03ec9d16 actor: There is no need to implement animate_property()
It's a deprecated virtual function, and its replacement does the right
thing by default.
2011-07-29 11:36:18 +01:00
Emmanuele Bassi
677df44975 animation: Use Animatable.interpolate_value()
And stop using the deprecated animate_property() method.
2011-07-29 11:36:18 +01:00
Emmanuele Bassi
8b861cea8f animatable: Deprecate and replace animate_property()
The animate_property() method of the Animatable interface is far less
than optimal:

  • it has a direct reference to ClutterAnimation;
  • it has an interval decomposed as two values.

These issues tie the Animatable interface with the Animation object,
even though it's neither necessary nor future-proof.

Let's introduce a new method, interpolate_value(), which does not
reference ClutterAnimation and uses a ClutterInterval to express the
initial and final states.
2011-07-29 11:36:18 +01:00
Emmanuele Bassi
473f3817d4 model: Clean up ModelIter vfunc wrappers
All ClutterModelIter virtual functions have a default implementation,
and G_TYPE_INSTANCE_GET_CLASS cannot return NULL unless in case of a
catastrophic event in the type system - which will most likely blow up
any application code way before you could call a ModelIter method.

Thus, the idiom:

  klass = CLUTTER_MODEL_ITER_GET_CLASS (instance);
  if (klass && klass->vfunc)
    klass->vfunc (instance);

is utterly useless complication, and it can be perfectly replaced by:

  CLUTTER_MODEL_ITER_GET_CLASS (instance)->vfunc (instance);

without any loss of safety.
2011-07-29 11:29:51 +01:00
Emmanuele Bassi
e470fd7d82 model: Make sure to emit ::row-changed
Currently, only clutter_model_iter_set_valist() is in charge of emitting
the ClutterModel::row-changed signal. Both the set() and the
set_valist() functions can be called with multiple columns, so we
coalesce the signal emission at the end of the set_valist(), to have a
single ::row-changed emission per change.

The clutter_model_iter_set_value() function is just a thin wrapper
around the set_value() virtual function, but since it's called
internally we cannot add the signal emission there as well, as we'd
break the signal coalescing.

For this reason, we need some code refactoring inside the various set()
variants of ClutterModelIter:

  - we only use the internal va_arg variant for both the set() and
    set_valist() public functions, to avoid multiple type checks;
  - the internal set_valist() calls an internal set_value() method
    which calls the virtual function from the iterator vtable;
  - a new internal emit_row_changed() method is needed to retrieve
    the ClutterModel from the iterator, and emit the signal;

Now, all three variants of the value setter will call an internal
ClutterModelIter::set_value() wrapper, and emit the ::row-changed
signal.

To check that the intended behaviour has been implemented, and it's not
going to be broken, the test suite has grown a new unit which populates
a model and changes a random row.
2011-07-28 15:00:18 +01:00
Alejandro Piñeiro
468f121f59 a11y: Use existing clutter_actor_get_paint_visibility
Cally was initially created with Clutter 0.6 in mind. To check
recursively the visibility of a actor a custom method was added.
Since 0.8.4 clutter_actor_get_pain_visibility provides
the same functionality.

Also removed a dummy method. Lets add methods that provide a real
functionality.
2011-07-26 16:24:49 +02:00
Emmanuele Bassi
7f8838d7cc cairo-texture: Add the :auto-resize property
Keeping the backing Cairo surface of a CairoTexture canvas in sync with
the actor's allocation is tedious and prone to mistakes. We can
definitely do better by simply exposing a property that does the surface
resize and invalidation automagically on ::allocate.
2011-07-26 14:55:19 +01:00
Emmanuele Bassi
0f8e3ab4aa bin-layout: Fix a leak
https://bugzilla.gnome.org/show_bug.cgi?id=655342
2011-07-26 13:55:24 +01:00
Emmanuele Bassi
78049c38bf docs: Fixes for building the API reference 2011-07-26 13:44:12 +01:00
Emmanuele Bassi
278daca61c cairo-texture: Deprecate create()/create_region()
The recommended way of drawing on a ClutterCairoTexture is the ::draw
signal.
2011-07-26 12:53:22 +01:00
Emmanuele Bassi
2f445682b1 cairo-texture: Use signal-based drawing
The current "create context/draw/destroy context" pattern presents
various problems. The first issue is that it defers memory management to
the caller of the create() or create_region() methods, which makes
bookkeeping of the cairo_t* harder for language bindings and third party
libraries. The second issue is that, while it's easier for
draw-and-forget texturs, this API is needlessly complicated for contents
that have to change programmatically - and it introduces constraints
like calling the drawing code explicitly after a surface resize (e.g.
inside an allocate() implementation).

By using a signal-based approach we can make the CairoTexture actor
behave like other actors, and like other libraries using Cairo as their
2D drawing API.

The semantics of the newly-introduced ::draw signal are the same as the
one used by GTK+:

  - the signal is emitted on invalidation;
  - the cairo_t* context is owned by the actor;
  - it is safe to have multiple callbacks attached to the same
    signal, to allow composition;
  - the cairo_t* is already clipped to the invalidated area, so
    that Cairo can discard geometry immediately before we upload
    the texture data.

There are possible future improvements, like coalescing multiple
invalidations inside regions, and performing clipped draws during
the paint cycle; we could even perform clipped redraws if we know the
extent of the invalidated area.
2011-07-26 12:40:52 +01:00
Emmanuele Bassi
e1327f5591 actor: Clean up the allocate() checks
Move the conditions to their own boolean flags, to avoid making the
if() incomprehensible.
2011-07-19 14:03:02 +01:00
Emmanuele Bassi
123bd41e6c texture: Clean up error reporting
ClutterTexture relies too much on GError, even for things that are
clearly programmer errors. Also, no error message passed to GError
is marked for translation as it should.

We should move the programmer errors, like passing the wrong bpp
value with regards to the presence of the alpha channel, to real
warnings; we should also try and harmonize all the error messages,
and not mention Cogl — especially in the ones marked for translation.
2011-07-18 18:06:57 +01:00
Robert Bragg
672bc337ba build: don't explicitly include and egl or gl headers
This avoids explicitly including gl or egl headers in
clutter-egl-headers.h. We were getting build failures when building
clutter against a libcogl that has runtime support for GL and GLES
because cogl-defines.h was including gl.h and then clutter-egl-headers.h
was later including GLES2/gl.h with typedef conflicts. Clutter relies on
Cogl to abstract GL and GLES and the winsys APIs like EGL and GLX so
Clutter should just rely on cogl.h to include the appropriate egl.h in
clutter-egl-headers.h.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-07-18 17:07:40 +01:00
Damien Lespiau
a4b9eaf3ec alpha: Don't use the GClosure to compute the alpha when possible
Setting up the call and calling the GClosure was showing up in profiles
and seemed an easy one to remove.

Instead of calling the closure, let's remember the alpha func and the
user_data when possible (ie set_mode() and set_func()) and use it in
get_alpha().

https://bugzilla.gnome.org/show_bug.cgi?id=654727
2011-07-18 15:17:15 +01:00
Damien Lespiau
4d58534fbb text: Fix the default value of "editable"
The "editable" property is documented to default to TRUE, but is
initialized to FALSE in the _init() function.

Third party code would be affected if we changed the default to be
TRUE, so we have to change the default value in the GParamSpec.

https://bugzilla.gnome.org/show_bug.cgi?id=654726
2011-07-18 13:57:44 +01:00
Emmanuele Bassi
e25e48efb3 Do not use return with void functions
https://bugzilla.gnome.org/show_bug.cgi?id=654718
2011-07-18 13:53:16 +01:00
Emmanuele Bassi
1402c05112 timeline: Cast elapsed time before emitting ::new-frame
When emitting a new-frame signal, priv->elapsed_time is passed as a
parameter. This is a gint64. The closure marshal uses an INT. On some
platforms, this is not received correctly by signal handlers (they
receive 0). One solution is to cast priv->elapsed_time to a gint when
emitting the signal.

We cannot change the signature of the signal without breaking ABI.

https://bugzilla.gnome.org/show_bug.cgi?id=654066
2011-07-18 13:45:55 +01:00
Bastian Winkler
c9cbe58343 snap-constraint: Fix allocation for CLUTTER_SNAP_EDGE_RIGHT
Use source_with instead of source_height to calculate the the x1/x2
positions for CLUTTER_SNAP_EDGE_RIGHT

https://bugzilla.gnome.org/show_bug.cgi?id=654024
2011-07-18 13:43:29 +01:00
Emmanuele Bassi
bc1c3e003d x11/event: Avoid compiler warnings with HAVE_XGE undefined 2011-07-15 16:08:38 +01:00
Emmanuele Bassi
538559391c actor: Plug a leak in an error path
If the meta for the animation property is not found, the name of the
property to look for is still from the token, and we need to free the
memory allocated for it.
2011-07-15 15:53:55 +01:00
Carlos Garnacho
075a4ed86c x11: Improve XGenericEventCookie data allocation
https://bugzilla.gnome.org/show_bug.cgi?id=654656

Clutter may be used together with GTK+, which indirectly may use
XInput2 too, so the cookie data must persist when both are handling
events.

What happens now in a nutshell is, Clutter is only guaranteed to allocate
the cookie itself after XNextEvent(), and only frees the cookie if its
XGetEventData() call allocated the cookie data.

The X[Get|Free]EventData() calls happen now in clutter-event-x11.c as
hypothetically different event translators could also handle other set
of X Generic Events, or other libraries handling events for that matter.
2011-07-15 13:46:33 +02:00
Robert Bragg
c6a0427c69 pick: Use Cogl API not GL API to disable dithering
When picking we need to disable dithering to be sure that the hardware
will not modify the colors we use as actor identifiers. Clutter was
manually calling glEnable/Disable GL_DITHER to handle this, but that was
a layering violation since Cogl is intended to handle all interactions
with OpenGL. Since we are now striving for GL vs GLES to be a runtime
choice we need to remove this last direct usage of GL from Clutter so it
doesn't have to be linked with GL at build time.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-07-14 13:54:16 +01:00
Robert Bragg
3183240fef Provide stable paint-boxes for fixed sized actors
This updates _clutter_paint_volume_get_stage_paint_box to try and
calculate more stable paint-box sizes for fixed sized paint-volumes by
not basing the size on the volume's sub-pixel position.

So the aim is that for a given rectangle defined with floating point
coordinates we want to determine a stable quantized size in pixels that
doesn't vary due to the original box's sub-pixel position.

The reason this is important is because effects will use this API to
determine the size of offscreen framebuffers and so for a fixed-size
object that may be animated across the screen we want to make sure that
the stage paint-box has an equally stable size so that effects aren't
made to continuously re-allocate a corresponding fbo.

The other thing we consider is that the calculation of this box is
subject to floating point precision issues that might be slightly
different to the precision issues involved with actually painting the
actor, which might result in painting slightly leaking outside the
user's calculated paint-volume. This patch now adds padding to consider
this too.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-14 13:54:12 +01:00
Robert Bragg
df751a8a25 actor: improve rounding in get_allocation_geometry
Instead of relying on C to round the floating point allocation to
integers by flooring the values we now use CLUTTER_NEARBYINT to round
the allocation's position and size to the nearest integers instead. Using
floor leads to rather unstable rounding for the width and height when
there may be tiny fluctuations in the floating point width/height.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-14 13:54:09 +01:00
Robert Bragg
32487af55b Adds a CLUTTER_NEARBYINT macro for float rounding
This is a replacement for the nearbyint function which always rounds to
the nearest integer. nearbyint is a C99 function so it might not always
be available but also it seems in glibc it is defined as a function call
so this macro could end up faster anyway. We can't just add 0.5 because
it will break for negative numbers.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-14 13:54:05 +01:00
Robert Bragg
ad234b303c paint-volume: don't round paint-volume from allocation
The implementation of _clutter_actor_set_default_paint_volume which
simply uses the actor's allocation to determine a paint-volume was
needlessly using the allocation rounded to integers by internally using
clutter_actor_get_allocation_geometry instead of
clutter_actor_get_allocation_box. This was introducing a lot of
instability into the paint-volume due to the way rounding was done.

The code has now been updated to use clutter_actor_get_allocation_box
so we are dealing with the floating point allocation instead.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-14 13:54:01 +01:00
Tomeu Vizoso
01cf70594d Make sure the gesture is cancelled even if we miss the release event 2011-07-14 13:11:12 +02:00
Tomeu Vizoso
439c7e6ee7 Remove unneeded class closure 2011-07-14 11:46:12 +02:00
Emmanuele Bassi
18b3da95ef osx: Code style cleanups 2011-07-13 19:33:11 +01:00
Tomeu Vizoso
c8e3db105c Add default closures for the signals in ClutterGestureAction
Also make sure we cancel the gesture as soon as we know we have to
2011-07-13 19:15:20 +02:00
Dinh Bowman
48426c28bf Fixed typo of bidng to bind
https://bugzilla.gnome.org/show_bug.cgi?id=654103
2011-07-13 15:19:22 +01:00
Emmanuele Bassi
9a3b97b55e Revert "build: Detect the appropriate default flavour"
Ouch, butterfingers and git commit -a.

This reverts commit 81e8c8dec9.
2011-07-13 14:26:05 +01:00
Emmanuele Bassi
81e8c8dec9 build: Detect the appropriate default flavour
If we're building on/for Windows, set 'win32' as the default flavour; if
we're building on OS X, set 'osx' as the default flavour. For everything
else, use 'glx'.
2011-07-13 14:20:47 +01:00
Neil Roberts
a72237b876 clutter-stage: Add clutter_stage_get_redraw_clip_bounds
This adds a public function to get the bounds of the current clipped
redraw on a stage. This should only be called while the stage is being
painted. The function diverts to a virtual function on the
ClutterStageWindow implementation. If the function isn't implemented
or it returns FALSE then the entire stage is reported. The clip bounds
are in integer pixel coordinates in the stage's coordinate space.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2421
2011-07-13 13:54:50 +01:00
Damien Lespiau
25a7435a86 uprof: Add the units in the name of the "Per Frame" timer attribute
So it shows up in the profile report. Take the opportunity to write a
better long description for the attribute.

https://bugzilla.gnome.org/show_bug.cgi?id=654363
2011-07-12 10:57:18 +01:00
Robert Bragg
ab6be41ea0 build: update cogl_onscreen_x11 syms to cogl_x11_onscreen
Cogl recently renamed symbols with the form
cogl_onscreen_<platform>_blah to be consistent with other platform
specific APIs so they are now named like cogl_<platform>_onscreen_blah.
This makes the corresponding change to clutter.
2011-07-11 16:59:26 +01:00
Robert Bragg
d182d5a171 backend-cogl: update _get_egl_context symbol name
Cogl changed has changed the name of cogl_context_egl_get_egl_context to
cogl_egl_context_get_egl_context to be consistent with other platform
specific symbols.
2011-07-11 16:59:26 +01:00
Robert Bragg
71d0872b76 don't call cogl_set_default_context since it's been removed
cogl_set_default_context has been removed from Cogl so this updates
Clutter in-line with that change.
2011-07-11 16:59:26 +01:00
Damien Lespiau
c17ddfd6a9 uprof: Rename timers to remove the EGL specific bits
Cogl abstracts the winsys, Remove the egl prefix from the timer names.

https://bugzilla.gnome.org/show_bug.cgi?id=654361
2011-07-11 01:53:53 +01:00
Emmanuele Bassi
5d10a7141c text: Make sure that the selection box is big enough
Do not use integers to store the result of the PANGO_UNITS scaling to
avoid rounding issues with the default C rules. We should use cielf()
instead.
2011-07-10 10:24:40 +01:00
Emmanuele Bassi
f6cdeb9858 osx: Fix a compiler warning
No declaration after statement.
2011-07-10 10:12:08 +01:00
Emmanuele Bassi
96440acffe texture: Deprecate the new_from_actor() function
Now that we have proper offscreen and shader handling using the
ClutterEffect API, we can finally deprecate this hard to bind, easy
to break function.
2011-07-08 12:08:19 +01:00
Emmanuele Bassi
e677ebc3e8 Deprecate ClutterScore
The class is of dubious utility, now that we have a complex animation
API in ClutterAnimator and ClutterState, as opposed to a simple one
in ClutterBehaviour. The Score API also suffers from some naïve design
issues that made it far less useful than intended.
2011-07-08 12:01:08 +01:00
Philippe Normand
eb28d16300 a11y: cally-text get_offset_at_point implementation
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 17:05:49 +02:00
Philippe Normand
7565fcaab0 a11y: cally-text get_character_extents implementation
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 16:56:30 +02:00
Philippe Normand
61ea64c8c1 a11y: expose _cally_actor_get_top_level_origin in cally-actor-private
As this function is needed for atktext get_character_extents and
get_offset_at_point implementations.
2011-07-06 16:55:55 +02:00
Philippe Normand
ae0aa9e4cf a11y: get_default_attributes implementation on cally-text
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 16:51:49 +02:00
Philippe Normand
11efaf8297 a11y: use actor color if no fgcolor found in pango attributes 2011-07-06 16:44:40 +02:00
Philippe Normand
49d4317420 a11y: factor some PangoAttributes->AtkTextAttributes mappings
That code can then be used by get_run_attributes and
get_default_attributes implementations.
2011-07-06 16:34:36 +02:00
Alejandro Piñeiro
7e9ee85c7d [a11y] Exposing via ATK the proper toolkit name and version 2011-07-06 14:25:02 +02:00
Neil Roberts
bd3762b719 clutter-actor: Don't apply shaders during picking
Commit 0ede622f51 inadvertently made it so that shaders are applied
during picking. This was making test-shader fail to respond to clicks.

The commit also makes it so that culling is applied during
picking. Presumably this is also unintentional because the commit
message does not mention it. However I think it may make sense to do
culling during picking so it might as well stay that way.

https://bugzilla.gnome.org/show_bug.cgi?id=653959
2011-07-05 13:30:42 +01:00
Emmanuele Bassi
87f35a3434 build: Fix the path to the tslib event source 2011-07-04 16:09:41 +01:00
Samuel Degrande
2544e87869 clutter-media: mention the asynchronous behavior of set_playing() in the doc.
Depending on the ClutterMedia implementation, the set_playing()
call can be asynchronous, the playing state's change being not
immediate.

https://bugzilla.gnome.org/show_bug.cgi?id=650675
2011-07-04 15:58:08 +01:00
Jasper St. Pierre
037138d3bf clutter-text: Always update cursor positions when painting
The cursor's on-screen rectangle is defined in terms of the text
length, the current index, and text_x and text_y, which hold the text
offset in overflowing text fields.

When deleting large amounts of text, text_x is set to 0. In some
edge case branch paths, the cursor rectangle could be calculated
after the current index and text length were updated, but before
the text_x offset could be. This left a negative x position, which
consequently blew up Cogl and the widget.

https://bugzilla.gnome.org/show_bug.cgi?id=651079
2011-07-04 15:58:08 +01:00
Emmanuele Bassi
e9a42f23fe Deprecate mallum's add() macros for Group and Stage
I think we're way past overdue.
2011-07-04 15:58:08 +01:00
Robert Bragg
d65161a7fd build: fix Makefile.am to build glx tfp code on x11 platforms
It was already the intention that the ClutterGLXTexturePixmap API should
be built and made available on any X11 based platforms since there was
nothing specific about the API and it is useful to have for
compatibility. There was a mistake in the Makefile.am though which meant
only the header was getting installed but the code wasn't being built.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-04 15:41:38 +01:00
Robert Bragg
5ab10e0f7a glx-tfp: Don't include glx.h
Since the implementation of ClutterGLXTexturePixmap has nothing GLX
specific about it (it is simply layered on top of
ClutterX11TexturePixmap) we don't need to include glx.h. Removing this
include also means that the code can be built for compatibility against
GLES drivers.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-04 15:41:38 +01:00
Peter Ward
c94e8d1292 Arrays in parameters were not correctly annotated.
https://bugzilla.gnome.org/show_bug.cgi?id=653607
2011-07-01 12:32:19 +01:00
Robert Bragg
8bc265d22c paint-volume: remove more is_axis_aligned assertions
This removes the is_axis_aligned assertions for the width/height/depth
getters and setters, since for example it is legitimate to query the
width, height or depth of a container's child actors which aren't
necessarily axis aligned.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-06-30 14:53:40 +01:00
Robert Bragg
cc5808387e backend-cogl: update in line with Cogl API change
cogl_renderer_xlib_set_foreign_display was renamed to
cogl_xlib_renderer_set_foriegn_display so this is the corresponding
change to clutter.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-06-30 14:53:40 +01:00
Robert Bragg
aacdbb4a55 win32: use typesafe cogl_win32_renderer_handle_event
The generic cogl_renderer_handle_native_event API was removed from the
Cogl public API in favour of typesafe functions, so this updates the
win32 backend in line with that change.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-06-30 14:53:40 +01:00
Peter Ward
2dc8e2f866 Annotate ClutterTexture::load-finished with the correct type for error.
https://bugzilla.gnome.org/show_bug.cgi?id=653307
2011-06-27 11:49:19 +01:00
Emmanuele Bassi
478014041b build: Create and install clutter-glx pkg-config file
For backward compatibility.
2011-06-24 19:22:22 +01:00
Peter Ward
2528ad8cb8 Support multiple pointers in ClutterDragAction.
https://bugzilla.gnome.org/show_bug.cgi?id=653066
2011-06-21 18:29:01 +01:00
Emmanuele Bassi
459e1e7fc9 docs: Fix the GLX section
The whole thing should just go away.
2011-06-20 19:45:14 +01:00
Emmanuele Bassi
f3f1c87d8c docs: Fix deprecation notice for ClutterBehaviour 2011-06-20 19:44:55 +01:00
Emmanuele Bassi
513f218c38 docs: Add the Deprecate tag to Behaviours
And link the migration guide.
2011-06-20 18:46:48 +01:00
Emmanuele Bassi
7b064a0bda build: Build the GLX symbols
The change from the GLX backend to the Cogl backend left out the GLX
source code from the list of source files to be built.
2011-06-20 18:26:34 +01:00
Emmanuele Bassi
71b6554176 Fix the deprecation guard for ClutterGLXTexturePixmap
It's CLUTTER_DISABLE_DEPRECATED.
2011-06-20 18:22:06 +01:00
Emmanuele Bassi
e5641dabf8 docs: Document ClutterDropAction
And add it to the API reference.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 15:25:54 +01:00
Emmanuele Bassi
1238e0ddf9 Add ClutterDropAction
ClutterDropAction is an Action sub-class that allows writing actors that
react to dragged actors being dropped on them.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 15:25:53 +01:00
Emmanuele Bassi
a6a57d7967 drag-action: Remove the drag handle on destruction
When the drag handle actor is destroyed we should unset the field inside
the DragAction, to avoid having stale pointers lying around.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 14:31:07 +01:00
Emmanuele Bassi
0dea846096 drag-action: Use the dragged actor private API
Use the newly added private API on ClutterStage to track the currently
dragged actor.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 14:31:07 +01:00
Emmanuele Bassi
530a13f02f stage: Allow tracking dragged actors
We should be able to internally attach the actor currently being dragged
to the device that is dragging it.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 14:31:07 +01:00
Emmanuele Bassi
e4756fd764 docs: Fix up the API reference 2011-06-20 14:26:57 +01:00
Emmanuele Bassi
d5ea422c8f stage: Maintain the motion event delivery invariants
It is possible, by calling clutter_set_motion_events_enabled() prior to
the creation of any stage, to control the per-actor motion event
delivery flag on each newly created stage. Since we deprecated the
global accessor functions in favour of the per-Stage ones, we need to
remove the call to clutter_get_motion_events_enabled() inside the
ClutterStage instance initialization, and replace it with an internal
function.

This code will go away when we can finally break API and remove the
deprecated functions.
2011-06-20 13:53:09 +01:00
Emmanuele Bassi
b6eb5728e1 stage: Make per-actor motion event delivery accessors public
Complete the quest of commit bc548dc862
by making the ClutterStage methods for controlling the per-actor motion
and crossing event delivery public, and deprecating the global ones.
2011-06-20 11:41:28 +01:00
Robert Bragg
b66c22ac1c actor: documents _get/apply_relative_transform_matrix
Although this patch doesn't make them public, it documents the
_clutter_actor_get/apply_relative_transform_matrix functions so they
could easily be made public if desired. I think these API could be
useful to have publicly, and I originally documented them because I
thought they would be needed in the MX toolkit.
2011-06-17 18:38:29 +01:00
Neil Roberts
87d55ffcfa actor: Don't use propagated_one_redraw to determine effect dirty state
Previously ClutterActor was using priv->propagated_one_redraw to
determine whether to pass CLUTTER_EFFECT_PAINT_ACTOR_DIRTY to the
paint method of the effect. This isn't a good idea because the
propagated_one_redraw flag is cleared whenever clutter_actor_paint is
called, even if the actor isn't actually painted because of the zero
opacity shortcut. Instead of this, ClutterActor now has a separate
flag called is_dirty that gets set whenever queue_redraw_full is
called or whenever the queue redraw signal is bubbled up from a child
actor. The flag is only cleared in clutter_actor_paint if the effects
are actually run. Therefore it will stay set even if the opacity is
zero or if the parent actor decides not to paint the child.

Previously there were two places set propagated_one_redraw to FALSE -
once if the opacity is zero and once just before we emit the paint
signal.  Now that propagated_one_redraw is only used to determine
whether to pass on the queue redraw signal it seems to make sense to
just clear it in one place right at the start of clutter_actor_paint.

https://bugzilla.gnome.org/show_bug.cgi?id=651784
2011-06-17 18:06:51 +01:00
Robert Bragg
1720b77d29 actor: review use of _apply_modelview_transform_recursive
On reviewing the clutter-actor.c code using
_apply_modelview_transform_recursive I noticed various comments stating
that it will never call the stage's ->apply_transform vfunc to transform
into eye coordinates, but actually looking at the implementation that's
not true. The comments probably got out of sync with an earlier
implementation that had that constraint. This removes the miss-leading
comments and also updates various uses of the api where we were manually
applying the stage->apply_transform.
2011-06-17 17:44:16 +01:00
Robert Bragg
ddc9eb5fa5 group: Handle list modification while destroying children
This makes the dispose code that destroys children resilient against
priv->children being modified during child destruction.
2011-06-17 17:23:32 +01:00
Robert Bragg
1741c805be debug: Use cogl_primitive api for paint-volume visualization
Instead of using the cogl_vertex_buffer API this uses the more concise
cogl_primitive API instead. The aim is to get rid of the
cogl_vertex_buffer API eventually so we should be trying out the
replacement API wherever possible.
2011-06-17 16:59:20 +01:00
Robert Bragg
7f64772984 debug: disable culling with CLUTTER_PAINT=paint-volumes
When using CLUTTER_PAINT=paint-volumes to visualize the paint-volumes of
actors we were already disabling clipped-redraws because we are drawing
extra geometry that the actors don't know about but we didn't disable
culling. This was resulting in actors disappearing while using this
debug option.
2011-06-17 16:58:36 +01:00
Robert Bragg
d7bf214397 debug: avoid visualization code during picking
This makes sure we don't try and draw paint-volumes or culling results
during a pick cycle since that results in us reading back invalid ids
from the pick-buffer.
2011-06-17 16:58:36 +01:00
Neil Roberts
1e2e0f21b8 clutter-actor: Add a debug flag for disabling offscreen redirect
This adds CLUTTER_PAINT=disable-offscreen-redirect to help diagnose
problems with the correct opacity changes. This just makes it so that
it never installs the flatten effect so it will never automatically
redirect an actor offscreen.
2011-06-17 12:15:19 +01:00
Emmanuele Bassi
78fbac71f2 keysyms: Update the key symbols
Re-sync with the X.org headers.
2011-06-17 12:14:15 +01:00
Emmanuele Bassi
c79f613c25 Remove an unused variable
And the compiler warning that comes with it.
2011-06-17 12:03:21 +01:00
Robert Bragg
e936b9591a paint-volumes: remove is_axis_aligned assert for _union
This removes the pv->is_xis_aligned assertion in
_clutter_paint_volume_union. We were already considering the case where
the second volume may not be axis aligned and aligning it into a
temporary variable in that case, but we now also consider that the first
pv may also not be aligned.
2011-06-16 15:28:23 +01:00
Robert Bragg
4dc30c255f paint-volumes: avoid is_complete assert in _axis_align
The removes the pv->is_complete assertion from
_clutter_paint_volume_axis_align() and instead if the volume isn't
complete it calls _clutter_paint_volume_complete().
2011-06-16 15:28:23 +01:00
Robert Bragg
923b1657d9 paint-volumes: fix unioning with empty volumes
When calculating the union of a volume with an empty volume we aim to
simply take the contents of the non-empty volume, but we were not
copying the flags across. We now use
_clutter_paint_volume_set_from_volume which copies all the flags except
the is_static flag.
2011-06-16 12:40:22 +01:00
Robert Bragg
394512b274 paint-volumes: remove alignment constraint for _set_origin
The implementation for clutter_paint_volume_set_origin can cope with
volumes that are not axis aligned so this remove the is_axis_aligned
assertion.
2011-06-16 12:40:22 +01:00
Robert Bragg
30eb3be781 paint-volumes: avoid trashing is_static state
In _clutter_paint_volume_set_from_volume we were using memcpy to simply
copy everything from one volume to another, but that meant we were
trashing the is_static flag which determines if the destination
paint-volume was slice allocated or not.
2011-06-16 12:40:11 +01:00