Commit Graph

264 Commits

Author SHA1 Message Date
Robert Bragg
2d8083bab8 unify egl and glx backends as "cogl" backend
Since GLX and EGL are abstracted by Cogl the two backends are both
implementing everything using the Cogl API and they are almost
identical.

This updates the egl backend to support everything that the glx backend
supports. Now that EGL and GLX are abstracted by Cogl, the plan is that
we will squash the clutter-egl/glx backends into one. Since the EGL
backend in clutter can conditionally not depend on X11 we will use the
EGL backend as the starting point of our common backend.

https://bugzilla.gnome.org/show_bug.cgi?id=649826
2011-06-14 20:35:18 +01:00
Emmanuele Bassi
a7fc76a1c5 build: Disable deprecated symbols during development cycles
And add a configure switch to toggle them.
2011-06-14 14:50:10 +01:00
Tomeu Vizoso
ba72235b66 Add ClutterSwipeAction and ClutterGestureAction
To allow actors to handle gestures in a more organized way.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2585
2011-06-10 14:02:17 +01:00
Neil Roberts
7f78237ee5 clutter-actor: Add an 'offscreen-redirect' property
This adds a property which can be used to redirect the actor through
an FBO before painting so that it becomes flattened in an image. The
image can be used as a cache to avoid having to repaint the actor if
something unrelated in the scene changes. It can also be used to
implement correct opacity even if the actor has overlapping
primitives. The property is an enum that takes three values:

CLUTTER_OFFSCREEN_REDIRECT_NEVER: The default behaviour which is to
  never flatten the actor.

CLUTTER_OFFSCREEN_REDIRECT_ALWAYS: The actor is always redirected
  through an FBO.

CLUTTER_OFFSCREEN_REDIRECT_ONLY_FOR_OPACITY: The actor is only
  redirected through an FBO if the paint opacity is not 255. This
  value would be used if the actor wants correct opacity. It will
  avoid the overhead of using an FBO whenever the actor is fully
  opaque.

The property is implemented by installing a ClutterFlattenEffect.
ClutterFlattenEffect is a new internal class which subclasses
ClutterOffscreen to redirect the painting to an FBO. When
ClutterOffscreen paints, the effect sets an opacity override on the
actor so that the image will always contain the actor at full
opacity. The opacity is then applied to the resulting image before
painting it to the stage. This means the actor does not need to be
redrawn while the opacity is being animated.

The effect has a high internal priority so that it will always occur
before any other effects and it gets hidden from the application.
2011-05-13 01:46:32 +01:00
Emmanuele Bassi
ea502fd492 build: Depend on cogl-pango-1.0
For both builds and introspection.
2011-05-06 17:21:00 +01:00
Emmanuele Bassi
21786cccd6 build: Fix introspection rules
Remove some cruft after the surgery that split Cogl out of tree.
2011-05-06 16:55:10 +01:00
Robert Bragg
223e14811c Removes Cogl from the repository
Cogl has now been split out into a standalone project with a separate
repository at git://git.gnome.org/cogl. From now on the Clutter build
will now simply look for a cogl-1.0 pkg-config file to find a suitable
Cogl library to link against at build time.
2011-05-06 15:44:08 +01:00
Robert Bragg
136cf1b2d6 clutter/Makefile.am: mark clutter-cex100.h as BUILT_SOURCES
clutter-xcex100.h is generated from clutter-cex100.h.in when running
./configure so it should be added to automake's BUILT_SOURCES variable.
2011-05-05 14:46:03 +01:00
Robert Bragg
c55cffbb6b Moves all EGL code down from Clutter to Cogl
As was recently done for the GLX window system code, this commit moves
the EGL window system code down from the Clutter backend code into a
Cogl winsys.

Note: currently the cogl/configure.ac is hard coded to only build the GLX
winsys so currently this is only available when building Cogl as part
of Clutter.
2011-05-05 14:46:01 +01:00
Robert Bragg
af366ad750 backend: remove untested fruity backend
This backend hasn't been used for years now and so because it is
untested code and almost certainly doesn't work any more it would be a
burdon to continue trying to maintain it. Considering that we are now
looking at moving OpenGL window system integration code down from
Clutter backends into Cogl that will be easier if we don't have to
consider this backend.
2011-04-11 17:54:36 +01:00
Robert Bragg
70767f08dc Adds a --with-system-cogl config option for Clutter
This makes it possible to build Clutter against a standalone build of
Cogl instead of having the Clutter build traverse into the clutter/cogl
subdirectory.
2011-04-11 17:54:36 +01:00
Robert Bragg
31da46c799 Adds the ability to build Cogl standalone
This adds an autogen.sh, configure.ac and build/autotool files etc under
clutter/cogl and makes some corresponding Makefile.am changes that make
it possible to build and install Cogl as a standalone library.

