Emmanuele Bassi [Mon, 5 Jan 2009 15:27:33 +0000 (15:27 +0000)]
Rename the PangoContext creation functions
The _clutter_context_create_pango_context() should create a new
context; the function returning the PangoContext stored inside the
MainContext structure should be named _get_pango_context() instead.
Emmanuele Bassi [Mon, 5 Jan 2009 15:26:57 +0000 (15:26 +0000)]
Whitespace fixes
Emmanuele Bassi [Mon, 5 Jan 2009 12:52:29 +0000 (12:52 +0000)]
[docs] Add the new API to the BindingPool section
Add the clutter_binding_pool_override_* family of functions to
the BindingPool section of the Clutter API reference.
Emmanuele Bassi [Mon, 5 Jan 2009 12:49:01 +0000 (12:49 +0000)]
Allow overriding actions inside a BindingPool
As of now, a key binding installed into a BindingPool is always there
and cannot be changed.
This is problematic for sub-classes trying to override the callback
or the action for a given key binding.
This commit adds the ability to override the closure for an existing
key binding inside a binding pool -- assumed the caller knows the
key symbol and modifiers used to install the key binding in the first
place.
Emmanuele Bassi [Mon, 5 Jan 2009 12:27:45 +0000 (12:27 +0000)]
[text] Add select-all binding
Bind Ctrl+A to the "select all" action.
Emmanuele Bassi [Tue, 16 Dec 2008 17:44:13 +0000 (17:44 +0000)]
[docs] Add clutter_text_activate()
Add the last unused symbol to the ClutterText section.
Emmanuele Bassi [Tue, 16 Dec 2008 17:40:41 +0000 (17:40 +0000)]
[docs] Remove ClutterLabel and ClutterEntry sections
Remove the sections for the Label and the Entry actors, which
have been replaced by ClutterText.
Emmanuele Bassi [Tue, 23 Dec 2008 16:59:14 +0000 (16:59 +0000)]
[docs] Document the newly added functions
Document the ClutterBackend font name accessors, and the
clutter_actor_get_pango_context() getter method.
Emmanuele Bassi [Tue, 23 Dec 2008 16:40:26 +0000 (16:40 +0000)]
Add the ability to set the text direction
The direction of the text depends on the locale, and it is the
basic setting needed to enable internationalization of user
interfaces.
This commit allows setting the direction of the PangoContext instance
used by Clutter by using the CLUTTER_TEXT_DIRECTION environment
variable, or by passing the --clutter-text-direction command line
argument. Valid values are:
ltr - for left-to-right locales
rtl - for right-to-left locales
The default is LTR.
Ideally, this should be a value set by the localization teams on the
PO file, but this step requires some build system surgery to allow
the translation of the Clutter strings.
Emmanuele Bassi [Tue, 23 Dec 2008 16:27:54 +0000 (16:27 +0000)]
Return the default font name if no font name is set
When calling clutter_backend_get_font_name(), if no default font
name has previously been set, we just set the default and return
a pointer to it - like we do for the font options.
Emmanuele Bassi [Tue, 23 Dec 2008 15:05:16 +0000 (15:05 +0000)]
Use the default font from the Backend
Instead of storing the default font name and size as a pre-processor
macro, use the newly added ClutterBackend API to retrieve the current
default font from the backend.
Emmanuele Bassi [Tue, 23 Dec 2008 15:03:11 +0000 (15:03 +0000)]
Store the default font name inside ClutterBackend
The default backend stores some of the global defaults, like the
font options, text resolution, double click settings. It should also
store the default font name, to allow various text-based actors to
share the same settings.
When the font name changes, the ::font-changed signal is emitted,
to allow actors to pick up the change.
Emmanuele Bassi [Tue, 23 Dec 2008 14:34:16 +0000 (14:34 +0000)]
Update the PangoContext on backend changes
When the ClutterBackend notifies of changes in the resolution or
font options, update the PangoContext stored by Clutter's main
context. This allows changing the backend font-related settings at
runtime.
Emmanuele Bassi [Tue, 23 Dec 2008 14:27:41 +0000 (14:27 +0000)]
Store the PangoContext inside the main context
The PangoContext should be stored once, and inside the main
Clutter context. Each actor for which clutter_actor_get_pango_context()
has been called will hold a reference on the Pango context as well.
This makes it possible to update the text rendering for Clutter
by using only public API.
Emmanuele Bassi [Tue, 23 Dec 2008 14:15:10 +0000 (14:15 +0000)]
Do not leak the PangoContext
We hold a reference on the PangoContext we use for an actor, so
we should remove the reference inside the dispose implementation.
Emmanuele Bassi [Tue, 23 Dec 2008 14:11:27 +0000 (14:11 +0000)]
Create the PangoContext of the Text actor
Instead of creating a single, private PangoContext for every
Text actor, use the newly added clutter_actor_get_pango_context()
function.
Emmanuele Bassi [Tue, 23 Dec 2008 14:06:55 +0000 (14:06 +0000)]
Add a per-actor PangoContext
Rendering text inside an actor is pretty much impossible without
using internal API to create the various pieces like the PangoContext
and the font map.
Each actor should have the ability to create a PangoContext, which
is the only object needed to generate layouts and change the various
Pango settings.
This commit adds a clutter_actor_get_pango_context() function that
creates a PangoContext inside the ClutterActor private data and allows
the creation of PangoLayouts when needed. If the actor already
has a PangoContext, the same instance is returned.
The PangoContext is created only on demand.
Emmanuele Bassi [Tue, 23 Dec 2008 13:55:51 +0000 (13:55 +0000)]
Add signals for Backend options
The ClutterBackend instance at the moment lacks the ability to
notify runtime changes of the font options and the resolution.
For this reason, this commit adds a ::resolution-changed and a
::font-changed signals to the Backend class.
The ::resolution-changed signal is emitted when set_resolution()
is called with a different DPI; ::font-changed is emitted when the
cairo_font_options_t* changes from the default.
Emmanuele Bassi [Mon, 22 Dec 2008 13:29:10 +0000 (13:29 +0000)]
Use "" as the default value for the :text property
This follows the convention of GtkLabel/GtkEntry in GTK+ and the old
ClutterEntry.
It makes it easier to use strlen/strcmp etc on the output, since we can
assume that it is always a string.
This commit also updates the test unit for ClutterText to verify that
the clutter_text_get_text() function also returns an empty string when
a ClutterText actor has been created.
Emmanuele Bassi [Mon, 22 Dec 2008 13:24:52 +0000 (13:24 +0000)]
Do not include cogl-pango.h multiple times
The clutter-private.h header already includes cogl-pango.h with
the correct inclusion path, because the main context stores a
pointer to the font map.
There is no need for clutter-text.c to include cogl-pango.h
again since it already includes clutter-private.h.
Emmanuele Bassi [Tue, 16 Dec 2008 15:53:57 +0000 (15:53 +0000)]
Fix the selection behaviour around the 0th glyph
After fixing the cursor position issues around the initial
glyph of the layout, the selection position needs fixing as
well.
The fix is similar: check if the position of the selection
is 0 and provide a fast path by setting the offset to 0.
Emmanuele Bassi [Tue, 16 Dec 2008 13:58:54 +0000 (13:58 +0000)]
[tests] Make the layout cache fail at the right place
The GTest report output allows the developer to know where exactly
a test unit failure happened. The test-text-cache unit makes it
very hard to pinpoint the exact failure location because it relies
on the output to be printed out - which is not the case when the
tests are run as part of a make check.
This commit makes each sub-test inside the unit fail exactly where
the check function fails, which makes it easier to know which sub-test
did actually fail.
Emmanuele Bassi [Tue, 16 Dec 2008 12:42:44 +0000 (12:42 +0000)]
[docs] Add clutter_text_set_selection to gtk-doc
Insert the newly added symbol to the ClutterText section in
the API reference.
Emmanuele Bassi [Tue, 16 Dec 2008 12:41:20 +0000 (12:41 +0000)]
Add ClutterText::set_selection()
The clutter_text_set_selection() function is a convenience
method for setting the cursor position and the selection
boundary to a given position in a single call, with sanity
checks for the positions.
Emmanuele Bassi [Tue, 16 Dec 2008 12:25:45 +0000 (12:25 +0000)]
Fix ClutterText::get_selection()
The clutter_text_get_selection() function was not checking the
passed argument, and was still accessing the contents of the
Text actor using clutter_text_get_text().
This commit also adds the last few gtk-doc annotations missing
from ClutterText.
Emmanuele Bassi [Tue, 16 Dec 2008 12:25:15 +0000 (12:25 +0000)]
[docs] Add more gtk-doc annotations
Almost reaching full documentation.
Emmanuele Bassi [Tue, 16 Dec 2008 12:05:10 +0000 (12:05 +0000)]
Use clutter_text_activate()
Instead of repeating the same code for the ::activate signal
emission, use the clutter_text_activate() function inside the
'activate' key binding handler.
Emmanuele Bassi [Tue, 16 Dec 2008 12:02:58 +0000 (12:02 +0000)]
Add ClutterText::activate()
The clutter_text_activate() function will emit the ::activate
signal if the :activatable property is set.
This function is useful for subclasses or application code, for
example if we are going to use ::captured-event or ::key-press-event
signal handlers to intercept the Return key and emit the ::activate
signal ourselves.
Emmanuele Bassi [Tue, 16 Dec 2008 11:52:57 +0000 (11:52 +0000)]
[docs] Add more gtk-doc annotations for ClutterText
Document the ClutterText constructors and the :editable, :selectable
and :activatable properties accessors.
Emmanuele Bassi [Tue, 16 Dec 2008 11:30:47 +0000 (11:30 +0000)]
[docs] Annotate properties and fix signals docs
Annotate the properties without gtk-doc description, to get the
"Since" attribute.
Also, fix the ::cursor-event and ::activate signals documentation.
Emmanuele Bassi [Tue, 16 Dec 2008 10:43:05 +0000 (10:43 +0000)]
[docs] Add :cursor-size property accessors
Add the ClutterText:cursor-size property accessors to the
known gtk-doc symbols for the ClutterText section.
Emmanuele Bassi [Tue, 16 Dec 2008 10:39:52 +0000 (10:39 +0000)]
Allow selecting with line-start and line-end bindings
Instead of installing the line-start and line-end key bindings
using the bare ClutterBindingPool API, we can use the internal
clutter_text_add_move_binding(), which automatically installs
the same key binding with the Shift modifier mask.
This allows selecting when pressing Shift+Home or Shift+End.
The selection behaviour is still incorrect around the zeroeth
position, with all the text after the first line being selected.
Emmanuele Bassi [Tue, 16 Dec 2008 10:37:45 +0000 (10:37 +0000)]
Add :cursor-size property to ClutterText
We can control the width of the cursor when painting by using
a simple property.
The magic -1 number passed to the setter method will reset the
cursor size to the default one of 2px.
The getter method will return an unsigned integer with the
current size.
Emmanuele Bassi [Tue, 16 Dec 2008 10:19:56 +0000 (10:19 +0000)]
Remove unused page up/down key bindings
Moving the text by a "page" depends on being able to define a
"page size" in terms of lines of text. Since we don't define
something similar to an Adjustment that allows us to handle this
behaviour, we should defer the paging implementation to a higher
level class based on ClutterText.
Emmanuele Bassi [Tue, 16 Dec 2008 10:15:57 +0000 (10:15 +0000)]
Fix line start and line end key binding behaviour
Another fix for the key navigation behaviour around the zeroeth
glyph in the layout.
This commit adds a fast path for for the zero index when the
cursor position is set as zero, in case we are using the line-start
or line-end key bindings, similarly to what we did in commit
be64cbcdc22952ce2fa9f902e153e3bd9f4a08c9 for the move-up and
move-down bindings.
Emmanuele Bassi [Mon, 15 Dec 2008 18:46:08 +0000 (18:46 +0000)]
Fix up/down key navigation
The behaviour of ClutterText around the initial position is still
a little bit erratic.
This commit fixes the key navigation with Up and Down arrows around
the first line of text.
Emmanuele Bassi [Mon, 15 Dec 2008 18:24:42 +0000 (18:24 +0000)]
Use units in position_to_coords()
We loose precision with a direct conversion for PangoUnits to
pixels, so we should do the conversion as needed, inside the
callers of clutter_text_position_to_coords().
Emmanuele Bassi [Mon, 15 Dec 2008 18:23:25 +0000 (18:23 +0000)]
Constify the cursor geometry in ::cursor-event
We don't allow changing the cursor geometry inside the ::cursor-event
signal handlers; for starters, it would make binding the signal a
huge mess, and it would also potentially break the whole actor.
Emmanuele Bassi [Mon, 15 Dec 2008 15:10:55 +0000 (15:10 +0000)]
[docs] Add annotations for ClutterText structures
ClutterText and ClutterTextClass were missing annotations for
gtk-doc to pick up.
Emmanuele Bassi [Mon, 15 Dec 2008 15:08:12 +0000 (15:08 +0000)]
Remove ClutterLabel and ClutterEntry
Both ClutterLabel and ClutterEntry have been deprecated by
ClutterText.
Emmanuele Bassi [Thu, 11 Dec 2008 15:01:28 +0000 (15:01 +0000)]
[docs] Update the API reference
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.
Emmanuele Bassi [Thu, 11 Dec 2008 15:00:22 +0000 (15:00 +0000)]
Fix documentation issues
Provide a description for the ClutterText section, and fix some
misnamed arguments inside the header file.
Emmanuele Bassi [Thu, 11 Dec 2008 14:57:46 +0000 (14:57 +0000)]
Lazily create the PangoContext on Text::init
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.
Emmanuele Bassi [Thu, 11 Dec 2008 13:49:39 +0000 (13:49 +0000)]
Remove ClutterEntry and ClutterLabel from the build
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.
Emmanuele Bassi [Thu, 11 Dec 2008 13:48:45 +0000 (13:48 +0000)]
Update the micro-bench tests to ClutterText
Test the ClutterText rendering speed instead of ClutterLabel's.
Emmanuele Bassi [Thu, 11 Dec 2008 13:48:01 +0000 (13:48 +0000)]
Update the interactive tests to ClutterText
Instead of using ClutterLabel, use ClutterText to display some
text where needed.
Emmanuele Bassi [Thu, 11 Dec 2008 13:45:22 +0000 (13:45 +0000)]
Do not compile the opacity and entry interactive tests
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.
Emmanuele Bassi [Thu, 11 Dec 2008 13:39:35 +0000 (13:39 +0000)]
Update ignore file
Add the conformance test units for ClutterText.
Emmanuele Bassi [Thu, 11 Dec 2008 12:26:47 +0000 (12:26 +0000)]
Update the paint opacity unit test
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.
Emmanuele Bassi [Thu, 11 Dec 2008 12:24:45 +0000 (12:24 +0000)]
Allow only synthetic events with keyval 0
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.
Emmanuele Bassi [Thu, 11 Dec 2008 12:21:57 +0000 (12:21 +0000)]
Do not use contractions when not needed
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.
Emmanuele Bassi [Thu, 11 Dec 2008 12:18:26 +0000 (12:18 +0000)]
Use the paint opacity when painting a ClutterText
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.
Emmanuele Bassi [Thu, 11 Dec 2008 12:17:11 +0000 (12:17 +0000)]
Add documentation annotations
ClutterText is heavily under-documented. This commit ports most of
the API documentation from ClutterLabel and ClutterEntry to
ClutterText.
Emmanuele Bassi [Thu, 11 Dec 2008 12:15:49 +0000 (12:15 +0000)]
Code style fixes
Fix the arguments alignment whenever not consistent with the
coding style rules.
Emmanuele Bassi [Thu, 11 Dec 2008 12:14:53 +0000 (12:14 +0000)]
Remove unused types
Since ClutterText now uses ClutterBindingPool there is no more
need for the internal key mapping types.
Emmanuele Bassi [Thu, 11 Dec 2008 12:13:26 +0000 (12:13 +0000)]
Remove units for Entry and Label
ClutterText should supercede all unit tests for ClutterLabel and
ClutterEntry.
Emmanuele Bassi [Thu, 11 Dec 2008 12:10:46 +0000 (12:10 +0000)]
Truncate selections on text insertion
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.
Emmanuele Bassi [Thu, 11 Dec 2008 12:08:20 +0000 (12:08 +0000)]
Change the binding propagation when truncating a selection
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.
Emmanuele Bassi [Thu, 11 Dec 2008 12:07:20 +0000 (12:07 +0000)]
Comment out the mapping API
The test-text interactive test for ClutterText should not use
the mapping API, since ClutterText does not have it anymore.
Emmanuele Bassi [Thu, 11 Dec 2008 12:03:17 +0000 (12:03 +0000)]
Use ClutterBindPool inside ClutterText
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.
Emmanuele Bassi [Thu, 11 Dec 2008 11:59:50 +0000 (11:59 +0000)]
Add Text::get_chars() implementation and tests
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.
Emmanuele Bassi [Thu, 11 Dec 2008 11:57:46 +0000 (11:57 +0000)]
Do not namespace internal data structures
Since the internal data structures are not exported (duh!), we
can eschew the namespacing and save us some characters.
Emmanuele Bassi [Thu, 11 Dec 2008 11:56:44 +0000 (11:56 +0000)]
Add comments in the test suite
Comment why we need to enable the editability of the Text actor
inside the test suite.
This should clarify commit
ea508ea528d61ae478d8bc4c88f54a89304f18e8
Emmanuele Bassi [Thu, 11 Dec 2008 11:55:39 +0000 (11:55 +0000)]
Move internal data structures on top
Try to keep the declarations section of the source files clean and
possibly consistent.
Emmanuele Bassi [Thu, 11 Dec 2008 11:54:32 +0000 (11:54 +0000)]
Coding style consistency
Channel mitch's spirit.
This is also how I get to have the highest commit count on Clutter's
repository.
Emmanuele Bassi [Thu, 11 Dec 2008 11:54:07 +0000 (11:54 +0000)]
Implement Text:max-length
The :max-length property establishes the maximum available
length for the Text actor's contents, in characters.
Emmanuele Bassi [Thu, 11 Dec 2008 11:51:28 +0000 (11:51 +0000)]
Update the ClutterText test unit
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.
Emmanuele Bassi [Thu, 11 Dec 2008 11:50:02 +0000 (11:50 +0000)]
Use the stored contents length in ::delete_chars()
Instead of recomputing it, we can reuse the contents length we
compute and store inside clutter_text_set_text().
Emmanuele Bassi [Thu, 11 Dec 2008 11:49:45 +0000 (11:49 +0000)]
Improve the safety checks inside the text setters
We should check that the contents of the Text actor are
not NULL when computing the offsets in bytes.
Emmanuele Bassi [Thu, 11 Dec 2008 11:49:14 +0000 (11:49 +0000)]
Add :cursor-color-set property declaration
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.
Emmanuele Bassi [Thu, 11 Dec 2008 11:48:17 +0000 (11:48 +0000)]
General whitespace fixes in ClutterText
Let's keep whitespace fixes to their own commit to avoid
polluting git-blame.
Emmanuele Bassi [Thu, 11 Dec 2008 11:47:06 +0000 (11:47 +0000)]
Replace offset_to_bytes() implementation
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.
Emmanuele Bassi [Thu, 11 Dec 2008 11:45:37 +0000 (11:45 +0000)]
Add a separate test unit for 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.
Emmanuele Bassi [Thu, 11 Dec 2008 11:43:56 +0000 (11:43 +0000)]
Add text editing methods
Port the text editing methods from ClutterEntry, so that
ClutterText exposes the same API.
Emmanuele Bassi [Thu, 11 Dec 2008 11:43:37 +0000 (11:43 +0000)]
Add missing basic constructor
ClutterText should have an empty constructor, mostly for
bindings to use, that just proxies call to g_object_new()
without setting any property.
Emmanuele Bassi [Thu, 11 Dec 2008 11:42:33 +0000 (11:42 +0000)]
Initialize the cursor position
By default, the cursor position is initialized to -1, meaning
"place the cursor always at the end of the text".
Emmanuele Bassi [Thu, 11 Dec 2008 11:40:55 +0000 (11:40 +0000)]
Add text-visibility accessors for ClutterText
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.
Emmanuele Bassi [Thu, 11 Dec 2008 11:37:46 +0000 (11:37 +0000)]
Move test-threads to ClutterText
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.
Emmanuele Bassi [Thu, 11 Dec 2008 11:35:52 +0000 (11:35 +0000)]
Correctly initialize the initial state of ClutterText
Some of the values in ClutterText have an initial state that
does not match a zero-ed out ClutterTextPrivate structure.
Emmanuele Bassi [Thu, 11 Dec 2008 11:33:10 +0000 (11:33 +0000)]
Merge the ClutterLabel properties into ClutterText
ClutterText should have the same properties as ClutterLabel.
While at it, we can finally fix the disconnect between the wrap
and wrap-mode properties and its accessors, that we perpetuated
from GtkLabel.
The ClutterText:line-wrap property and ClutterText:line-wrap-mode
are mapped to the set_line_wrap(), get_line_wrap() and
set_line_wrap_mode(), get_line_wrap_mode() accessor functions
respectively. This should simplify bindings the Vala ones that
map a property into a method.
Emmanuele Bassi [Thu, 11 Dec 2008 11:31:48 +0000 (11:31 +0000)]
Add Text::get_chars() method declaration
Add the declaration for a clutter_text_get_chars() function that
returns a portion of the contents of a Text actor.
Emmanuele Bassi [Thu, 11 Dec 2008 11:22:46 +0000 (11:22 +0000)]
Add Actor::grab_key_focus() method
Bug 1003 - Add clutter_actor_take_key_focus()
The grab_key_focus() method is just a simple wrapper around
clutter_stage_take_key_focus() that removes the need to get
the ClutterStage of an actor in order to set the key focus.
Based on a patch by Xan López.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Øyvind Kolås <pippin@linux.intel.com>
Emmanuele Bassi [Thu, 11 Dec 2008 11:21:39 +0000 (11:21 +0000)]
Merge Label and Entry API into ClutterText
ClutterText should expose both ClutterLabel and ClutterEntry
functionality using an API that matches the one provided by
those two classes.
Emmanuele Bassi [Thu, 11 Dec 2008 11:20:14 +0000 (11:20 +0000)]
Expose the Text accessors as public API
Fix up the header to expose ClutterText accessors for the main
properties, matching ClutterLabel.
Emmanuele Bassi [Thu, 11 Dec 2008 11:18:05 +0000 (11:18 +0000)]
Update the ClutterText interactive test
Use ClutterText's own API instead of relying on the Label's API.
ClutterText is not meant to be a subclass of ClutterLabel.
Emmanuele Bassi [Thu, 11 Dec 2008 11:17:26 +0000 (11:17 +0000)]
Coalesce ClutterLabel API usage
ClutterText replaces ClutterLabel, so it should expose the same
kind of API - ideally with the minimal amount of changes, so that
the porting is trivial.
Emmanuele Bassi [Thu, 11 Dec 2008 11:15:56 +0000 (11:15 +0000)]
Group all the integer private fields
Integer fields using the ": <bits>" notation should be packed
together so that the compiler can optimize the structure size
correctly.
Emmanuele Bassi [Thu, 11 Dec 2008 11:15:11 +0000 (11:15 +0000)]
Use internal headers
Since ClutterText is part of Clutter, it can use the internal
and private headers instead of the catch-all clutter.h.
Emmanuele Bassi [Thu, 11 Dec 2008 11:12:48 +0000 (11:12 +0000)]
Initial import of the Text actor from Tidy
The TidyText actor is meant as a replacement for both ClutterLabel
and ClutterText.
Any text-displaying and editing actor should derive from ClutterText
and implement the various visual cues to differentiate the editable
from the non-editable state. Those visual cues usually belong to
a high-level toolkit, especially if themeing is involved.
Emmanuele Bassi [Thu, 11 Dec 2008 11:11:11 +0000 (11:11 +0000)]
Resort the main Clutter include file
Just for overall sanity we keep the include file sorted.
Emmanuele Bassi [Wed, 10 Dec 2008 23:12:22 +0000 (23:12 +0000)]
Update ignore file
Emmanuele Bassi [Wed, 10 Dec 2008 23:00:48 +0000 (23:00 +0000)]
Do not modify parameters in place
When the apply_transform_to_point() and its relative variant
landed in Clutter 0.3, the initial approach was to modify the
passed vertex as an in-out parameter. This was later dropped
in favour of a more consistent out parameter.
Unfortunately, the implementation never changed: both methods
where modifying the passed vertex with the partial results of
the computations.
This commit copies the contents of the "point" ClutterVertex
argument inside a stack variable and, for good measure, constifies
the argument.
Thanks to Thomas Steinacher for catching this in Python.
Neil Roberts [Wed, 10 Dec 2008 12:13:20 +0000 (12:13 +0000)]
* clutter/cogl/gl/cogl.c:
* clutter/cogl/gl/cogl-defines.h.in:
* clutter/cogl/gl/cogl-context.h:
* clutter/cogl/common/cogl-mesh.c: Rename the glBufferDataSub
function to glBufferSubData. When calling glXGetProcAddress with
the former Mesa returns a stub dispatch function which will
segfault if you try to use it. With NVIDIA it returns NULL so
_cogl_features_init decides the card doesn't have VBO support.
Neil Roberts [Wed, 10 Dec 2008 11:27:14 +0000 (11:27 +0000)]
Bug 1323 - ClutterBehaviorDepth conflicts with other behaviors
* clutter/clutter-behaviour-ellipse.c (actor_apply_knot_foreach):
Don't set the depth if there is no x or y tilt. That way it can
still be used in conjunction with ClutterBehaviourDepth. Thanks to
Tonny Tzeng.
Emmanuele Bassi [Mon, 8 Dec 2008 14:22:52 +0000 (14:22 +0000)]
2008-12-08 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-binding-pool.h: Fix the ActivateFunc
documentation by adding a "return value" annotation.
Emmanuele Bassi [Mon, 8 Dec 2008 14:22:39 +0000 (14:22 +0000)]
2008-12-08 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-docs.xml:
* clutter/clutter-sections.txt: Add ClutterBindingPool
section and link.
Emmanuele Bassi [Mon, 8 Dec 2008 13:57:10 +0000 (13:57 +0000)]
2008-12-08 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/Makefile.am:
* clutter/clutter.h: Add ClutterBindingPool to the build.
* clutter/clutter-binding-pool.c:
* clutter/clutter-binding-pool.h: Add ClutterBindingPool, a data
structure meant to hold (key symbol, modifiers) pairs and associate
them to a closure. The ClutterBindingPool can be used to install
key bindings for actors and then execute closures inside the
key-press-event signal handlers, removing the need for big
switch() or if() blocks for each key.
* clutter/clutter-event.c: Consistently use "key symbol" instead
of "key value".
* clutter/clutter-event.h: Add more modifier masks.
* clutter/clutter-marshal.list:
* tests/conform/Makefile.am:
* tests/conform/test-binding-pool.c:
* tests/conform/test-conform-main.c: Add ClutterBindingPool
conformance test.
* tests/interactive/Makefile.am:
* tests/interactive/test-binding-pool.c: Add interactive test (and
example code) for the ClutterBindingPool usage.
Neil Roberts [Mon, 8 Dec 2008 12:02:36 +0000 (12:02 +0000)]
* clutter/clutter-main.c (_clutter_do_pick): Restore the GL_DITHER
state after reading the pixel value instead of before. Suggested
in bug 1328 thanks to Guy Zadickario.
Emmanuele Bassi [Fri, 5 Dec 2008 17:44:12 +0000 (17:44 +0000)]
2008-12-05 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1309 - clutter_timeline_new and clutter_timeline_set_speed
have two standard of the fps limitation
* clutter/clutter-timeline.c:
(clutter_timeline_class_init): Set the maximum value of the
:fps property to be G_MAXUINT. (Zhang Wei)
Neil Roberts [Fri, 5 Dec 2008 14:29:57 +0000 (14:29 +0000)]
* clutter/clutter-entry.c: Fix the 'Since' annotation in the
gtk-doc.