Commit Graph

250 Commits

Author SHA1 Message Date
Damien Lespiau
2f54f8f0ea introspection: Use the --quiet flag conditionally
--quiet has been added to g-ir-scanner in the 0.9.1 cycle. We really
want to be able to compile clutter with 0.6.14 to be able to reuse
gir files that are distributed in current distributions.

Use the INTROSPECTION_SCANNER_ARGS (previously unused) variable to
convey --quiet when necessary.

Fixes: http://bugzilla.clutter-project.org/show_bug.cgi?id=2265
2010-08-12 16:43:07 +01:00
Emmanuele Bassi
2bf01dd959 build: Make the introspection generation quiet (again) 2010-08-12 09:03:58 +01:00
José Dapena Paz
d14e294d86 Add ClutterTableLayout, a layout showing children in rows and columns
A TableLayout is a layout manager that allocates its children in rows
and columns. Each child is assigned to a cell (or more if a cell span
is set).

The supported child properties are:

  • x-expand and y-expand: if this cell with try to allocate the
    available extra space for the table.
  • x-fill and y-fill: if the child will get all the space available in
    the cell.
  • x-align and y-align: if the child does not fill the cell, then
    where the child will be aligned inside the cell.
  • row-span and col-span: number of cells the child will allocate for
    itself.

Also, the TableLayout has row-spacing and col-spacing for specifying
the space in pixels between rows and between columns.

We also include a simple test of the layout manager, and the
documentation updates.

The TableLayout was implemented starting from MxTable and
ClutterBoxLayout.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-08-10 23:20:06 +01:00
Emmanuele Bassi
e7ae71e072 build: Fix include path for Cally's introspection
The introspection scanner does not include '.' by default, so it was
always using the installed copy of Clutter-1.0.gir. Which obviously
wouldn't work if we didn't have one.
2010-07-15 00:27:43 +01:00
Emmanuele Bassi
a3c69dc27c cally: Add introspection generation
Toolkits and applications not written in C might still need access to
the Cally API to write accessibility extensions based on it for their
own native elements.
2010-07-07 15:57:43 +01:00
Alejandro Piñeiro
c0f753d108 Add Cally
The Clutter Accessibility Library is an implementation of the ATK,
the Accessibility Toolkit, which exposes Clutter actors to accessibility
tools. This allows not only writing accessible user interfaces, but also
allows testing and verification frameworks based on A11Y technologies to
inspect and test a Clutter scene graph.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-07-05 16:45:43 +01:00
Emmanuele Bassi
3734408962 Use -Bsymbolic-functions
The -Bsymbolic-functions linker flag allows to avoid intra-library
PLT jumps on ELF platforms. It is similar to the aliasing hack in
GLib and GTK+, but definitely less messy.

The configure script should look for the flags, in order to support
platforms/linkers that do not have it.
2010-06-22 13:32:11 +01:00
Emmanuele Bassi
437dcad86a settings: Migrate Backend settings to a new object
Instead of storing settings inside the Backend instance we should use a
separate public object.
2010-06-21 15:55:36 +01:00
Robert Bragg
d45ac12628 egl: Consolidates eglx and eglnative into one "egl" winsys
This remove quite a lot of redundant code by consolidating the eglx and
eglnative window system backends.
2010-06-18 17:38:41 +01:00
Robert Bragg
bf9d5f3949 build: distinguish CLUTTER_WINSYS and CLUTTER_SONAME_INFIX
This adds a separate variable name "CLUTTER_SONAME_INFIX" to define the
infix for the clutter library that gets linked. Currently the WINSYS
corresponds to the directory we enter when building to compile the
window system and input support, but it is desirable to be able to
define multiple flavours that use the same WINSYS but should result in
different library names.

For example we are planning to combine the eglx and eglnative window
systems into one "egl" winsys but we will need to preserve the current
library names for the eglx and eglnative flavours.
2010-06-18 17:38:40 +01:00
Johan Bilien
272cf6d943 build: Do not include built sources in the distribution
allows to run make distcheck without first running make

http://bugzilla.openedhand.com/show_bug.cgi?id=2171

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-06-15 15:05:47 +01:00
Emmanuele Bassi
b8b2a51d44 Merge branch 'wip/deform-effect'
* wip/deform-effect:
  docs: Add DeformEffect and PageTurnEffect to the API reference
  effect: Add PageTurnEffect
  effect: Add DeformEffect
  offscreen-effect: Traslate the modelview with the offsets
  docs: Fix Effect subclassing section
2010-06-11 18:12:54 +01:00
Emmanuele Bassi
b2c905ff50 Hide the marshallers
The marshallers we use for the signals are declared in a private header,
and it stands to reason that they should also be hidden in the shared
object by using the common '_' prefix. We are also using some direct
g_cclosure_marshal_* symbol from GLib, instead of consistently use the
clutter_marshal_* symbol.
2010-06-11 16:09:36 +01:00
Emmanuele Bassi
44f300b3a2 effect: Add PageTurnEffect
A simple deformation effect that simulates a page curl.

Ported from MxDeformPageTurn inside the Mx toolkit, written by
Chris Lord.
2010-06-10 18:40:29 +01:00
Emmanuele Bassi
c2081a076c effect: Add DeformEffect
DeformEffect is an abstract class that should be used to write effects
that change the geometry of an actor before submitting it to the GPU.

