cogl-object: Adds an internal _cogl_object_set_user_data
authorRobert Bragg <robert@linux.intel.com>
Wed, 12 Jan 2011 20:37:53 +0000 (20:37 +0000)
committerRobert Bragg <robert@linux.intel.com>
Fri, 21 Jan 2011 16:18:10 +0000 (16:18 +0000)
commit385e0f84c6179a30f9031aba974131e1cf3e6a4e
tree247ee1000f76aa4ae8ae65baec762d8c1363769c
parent131578c13aeeb53d99d7c63a0b2ddaded23524fc
cogl-object: Adds an internal _cogl_object_set_user_data

This adds an internal alternative to cogl_object_set_user_data that also
passes an instance pointer to destroy notify callbacks.

When setting private data on a CoglObject it's often desirable to know
the instance being destroyed when we are being notified to free the
private data due to the object being freed. The typical solution to this
is to track a pointer to the instance in the private data itself so it
can be identified but that usually requires an extra micro allocation
for the private data that could have been avoided if only the callback
were given an instance pointer.

The new internal _cogl_object_set_user_data passes the instance pointer
as a second argument which means it is ABI compatible for us to layer
the public version on top of this internal function.
clutter/cogl/cogl/cogl-object-private.h
clutter/cogl/cogl/cogl-object.c