2007-06-07 19:23:04 +00:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 OpenedHand
|
|
|
|
*
|
|
|
|
* 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
|
2008-10-30 17:04:34 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2007-06-07 19:23:04 +00:00
|
|
|
*
|
|
|
|
* ClutterContainer: Generic actor container interface.
|
|
|
|
* Author: Emmanuele Bassi <ebassi@openedhand.com>
|
|
|
|
*/
|
|
|
|
|
2015-07-07 14:51:13 +00:00
|
|
|
#ifndef __CLUTTER_CONTAINER_H__
|
|
|
|
#define __CLUTTER_CONTAINER_H__
|
|
|
|
|
2008-10-30 17:04:34 +00:00
|
|
|
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
|
|
#error "Only <clutter/clutter.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2007-06-07 19:23:04 +00:00
|
|
|
#include <clutter/clutter-actor.h>
|
2008-05-28 13:48:11 +00:00
|
|
|
#include <clutter/clutter-child-meta.h>
|
|
|
|
#include <clutter/clutter-types.h>
|
2007-06-07 19:23:04 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define CLUTTER_TYPE_CONTAINER (clutter_container_get_type ())
|
|
|
|
#define CLUTTER_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CONTAINER, ClutterContainer))
|
|
|
|
#define CLUTTER_IS_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CONTAINER))
|
|
|
|
#define CLUTTER_CONTAINER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_CONTAINER, ClutterContainerIface))
|
|
|
|
|
|
|
|
typedef struct _ClutterContainerIface ClutterContainerIface;
|
|
|
|
|
2010-03-02 09:53:55 +00:00
|
|
|
/**
|
|
|
|
* ClutterContainer:
|
|
|
|
*
|
|
|
|
* #ClutterContainer is an opaque structure whose members cannot be directly
|
|
|
|
* accessed
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
|
2007-08-07 14:03:58 +00:00
|
|
|
/**
|
|
|
|
* ClutterContainerIface:
|
2011-12-20 14:58:08 +00:00
|
|
|
* @add: virtual function for adding an actor to the container. This virtual
|
|
|
|
* function is deprecated, and it should not be overridden.
|
|
|
|
* @remove: virtual function for removing an actor from the container. This
|
|
|
|
* virtual function is deprecated, and it should not be overridden.
|
2011-12-27 18:57:32 +00:00
|
|
|
* @raise: virtual function for raising a child. This virtual function is
|
|
|
|
* deprecated and it should not be overridden.
|
|
|
|
* @lower: virtual function for lowering a child. This virtual function is
|
|
|
|
* deprecated and it should not be overridden.
|
2007-08-13 17:00:58 +00:00
|
|
|
* @sort_depth_order: virtual function for sorting the children of a
|
2011-12-27 18:57:32 +00:00
|
|
|
* container depending on their depth. This virtual function is deprecated
|
|
|
|
* and it should not be overridden.
|
2008-06-10 17:11:14 +00:00
|
|
|
* @child_meta_type: The GType used for storing auxiliary information about
|
|
|
|
* each of the containers children.
|
|
|
|
* @create_child_meta: virtual function that gets called for each added
|
|
|
|
* child, the function should instantiate an object of type
|
|
|
|
* #ClutterContainerIface::child_meta_type, set the container and actor
|
|
|
|
* fields in the instance and add the record to a data structure for
|
|
|
|
* subsequent access for #ClutterContainerIface::get_child_meta
|
|
|
|
* @destroy_child_meta: virtual function that gets called when a child is
|
2020-08-26 09:49:50 +00:00
|
|
|
* removed; it should release all resources held by the record
|
2008-06-10 17:11:14 +00:00
|
|
|
* @get_child_meta: return the record for a container child
|
2011-01-28 16:49:07 +00:00
|
|
|
* @actor_added: class handler for #ClutterContainer::actor-added
|
|
|
|
* @actor_removed: class handler for #ClutterContainer::actor-removed
|
2008-06-12 11:43:25 +00:00
|
|
|
* @child_notify: class handler for #ClutterContainer::child-notify
|
|
|
|
*
|
2019-10-14 14:38:59 +00:00
|
|
|
* Base interface for container actors. The @add and @remove
|
2008-10-16 10:28:17 +00:00
|
|
|
* virtual functions must be provided by any implementation; the other
|
|
|
|
* virtual functions are optional.
|
2007-08-07 14:03:58 +00:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
2007-06-07 19:23:04 +00:00
|
|
|
struct _ClutterContainerIface
|
|
|
|
{
|
2007-08-07 14:03:58 +00:00
|
|
|
/*< private >*/
|
2007-06-07 19:23:04 +00:00
|
|
|
GTypeInterface g_iface;
|
|
|
|
|
2007-08-07 14:03:58 +00:00
|
|
|
/*< public >*/
|
2008-05-28 13:48:11 +00:00
|
|
|
void (* add) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
|
|
|
void (* remove) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
2008-10-16 10:28:17 +00:00
|
|
|
|
|
|
|
/* child stacking */
|
2008-05-28 13:48:11 +00:00
|
|
|
void (* raise) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor,
|
|
|
|
ClutterActor *sibling);
|
|
|
|
void (* lower) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor,
|
|
|
|
ClutterActor *sibling);
|
|
|
|
void (* sort_depth_order) (ClutterContainer *container);
|
|
|
|
|
|
|
|
/* ClutterChildMeta management */
|
|
|
|
GType child_meta_type;
|
|
|
|
void (* create_child_meta) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
|
|
|
void (* destroy_child_meta) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
|
|
|
ClutterChildMeta *(* get_child_meta) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
2007-08-13 17:00:37 +00:00
|
|
|
|
2007-06-07 19:23:04 +00:00
|
|
|
/* signals */
|
|
|
|
void (* actor_added) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
|
|
|
void (* actor_removed) (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
2008-05-28 13:48:11 +00:00
|
|
|
|
|
|
|
void (* child_notify) (ClutterContainer *container,
|
2011-02-08 15:30:48 +00:00
|
|
|
ClutterActor *child,
|
2008-05-28 13:48:11 +00:00
|
|
|
GParamSpec *pspec);
|
2007-06-07 19:23:04 +00:00
|
|
|
};
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
GType clutter_container_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
ClutterActor * clutter_container_find_child_by_name (ClutterContainer *container,
|
|
|
|
const gchar *child_name);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
GParamSpec * clutter_container_class_find_child_property (GObjectClass *klass,
|
|
|
|
const gchar *property_name);
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
GParamSpec ** clutter_container_class_list_child_properties (GObjectClass *klass,
|
|
|
|
guint *n_properties);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
void clutter_container_create_child_meta (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
void clutter_container_destroy_child_meta (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
ClutterChildMeta * clutter_container_get_child_meta (ClutterContainer *container,
|
|
|
|
ClutterActor *actor);
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
void clutter_container_child_set_property (ClutterContainer *container,
|
|
|
|
ClutterActor *child,
|
|
|
|
const gchar * property,
|
|
|
|
const GValue *value);
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
void clutter_container_child_get_property (ClutterContainer *container,
|
|
|
|
ClutterActor *child,
|
|
|
|
const gchar *property,
|
|
|
|
GValue *value);
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
void clutter_container_child_set (ClutterContainer *container,
|
|
|
|
ClutterActor *actor,
|
|
|
|
const gchar *first_prop,
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
void clutter_container_child_get (ClutterContainer *container,
|
|
|
|
ClutterActor *actor,
|
|
|
|
const gchar *first_prop,
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
|
|
|
|
2018-05-22 21:01:54 +00:00
|
|
|
CLUTTER_EXPORT
|
2014-03-17 18:19:52 +00:00
|
|
|
void clutter_container_child_notify (ClutterContainer *container,
|
|
|
|
ClutterActor *child,
|
|
|
|
GParamSpec *pspec);
|
2007-06-07 19:23:04 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __CLUTTER_CONTAINER_H__ */
|