The nodes of the test path have been reordered because Cairo coalesces
multiple move operations into a single move so the comparison would
fail if the two move nodes are consecutive.
Fix the CairoTexture description, and some of the comments inside
the code, especially with regards to the alpha channel unpremultiplication
that we have to perform each time we upload the image surface to
GL.
If you create a Cairo context in the middle of a paint run and then
you destroy it, the CairoTexture will have to upload the contents of
the image surface to the GL pipeline. This usually leads to slow
downs and general performance degradation.
ClutterCairoTexture will warn to the console if Clutter has been
compiled with the debug messages and if create() or create_region()
are called while an actor is in the middle of a paint.
Since the CLUTTER_ACTOR_IN_PAINT private flag is set as part
of the paint process by clutter_actor_paint(), there is no
need to set it inside the ClutterStage paint function.
When calling clutter_actor_paint() we should be setting the
CLUTTER_ACTOR_IN_PAINT private flag. This allows signalling
to each Actor subclass that we are effectively in the middle
of a paint sequence. Actor subclasses can check for this
private flag and act based on its presence - for instance to
avoid recursion, or to detect performance degradation cases.
Move the ClutterCairo actor from a separate library to an in-tree
actor.
ClutterCairoTexture is a simple texture subclass that allows you
to retrieve a Cairo context for a private image surface. When the
Cairo context is destroyed it will cause the image surface
contents to be uploaded to a GL texture.
The image surface used is not hardware accelerated.
Cairo has been an indirect dependency for Clutter since 0.8, through
the PangoCairo API.
Now we explicitly depend on Cairo in order to merge the clutter-cairo
API into Clutter core.
Add all the unused API to the sections file; there are still
some undocumented bits, but clutter-unused.txt is empty for
the time being.
Also, add ClutterText to the main XML document and remove
ClutterLabel and ClutterEntry.
If we create the PangoContext for ClutterText inside the class
initialization we might not have a Clutter main context yet.
Ideally, we should store the Pango context inside the main context
and create it on clutter_init(), but for now we can lazily create
the PangoContext when we initialize a ClutterText instance for the
first time.
For the time being, just don't include them or compile them; the
files will be removed from the repository as soon as all the
documentation annotations have been ported over to ClutterText.
The test-opacity interactive test is superceded by the equivalent
units inside the conformance test suite.
The test-entry interactive test is superceded by the test-text one.
ClutterText behaviour with regards to the paint opacity has been
changed by commit 07e19fff5ffa9617413fa6c3715914513fec3793.
We need to update the test suite for the paint opacity to reflect
that change as well.
We allow KeyEvents with a key symbol of '0' to fall through only
if they are marked as synthetic. Otherwise we discard them without
mercy.
Synthetic events are useful to test ClutterText behaviour; in fact,
we do use them inside the test suite exactly for that reason.
I understand we are not Pascal developers, and we don't have to
use cute and cuddly names like "i_am_an_integer_counter", but
a ClutterButtonEvent should be stored inside an "event" variable.
Using "bev" instead? Mmmh, not so much.
ClutterText should use the paint opacity for both text and
cursor.
ClutterLabel had the wrong behaviour, as it set the actor's
opacity using the text color's alpha channel, and ClutterEntry
completely disregarded the actor's opacity when painting the
cursor.
This commit harmonizes the ClutterText behaviour to always
use a composition of the actor's paint opacity and the text
and cursor alpha channel values, thus behaving more
consistently with the rest of Clutter.
When inserting text on a key press event we should also truncate
the selection.
We should not truncate the selection when inserting any Unicode
character, since changing the selection also changes the cursor
position - and one of the invariants we inherited from ClutterEntry
is that inserting characters programmatically does not change the
cursor position.
If a selection has been truncated inside a key binding handler,
we should just return and let the usual key event handler continue.
This fixes the case where we deleted a selection using the Delete
or the Backspace keys.
ClutterText should use the newly added ClutterBindingPool API to
handle key events, instead of its homegrown code.
This commit removes the action/mapping code and defers the entire
key binding matching to a ClutterBindingPool created inside the
Text class initialization function.
The clutter_text_get_chars() function returns a section of the
contents of the Text actor, delimited by a start and an end position.
This commit adds the implementation for that function and a test
unit that guarantees the offset-to-bytes computations are correct.
Comment why we need to enable the editability of the Text actor
inside the test suite.
This should clarify commit ea508ea528d61ae478d8bc4c88f54a89304f18e8
Whenever we are sending specially crafted KeyEvents to a ClutterText
we also need to set it editable, since the event handling code depends
on the editability setting.
The :cursor-color-set property is a read-only property that
reflects whether the ClutterText actor is going to use the
color set inside the :cursor-color property when painting
the cursor.
We should re-use the offset_to_bytes() implementation from ClutterEntry
as it guaranteed some behaviour and sanity checks that we want to keep
inside ClutterText.
Instead of changing the unit for ClutterEntry, we add a new
test unit specifically for ClutterText so that we can later tweak
it specifically for the behaviour changes needed to make ClutterText
work better.
A ClutterText can be put in "password mode" by setting the
text as "invisible": every character inside the Text actor's
contents will be replaced when building the Pango layout with
a specific Unicode character.
The Unicode character is set to '*' by default, but the user
can be changed using the provided API.
The test-threads interactive test is a good candidate for the
switch from ClutterLabel to ClutterText to verify that the
behaviour of the two classes is the same.