Commit Graph

4949 Commits

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