2009-09-14 10:04:11 +00:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Intel Corporation.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Author:
|
|
|
|
* Emmanuele Bassi <ebassi@linux.intel.com>
|
|
|
|
*/
|
|
|
|
|
2015-07-07 14:51:13 +00:00
|
|
|
#ifndef __CLUTTER_LAYOUT_MANAGER_H__
|
|
|
|
#define __CLUTTER_LAYOUT_MANAGER_H__
|
|
|
|
|
2009-09-01 15:34:28 +00:00
|
|
|
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
|
|
#error "Only <clutter/clutter.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2009-09-15 16:37:11 +00:00
|
|
|
#include <clutter/clutter-types.h>
|
2009-09-01 15:34:28 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define CLUTTER_TYPE_LAYOUT_MANAGER (clutter_layout_manager_get_type ())
|
|
|
|
#define CLUTTER_LAYOUT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYOUT_MANAGER, ClutterLayoutManager))
|
|
|
|
#define CLUTTER_IS_LAYOUT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYOUT_MANAGER))
|
|
|
|
#define CLUTTER_LAYOUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_LAYOUT_MANAGER, ClutterLayoutManagerClass))
|
|
|
|
#define CLUTTER_IS_LAYOUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_LAYOUT_MANAGER))
|
|
|
|
#define CLUTTER_LAYOUT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_LAYOUT_MANAGER, ClutterLayoutManagerClass))
|
|
|
|
|
|
|
|
typedef struct _ClutterLayoutManagerClass ClutterLayoutManagerClass;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ClutterLayoutManager:
|
|
|
|
*
|
|
|
|
* The #ClutterLayoutManager structure contains only private data
|
|
|
|
* and should be accessed using the provided API
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
struct _ClutterLayoutManager
|
|
|
|
{
|
2009-09-14 10:04:11 +00:00
|
|
|
/*< private >*/
|
2009-09-02 10:55:22 +00:00
|
|
|
GInitiallyUnowned parent_instance;
|
2009-09-16 13:58:30 +00:00
|
|
|
|
2013-07-03 13:14:01 +00:00
|
|
|
gpointer CLUTTER_PRIVATE_FIELD (dummy);
|
2009-09-01 15:34:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ClutterLayoutManagerClass:
|
2009-09-14 10:04:11 +00:00
|
|
|
* @get_preferred_width: virtual function; override to provide a preferred
|
|
|
|
* width for the layout manager. See also the get_preferred_width()
|
|
|
|
* virtual function in #ClutterActor
|
|
|
|
* @get_preferred_height: virtual function; override to provide a preferred
|
|
|
|
* height for the layout manager. See also the get_preferred_height()
|
|
|
|
* virtual function in #ClutterActor
|
|
|
|
* @allocate: virtual function; override to allocate the children of the
|
|
|
|
* layout manager. See also the allocate() virtual function in
|
|
|
|
* #ClutterActor
|
2009-09-16 13:58:30 +00:00
|
|
|
* @set_container: virtual function; override to set a back pointer
|
|
|
|
* 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
|
2009-11-05 11:57:06 +00:00
|
|
|
* @get_child_meta_type: virtual function; override to return the #GType
|
|
|
|
* of the #ClutterLayoutMeta sub-class used by the #ClutterLayoutManager
|
2009-09-15 15:24:47 +00:00
|
|
|
* @create_child_meta: virtual function; override to create a
|
2009-11-30 19:03:11 +00:00
|
|
|
* #ClutterLayoutMeta instance associated to a #ClutterContainer and a
|
2009-09-15 15:24:47 +00:00
|
|
|
* child #ClutterActor, used to maintain layout manager specific properties
|
2009-12-12 00:02:43 +00:00
|
|
|
* @begin_animation: virtual function; override to control the animation
|
2012-04-20 17:14:42 +00:00
|
|
|
* of a #ClutterLayoutManager with the given duration and easing mode.
|
|
|
|
* This virtual function is deprecated, and it should not be overridden
|
|
|
|
* in newly written code.
|
2009-12-12 00:02:43 +00:00
|
|
|
* @end_animation: virtual function; override to end an animation started
|
2012-04-20 17:14:42 +00:00
|
|
|
* by clutter_layout_manager_begin_animation(). This virtual function is
|
|
|
|
* deprecated, and it should not be overriden in newly written code.
|
2009-12-12 00:02:43 +00:00
|
|
|
* @get_animation_progress: virtual function; override to control the
|
2012-04-20 17:14:42 +00:00
|
|
|
* progress of the animation of a #ClutterLayoutManager. This virtual
|
|
|
|
* function is deprecated, and it should not be overridden in newly written
|
|
|
|
* code.
|
2009-09-14 10:04:11 +00:00
|
|
|
* @layout_changed: class handler for the #ClutterLayoutManager::layout-changed
|
|
|
|
* signal
|
2009-09-01 15:34:28 +00:00
|
|
|
*
|
|
|
|
* The #ClutterLayoutManagerClass structure contains only private
|
|
|
|
* data and should be accessed using the provided API
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
struct _ClutterLayoutManagerClass
|
|
|
|
{
|
2009-09-14 10:04:11 +00:00
|
|
|
/*< private >*/
|
2009-09-02 10:55:22 +00:00
|
|
|
GInitiallyUnownedClass parent_class;
|
2009-09-01 15:34:28 +00:00
|
|
|
|
2009-09-14 10:04:11 +00:00
|
|
|
/*< public >*/
|
2009-12-12 00:02:43 +00:00
|
|
|
void (* get_preferred_width) (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
gfloat for_height,
|
2010-12-09 12:36:50 +00:00
|
|
|
gfloat *min_width_p,
|
|
|
|
gfloat *nat_width_p);
|
2009-12-12 00:02:43 +00:00
|
|
|
void (* get_preferred_height) (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
gfloat for_width,
|
2010-12-09 12:36:50 +00:00
|
|
|
gfloat *min_height_p,
|
|
|
|
gfloat *nat_height_p);
|
2009-12-12 00:02:43 +00:00
|
|
|
void (* allocate) (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
const ClutterActorBox *allocation,
|
|
|
|
ClutterAllocationFlags flags);
|
|
|
|
|
|
|
|
void (* set_container) (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container);
|
|
|
|
|
|
|
|
GType (* get_child_meta_type) (ClutterLayoutManager *manager);
|
|
|
|
ClutterLayoutMeta *(* create_child_meta) (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
|
|
|
|
2012-04-20 17:14:42 +00:00
|
|
|
/* deprecated */
|
2009-12-13 01:23:54 +00:00
|
|
|
ClutterAlpha * (* begin_animation) (ClutterLayoutManager *manager,
|
2009-12-12 00:02:43 +00:00
|
|
|
guint duration,
|
|
|
|
gulong mode);
|
2012-04-20 17:14:42 +00:00
|
|
|
/* deprecated */
|
2009-12-12 00:02:43 +00:00
|
|
|
gdouble (* get_animation_progress) (ClutterLayoutManager *manager);
|
2012-04-20 17:14:42 +00:00
|
|
|
/* deprecated */
|
2009-12-12 00:02:43 +00:00
|
|
|
void (* end_animation) (ClutterLayoutManager *manager);
|
|
|
|
|
|
|
|
void (* layout_changed) (ClutterLayoutManager *manager);
|
2009-09-14 10:04:11 +00:00
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
/* padding for future expansion */
|
2009-09-01 15:34:28 +00:00
|
|
|
void (* _clutter_padding_1) (void);
|
|
|
|
void (* _clutter_padding_2) (void);
|
|
|
|
void (* _clutter_padding_3) (void);
|
|
|
|
void (* _clutter_padding_4) (void);
|
|
|
|
void (* _clutter_padding_5) (void);
|
|
|
|
void (* _clutter_padding_6) (void);
|
|
|
|
void (* _clutter_padding_7) (void);
|
2011-12-21 17:07:25 +00:00
|
|
|
void (* _clutter_padding_8) (void);
|
2009-09-01 15:34:28 +00:00
|
|
|
};
|
|
|
|
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-09-01 15:34:28 +00:00
|
|
|
GType clutter_layout_manager_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_get_preferred_width (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
gfloat for_height,
|
|
|
|
gfloat *min_width_p,
|
|
|
|
gfloat *nat_width_p);
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
gfloat for_width,
|
|
|
|
gfloat *min_height_p,
|
|
|
|
gfloat *nat_height_p);
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_allocate (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
const ClutterActorBox *allocation,
|
|
|
|
ClutterAllocationFlags flags);
|
|
|
|
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_set_container (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container);
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_layout_changed (ClutterLayoutManager *manager);
|
|
|
|
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
GParamSpec * clutter_layout_manager_find_child_property (ClutterLayoutManager *manager,
|
|
|
|
const gchar *name);
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
GParamSpec ** clutter_layout_manager_list_child_properties (ClutterLayoutManager *manager,
|
|
|
|
guint *n_pspecs);
|
|
|
|
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
ClutterLayoutMeta *clutter_layout_manager_get_child_meta (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
|
|
|
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_child_set (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
ClutterActor *actor,
|
|
|
|
const gchar *first_property,
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_child_get (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
ClutterActor *actor,
|
|
|
|
const gchar *first_property,
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_child_set_property (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
ClutterActor *actor,
|
|
|
|
const gchar *property_name,
|
|
|
|
const GValue *value);
|
2014-03-17 18:19:52 +00:00
|
|
|
CLUTTER_AVAILABLE_IN_1_2
|
2009-11-05 12:24:37 +00:00
|
|
|
void clutter_layout_manager_child_get_property (ClutterLayoutManager *manager,
|
|
|
|
ClutterContainer *container,
|
|
|
|
ClutterActor *actor,
|
|
|
|
const gchar *property_name,
|
|
|
|
GValue *value);
|
2009-09-14 10:04:11 +00:00
|
|
|
|
2012-04-20 17:14:42 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_12
|
2009-12-13 01:23:54 +00:00
|
|
|
ClutterAlpha * clutter_layout_manager_begin_animation (ClutterLayoutManager *manager,
|
2009-12-12 00:02:43 +00:00
|
|
|
guint duration,
|
|
|
|
gulong mode);
|
2012-04-20 17:14:42 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_12
|
2009-12-12 00:02:43 +00:00
|
|
|
void clutter_layout_manager_end_animation (ClutterLayoutManager *manager);
|
2012-04-20 17:14:42 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_12
|
2009-12-12 00:02:43 +00:00
|
|
|
gdouble clutter_layout_manager_get_animation_progress (ClutterLayoutManager *manager);
|
|
|
|
|
2009-09-01 15:34:28 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __CLUTTER_LAYOUT_MANAGER_H__ */
|