Some notable things about this are:
A standalone installation of Cogl installs 3 pkg-config files;
cogl-1.0.pc, cogl-gl-1.0.pc and cogl-2.0.pc. The second is only for
compatibility with what clutter installed though I'm not sure that
anything uses it so maybe we could remove it. cogl-1.0.pc is what
Clutter would use if it were updated to build against a standalone cogl
library. cogl-2.0.pc is what you would use if you were writing a
standalone Cogl application.

A standalone installation results in two libraries currently, libcogl.so
and libcogl-pango.so. Notably we don't include a major number in the
sonames because libcogl supports two major API versions; 1.x as used by
Clutter and the experimental 2.x API for standalone applications.
Parallel installation of later versions e.g. 3.x and beyond will be
supportable either with new sonames or if we can maintain ABI then we'll
continue to share libcogl.so.

The headers are similarly not installed into a directory with a major
version number since the same headers are shared to export the 1.x and
2.x APIs (The only difference is that cogl-2.0.pc ensures that
-DCOGL_ENABLE_EXPERIMENTAL_2_0_API is used). Parallel installation of
later versions is not precluded though since we can either continue
sharing or later add a major version suffix.
2011-04-11 17:54:36 +01:00
Robert Bragg
e51749d33c win32: mkdir -p win32 needed for out of tree builds
if cross compiling clutter using mingw using an out of tree build
directory then a pre-requisite for creating the resources.o file
containing the transparent cursor is for the win32 directory itself to
be created at $(top_builddir)/clutter/win32.
2011-03-16 11:22:20 +00:00
Emmanuele Bassi
e2b5762571 Move the keysym ↔ Unicode table to .rodata
The table we use for converting between keysyms and Unicode should be
static and constified, so that it can live in the .rodata section of
the ELF shared object, and be shared among processes.

This change moves the table to a source file, instead of an header; the
change also requires the clutter_keysym_to_unicode() function to be
moved from clutter-event.c into this new source file. The declaration is
still in clutter-event.h, so we don't need to do anything special.
2011-02-28 14:16:24 +00:00
Emmanuele Bassi
20f19fe06c offscreen-effect: Add private API for getting the target size
Since the FBO target might have a different size than the mere paint box
of the actor, we need API to get it out of the ClutterOffscreenEffect
private data structure and on to sub-classes.

Since we cannot add new API in a stable cycle, we need a private
function; we'll leave it there even when opening 1.7, since it's useful
for internal purposes.
2011-02-19 09:15:34 +00:00
Emmanuele Bassi
3e5aa9ed63 Add private header for event-related API 2011-02-18 16:35:36 +00:00
Emmanuele Bassi
d27b335b61 Move ClutterEffect private symbols to a private header
No point in cluttering up clutter-private.h even more than necessary.
2011-02-18 16:00:39 +00:00
Emmanuele Bassi
92d13a1966 build: Re-enable --warn-all for g-ir-scanner
Now that I don't have to see a bunch of false positives any more, we can
finally use warnings to catch issues.
2011-02-15 12:40:12 +00:00
Viatcheslav Gachkaylo
901ed32568 Fixed bugs with mouse events.
Enter/leave events are now being received. Mouse move events
now work properly.

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

http://bugzilla.clutter-project.org/show_bug.cgi?id=2545
2011-02-03 10:58:38 +00:00
Viatcheslav Gachkaylo
634e4ffd1a osx: Improve the event loop
Implementation of event loop which works with GLib events, native OS X
events and Clutter events.

The event loop source code comes from the equivalent code in the Quartz
GDK backend from GTK+ 2.22.1, which is LGPL v2.1+ and thus compatible
with Clutter's licensing terms.

The code has been tested with libsoup, which did not work before together
with Clutter.

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

http://bugzilla.clutter-project.org/show_bug.cgi?id=2490
2011-01-31 13:43:12 +00:00
Emmanuele Bassi
1b1e77b469 event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.

