[stage manager] Add peek_stages()

We need an method for StageManager that returns a const pointer
to the internal list, to avoid the copy.
This commit is contained in:
Emmanuele Bassi 2009-05-29 14:45:53 +01:00
parent 63c7cc0175
commit 5d4974ed36
2 changed files with 23 additions and 2 deletions

View File

@ -224,8 +224,9 @@ clutter_stage_manager_get_default_stage (ClutterStageManager *stage_manager)
*
* Lists all currently used stages.
*
* Return value: (transfer container) (element-type ClutterStage): a newly allocated list
* of #ClutterStage objects. Use g_slist_free() to deallocate it when done.
* Return value: (transfer container) (element-type ClutterStage): a newly
* allocated list of #ClutterStage objects. Use g_slist_free() to
* deallocate it when done.
*
* Since: 0.8
*/
@ -235,6 +236,25 @@ clutter_stage_manager_list_stages (ClutterStageManager *stage_manager)
return g_slist_copy (stage_manager->stages);
}
/**
* clutter_stage_manager_list_stage:
* @stage_manager: a #ClutterStageManager
*
* Lists all currently used stages.
*
* Return value: (transfer none) (element-type ClutterStage): a pointer
* to the internal list of #ClutterStage objects. The returned list
* is owned by the #ClutterStageManager and should never be modified
* or freed
*
* Since: 1.0
*/
const GSList *
clutter_stage_manager_peek_stages (ClutterStageManager *stage_manager)
{
return stage_manager->stages;
}
void
_clutter_stage_manager_add_stage (ClutterStageManager *stage_manager,
ClutterStage *stage)

View File

@ -61,6 +61,7 @@ void clutter_stage_manager_set_default_stage (ClutterStageManage
ClutterStage *stage);
ClutterStage * clutter_stage_manager_get_default_stage (ClutterStageManager *stage_manager);
GSList * clutter_stage_manager_list_stages (ClutterStageManager *stage_manager);
const GSList * clutter_stage_manager_peek_stages (ClutterStageManager *stage_manager);
G_END_DECLS