Just like the ShaderEffect class, DeformEffect renders the actor to
which it has been applied into an FBO; then it creates a mesh and stores
it inside a VBO. Sub-classes can control vertex attributes like
position, texel coordinates and the color.
2010-06-10 18:40:29 +01:00
Damien Lespiau
cef4c8de76 build: Don't distribute clutter-version.h and cogl-defines.h
As with a351ff2af earlier, distributing headers generated at configure
time conflicts with out of tree builds as the distributed headers will
be included first instead of including the generated ones.
2010-06-04 17:43:57 +01:00
Damien Lespiau
a351ff2afc build: Do not distribute clutter-json.h
clutter-jon.h is generated at configure time, we should not distribute it.

This caused a build issue when compiling from a tarballs and out of tree
builds as we ended up with two clutter-json.h one in $(top_srcdir)/json
and the other in $(top_builddir)/json and picked up the wrong one
($(top_srcdir)/json is included first in the include search path).
2010-06-03 15:00:07 +01:00
Emmanuele Bassi
b4f8ba0f73 effect: Add ColorizeEffect
A copy of DesaturateEffect that converts to grayscale and applies a
user-defined tint to the render target.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
73a773d37a effect: Add DesaturateEffect
A simple shader-based effect that desaturates an actor and its contents
based on a controllable factor.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
5a5b21446c effect: Add BlurEffect
A simple, GLSL shader-based blur effect.

The blur shader is taken straight from the test-shader.c interactive
test case. It's a fairly clunky, inefficient and visually incorrect
implementation of a box blur, but it's all we have right now until I
figure out a way to do multi-pass shading with the current API.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
c260da79e3 effect: Add ShaderEffect
The ShaderEffect class is an abstract base type for shader-based
effects. GLSL-based effects should be implemented by sub-classing
ShaderEffect and overriding ActorMeta::set_actor() to set the source
code of the shader, and Effect::pre_paint() to update the uniform
values, if any.

The ShaderEffect has a generic API for sub-classes to set the values
of the uniforms defined by their shaders, and it uses the shader
types we defined for ClutterShader, to avoid re-inventing the wheel
every time.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
c3ab32ae68 effect: Add OffscreenEffect
The OffscreenEffect class is meant to be used to implement Effect
sub-classes that create an offscreen framebuffer and redirect the
actor's paint sequence there. The OffscreenEffect is useful for
effects using fragment shaders.

Any shader-based effect being applied to an actor through an offscreen
buffer should be used before painting the resulting target material and
not for every actor. This means that doing:

       pre_paint: cogl_program_use(program)
                  set up offscreen buffer
           paint: [ actors ] → offscreen buffer → target material
      post_paint: paint target material
                  cogl_program_use(null)

Is not correct. Unfortunately, we cannot really do:

      post_paint: cogl_program_use(program)
                  paint target material
                  cogl_program_use(null)

Because the OffscreenEffect::post_paint() implementation also pops the
offscreen buffer and re-instates the previous framebuffer:

      post_paint: cogl_program_use(program)
                  change frame buffer ← ouch!
                  paint target material
                  cogl_program_use(null)

One way to fix it is to allow using the shader right before painting
the target material - which means adding a new virtual inside the
OffscreenEffect class vtable in additions to the ones defined by the
parent Effect class.

The newly-added paint_target() virtual allows the correct sequence of
actions by adding an entry point for sub-classes to wrap the "paint
target material" operation with custom code, in order to implement the
case above correctly as:

      post_paint: change frame buffer
                  cogl_program_use(program)
                  paint target material
                  cogl_program_use(null)

The added upside is that sub-classes of OffscreenEffect involving
shaders really just need to override the prepare() and paint_target()
virtuals, since the pre_paint() and post_paint() do all that's needed.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
a86f1b45bb Add the ClutterEffect abstract class
ClutterEffect is an abstract class that should be used to apply effects
on generic actors.

The ClutterEffect class just defines what an effect should implement; it
could be defined as an interface, but we might want to add some default
behavior dependent on the internal state at a later point.

The effect API applies to any actor, so we need to provide a way to
assign an effect to an actor, and let ClutterActor call the Effect
methods during the paint sequence.

Once an effect is attached to an actor we will perform the paint in this
order:

  • Effect::pre_paint()
  • Actor::paint signal emission
  • Effect::post_paint()

Since an effect might collide with the Shader class, we either allow a
shader or an effect for the time being.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
7a299e9b47 introspection: Add --pkg atk
We need to tell the introspection scanner all the dependencies we
require, including the pkg-config name to use when compiling the
GIR file into a typelib object.
2010-05-26 13:40:18 +01:00
Emmanuele Bassi
f6fce05ee9 action: Add ClickAction
ClickAction adds "clickable" semantics to an actor. It provides all
the business logic to emit a high-level "clicked" signal from the
various low-level signals inside ClutterActor.
2010-05-25 11:13:03 +01:00
Alejandro Piñeiro
a59bd4cfbb Implement AtkImplementor on ClutterActor
Implements AtkImplementor interface on ClutterActor, and his method
atk_implementor_ref_accessible.

