* clutter/clutter-actor.c:
(clutter_actor_real_request_coords),
(clutter_actor_request_coords),
(clutter_actor_class_init): Provide a default ::request_coords()
implementation in ClutterActor and use it to store the bounding
box passed to clutter_actor_request_coords(). This makes the code
more reliable and clean, and avoids a call to the subclass
request_coords() method if the bounding box did not change. Now,
every class overriding ClutterActor::request_coords() *must* chain
up to the parent class method or the bounding box will not be
saved inside the ClutterActor structure.
* clutter/clutter-entry.c:
* clutter/clutter-group.c:
* clutter/clutter-hbox.c:
* clutter/clutter-label.c:
* clutter/clutter-texture.c:
* clutter/clutter-vbox.c: Chain up to the parent class
request_coords() method.
* clutter/eglnative/clutter-backend-egl.c:
* clutter/eglx/clutter-backend-egl.c:
* clutter/sdl/clutter-backend-sdl.c: Set the default resolution
as 96.0 dpi for every backend (we already were under this
assumption anyway, and this makes it easier to change this
setting per-backend).
* clutter/pango/pangoclutter-fontmap.c:
* clutter/pango/pangoclutter.h: Allow setting the resolution
for the PangoClutterFontMap object and provide the implementation
for the PangoFcFontMap::get_resolution() virtual function. This
allows to set the resolution of the PangoContext when retrieving
it.
* clutter/clutter-label.c (clutter_label_init): Set the
resolution of the font map with the one the backend gives us.
* clutter/clutter-entry.c (clutter_entry_init): Ditto.
* clutter/clutter-backend.[ch]: Add clutter_backend_set_resolution()
and clutter_backend_get_resolution(); backends should use the former
to set the resolution of the display when initialising, while actors
should use the latter when sizing themselves depending on the
resolution or the font size.
* clutter/glx/clutter-backend-glx.c: Set the resolution as 96 dpi
as a default and query the X server when opening the display.
* clutter/clutter-entry.c: Drop the hardcoded dpi value and use
clutter_backend_get_resolution() to compute the default size.
* clutter/clutter-entry.c: (offset_to_bytes),
(clutter_entry_ensure_cursor_position),
(clutter_entry_new_with_text), (clutter_entry_new),
(clutter_entry_insert_unichar), (clutter_entry_delete_chars):
Fixed utf8 support so it actually works now, for both inserting and deleting
chars.
Fixed positioning of cursor for utf8 chars. Both GString and Pnago need
bytes (not documented!) for string manipulation, so making sure all values
were bytes and not char positions fixed the issue.
Set a default size of 50x50 for the entry, otherwise no chars can be seen
if the size is not set after creation (which confuses the developer).
Most of these fixes are simple symbol shadowing issues, like index and the
braindead y0 and y1 extern symbols exported by math.h on GNU libc systems.
There is a masking issue in ClutterTexture which should be checked; I ran
the tests and everything looked fine.
The rest are just unused variables.
* clutter/clutter-entry.[ch]: Various fixes to ClutterEntry:
fix code style issues; add documentation for the various
properties; add ClutterEntry:entry-padding property, for controlling
the text padding (until we have style properties separated from
the object properties); notify property changes; free resources
in the ::finalize method; rename clutter_entry_add() to
clutter_entry_insert_unichar(), and clutter_entry_remove() to
clutter_entry_delete_chars() - for bindings and for matching the
insert_text() and delete_text() existing methods; add a getter
method for the max-length property.
* clutter/clutter-entry.c: (clutter_entry_handle_key_event),
(clutter_entry_add), (clutter_entry_remove):
Check if unichar == 0, and if so, return, as it will cause a delete in
the GString.
* clutter/clutter-entry.c: (clutter_entry_set_property),
(clutter_entry_get_property), (clutter_entry_class_init),
(clutter_entry_init), (clutter_entry_set_text),
(clutter_entry_set_max_length):
* clutter/clutter-entry.h:
* examples/test-entry.c: (main):
Added a max-length property whihc limits the length of the text in the
entry.
boundries.
Text will move within the clip region to keep the cursor always
visible.
Added some padding to the left and right to make sure cursor is
always show.