The new design for handling X11 event translation works this way:

  - ClutterBackend::translate_event() has been added as the central
    point used by a ClutterBackend implementation to translate a
    native event into a ClutterEvent;

  - ClutterEventTranslator is a private interface that should be
    implemented by backend-specific objects, like stage
    implementations and ClutterDeviceManager sub-classes, and
    allows dealing with class-specific event translation;

  - ClutterStageX11 implements EventTranslator, and deals with the
    stage-relative X11 events coming from the X11 event source;

  - ClutterStageGLX overrides EventTranslator, in order to
    deal with the INTEL_GLX_swap_event extension, and it chains up
    to the X11 default implementation;

  - ClutterDeviceManagerX11 has been split into two separate classes,
    one that deals with core and (optionally) XI1 events, and the
    other that deals with XI2 events; the selection is done at run-time,
    since the core+XI1 and XI2 mechanisms are mutually exclusive.

All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-21 10:25:43 +00:00
Emmanuele Bassi
94b905b9e1 build: Generate an instealled config header
Clutter has some platform-specific API that is accessible only if the
right backend has been compiled in. Third party applications that wish
to be portable across backends might want to use defines and other
pre-processor tricks to determine header inclusion and API usage.

While Clutter has an internal set of symbols it can use, third party
applications don't have the luxury of being able to access the config.h
generated by Clutter's configure script.

For this reason, Clutter should install a configuration header with a
series of namespaced defines that can be picked up by applications and
other third party code.
2011-01-19 14:33:27 +00:00
Emmanuele Bassi
d5a4183047 introspection: Add cairo-1.0 to the dependencies 2010-12-10 17:15:23 +00:00
Emmanuele Bassi
3795c9b975 build: Do not hardcode --warn-all for g-ir-scanner
It's possible to use --warn-all through the introspection scanner
options from outside the build environment.
2010-12-09 12:37:41 +00:00
Damien Lespiau
afd279dd76 evdev: Merge clutter-event-evdev.[ch] into the device manager
The device manager now fully owns the GSources corresponding to the
devices it manages. This will allow not only to remove the source when
udev signals a device removal but also handle read() errors gracefully
by removing the faulty device from the manager.
2010-11-30 14:40:38 +00:00
Damien Lespiau
c6493885c3 evdev: First stab at an evdev backend
This backend is a event backend that can be enabled for EGL (for now).
It uses udev (gudev) to query input devices on a linux system, listens to
keyboard events from input devices and xkbcommon to translate raw key
codes into key keysyms.

This commit only supports key events, more to follow.
2010-11-30 14:40:37 +00:00
Damien Lespiau
ef5256ec25 evdev: Factor out the xkbcommon code from the wayland client backend
The wayland client code has support for translating raw linux input
device key codes coming from the wayland compositor into key symbols
thanks to libxkbcommon.

A backend directly listening to linux input devices (called evdev, just
like the Xorg one) could use exactly the same code for the translation,
so abstract it a bit in a separate file.
2010-11-30 14:40:37 +00:00
Emmanuele Bassi
3c15c0c9bb Add SnapConstraint
A SnapConstraint is a constraint that "snaps" the edges of two actors
together.
2010-11-15 16:00:49 +00:00
Emmanuele Bassi
985518c601 color: Add named, global colors
Since EGA colors are apparently all the rage in other toolkits, Clutter
should not be left out. On top of the usual CGA/EGA palette the static
colors also include the Tango Icon palette, which at least is more
pleasant to the eye.

Static colors are accessed through an enumeration by using
clutter_color_get_static(), or using the short-hand pre-processor
macros.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2066
2010-11-11 13:14:23 +00:00
Emmanuele Bassi
ef7f729c68 build: Re-instate profile builds
The profiling support was broken - probably during the restructuring of
the build environment, but I'm too lazy to bisect that.

The fix is trivial, and everything works as it should.
2010-11-07 15:27:17 +00:00
Emmanuele Bassi
bf6c635e9d Merge branch 'private-cleanup'
* private-cleanup:
  Add copyright notices
  Clean up clutter-private.h/6
  Clean up clutter-private.h/5
  Clean up clutter-private.h/4
  Clean up clutter-private.h/3
  Clean up clutter-private.h/2
  Clean up clutter-private.h/1
2010-10-25 23:44:53 +01:00
Emmanuele Bassi
6b2cbb9908 Add ClutterPathConstraint
ClutterPathConstraint is a simple Constraint implementation that
modifies the allocation of the Actor to which is has been applied using
a progress value and a ClutterPath.
2010-10-25 15:46:04 +01:00
Emmanuele Bassi
46c597a1f6 Clean up clutter-private.h/6
Move all Actor private API to a separate file.
2010-10-21 12:22:17 +01:00
Emmanuele Bassi
cf3a29f224 Clean up clutter-private.h/5
Move PaintVolume private API to a separate header.
2010-10-21 12:22:17 +01:00
Emmanuele Bassi
43edfc9400 Clean up clutter-private.h/4
Move the private Backend API to a separate header.

