profile/ivi/clutter.git
14 years agoMerge remote branch 'master' into texture-debugging
Neil Roberts [Mon, 1 Feb 2010 13:37:19 +0000 (13:37 +0000)]
Merge remote branch 'master' into texture-debugging

Conflicts:
clutter/cogl/cogl/cogl-context.h

14 years agocogl-material: Compare GL texture numbers for material layer textures
Neil Roberts [Mon, 1 Feb 2010 13:25:19 +0000 (13:25 +0000)]
cogl-material: Compare GL texture numbers for material layer textures

When deciding if a material layer is equal it now compares the GL
target and texture number if the textures are not sliced. This is
needed to get batching across atlased textures.

14 years agocogl: Let GL do the format conversion when uploading texture data
Neil Roberts [Mon, 1 Feb 2010 12:11:58 +0000 (12:11 +0000)]
cogl: Let GL do the format conversion when uploading texture data

Cogl accepts a pixel format for both the data in memory and the
internal format to be used for the texture. If they do not match then
it would convert them using the CoglBitmap functions before uploading
the data. However, GL also lets you specify both formats so it makes
more sense to let GL do the conversion. The driver may need the
texture in a specific format so it may end up being converted anyway.

The cogl_texture_upload_data functions have been removed and replaced
with a single function to prepare the bitmap. This will only do the
premultiplication conversion because that is the only part that GL
can't do directly.

14 years agocogl: Do the premult conversion in-place rather than copying to a new buffer
Neil Roberts [Fri, 29 Jan 2010 15:15:08 +0000 (15:15 +0000)]
cogl: Do the premult conversion in-place rather than copying to a new buffer

The premult part of _cogl_convert_premult has now been split out as
_cogl_convert_premult_status. _cogl_convert_premult has been renamed
to _cogl_convert_format to make it less confusing. The premult
conversion is now done in-place instead of copying the
buffer. Previously it was copying the buffer once for the format
conversion and then copying it again for the premult conversion. The
premult conversion never changes the size of the buffer so it's quite
easy to do in place. We can also use the separated out function
independently.

14 years agocogl-atlas-texture: Use a single atlas for both RGB and RGBA textures
Neil Roberts [Fri, 29 Jan 2010 12:19:42 +0000 (12:19 +0000)]
cogl-atlas-texture: Use a single atlas for both RGB and RGBA textures

The internal format of the atlas texture is still set to the
appropriate format so Cogl will disable blending for textures that are
intended to be RGB. This should end up ignoring the alpha channel from
the texture in the atlas. This makes the code slightly easier to
maintain and should also improve the chances of batching.

14 years agoMerge branch 'device-manager'
Emmanuele Bassi [Mon, 1 Feb 2010 11:26:56 +0000 (11:26 +0000)]
Merge branch 'device-manager'

* device-manager: (37 commits)
  x11: Re-enable XI1 extension keyboards
  x11: Always handle core device events before XI events
  docs: Documentation fixes for DeviceManager
  device-manager: Fix the signals definition
  docs: Add sections for InputDevice and DeviceManager
  docs: Add clutter_input_device_get_device_name()
  tests: Print out the device details on motion
  Always register core devices
  device: Remove unused is_default member
  win32: Experimental implementation of device support
  tests: Print the device name, as well as its Id
  x11: Fill out the :name property of the InputDevices
  device: Add the :name property to InputDevice
  x11: Store core devices on the X11 Backend singleton
  device: Unset the cursor actor when leaving the stage
  device: Add pointer actor getter
  x11: Discard the LeaveNotify for off-stage ButtonRelease
  device: Do not overwrite the stage for an InputDevice
  event: Off-stage button releases have a click count of 1
  event: Scroll events do not have click count
  ...

14 years agoFix problems with "position" and "selection-bound" change notification
Alejandro Piñeiro [Mon, 25 Jan 2010 15:13:58 +0000 (16:13 +0100)]
Fix problems with "position" and "selection-bound" change notification

Added a "selection-bound" notify on clutter_text_clear_selection as it
changes the value.

Added utility function clutter_text_set_positions, in order to
change both cursor position and selection bound inside a
g_object_[freeze/thaw]_notify block

Added g_object_[freeze/thaw]_notify in other functions that changes
both cursor position and selection bound

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

14 years agostage: Add :key-focus property
Emmanuele Bassi [Mon, 1 Feb 2010 11:04:59 +0000 (11:04 +0000)]
stage: Add :key-focus property

ClutterStage has both set_key_focus() and get_key_focus() methods, but
there is no :key-focus property. This means that it is not possible to
get notifications when the key-focus has changes except by connecting to
both the ::key-focus-in and ::key-focus-out signals and do additional
bookkeeping.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agodocs: Update the README
Emmanuele Bassi [Fri, 29 Jan 2010 10:13:57 +0000 (10:13 +0000)]
docs: Update the README

Clean up the grammar and some wrinkles in the text.