More information:
http://library.gnome.org/devel/atk/stable/AtkObject.html#AtkImplementor
2010-05-24 15:54:54 +01:00
Emmanuele Bassi
382bd394b9 Merge branch 'wip/state-machine'
* wip/state-machine:
  Do not use wildcards in test-state
  script: Implement State deserialization
  state: added a "target-state" property
  state: documented data structures
  Add State interactive tests to the ignore file
  state: Documentation and introspection annotation fixes
  state: Minor coding style fixes
  state: Clean up the header's documentation
  state: Constify StateKey accessors
  Do not include clutter.h from a Clutter header file
  state-machine: made clutter_state_change take a boolean animate argument
  state-machine: use clutter_timeline_get_progress
  state-machine: add completed signal
  state machine: added state machine

Conflicts:
	.gitignore
2010-05-24 10:42:03 +01:00
Emmanuele Bassi
5e3dc55666 Merge branch 'wip/constraints'
* wip/constraints: (24 commits)
  Add the Cogl API reference to the fixxref extra directories
  Document the internal MetaGroup class
  Remove the construct-only flag from ActorMeta:name
  doc: Remove gtk-doc annotations from the json-glib copy
  doc: Fix parameter documentation
  Add named modifiers for Action and Constraint
  Remove a redundant animation
  Set the stage resizable in test-constraints
  Use a 9 grid for the constraints test
  Miscellaneous documentation fixes
  docs: Document animating action and constraint properties
  docs: Document BindConstraint and AlignConstraint
  constraint: Rename BindConstraint:bind-axis
  constraints: Add AlignConstraint
  tests: Add a constraints interactive test
  constraint: Add BindConstraint
  actor: Implement Animatable
  animation: Use the new Animatable API for custom properties
  animatable: Add custom properties to Animatable
  constraint: Add ClutterConstraint base class
  ...

Conflicts:
	configure.ac
2010-05-21 10:55:09 +01:00
Øyvind Kolås
fcdc3a8989 state machine: added state machine 2010-05-20 16:24:29 +01:00
Robert Bragg
f2f2e9b7e6 build: expose automake conditionals for cogl winsys
Expose the ./configured window system/backend options to the Cogl
automake files via some new SUPPORT_XYZ conditionals.
2010-05-19 15:08:14 +01:00
Emmanuele Bassi
f857457b9d constraints: Add AlignConstraint
AlignConstraint is a simple constraint that keeps an actor's position
aligned to the width or height of another actor, multiplied by an
alignment factor.
2010-05-19 13:02:43 +01:00
Emmanuele Bassi
769e964424 constraint: Add BindConstraint
The BindConstraint object is a constraint that binds the current
position of an actor on a given axis to the actor that has the
constraint applied.
2010-05-19 12:28:35 +01:00
Emmanuele Bassi
b842f0ad8e constraint: Add ClutterConstraint base class
The Constraint base, abstract class should be used to implement Actor
modifiers that affect the way an actor is sized or positioned inside a
fixed layout manager.
2010-05-19 12:28:30 +01:00
Emmanuele Bassi
4fd74e71e6 action: Add DragAction, an action implementing drag capabilities
DragAction is an Action sub-class that provides dragging capabilities to
any actor. DragAction has:

  • drag-begin, drag-motion and drag-end signals, relaying the event
    information like coordinates, button and modifiers to user code;

  • drag-threshold property, for delaying the drag start by a given
    amount of pixels;

  • drag-handle property, to allow using other actors as the drag
    handle.

  • drag-axis property, to allow constraining the dragging to a specific
    axis.

An interactive test demonstrating the various features is also provided.
2010-05-17 16:42:11 +01:00
Emmanuele Bassi
0e0db0d624 action: Add ClutterAction
ClutterAction is an abstract class that should be used as the ancestor
for objects that change how an actor behaves when dealing with events
coming from user input.
2010-05-17 16:42:10 +01:00
Emmanuele Bassi
c075d26fb2 actor: Add ActorMeta, a base class for actor modifiers
ClutterActorMeta is a base, abstract class that can be used to derive
classes that are attached to a ClutterActor instance in order to modify
the way an actor is painted, sized/positioned or responds to events.

A typed container for ActorMeta instances is also provided to the
sub-classes can be attached to an Actor.
2010-05-17 16:42:10 +01:00
Robert Bragg
b9a91594f4 build: Fixes out of tree builds
When building the gobject introspection data the build wasn't able to
find clutter/clutter-json.h so this adds $(top_builddir) to INCLUDES.
2010-03-01 15:25:45 +00:00
Emmanuele Bassi
b61c2b510b build: Tweak internal defines for building Clutter
When building Clutter we should:

  • disable Cogl deprecated API;
  • enable experimental API.
2010-02-10 10:58:14 +00:00
Øyvind Kolås
4cc269a468 Add ClutterAnimator
ClutterAnimator is a class for managing the animation of multiple
properties of multiple actors over time with keyframing of values.

