mutter/clutter/x11
Emmanuele Bassi d6d208da7d Remove Units from the public API
With the recent change to internal floating point values, ClutterUnit
has become a redundant type, defined to be a float. All integer entry
points are being internally converted to floating point values to be
passed to the GL pipeline with the least amount of conversion.

ClutterUnit is thus exposed as just a "pixel with fractionary bits",
and not -- as users might think -- as generic, resolution and device
independent units. not that it was the case, but a definitive amount
of people was convinced it did provide this "feature", and was flummoxed
about the mere existence of this type.

So, having ClutterUnit exposed in the public API doubles the entry
points and has the following disadvantages:

  - we have to maintain twice the amount of entry points in ClutterActor
  - we still do an integer-to-float implicit conversion
  - we introduce a weird impedance between pixels and "pixels with
    fractionary bits"
  - language bindings will have to choose what to bind, and resort
    to manually overriding the API
    + *except* for language bindings based on GObject-Introspection, as
      they cannot do manual overrides, thus will replicate the entire
      set of entry points

For these reason, we should coalesces every Actor entry point for
pixels and for ClutterUnit into a single entry point taking a float,
like:

  void clutter_actor_set_x (ClutterActor *self,
                            gfloat        x);
  void clutter_actor_get_size (ClutterActor *self,
                               gfloat       *width,
                               gfloat       *height);
  gfloat clutter_actor_get_height (ClutterActor *self);

etc.

The issues I have identified are:

  - we'll have a two cases of compiler warnings:
    - printf() format of the return values from %d to %f
    - clutter_actor_get_size() taking floats instead of unsigned ints
  - we'll have a problem with varargs when passing an integer instead
    of a floating point value, except on 64bit platforms where the
    size of a float is the same as the size of an int

To be clear: the *intent* of the API should not change -- we still use
pixels everywhere -- but:

  - we remove ambiguity in the API with regard to pixels and units
  - we remove entry points we get to maintain for the whole 1.0
    version of the API
  - we make things simpler to bind for both manual language bindings
    and automatic (gobject-introspection based) ones
  - we have the simplest API possible while still exposing the
    capabilities of the underlying GL implementation
2009-05-06 16:44:47 +01:00
..
clutter-backend-x11-private.h 2008-01-31 Rob Bradford <rob@openedhand.com> 2008-01-31 11:24:11 +00:00
clutter-backend-x11.c Remove usage of the grave accent as quotation mark 2009-03-17 14:13:31 +00:00
clutter-backend-x11.h [x11] Add backend-specific get_current_event_time() 2009-02-18 10:07:12 +00:00
clutter-event-x11.c [x11] Only update cached last event time if we have a real timestamp. 2009-02-18 16:56:39 +00:00
clutter-stage-x11.c Remove Units from the public API 2009-05-06 16:44:47 +01:00
clutter-stage-x11.h [ClutterStageX11] Remove the handling_configure flag 2009-01-14 15:10:50 +00:00
clutter-x11-enum-types.c.in 2008-06-30 Emmanuele Bassi <ebassi@openedhand.com> 2008-06-30 15:03:42 +00:00
clutter-x11-enum-types.h.in 2008-06-30 Emmanuele Bassi <ebassi@openedhand.com> 2008-06-30 15:03:42 +00:00
clutter-x11-texture-pixmap.c [x11-texture-pixmap] Fixes a reported lockup due to an undesireable X server grab 2009-04-22 13:43:53 +01:00
clutter-x11-texture-pixmap.h 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com> 2008-10-30 17:04:34 +00:00
clutter-x11.h [x11] Add backend-specific get_current_event_time() 2009-02-18 10:07:12 +00:00
clutter-x11.pc.in Bug 1491 - Fix hardcoded lib path in .pc files 2009-03-09 10:45:09 +00:00
Makefile.am Use $(MAINTAINER_CFLAGS) in clutter/{x11,glx}/Makefile.am 2009-04-17 14:53:24 +01:00