14 years agodocs: Update the configure switches in the README
Emmanuele Bassi [Fri, 29 Jan 2010 09:31:13 +0000 (09:31 +0000)]
docs: Update the configure switches in the README

14 years agobuild: Warn with --disable-conformance and --enable-gcov
Emmanuele Bassi [Fri, 29 Jan 2010 09:29:53 +0000 (09:29 +0000)]
build: Warn with --disable-conformance and --enable-gcov

When building Clutter without conformance test suite we ought to warn
the user that the coverage report is not going to be accurate.

14 years agoRemove tabs from configure.ac
Emmanuele Bassi [Fri, 29 Jan 2010 09:29:37 +0000 (09:29 +0000)]
Remove tabs from configure.ac

14 years agobuild: Allow disabling the conformance test suite
Emmanuele Bassi [Fri, 29 Jan 2010 09:26:47 +0000 (09:26 +0000)]
build: Allow disabling the conformance test suite

When building Clutter for packaging on headless boxes it's pointless to
allow building the conformance test to be built (and run on 'make
check').

14 years agoWhitespace fixes in cogl-util
Emmanuele Bassi [Wed, 27 Jan 2010 21:26:26 +0000 (21:26 +0000)]
Whitespace fixes in cogl-util

14 years agoWhitespace fixes
Emmanuele Bassi [Wed, 27 Jan 2010 21:16:28 +0000 (21:16 +0000)]
Whitespace fixes

14 years agodocs: Fixes for TimeoutPool and Frame sources
Emmanuele Bassi [Wed, 27 Jan 2010 21:14:43 +0000 (21:14 +0000)]
docs: Fixes for TimeoutPool and Frame sources

The TimeoutPool is not used by ClutterTimeline any more, so we need to
remove a sentence from its description. We also need to fix the gtk-doc
syntax errors.

14 years agocogl: Use the colours of COGL_DEBUG=rectangles to debug batching
Neil Roberts [Fri, 22 Jan 2010 18:14:57 +0000 (18:14 +0000)]
cogl: Use the colours of COGL_DEBUG=rectangles to debug batching

Instead of assigning a new colour to each quad of a batch, the
rectangle debugging code now assigns a new colour to each batch so
that it can be used to visually see what is being batched. The colour
is stored in a global variable that is reset during cogl_clear. This
improves the chances that the same colour will be used for a batch in
the next frames to avoid flickering.

14 years agocogl-vertex-buffer: Fix disabling the texture arrays from previous prim
Neil Roberts [Tue, 26 Jan 2010 13:46:27 +0000 (13:46 +0000)]
cogl-vertex-buffer: Fix disabling the texture arrays from previous prim

When setting up the state for the vertex buffer,
enable_state_for_drawing_buffer tries to keep track of the highest
numbered texture unit in use. It then disables any texture arrays for
units that were previously enabled if they are greater than that
number. However if there is no texturing in the VBO then the max used
unit would be left at 0 which it would later think meant unit 0 is
still in use so it wouldn't disable it. To fix this it now initialises
the max used unit to -1 which it should interpret as ‘no units are in
use’ so it will later disable the arrays for all units.

Thanks to Jon Mayo for reporting the bug.

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

14 years agodocs: Add some notes about the CoglPixelFormat enums
Neil Roberts [Wed, 27 Jan 2010 12:06:22 +0000 (12:06 +0000)]
docs: Add some notes about the CoglPixelFormat enums

The pixel format enums didn't explain what order in memory the
components should be so it was difficult to use them.

14 years agodocs: Fix some of the examples for the animation docs
Neil Roberts [Wed, 27 Jan 2010 11:02:34 +0000 (11:02 +0000)]
docs: Fix some of the examples for the animation docs

In the example for clutter_actor_animate the "x" and "y" properties
are floats so they need to be passed float values in the var args
otherwise it will crash. There was also a missing comma.

There were some other minor problems with the behaviours example which
would cause it not to compile.

14 years agocogl: Fix checks of the number of available texture units
Damien Lespiau [Tue, 26 Jan 2010 18:47:25 +0000 (18:47 +0000)]
cogl: Fix checks of the number of available texture units

We were checking the number of texture units against the GL enum that is
used in glGetInteger() to query that number. Let's abstract this in a
little function.

Took the opportunity to dig a bit on the usage of GL limits for the
number of texture (image) units and document our use of them. We'll need
something finer grained if we want to fully exploit texture image units
with a programmable pipeline.

14 years agocogl: Fix gl equivalent of blend string
Damien Lespiau [Sun, 15 Nov 2009 20:17:47 +0000 (20:17 +0000)]
cogl: Fix gl equivalent of blend string

An example of what could be the equivalent of
    "RBG = REPLACE(TEXTURE)
     A   = MODULATE(PREVIOUS,TEXTURE)"
using the ARB_texture_env_combine extension was given, but it seems that
a few typo were left:
    * remove a spurius GL_COMBINE_ALPHA
    * use the _ALPHA variant of SRCN and OPERANDN when setting up the
      alpha combiner

14 years agotests: blend-string: use g_assert_cmpint
Damien Lespiau [Wed, 18 Nov 2009 01:13:11 +0000 (01:13 +0000)]
tests: blend-string: use g_assert_cmpint

It's very useful to see the actual number the reference value is
compared too when the test fails. GTest has g_assert_cmp$type()
functions for that, so make good use of them.

14 years agotest-cogl-multitexture: use several materials with texture matrices
Damien Lespiau [Tue, 26 Jan 2010 16:59:50 +0000 (16:59 +0000)]
test-cogl-multitexture: use several materials with texture matrices

A small doubt has risen about the use of CoglTextureUnit in materials:
will texture matrices still work if we have several materials, each of
them having at texture on the same texture unit? The answer is yes!

test-cogl-multitexture has been extended to use 2 materials with about
the same setup except a little difference: the texture matrices for the
lightmaps rotate in opposite directions.

While at it, changed the rotation behaviour by an implicit animation
with a small additional bonus bling.

14 years agocogl: Create CoglTextureUnit with its associated unit number
Damien Lespiau [Sun, 15 Nov 2009 19:54:17 +0000 (19:54 +0000)]
cogl: Create CoglTextureUnit with its associated unit number

The index field of CoglTextureUnit was never set, leading to the
creation of units with index set to 0. When trying to retrieve a texture
unit by its index (!= 0) with _cogl_get_texture_unit(), a new one was
created as it could not find it back in the list of textures units:
ctx->texture_units.

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

14 years agoactor: Use GParamSpecUint for :opacity
Emmanuele Bassi [Thu, 21 Jan 2010 17:41:10 +0000 (17:41 +0000)]
actor: Use GParamSpecUint for :opacity

The :opacity property is defined using a GParamSpecUchar. This usually
leads to issues with language bindings that don't have an 'unsigned
char' type and that need to explicitly handle the conversion between
G_TYPE_UCHAR and G_TYPE_INT or G_TYPE_UINT.

The property definition already specifies an interval size of [0, 255]
on the values; more importantly, GObject already implicitly transforms
between G_TYPE_UCHAR and G_TYPE_UINT (the GValue transformation
functions are registered at type system initialization time) so
switching between a GParamSpecUchar and a GParamSpecUint should not be
an ABI break.

I have tested a simple program using the opacity property before and
after the change and I cannot see any run-time warnings related to this
issue.

14 years agotest-easing: Do not reconnect signals multiple times
Emmanuele Bassi [Fri, 22 Jan 2010 21:44:28 +0000 (21:44 +0000)]
test-easing: Do not reconnect signals multiple times

The test should keep track of the last animation and avoid reconnecting
signals to the same instance in case the -r argument has been passed.

14 years agoanimation: Verify internal state
Emmanuele Bassi [Fri, 22 Jan 2010 21:42:55 +0000 (21:42 +0000)]
animation: Verify internal state

Be more drastic if the internal state is broken, and assert() if the
expected Alpha and Timeline instances we need are not valid. This
usually implies a library bug or a massive heap corruption.

14 years agodocs: Fix the Animation:object property
Emmanuele Bassi [Fri, 22 Jan 2010 21:42:10 +0000 (21:42 +0000)]
docs: Fix the Animation:object property

There is a typo in the Animation:object property gtk-doc declaration.

14 years agoanimation: Add more debug annotations
Emmanuele Bassi [Fri, 22 Jan 2010 21:41:33 +0000 (21:41 +0000)]
animation: Add more debug annotations

We need some better tracking of the Animation's lifetime.

14 years agoanimation: Transform if necessary
Emmanuele Bassi [Fri, 22 Jan 2010 21:36:41 +0000 (21:36 +0000)]
animation: Transform if necessary

The Animation code does transformation of values between type A and A'
after checking for compatibility using g_value_type_compatible(). This
is incorrect: compatibility means that the two types can be copied. The
correct conversion should follow:

        if (compatible (type (A), type (A')))
          copy (A, A');
        else
          if (transformable (type (A), type (A')))
            transform (A, A');
          else
            error("Unable to trasform type A in A'");

The transformation might still fail, so we need to check for errors
there as well as a fall-through case.

14 years agoanimation: Check for value transformability
Emmanuele Bassi [Fri, 22 Jan 2010 21:33:28 +0000 (21:33 +0000)]
animation: Check for value transformability

We should not just check for compatibility, but also for the ability to
transform a GValue of type A into another of type A'.

Usually compatibility is enough, especially if types can be
introspected beforehand; some times, though, we also need to check for
transformability as a type can provide the transformation functions
necessary for the operation.

14 years agocogl-atlas-texture: Add a debug option to disable the atlas
Neil Roberts [Thu, 21 Jan 2010 15:34:19 +0000 (15:34 +0000)]
cogl-atlas-texture: Add a debug option to disable the atlas

If the user specifies the 'disable-atlas' debug option then no texture
will be put in the atlas.

14 years agobuild: Use no-define
Emmanuele Bassi [Fri, 22 Jan 2010 00:06:17 +0000 (00:06 +0000)]
build: Use no-define

We don't need the PACKAGE and VERSION defines in the config.h.

14 years agobuild: Add no-portability option to automake
Emmanuele Bassi [Thu, 21 Jan 2010 23:57:38 +0000 (23:57 +0000)]
build: Add no-portability option to automake

We require the GNU version of make for some of our rules, and it's been
so for a while now.

14 years agomaster clock: Improve the timeline advancement protection
Emmanuele Bassi [Thu, 21 Jan 2010 23:41:18 +0000 (23:41 +0000)]
master clock: Improve the timeline advancement protection

The commit 1c69c61745ed510f0b6ab16cb963ca01994cb9fc which improved the
protection against timeline removals during the master clock advancement
was only doing half the job - and actually broke the chaining of
animations inside the ::completed signal.

We cannot simply take a reference on the timelines and still use the list
held by the master clock because the do_tick() might result in the
creation of a new timeline, which gets added at the end of the list with
no reference increase and thus gets disposed at the end of the iteration.

We also cannot steal the master clock timelines list because a timeline
might be removed as the direct result of do_tick() and remove_timeline()
would not find the timeline, failing and leaving a dangling pointer
behind.

For this reason we copy the list of timelines out of the one that the
Master Clock holds, take a reference on each timeline, advance them all,
release the reference and free the list.

14 years agox11: Re-enable XI1 extension keyboards
Emmanuele Bassi [Wed, 20 Jan 2010 19:40:58 +0000 (19:40 +0000)]
x11: Re-enable XI1 extension keyboards

The extension keyboard support in XInput 1.x is hopelessly broken.

Nevertheless, it's possible to use some bits of it, as we prefer the
core keyboard events to the XInput events, thus at least having proper
handling for X11 key events on the Stage window.

14 years agox11: Always handle core device events before XI events
Emmanuele Bassi [Fri, 15 Jan 2010 16:28:00 +0000 (16:28 +0000)]
x11: Always handle core device events before XI events

The XI 1.0 layer is complementary to the X11 core devices handling; this
means that core events will still be emitted for the core pointer and
keyboard devices, and that secondary (floating) devices should be
handled on top of that.

Thus, the XI event handling code should be executed (if explicitly
compiled in and enabled) if the core device events have not been parsed.

Note: this is going away with XI2, which completely replaces both core and
XI1 events.

14 years agodocs: Documentation fixes for DeviceManager
Emmanuele Bassi [Fri, 15 Jan 2010 15:29:52 +0000 (15:29 +0000)]
docs: Documentation fixes for DeviceManager

14 years agodevice-manager: Fix the signals definition
Emmanuele Bassi [Fri, 15 Jan 2010 15:29:14 +0000 (15:29 +0000)]
device-manager: Fix the signals definition

Add documentation for the signals, as well as using the correct type for
the marshallers.

14 years agodocs: Add sections for InputDevice and DeviceManager
Emmanuele Bassi [Fri, 15 Jan 2010 14:56:43 +0000 (14:56 +0000)]
docs: Add sections for InputDevice and DeviceManager

14 years agodocs: Add clutter_input_device_get_device_name()
Emmanuele Bassi [Fri, 15 Jan 2010 14:42:19 +0000 (14:42 +0000)]
docs: Add clutter_input_device_get_device_name()

14 years agotests: Print out the device details on motion
Emmanuele Bassi [Fri, 15 Jan 2010 12:24:21 +0000 (12:24 +0000)]
tests: Print out the device details on motion

The test-device interactive test should print out the device name and id
when it detects a motion event.

14 years agoAlways register core devices
Emmanuele Bassi [Fri, 15 Jan 2010 12:22:29 +0000 (12:22 +0000)]
Always register core devices

Even with XInput support we should always register core devices. This
allows us to handle enter and leave events correctly on the Stage and
to have a working XInput 1.x support in Clutter.

14 years agodevice: Remove unused is_default member
Emmanuele Bassi [Fri, 15 Jan 2010 11:52:27 +0000 (11:52 +0000)]
device: Remove unused is_default member

The is_default member of the InputDevice structure was not used
anywhere.

14 years agowin32: Experimental implementation of device support
Emmanuele Bassi [Fri, 15 Jan 2010 11:47:05 +0000 (11:47 +0000)]
win32: Experimental implementation of device support

Mostly lifted from the core pointer and keyboard X11 backend support.

The win32 backend registers two devices (a core pointer and a core
keyboard) and assigns them to the event structure when doing the
translation from native events to Clutter events.

Thanks to: Samuel Degrande <Samuel.Degrande@lifl.fr> for testing this
patch.

14 years agotests: Print the device name, as well as its Id
Emmanuele Bassi [Fri, 15 Jan 2010 11:40:01 +0000 (11:40 +0000)]
tests: Print the device name, as well as its Id

The test-devices interactive test should display the device name along
with the id.

14 years agox11: Fill out the :name property of the InputDevices
Emmanuele Bassi [Fri, 15 Jan 2010 11:38:58 +0000 (11:38 +0000)]
x11: Fill out the :name property of the InputDevices

For the core pointer and keyboard we assign the names ourselves; for
devices coming from XI we can use the XDeviceInfo.name member.

14 years agodevice: Add the :name property to InputDevice
Emmanuele Bassi [Fri, 15 Jan 2010 11:37:43 +0000 (11:37 +0000)]
device: Add the :name property to InputDevice

The InputDevice should have a name, possibly user readable, coming from
the backend.

14 years agox11: Store core devices on the X11 Backend singleton
Emmanuele Bassi [Fri, 15 Jan 2010 11:21:52 +0000 (11:21 +0000)]
x11: Store core devices on the X11 Backend singleton

Instead of overloading the device id of 0 and 1 we should treat the core
devices as special, and have a pointer inside the X11 backend singleton
structure, for fast access.

14 years agodevice: Unset the cursor actor when leaving the stage
Emmanuele Bassi [Thu, 14 Jan 2010 17:14:33 +0000 (17:14 +0000)]
device: Unset the cursor actor when leaving the stage

When an InputDevice leaves a stage we set the stage member of
InputDevice to NULL. We should also unset the cursor_actor (as the
device is obviously not on an actor any more).

When the device re-enters the Stage the ENTER/LEAVE event generation
machinery will then be able to emit the ENTER event on the Stage.

14 years agodevice: Add pointer actor getter
Emmanuele Bassi [Tue, 12 Jan 2010 11:53:12 +0000 (11:53 +0000)]
device: Add pointer actor getter

ClutterInputDevice should have a getter method for retrieving the
reactive actor underneath the pointer.

14 years agox11: Discard the LeaveNotify for off-stage ButtonRelease
Emmanuele Bassi [Wed, 9 Dec 2009 00:03:13 +0000 (00:03 +0000)]
x11: Discard the LeaveNotify for off-stage ButtonRelease

If the user presses a button on a pointer device and then moves out the
Stage X11 will emit the following events:

  LeaveNotify ➔ MotionNotify ... ➔ ButtonRelease ➔ LeaveNotify

The second LeaveNotify differs from the first by the state field.

Unfortunately, ClutterCrossingEvent doesn't have a modifier_state field
like other events, so we cannot provide a way for programmatically
distinguishing them from a Clutter perspective. This is also an X11-ism
we might not even want to replicate on every backend with sane
enter/leave semantics.

For this reason we should check inside the X11 event processing if the
pointer device has already left the Stage and ignore the second
LeaveNotify.

14 years agodevice: Do not overwrite the stage for an InputDevice
Emmanuele Bassi [Wed, 9 Dec 2009 00:01:50 +0000 (00:01 +0000)]
device: Do not overwrite the stage for an InputDevice

The Stage field of an InputDevice is set by the backend, whenever the
pointer enters or leaves the Stage. The Stage should not overwrite the
stage field for every event it processes.

14 years agoevent: Off-stage button releases have a click count of 1
Emmanuele Bassi [Wed, 9 Dec 2009 00:00:49 +0000 (00:00 +0000)]
event: Off-stage button releases have a click count of 1

The ButtonRelease off-stage should not have a click count of 0 but a
click count initialized to 1.

14 years agoevent: Scroll events do not have click count
Emmanuele Bassi [Tue, 8 Dec 2009 23:59:56 +0000 (23:59 +0000)]
event: Scroll events do not have click count

Remove the unneeded CLUTTER_SCROLL case from the click count checks.

14 years agoWhitespace and indentation fixes
Emmanuele Bassi [Tue, 8 Dec 2009 18:33:01 +0000 (18:33 +0000)]
Whitespace and indentation fixes

14 years agoevent: Clean up click-count detection
Emmanuele Bassi [Mon, 7 Dec 2009 23:13:52 +0000 (23:13 +0000)]
event: Clean up click-count detection

Avoid a few indirections and direct access to the Event and InputDevice
structures.

14 years agodevice: Store the current state, not the previous
Emmanuele Bassi [Mon, 7 Dec 2009 23:05:20 +0000 (23:05 +0000)]
device: Store the current state, not the previous

The previous state for the device is used by the click count machinery
and we should not be overwriting it at every event; instead, we should
use a parallel storage for the current state coming from the windowing
system.

14 years agotests: Fix test-events output
Emmanuele Bassi [Mon, 7 Dec 2009 23:02:48 +0000 (23:02 +0000)]
tests: Fix test-events output

• The enter/leave event line should take into account the case where
  the related field is set to NULL (meaning entering from off-stage
  and leaving the stage).

• The ButtonRelease line shows the click count but uses the button; the
  button *and* the click count should be displayed for both ButtonPress
  and ButtonRelease, to verify they match.

14 years agodocs: Update the API reference
Emmanuele Bassi [Mon, 7 Dec 2009 18:38:18 +0000 (18:38 +0000)]
docs: Update the API reference

Add the new symbols for InputDevice and DeviceManager

14 years agoDo not pick when motion event delivery is disabled
Emmanuele Bassi [Tue, 24 Nov 2009 17:54:02 +0000 (17:54 +0000)]
Do not pick when motion event delivery is disabled

The device manager does not need to update the state of the devices
when the user has disabled the delivery of motion events to actors:
the events will always be delivered as they are to the stage.

14 years agoRework the emission of LEAVE/ENTER event pairs
Emmanuele Bassi [Tue, 24 Nov 2009 16:33:03 +0000 (16:33 +0000)]
Rework the emission of LEAVE/ENTER event pairs

The LEAVE/ENTER event pairs should be queued during the InputDevice
update process, when we change the actor under the device pointer.

This commit cleans up the event emission code inside clutter-main.c
and the logic of the event processing.

14 years agotests: Clean up test-events
Emmanuele Bassi [Tue, 24 Nov 2009 16:31:14 +0000 (16:31 +0000)]
tests: Clean up test-events

The output of test-events is a bit of a mess; this patch should clean
it up a little bit - at least enough for it to be useful again during
visual inspection.

14 years agoAdd docs and licensing notices
Emmanuele Bassi [Tue, 24 Nov 2009 16:22:44 +0000 (16:22 +0000)]
Add docs and licensing notices

14 years agoMove all picking-related operations inside InputDevice
Emmanuele Bassi [Fri, 8 Jan 2010 17:51:00 +0000 (17:51 +0000)]
Move all picking-related operations inside InputDevice

The InputDevice objects stores pointer coordinates, state, stage and
the actor under the cursor, so if the current backend provides us with
one attached to the Event structure then we want the InputDevice itself
to update its state and give us the ClutterActor underneath the
pointer's cursor.

14 years agoactor: Add :has-pointer property
Emmanuele Bassi [Tue, 24 Nov 2009 12:53:57 +0000 (12:53 +0000)]
actor: Add :has-pointer property

ClutterActor should be able to tell whether a pointer is within
its area or not.

14 years agodevice: Make InputDevice an object and subclass it for X11
Emmanuele Bassi [Mon, 23 Nov 2009 16:07:16 +0000 (16:07 +0000)]
device: Make InputDevice an object and subclass it for X11

ClutterInputDevice should be a type that we can subclass per-backend
to add functionality.

14 years agotests: Update the devices test
Emmanuele Bassi [Fri, 20 Nov 2009 16:37:58 +0000 (16:37 +0000)]
tests: Update the devices test

Use the DeviceManager API instead of the X11 specific API.

14 years agox11: Always assign a device to pointer and key events
Emmanuele Bassi [Fri, 20 Nov 2009 16:24:16 +0000 (16:24 +0000)]
x11: Always assign a device to pointer and key events

Even when we are not using XInput we now have fallback devices; the
X11 backend should always assign the default devices when translating
the X events to Clutter events.

14 years agoAdd :is-default flag to InputDevice
Emmanuele Bassi [Fri, 20 Nov 2009 15:43:50 +0000 (15:43 +0000)]
Add :is-default flag to InputDevice

14 years agoPort the X11 backend to the Device Manager
Emmanuele Bassi [Fri, 20 Nov 2009 15:36:43 +0000 (15:36 +0000)]
Port the X11 backend to the Device Manager

Use the device manager to store the input devices. Also, provide
two fallback devices when initializing the X11 backend: device 0
for the pointer and device 1 for the keyboard.

14 years agoAdd ClutterDeviceManager
Emmanuele Bassi [Fri, 20 Nov 2009 15:35:40 +0000 (15:35 +0000)]
Add ClutterDeviceManager

The ClutterDeviceManager is a singleton object that behaves like the
StageManager: it holds all input devices and notifies on addition and
removal.

14 years agotest-cogl-npot-texture: Use the COGL_TEXTURE_NO_ATLAS flag
Neil Roberts [Tue, 19 Jan 2010 17:14:58 +0000 (17:14 +0000)]
test-cogl-npot-texture: Use the COGL_TEXTURE_NO_ATLAS flag

If the texture is put in the atlas it won't be sliced whatever size it
is so it negates the test. We can avoid this with the NO_ATLAS flag.

14 years agocogl-atlas-texture: Don't create atlas textures with the premult bit
Neil Roberts [Tue, 19 Jan 2010 17:06:28 +0000 (17:06 +0000)]
cogl-atlas-texture: Don't create atlas textures with the premult bit

Previously the atlas textures were being created with whatever format
the first sub texture is in. Only three formats are supported so this
only matters if the first texture is a premultiplied alpha
texture. Instead it now masks out the premultiplied bit so that the
textures are always either RGB_888 or RGBA_8888.

14 years agowin32: Use an invisible cursor when cursor-visible is FALSE
Neil Roberts [Fri, 15 Jan 2010 22:56:37 +0000 (22:56 +0000)]
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.

14 years agoPost-release version bump to 1.1.7
Neil Roberts [Mon, 18 Jan 2010 17:33:08 +0000 (17:33 +0000)]
Post-release version bump to 1.1.7

14 years agoRelease Clutter 1.1.6
Neil Roberts [Mon, 18 Jan 2010 15:44:58 +0000 (15:44 +0000)]
Release Clutter 1.1.6

14 years agoREADME: Clarify the required OpenGL version
Neil Roberts [Mon, 18 Jan 2010 15:43:25 +0000 (15:43 +0000)]
README: Clarify the required OpenGL version

Cogl will not allow OpenGL 1.2 if it doesn't have the multitexturing
extension so we should make this clear in the README.

14 years agoAdd build/mingw/{README,mingw-cross-compile.sh} to the dist tarball
Neil Roberts [Mon, 18 Jan 2010 13:56:56 +0000 (13:56 +0000)]
Add build/mingw/{README,mingw-cross-compile.sh} to the dist tarball

It's quite difficult to get git working on Windows so it makes sense
to put the build instructions somewhere accessible.

14 years agotest-texture-fbo: Disconnect the paint handler for the stage
Neil Roberts [Mon, 18 Jan 2010 12:42:20 +0000 (12:42 +0000)]
test-texture-fbo: Disconnect the paint handler for the stage

Otherwise the paint handler will still be run for the subsequent
tests. This ends up writing to the ‘state’ variable which used to be
on the stack so it will end up corrupting some stack variable. This
was causing test-cogl-premult to fail.

14 years agoclutter-group: Use g_list_foreach in clutter_group_real_foreach
Neil Roberts [Mon, 18 Jan 2010 12:35:05 +0000 (12:35 +0000)]
clutter-group: Use g_list_foreach in clutter_group_real_foreach

g_list_foreach has better protection against the current node being
removed. This will happen for example if someone calls
clutter_container_foreach(container, clutter_actor_destroy). This was
causing valgrind errors for the conformance tests which do just that.

14 years agocogl-atlas-texture: Fix premultiplied texture formats
Neil Roberts [Mon, 18 Jan 2010 10:53:00 +0000 (10:53 +0000)]
cogl-atlas-texture: Fix premultiplied texture formats

When uploading texture data it was just calling cogl_texture_set_data
on the large texture. This would attempt to convert the data to the
format of the large texture. All of the textures with alpha channels
are stored together regardless of whether they are premultiplied so
this was causing premultiplied textures to be unpremultiplied
again. It now just uploads the data ignoring the premult bit of the
format so that it only gets converted once.

14 years agocogl-primitives: Ensure the mipmaps for a layer before logging quads
Neil Roberts [Thu, 14 Jan 2010 17:57:43 +0000 (17:57 +0000)]
cogl-primitives: Ensure the mipmaps for a layer before logging quads

With the atlas texture backend ensuring the mipmaps can make it become
a completely different texture which will have different texture
coordinates or may even be sliced. Therefore we need to ensure the
mipmaps before deciding which quads to log in the journal. This adds a
new private function to cogl-material which ensures the mipmaps if
needed.

14 years agocogl: Make CoglSubTexture only work for quad rendering
Neil Roberts [Mon, 18 Jan 2010 09:22:04 +0000 (09:22 +0000)]
cogl: Make CoglSubTexture only work for quad rendering

The sub texture backend doesn't work well as a completely general
texture backend because for example when rendering with cogl_polygon
it needs to be able to tranform arbitrary texture coordinates without
reference to the other coordintes. This can't be done when the texture
coordinates are a multiple of one because sometimes the coordinate
should represent the left or top edge and sometimes it should
represent the bottom or top edge. For example if the s coordinates are
0 and 1 then 1 represents the right edge but if they are 1 and 2 then
1 represents the left edge.

Instead the sub-textures are now documented not to support coordinates
outside the range [0,1]. The coordinates for the sub-region are now
represented as integers as this helps avoid rounding issues. The
region can no longer be a super-region of the texture as this
simplifies the code quite a lot.

There are two new texture virtual functions:

transform_quad_coords_to_gl - This transforms two pairs of coordinates
     representing a quad. It will return FALSE if the coordinates can
     not be transformed. The sub texture backend uses this to detect
     coordinates that require repeating which causes cogl-primitives
     to use manual repeating.

ensure_non_quad_rendering - This is used in cogl_polygon and
     cogl_vertex_buffer to inform the texture backend that
     transform_quad_to_gl is going to be used. The atlas backend
     migrates the texture out of the atlas when it hits this.

14 years agowin32: Fix computation of the fullscreen size during stage realization
Samuel Degrande [Fri, 27 Nov 2009 15:53:50 +0000 (16:53 +0100)]
win32: Fix computation of the fullscreen size during stage realization

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

Signed-off-by: Neil Roberts <neil@linux.intel.com>
14 years agodocs: Clarify usage of UTF-8 or ASCII art in commit messages
Emmanuele Bassi [Fri, 15 Jan 2010 17:32:46 +0000 (17:32 +0000)]
docs: Clarify usage of UTF-8 or ASCII art in commit messages

14 years agodocs: Display the features section
Emmanuele Bassi [Fri, 15 Jan 2010 17:06:56 +0000 (17:06 +0000)]
docs: Display the features section

The features section of the API reference is built but not used, and it
has some copy-and-paste errors.

14 years agoAdd test-cogl-texture-mipmaps to the Git ignore file
Emmanuele Bassi [Fri, 15 Jan 2010 14:50:06 +0000 (14:50 +0000)]
Add test-cogl-texture-mipmaps to the Git ignore file

14 years agox11: Fix typo in clutter_x11_set_use_argb_visual() declaration
Emmanuele Bassi [Fri, 15 Jan 2010 14:48:42 +0000 (14:48 +0000)]
x11: Fix typo in clutter_x11_set_use_argb_visual() declaration

The function should have a lowercase x11, not an uppercase X11 in its
name.

14 years agodocs: Ignore clutter-profile.h
Emmanuele Bassi [Fri, 15 Jan 2010 14:47:20 +0000 (14:47 +0000)]
docs: Ignore clutter-profile.h

14 years agocogl-texture: Fix manual repeating for negative coordinates
Neil Roberts [Mon, 11 Jan 2010 16:23:38 +0000 (16:23 +0000)]
cogl-texture: Fix manual repeating for negative coordinates

When calculating the next integer position for negative coordinates it
would not increment if the position is already a multiple of one so we
need to manually add one.

14 years agocogl-texture-2d: Fix the coordinate wrapping for negative coordinates
Neil Roberts [Mon, 11 Jan 2010 16:21:56 +0000 (16:21 +0000)]
cogl-texture-2d: Fix the coordinate wrapping for negative coordinates

The formula to wrap the coordinates to the [0,1] range was broken when
the coordinates were negative.

14 years agoMerge branch 'master' into more-texture-backends
Neil Roberts [Fri, 15 Jan 2010 12:15:46 +0000 (12:15 +0000)]
Merge branch 'master' into more-texture-backends

14 years agotests: Add a simple conformance test for texture mipmaps
Neil Roberts [Fri, 15 Jan 2010 12:02:09 +0000 (12:02 +0000)]
tests: Add a simple conformance test for texture mipmaps

This adds a test which renders a texture into a 1x1 pixel quad with
and without filters that use mipmaps. The pixel without mipmaps will
be one of the colors from the texture and the one with will be the
average of all the pixels in the texture.

14 years agoAdd a notice of deprecation in the pre-Git ChangeLog
Emmanuele Bassi [Thu, 14 Jan 2010 15:23:41 +0000 (15:23 +0000)]
Add a notice of deprecation in the pre-Git ChangeLog

14 years agocogl-framebuffer: Return gboolean from try_creating_fbo
Neil Roberts [Tue, 12 Jan 2010 21:44:40 +0000 (21:44 +0000)]
cogl-framebuffer: Return gboolean from try_creating_fbo

When try_creating_fbo fails it returns 0 to report the error and if it
succeeds it returns ‘flags’. However cogl_offscreen_new_to_texture
also passes in 0 for the flags as the last fallback to create the fbo
with nothing but the color buffer. In that case it will return 0
regardless of whether it succeeded so the last fallback will always be
considered a failure.

To fix this it now just returns a gboolean to indicate whether it
succeeded and the flags used for each attempt is assigned when passing
the argument rather than from the return value of the function.

Also if the only configuration that succeeded was with flags==0 then
it would always try all combinations because last_working_flags would
also be zero. To avoid this it now uses a separate gboolean to mark
whether we found a successful set of flags.

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

14 years agoconform: Add operators tests for ClutterColor
Emmanuele Bassi [Thu, 14 Jan 2010 14:07:04 +0000 (14:07 +0000)]
conform: Add operators tests for ClutterColor

The clutter_color_add() and clutter_color_subtract() functions are
lacking unit testing to catch eventual regressions.

14 years agomaster-clock: Add profiling timers
Emmanuele Bassi [Thu, 14 Jan 2010 12:28:07 +0000 (12:28 +0000)]
master-clock: Add profiling timers

Use the newly-added profiling timers inside the master clock dispatch
function to see how much time we spend:

  • in the whole function
    • in the event processing for each stage
    • in the timeline advancement

14 years agounits: Improve coverage of clutter_units_from_string()
Emmanuele Bassi [Wed, 13 Jan 2010 17:31:13 +0000 (17:31 +0000)]
units: Improve coverage of clutter_units_from_string()

Add a unit for an empty string as well as units for the missing unit
types like cm, mm and px.