The Animator class is meant to be used to effectively describe
animations using the ClutterScript definition format, and to construct
complex implicit animations from the ground up.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-02-07 18:25:19 +00:00
Emmanuele Bassi
d8d728a8d7 Remove the SDL backend
The SDL API is far too limited for the windowing system needs of
Clutter; the status of the SDL backend was always experimental, and
since the Windows platform is supported by a native backend there is
no point in having the SDL backend around any more.
2010-02-03 16:34:27 +00:00
Emmanuele Bassi
d23dd9af6b device: Make InputDevice an object and subclass it for X11
ClutterInputDevice should be a type that we can subclass per-backend
to add functionality.
2010-01-20 00:38:08 +00:00
Emmanuele Bassi
d34f1aa775 Add ClutterDeviceManager
The ClutterDeviceManager is a singleton object that behaves like the
StageManager: it holds all input devices and notifies on addition and
removal.
2010-01-20 00:38:07 +00:00
Neil Roberts
14a28620ae win32: Use an invisible cursor when cursor-visible is FALSE
The win32 backend now handles the WM_SETCURSOR message and sets a
fully transparent cursor if the cursor-visible property has been
cleared on the stage. The icon is stored in the library via a resource
file. The instance handle for the DLL is needed to load the resource
so there is now a DllMain function to grab the handle.
2010-01-19 16:10:23 +00:00
Emmanuele Bassi
948db40c87 Add gcov support to the build
Using gcov it's possible to get a coverage report, that is a break down
of how much the exposed API is exercised by the conformance test suite.
2010-01-13 17:15:06 +00:00
Emmanuele Bassi
8e9f56c411 build: Clean up private header/source files
Some source files should not be passed through the introspection parser,
as they are fully private and do not expose any valuable API.

Also the clutter-profile.h header is private and should not be
installed.
2010-01-10 11:35:26 +00:00
Robert Bragg
0057755854 profiling: Adds initial UProf support across clutter
UProf is a small library that aims to help applications/libraries provide
domain specific reports about performance.  It currently provides high
precision timer primitives (rdtsc on x86) and simple counters, the ability
to link statistics between optional components at runtime and makes report
generation easy.

This adds initial accounting for:
- Total mainloop time
- Painting
- Picking
- Layouting
- Idle time

The timing done by uprof is of wall clock time. It's not based on stochastic
samples we simply sample a counter at the start and end.  When dealing with
the complexities of GPU drivers and with various kinds of IO this form of
profiling can be quite enlightening as it will be able to represent where
your application is blocking unlike tools such as sysprof.

To enable uprof accounting you must configure Clutter with --enable-profile
and have uprof-0.2 installed from git://git.moblin.org/uprof

If you want to see a report of statistics when Clutter applications exit you
should export CLUTTER_PROFILE_OUTPUT_REPORT=1 before running them.

Just a final word of caution; this stuff is new and the manual nature of
adding uprof instrumentation means it is prone to some errors when modifying
code.  This just means that when you question strange results don't rule out
a mistake in the instrumentation.  Obviously though we hope the benfits out
weigh e.g.  by focusing on very key stats and by having automatic reporting.
2010-01-08 20:19:49 +00:00
Emmanuele Bassi
59d84f7806 build: Fix CPP and LD flags
• The debug flags are pre-processor ones, so they should be listed
  inside AM_CPPFLAGS.

• Clutter's publicly exported symbols match the following regular
  expression:

    ^(clutter|cogl|json)_*

  The old one also listed "pango" as a possible prefix, but the
  Pango API is now under the Cogl namespace.
2009-12-02 16:03:55 +00:00
Emmanuele Bassi
ba25571c8e Merge branch 'layout-manager'
* layout-manager: (50 commits)
  docs: Reword a link
  layout, docs: Add more documentation to LayoutManager
  layout, docs: Fix description of Bin properties
  layout, bin: Use ceilf() instead of casting to int
  layout, docs: Add long description for FlowLayout
  layout, box: Clean up
  layout, box: Write long description for Box
  layout, docs: Remove unused functions
  layout: Document BoxLayout
  layout: Add BoxLayout, a single line layout manager
  layout: Report the correct size of FlowLayout
  layout: Resizing the stage resizes the FlowLayout box
  layout: Use the get_request_mode() getter in BinLayout
  layout: Change the request-mode along with the orientation
  actor: Add set_request_mode() method
  [layout] Remove FlowLayout:wrap
  [layout] Rename BinLayout and FlowLayout interactive tests
  [layout] Skip invisible children in FlowLayout
  [layout] Clean up and document FlowLayout
  [layout] Snap children of FlowLayout to column/row
  ...
2009-10-19 11:45:15 +01:00
Emmanuele Bassi
936779fd96 build: Add back QUIET_GEN to the GIR generation 2009-10-18 17:49:00 +01:00
Emmanuele Bassi
ab376d961f build: De-nest the JSON from the introspection rules
The JSON conditional rules can be moved outside the introspection
conditional ones to avoid a nested check, as all the JSON rules do
is setting up variables that may or may not be used.
2009-10-18 17:12:12 +01:00
Emmanuele Bassi
8f11b3ca48 build: Fix up the GIR generation rules
The rules for generating Clutter's introspection data are
still referencing the old COGL layout.
2009-10-18 17:00:24 +01:00
Emmanuele Bassi
ad5c0af639 build: Add CPPFLAGS for the g-ir-scanner command line
When I moved all CPP flags to AM_CPPFLAGS from the INCLUDES directive
I forgot that g-ir-scanner needs those defines as well.
2009-10-17 00:32:41 +01:00
Robert Bragg
95a869dab1 [cogl] move clutter/pango to clutter/cogl/pango
As part of the re-organisation of Cogl; move clutter/pango to be part of the
cogl sub-project.
2009-10-16 18:58:51 +01:00
Robert Bragg
43efab46bc Intial Re-layout of the Cogl source code and introduction of a Cogl Winsys
As part of an incremental process to have Cogl be a standalone project we
want to re-consider how we organise the Cogl source code.

