layout: Add LayoutManager::get_child_meta_type()

In order to inspect a LayoutManager using LayoutMeta we need a
virtual function that returns the GType of the LayoutMeta used.
This commit is contained in:
Emmanuele Bassi 2009-11-05 11:57:06 +00:00
parent 95d78acb4c
commit e6dff59b27
2 changed files with 10 additions and 0 deletions

View File

@ -166,6 +166,12 @@ layout_manager_real_create_child_meta (ClutterLayoutManager *manager,
return NULL;
}
static GType
layout_manager_real_get_child_meta_type (ClutterLayoutManager *manager)
{
return G_TYPE_INVALID;
}
static void
clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
{
@ -176,6 +182,7 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
klass->get_preferred_height = layout_manager_real_get_preferred_height;
klass->allocate = layout_manager_real_allocate;
klass->create_child_meta = layout_manager_real_create_child_meta;
klass->get_child_meta_type = layout_manager_real_get_child_meta_type;
/**
* ClutterLayoutManager::layout-changed:

View File

@ -77,6 +77,8 @@ struct _ClutterLayoutManager
* on the #ClutterContainer using the layout manager. The implementation
* should not take a reference on the container, but just take a weak
* reference, to avoid potential leaks due to reference cycles
* @get_child_meta_type: virtual function; override to return the #GType
* of the #ClutterLayoutMeta sub-class used by the #ClutterLayoutManager
* @create_child_meta: virtual function; override to create a
* #ClutterChildMeta instance associated to a #ClutterContainer and a
* child #ClutterActor, used to maintain layout manager specific properties
@ -112,6 +114,7 @@ struct _ClutterLayoutManagerClass
void (* set_container) (ClutterLayoutManager *manager,
ClutterContainer *container);
GType (* get_child_meta_type) (ClutterLayoutManager *manager);
ClutterLayoutMeta *(* create_child_meta) (ClutterLayoutManager *manager,
ClutterContainer *container,
ClutterActor *actor);