This also allows us to finally move the class vtable and instance
structure to a separate file and plug the visibility hole that left
the Backend class bare for everyone to poke into.
2010-10-21 12:22:17 +01:00
Emmanuele Bassi
8613013ab0 Clean up clutter-private.h/3
Move Stage private API to a separate header.
2010-10-21 11:33:26 +01:00
Emmanuele Bassi
999c063784 Clean up clutter-private.h/2
Move StageManager private API to a different header.
2010-10-21 11:30:19 +01:00
Emmanuele Bassi
c1771d152e Clean up clutter-private.h/1
Move DeviceManager/InputDevice private API to a different header.
2010-10-21 10:54:14 +01:00
Kristian Høgsberg
cb5582c4ab Add wayland backend
This adds a clutter backend for running under the wayland window system.
Initial cogl framebuffer integration by Robert Bragg.
2010-10-14 16:23:05 +01:00
Emmanuele Bassi
89a389cd2b actor-box: Split out ActorBox into its own file
clutter-actor.c is getting way too large, so splitting it up wherever
possible makes sense.
2010-10-11 15:57:22 +01:00
Alejandro Piñeiro
f5aeabadd5 Fixing cally.pc.in and moving include headers to previous directory
After commit 8dd8fbdb some errors appear if you try work directly
against cally:

 * cally.pc.in removed some elements. After install clutter, doing
   pkg-config --cflags cally-1.0
   fails due missing winsys

 * cally headers were moved from clutter-1.0/cally to
   clutter-1.0/clutter/cally.  Applications using it (yes I know,
   nobody is officially using it) would require to:
    * Change their include.
    * Add directly a dependency to cally, in order to use the cally.pc
      file with the correct directory include.

Note: Take into account that accessibility support still works (ie:
clutter_get_accessibility_enabled). This bug only prevents
applications to work directly against cally (ie: create a CallyActor
subclass)

http://bugzilla.clutter-project.org/show_bug.cgi?id=2353

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-10-04 13:05:02 +01:00
Emmanuele Bassi
bdb24701f0 build: Add -xobjective-c to the fruity backend section
Like we do for the Quartz backend, we should turn on the -xobjective-c
compiler flag for the Fruity backend.

This does not mean that the backend actually works.
2010-10-04 10:52:36 +01:00
Emmanuele Bassi
0cf2f50ba6 build: Remove redundant EXTRA_DISTs
The files for the backend that we conditionally compile are
automatically added to the dist process by automake.
2010-10-04 09:09:13 +01:00
Emmanuele Bassi
939333b4f2 build: Dist every backend file
All backend files should be present in the tarball generated by `make
dist`, to allow building Clutter on different platforms.
2010-10-03 16:10:44 +01:00
Emmanuele Bassi
18ff73c244 build: Add more metadata to the introspection files 2010-09-30 12:43:10 +01:00
Emmanuele Bassi
fde6efc690 build: Make Cally.gir depend on Cogl.gir
Since Cally's introspection data depends on it.
2010-09-30 12:31:28 +01:00
Colin Walters
077a5b4c34 introspection: Update to changed variables for header file names
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-30 12:10:02 +01:00
Emmanuele Bassi
66b0c1969c Remove the internal copy of JSON-GLib
The internal copy of JSON-GLib was meant to go away right after the 1.0
release, given that JSON-GLib was still young and relatively unknown.

Nowadays, many projects started depending on this little library, and
distributions ship it and keep it up to date.

Keeping a copy of JSON-GLib means keeping it up to date; unfortunately,
this would also imply updating the code not just for the API but for the
internal implementations.

Starting with the 1.2 release, Clutter preferably dependend on the
system copy; with the 1.4 release we stopped falling back automatically.
The 1.6 cycle finally removes the internal copy and requires a copy of
JSON-GLib installed on the target system in order to compile Clutter.
2010-09-29 15:57:28 +01:00
Emmanuele Bassi
e36cc40a49 Merge branch 'wip/non-recursive'
* wip/non-recursive:
  build: Start moving to a non-recursive layout
2010-09-29 15:55:58 +01:00
Robert Bragg
3040b140bc paint_volume: Splits out clutter_paint_volume code
This splits out all the clutter_paint_volume code from clutter-actor.c
into clutter-paint-volume.c. Since clutter-actor.c and
clutter-paint-volume.c both needed the functionality of
_fully_transform_vertices, this function has now been moved to
clutter-utils.c as _clutter_util_fully_transform_vertices.
2010-09-29 15:13:00 +01:00