Currently this is the structure I'm aiming for:
cogl/
    cogl/
	<put common source here>
	winsys/
	   cogl-glx.c
	   cogl-wgl.c
	driver/
	    gl/
	    gles/
	os/ ?
    utils/
	cogl-fixed
	cogl-matrix-stack?
        cogl-journal?
        cogl-primitives?
    pango/

The new winsys component is a starting point for migrating window system
code (i.e.  x11,glx,wgl,osx,egl etc) from Clutter to Cogl.

The utils/ and pango/ directories aren't added by this commit, but they are
noted because I plan to add them soon.

Overview of the planned structure:

* The winsys/ API is the API that binds OpenGL to a specific window system,
  be that X11 or win32 etc.  Example are glx, wgl and egl. Much of the logic
  under clutter/{glx,osx,win32 etc} should migrate here.

* Note there is also the idea of a winsys-base that may represent a window
  system for which there are multiple winsys APIs.  An example of this is
  x11, since glx and egl may both be used with x11.  (currently only Clutter
  has the idea of a winsys-base)

* The driver/ represents a specific varient of OpenGL. Currently we have "gl"
  representing OpenGL 1.4-2.1 (mostly fixed function) and "gles" representing
  GLES 1.1 (fixed funciton) and 2.0 (fully shader based)

* Everything under cogl/ should fundamentally be supporting access to the
  GPU.  Essentially Cogl's most basic requirement is to provide a nice GPU
  Graphics API and drawing a line between this and the utility functionality
  we add to support Clutter should help keep this lean and maintainable.

* Code under utils/ as suggested builds on cogl/ adding more convenient
  APIs or mechanism to optimize special cases. Broadly speaking you can
  compare cogl/ to OpenGL and utils/ to GLU.

* clutter/pango will be moved to clutter/cogl/pango

How some of the internal configure.ac/pkg-config terminology has changed:
backendextra -> CLUTTER_WINSYS_BASE # e.g. "x11"
backendextralib -> CLUTTER_WINSYS_BASE_LIB # e.g. "x11/libclutter-x11.la"
clutterbackend -> {CLUTTER,COGL}_WINSYS # e.g. "glx"
CLUTTER_FLAVOUR -> {CLUTTER,COGL}_WINSYS
clutterbackendlib -> CLUTTER_WINSYS_LIB
CLUTTER_COGL -> COGL_DRIVER # e.g. "gl"

Note: The CLUTTER_FLAVOUR and CLUTTER_COGL defines are kept for apps

As the first thing to take advantage of the new winsys component in Cogl;
cogl_get_proc_address() has been moved from cogl/{gl,gles}/cogl.c into
cogl/common/cogl.c and this common implementation first trys
_cogl_winsys_get_proc_address() but if that fails then it falls back to
gmodule.
2009-10-16 18:58:50 +01:00
Robert Bragg
35f11d863c [build] more Makefile.am.{enums,marshal} fixes for out of tree builds
for the marshal files $(srcdir) was getting prefixed twice since my last
commit (2cc88f1140) since it was already being prefixed including
Makefile.am.  The problem with prefixing it in the includer file though is
that the Make variable substitutions like :.list=.h mean we end up
generating into the $(srcdir).  This removes the prefix added in
clutter/Makefile.am

We were also missing a $(srcdir) prefix when setting EXTRA_DIST
2009-10-16 18:46:44 +01:00
Emmanuele Bassi
b526b76593 layout: Add BoxLayout, a single line layout manager
The BoxLayout layout manager implements a layout policy for arranging
children on a single line, either alongside the X axis or alongside the
Y axis.
2009-10-14 11:31:48 +01:00
Emmanuele Bassi
5737cf869f [layout] Initial implementation of FlowLayout
FlowLayout is a layout manager that arranges its children in a
reflowing line; the orientation controls the major axis for the
layout: horizontal, for reflow on the Y axis, and vertical, for
reflow on the X axis.
2009-10-14 11:31:30 +01:00
Emmanuele Bassi
a2086f1178 [layout] Add LayoutMeta
Instead of overloading ClutterChildMeta with both container and layout
metadata and delegate to every LayoutManager implementation to keep a
backpointer to the layout manager instance, we can simply subclass
ChildMeta into LayoutMeta and presto! everything works out pretty well
for everyone.
2009-10-14 11:31:26 +01:00
Emmanuele Bassi
1061ebeac9 [layout] Add BinLayout
A BinLayout is a simple layout manager that allocates a single cell,
providing alignment on both the horizontal and vertical axis.

If the container associated to the BinLayout has more than one child,
the preferred size returned by the layout manager will be as big as
the maximum of the children preferred sizes; the allocation will be
applied to all children - but it will still depend on each child
preferred size and the BinLayout horizontal and vertical alignment
properties.

The supported alignment properties are:

  * center: align the child by centering it
  * start: align the child at the top or left border of the layout
  * end: align the child at the bottom or right border of the layout
  * fill: expand the child to fill the size of the layout
  * fixed: let the child position itself
