While grepping through the public headers looking for invalid use of
private HAVE_* defines, I stumbled upon two out of sync comments. Yes
it's a very minor trivial change.
The ClutterColor API has some inconsistencies:
- the string deserialization function does not match the rest of
the conversion function naming policy; the naming should be:
clutter_color_parse() -> clutter_color_from_string()
and the first parameter should be the ClutterColor that will
be set from the string, not the string itself (a GDK-ism).
- the fixed point API should not be exposed, especially in the
form of ClutterFixed values
- the non-fixed point HLS conversion functions do not make any
sense. The values returned should be:
hue := range [ 0, 360 ]
luminance := range [ 0, 1 ]
saturation := range [ 0, 1 ]
like the current fixed point API does. Returning a value in
the [ 0, 255 ] range is completely useless
- the clutter_color_equal() should be converted for its use inside
a GHashTable; a clutter_color_hash() should be added as well
- the second parameter of the clutter_color_shade() function should
be the shading factor, not the result (another GDK-ism). this way
the function call can be translated from this:
color.shade(out result, factor)
to the more natural:
color.shade(factor, out result)
This somewhat large commit fixes all these issues and updates the
internal users of the API.
reviewed by: Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-color.[ch]: Add GParamSpec and GValue integration
for ClutterColor. With ClutterParamSpecColor it is possible to define
color properties; with the GValue integration it's possible to
automatically transform strings into colors and vice versa.
(clutter_color_free): Allow NULL parameter to match other boxed
types destructors.
(clutter_color_new): Add a constructor for the ClutterColor boxed
type, mostly for bindings.
* clutter/clutter-private.h: Remove inclusion of backend-specific
headers; update the main context object; add the declarations for
the event queue functions.
* clutter/clutter-backend.[ch]: Add the abstract ClutterBackend
object, which holds backend-specific settings, the main stage,
and the event queue. Every backend must implement a subclass of
ClutterBackend and ClutterStage.
* clutter/clutter-feature.c: Protect the GLX specific calls
behing #ifdef HAVE_CLUTTER_GLX.
* clutter/clutter-actor.c:
* clutter/clutter-group.c:
* clutter/clutter-clone-texture.c: Include GL/gl.h
* clutter/clutter-event.[ch]: Update public API and implement the
event queue private API; hold a reference on the event objects;
move out the keysym-to-unicode table; add the new event types.
* clutter/clutter-color.h: Include clutter-fixed.h
* clutter/clutter-main.c: Update API; get the main stage
from the backend object; process the event received from the
queue; lock/unlock the main mutex if we have one; move the
initialisation process sooner in the init sequence, in order to
have the backend object when we check for options; call the
backed vfuncs in the pre/post parse hooks.
* clutter/clutter-stage.c: Make ClutterStage and abstract class,
implemented by the backends.
* clutter/clutter/glx/clutter-glx.h:
* clutter/clutter/glx/clutter-backend-glx.[ch]:
* clutter/clutter/glx/clutter-event-glx.c:
* clutter/clutter/glx/clutter-stage-glx.[ch]:
* clutter/clutter/glx/Makefile.am: Add the GLX backend.
* clutter/clutter/egl/clutter-backend-egl.[ch]:
* clutter/clutter/egl/clutter-event-egl.c:
* clutter/clutter/egl/clutter-stage-egl.[ch]:
* clutter/clutter/egl/Makefile.am: Add the stub for a EGL backend.
* examples/*.c: Update for the new API.
* clutter/clutter-color.h:
* clutter/clutter-color.c: Expose clutter_color_copy()
and clutter_color_free() for the python bindings, so that
they can manager the conversion automatically; use the
slice allocator when copying/freeing a ClutterColor.
* clutter/clutter-color.h:
* clutter/clutter-color.c: Add clutter_color_parse(),
which parses a string containing a color definition as
understood by XParseColor() (or pango_color_parse()).
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.