Clean up of the ClutterColor API
authorEmmanuele Bassi <ebassi@linux.intel.com>
Sat, 28 Feb 2009 16:16:09 +0000 (16:16 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 10 Mar 2009 12:38:02 +0000 (12:38 +0000)
commit7d674db9d2c960a55e332b7ec631a01db317f013
treeaa73c625ea3e3a7d5de5b957588e5f3cbe1b656a
parent8a1eca72877471af08da8c1874e4b718e5640628
Clean up of the ClutterColor API

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.
clutter/clutter-color.c
clutter/clutter-color.h
clutter/clutter-deprecated.h
clutter/clutter-script.c
doc/reference/clutter/clutter-sections.txt
tests/interactive/test-behave.c
tests/interactive/test-layout.c