2009-10-14 11:27:19 +01:00
Emmanuele Bassi
6d4cc13f7c [layout] Add Fixed layout manager
The FixedLayout layout manager object implements the same layout
policy of ClutterGroup.
2009-10-14 11:27:18 +01:00
Emmanuele Bassi
0340f65634 [box] Add ClutterBox
ClutterBox is an actor with no layout management. It relies on
a ClutterLayoutManager to perform size requisition and allocation
of its children.
2009-10-14 11:27:18 +01:00
Emmanuele Bassi
d6183e95e5 [layout] Add initial implementation of LayoutManager
The LayoutManager class is an abstract proxy for the size requesition
and size allocation process in ClutterActor.

A ClutterLayoutManager sub-class must implement get_preferred_width(),
get_preferred_height() and allocate(); a ClutterContainer using the
LayoutManager API will then proxy the corresponding Actor virtual
functions to the LayoutManager instance. This allows having a generic
"blank" ClutterActor sub-class, implementing the ClutterContainer
interface, which leaves only the layout management implementation to
the application developers.
2009-10-14 11:27:18 +01:00
Emmanuele Bassi
4f2bfc003a build: Clean up main Makefile.am 2009-10-14 09:07:11 +01:00
Emmanuele Bassi
46b736f42e build: Move marshallers and enum types rules out
The rules to create signal marshallers and enumeration GTypes are
usually copied and pasted all over different projects, though they
are pretty generic and, given a little bit of parametrization, can
be put in separate Makefile.am files and included whenever needed.
2009-10-14 09:07:11 +01:00
Emmanuele Bassi
72243081b5 Merge branch 'stage-window-object'
* stage-window-object:
  [x11] Fix Stage user-initiated resize
  [x11] Remove a useless forced paint
  [stage] Rework the Stage implementation class
2009-10-05 12:37:08 +01:00
Emmanuele Bassi
ecfa0c4f92 [build] Split out the custom silent rules
The silent rules we use for custom targets should be moved into a
separate Makefile.am that gets included from all the others.
2009-09-16 17:47:59 +01:00
Emmanuele Bassi
6988744db7 [stage] Rework the Stage implementation class
Instead of using ClutterActor for the base class of the Stage
implementation we should extend the StageWindow interface with
the required bits (geometry, realization) and use a simple object
class.

This require a wee bit of changes across Backend, Stage and
StageWindow, even though it's mostly re-shuffling.

First of all, StageWindow should get new virtual functions:

  * geometry:
    - resize()
    - get_geometry()

  * realization
    - realize()
    - unrealize()

This covers all the bits that we use from ClutterActor currently
inside the stage implementations.

The ClutterBackend::create_stage() virtual function should create
a StageWindow, and not an Actor (it should always have been; the
fact that it returned an Actor was a leak of the black magic going
on underneath). Since we never guaranteed ABI compatibility for
the Backend class, this is not a problem.

Internally to ClutterStage we can finally drop the shenanigans of
setting/unsetting actor flags on the implementation: if the realization
succeeds, for instance, we set the REALIZED flag on the Stage and
we're done.

As an initial proof of concept, the X11 and GLX stage implementations
have been ported to the New World Order(tm) and show no regressions.
2009-09-08 10:52:58 +01:00
Emmanuele Bassi
373b165b3f Use AM_SILENT_RULES if automake >= 1.11 is installed
Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1756

Based on a patch by: Javier Jardón <javierjc1982@gmail.com>
2009-08-19 13:42:36 +01:00
Emmanuele Bassi
f655b28e66 [build] Nothing can be prepended to QUIET_* rules
Move the LD_LIBRARY_PATH override after the QUIET_GEN rule and
unbreak the typelib compilation.
2009-08-17 23:27:22 +01:00
Owen W. Taylor
5d7c2e7c44 Set LD_LIBRARY_PATH when running g-ir-compiler
g-ir-compiler currently opens the library for the .gir it is compiling;
to make that work we need to set LD_LIBRARY_PATH before running
g-ir-compiler to include .libs.

(I think this may have been working earlier because there was a
hack that substituted .so with .la and tried opening that; that
works for the incorrect libclutter-glx-1.0.so but not for the
correct libclutter-glx-1.0.so.0)

http://bugzilla.openedhand.com/show_bug.cgi?id=1771
2009-08-17 22:39:12 +01:00
Owen W. Taylor
4c1248c5e9 Full fix for the G-I support in Clutter
Update the sed hack for the shared library to be more robust.

Remove the --shared-library command line argument from g-ir-scanner,
as no distribution will ever ship the .la files. This effectively
reverts commit 68f8a98cfb.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-08-17 15:42:33 +01:00
Götz Waschk
68f8a98cfb Specify the shared library for g-ir-compile
Use the --shared-library option to specify the shared object to link
against when compiling the typelib from the GIR data.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-08-17 14:21:42 +01:00
Götz Waschk
366e0f9cd7 Update Clutter to use G-I 0.6.4
Following bug #1762, the syntax of g-ir-scanner was changed in
gobject-introspection, so Clutter does not build anymore with 0.6.4.

See the bugzilla bug:

  http://bugzilla.gnome.org/show_bug.cgi?id=591669

