Refactored the integer id->ClutterActor mapping code to be a self

contained data structure.
* clutter/clutter-id-pool.[ch]: new files.
* clutter/Makefile.am: added clutter-id-pool.[ch]
* clutter/clutter-private.h: use a ClutterIDPool instead of GArray and
GSList to keep track of the reusable ids.
* clutter/clutter-actor.c: moved id pool logic away.
* clutter/clutter-main.c: simplified id pool creation/finalization.
This commit is contained in:
Øyvind Kolås
2008-03-07 17:34:40 +00:00
parent d628513f9d
commit cdf8bb0739
7 changed files with 197 additions and 65 deletions

View File

@ -44,6 +44,7 @@
#include "clutter-backend.h"
#include "clutter-stage.h"
#include "clutter-feature.h"
#include "clutter-id-pool.h"
G_BEGIN_DECLS
@ -83,8 +84,7 @@ struct _ClutterMainContext
guint motion_frequency; /* Motion events per second */
gint num_reactives; /* Num of reactive actors */
GArray *actor_array; /* Array of ClutterActors */
GSList *free_actor_ids; /* A stack of released actor ids */
ClutterIDPool *id_pool; /* mapping between reused integer ids and actors */
guint frame_rate; /* Default FPS */