From e6dff59b27d7eb6d9fca51f6ddf74fcb7d8253e3 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 5 Nov 2009 11:57:06 +0000 Subject: [PATCH] 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. --- clutter/clutter-layout-manager.c | 7 +++++++ clutter/clutter-layout-manager.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/clutter/clutter-layout-manager.c b/clutter/clutter-layout-manager.c index baf4a10f8..bd1b13108 100644 --- a/clutter/clutter-layout-manager.c +++ b/clutter/clutter-layout-manager.c @@ -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: diff --git a/clutter/clutter-layout-manager.h b/clutter/clutter-layout-manager.h index d3333c7cb..b7e53636c 100644 --- a/clutter/clutter-layout-manager.h +++ b/clutter/clutter-layout-manager.h @@ -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);