GObject-Introspection now uses a different mechanism to extract the
SONAME when building the gir file and it needs the libtool archive as
option.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-08-17 14:14:18 +01:00
Emmanuele Bassi
cc6aa6e4d5 Clutter GIR depends on ClutterJson GIR conditionally
If we're building Clutter with a system JSON-GLib we need to skip
the typelib compilation of ClutterJson since we depend on Json-1.0.gir
directly.
2009-08-12 15:32:18 +01:00
Emmanuele Bassi
d0748b3b9b Merge branch 'system-json-glib'
* system-json-glib:
  [script] Simplify the parser code
  Update JSON-GLib dependency
2009-08-10 17:21:20 +01:00
Damien Lespiau
94b35a4a5e [build] GCC_FLAGS is no more, MAINTAINER_CFLAGS is the One.
CC_FLAGS was a left over from the 0.8.x age. Killed it and use the
newer MAINTAINER_CFLAGS variable instead.
2009-08-03 14:25:08 +01:00
Owen W. Taylor
a11b912dea Fix parallel build of introspection
We need to explicitly force order so that ClutterJson.gir and Cogl.gir
are present in the parent directory before we try to build Clutter.typelib.

http://bugzilla.openedhand.com/show_bug.cgi?id=1700

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-07-18 16:53:08 +01:00
Owen W. Taylor
7654ef10ab Fix building introspection when dolt is not in use
On some platforms (anything but Linux, and on obscure Linux
architectures) dolt isn't used, so $(top_builddir)/doltlibtool
won't exist. $(top_builddir)/libtool will always be generated
even if dolt is used, so just use that unconditionally. We don't
need the extra speed when linking the single program for
introspection.

http://bugzilla.openedhand.com/show_bug.cgi?id=1699

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-07-18 16:52:57 +01:00
Emmanuele Bassi
354fa437cd Update JSON-GLib dependency
Currently, Clutter depends on the internal copy of JSON-GLib for
the ClutterScript parser. This is done to allow building Clutter
on platforms that do not have the library installed on the system.

Just like we use the internal PNG/JPEG loader as a fallback in
case we don't have GdkPixbuf or CoreGraphics available, we should
use the internal copy of JSON-GLib only in case the system copy
is not present.

The change is simply to move the default for the --with-json
configure switch from "internal" to "check".

In order to allow stricter compliance, a third setting should
be present: "system", which fails if the system copy is not
available.

We should also change the introspection generation to avoid
breaking in case we require the installed Json-1.0.gir instead
of the generated ClutterJson.gir
2009-06-29 17:01:11 +01:00
Emmanuele Bassi
3035092edb Do not use the --pkd switch for g-ir-scanner
Revert commit 8aacff0e0f
2009-06-16 18:08:52 +01:00
Emmanuele Bassi
8aacff0e0f [introspection] Add --pkg switch pointing at Clutter
Add a <package/> element pointing to Clutter's pkg-config
file name.
2009-06-16 16:43:00 +01:00
Emmanuele Bassi
0415d62d40 Disable single header inclusion for GLib
In order to be ready for the next major version of GLib we need to
disable single header inclusion by using the G_DISABLE_SINGLE_INCLUDES
define in the build process.
2009-06-15 11:29:37 +01:00
Emmanuele Bassi
91856b1bed [introspection] Add --c-include to g-ir-scanner
Since Clutter has a single-include header policy we need to put
the header to be included inside the GIR file.
2009-06-09 12:45:23 +01:00
Owen W. Taylor
ca305d2a40 [build] Search for Cogl GIR in the right place
Since we build the Cogl GIR inside /clutter/cogl we should be looking
there when building the Clutter GIR. Otherwise g-ir-scanner will look
inside the gir directory -- and if you never built Clutter before it
will error out.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1638

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-08 01:59:04 +01:00
Emmanuele Bassi
6cd1cb21cc [introspection] Remove Cogl symbols from Clutter GIR
The GIR file for Clutter still contains symbols from COGL, even
though we provide a Cogl GIR as well. The Clutter GIR should
depend on the Cogl GIR instead.
2009-06-01 15:51:59 +01:00
Marc-André Lureau
86230eb9fa build: don't double install clutter-version.h
Automake 1.11 installs several files in one command, and it fails if
the same file is installed two times.

See NEWS for details:
http://lists.gnu.org/archive/html/automake/2009-05/msg00093.html

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-01 15:49:11 +01:00
Emmanuele Bassi
f8f54989be Merge commit 'origin/master' into 1.0-integration
Conflicts:
	clutter/clutter-texture.c
	clutter/cogl/gl/cogl-fbo.c
2009-05-20 16:49:22 +01:00
Owen W. Taylor
d8aa6827ee Don't build Cogl.gir against installed Clutter library
Passing:

 --library=clutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@

to g-ir-scanner, when building Cogl was causing g-ir-scanner to
link the introspection program against the installed clutter library,
if it existed or fail otherwise. Instead copy the handling from
the json/ directory where we link against the convenience library
to scan, and do the generation of the typelib later in the
main clutter/directory.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1594

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-05-13 23:31:43 +01:00
Emmanuele Bassi
678f99677f Use a single master "clock" to drive timelines
Currently, all timelines install a timeout inside the TimeoutPool
they share. Every time the main loop spins, all the timeouts are
updated. This, in turn, will usually lead to redraws being queued
on the stages.

This behaviour leads to the potential starvation of timelines and
to excessive redraws.

One lesson learned from the games developers is that the scenegraph
should be prepared in its entirety before the GL paint sequence is
initiated. This means making sure that every ::new-frame signal
handler is called before clutter_redraw() is invoked.

In order to do so a TimeoutPool is not enough: we need a master
clock. The clock will be responsible for advancing all the active
timelines created inside a scene, but only when the stage is
being redrawn.

The sequence is:

  + queue_redraw() is invoked on an actor and bubbles up
    to the stage

  + if no redraw() has already been scheduled, install an
    idle handler with a known priority

  + inside the idle handler:

    - advance the master clock, which will in turn advance
      every playing timeline by the amount of milliseconds
      elapsed since the last redraw; this will make every
      playing timeline emit the ::new-frame signal

    - queue a relayout

    - call the redraw() method of the backend

This way we trade multiple timeouts with a single frame source
that only runs if a timeline is playing and queues redraws on
the various stages.
2009-04-24 15:28:15 +01:00
Neil Roberts
a93a93d007 Count timeline frames using the FPS instead of an integer interval
Bug 1495 - Timelines run 4% short

Previously the timelines were timed by calculating the interval
between each frame stored as an integer number of milliseconds so some
precision is lost. For example, requesting 60 frames per second gets
converted to 16 ms per frame which is actually 62.5 frames per
second. This makes the timeline shorter by 4%.

This patch merges the common code for timing from the timeout pools
and frame sources into an internal clutter-timeout-interval file. This
stores the interval directly as the FPS and counts the number of
frames that have been reached instead of the elapsed time.
2009-03-16 15:40:18 +00:00
Neil Roberts
5e9894fbac Remove use of $(builddir)
$(builddir) isn't always defined in earlier versions of Automake
(although I can't track down exactly which version it appeared
in). According to the autoconf docs it is "rigorously equal to `.'" so
we might as well not use it.
2009-03-10 19:24:17 +00:00
Neil Roberts
57c3e84289 Fix out of tree builds
Commit a383929 added the $(srcdir) prefix to all of the source files
but some files are generated by the configure script and other make
rules so they actually live in $(builddir). Out-of-tree builds
therefore broke.
2009-03-10 14:40:33 +00:00
Emmanuele Bassi
a3839296c4 [build] Various fixes for distcheck
The generation of the GObject introspection data has broken
the distcheck phase.

The location of the header and source files should always be
depending on the $(top_srcdir) and $(srcdir) variables,
respectively; the special handling of the COGL API inside the
GIR generation should also take those two variables into
account.
2009-03-10 12:38:02 +00:00
Emmanuele Bassi
0fc9452b03 [build] Do not shave typelib generation
Bug 1478 - typelib creation shaved out of existence

Add a 'GEN' output rule for the typelib files created when
introspection is enabled.
2009-02-26 12:46:36 +00:00
Emmanuele Bassi
82f83ffbfb [build] Move all the compiler flags to AM_CFLAGS
The INCLUDES directive should only contain pre-processor flags, since
we're passing it also to the introspection scanner.

Using AM_CFLAGS for compiler flags, like debug flags and maintainer
flags, is more indicated.
2009-02-21 13:44:14 +00:00
Emmanuele Bassi
21aa09748c Add build machinery for gobject-introspection data
configure.ac: Check for gobject-introspection

build/introspection.m4: Include the file that defines the
GOBJECT_CHECK_INTROSPECTION m4 macro in case we want to disable
the introspection data generation.

clutter/json/Makefile.am: Build the .gir for "ClutterJson"
  (json-glib as part of the Clutter library)

clutter/Makefile.am: Build the .gir for clutter, compile the
  Clutter and ClutterJson girs into typelibs, and install them.
  Also move GCC_FLAGS from $(INCLUDES) to $(AM_CFLAGS) since it includes
  non-preprocessor flag like -Wall.

See also:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1450

Based on a patch by: Owen W. Taylor <otaylor@fishsoup.net>

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-02-20 14:39:51 +00:00
Emmanuele Bassi
cf48935cf5 [build] Pass the -s switch to cmp
The call to "cmp" to compare a built file with its current version
should use the -s (silent) command line switch. This avoids a ugly
message on the console when building Clutter the first time.
2009-02-19 14:57:43 +00:00
Damien Lespiau
8eec75efde [build] Beautify autotools' output
Use shave (http://git.lespiau.name/cgit/shave) to make compilation more
human friendly.
2009-02-18 17:38:34 +00:00
Emmanuele Bassi
3cfc7fb1ca Merge branch 'generic-actor-clone'
* generic-actor-clone:
  Remove CloneTexture from the API
  [tests] Clean up the Clone interactive test
  Rename ActorClone to Clone/2
  Rename ActorClone to Clone/1
  Improves the unit test to verify more awkward scaling and some corresponding fixes
  Implements a generic ClutterActorClone that doesn't need fbos.
2009-01-27 16:14:35 +00:00
Emmanuele Bassi
86e95a779a Remove CloneTexture from the API
ClutterClone supercedes ClutterCloneTexture, since it can clone
every kind of actor -- including composite ones.

This is another "brain surgery with a shotgun" kind of commit: it
removes CloneTexture and updates every test case using CloneTexture
to ClutterClone. The API fallout is minimal, luckily for us.
2009-01-27 15:18:45 +00:00