2006-11-15 23:37:53 +00:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
|
|
* Jorn Baayen <jorn@openedhand.com>
|
|
|
|
* Emmanuele Bassi <ebassi@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-07-01 10:08:28 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2006-11-15 23:37:53 +00:00
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
|
|
|
|
#ifndef __CLUTTER_BEHAVIOUR_H__
|
|
|
|
#define __CLUTTER_BEHAVIOUR_H__
|
2006-08-13 23:55:52 +00:00
|
|
|
|
2007-07-26 13:13:23 +00:00
|
|
|
#include <clutter/clutter-types.h>
|
2006-08-13 23:55:52 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2006-09-08 20:57:31 +00:00
|
|
|
#define CLUTTER_TYPE_BEHAVIOUR clutter_behaviour_get_type()
|
2006-08-13 23:55:52 +00:00
|
|
|
|
2006-09-08 20:57:31 +00:00
|
|
|
#define CLUTTER_BEHAVIOUR(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviour))
|
2006-08-13 23:55:52 +00:00
|
|
|
|
2006-09-08 20:57:31 +00:00
|
|
|
#define CLUTTER_BEHAVIOUR_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass))
|
2006-08-13 23:55:52 +00:00
|
|
|
|
2006-09-08 20:57:31 +00:00
|
|
|
#define CLUTTER_IS_BEHAVIOUR(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR))
|
|
|
|
|
|
|
|
#define CLUTTER_IS_BEHAVIOUR_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR))
|
|
|
|
|
|
|
|
#define CLUTTER_BEHAVIOUR_GET_CLASS(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass))
|
|
|
|
|
2006-11-14 14:12:56 +00:00
|
|
|
typedef struct _ClutterBehaviourPrivate ClutterBehaviourPrivate;
|
|
|
|
typedef struct _ClutterBehaviourClass ClutterBehaviourClass;
|
2006-12-08 16:12:52 +00:00
|
|
|
|
|
|
|
/**
|
2007-08-07 14:03:58 +00:00
|
|
|
* ClutterBehaviourForeachFunc:
|
2006-12-08 16:12:52 +00:00
|
|
|
* @behaviour: the #ClutterBehaviour
|
|
|
|
* @actor: an actor driven by @behaviour
|
2011-07-27 07:14:10 +00:00
|
|
|
* @data: (closure): optional data passed to the function
|
2006-12-08 16:12:52 +00:00
|
|
|
*
|
2010-11-18 14:14:37 +00:00
|
|
|
* This function is passed to clutter_behaviour_actors_foreach() and
|
2006-12-08 16:12:52 +00:00
|
|
|
* will be called for each actor driven by @behaviour.
|
2007-08-07 14:03:58 +00:00
|
|
|
*
|
2012-08-27 08:48:36 +00:00
|
|
|
*
|
2010-11-06 15:54:21 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.6
|
2006-12-08 16:12:52 +00:00
|
|
|
*/
|
|
|
|
typedef void (*ClutterBehaviourForeachFunc) (ClutterBehaviour *behaviour,
|
|
|
|
ClutterActor *actor,
|
|
|
|
gpointer data);
|
|
|
|
|
2008-07-01 10:08:28 +00:00
|
|
|
/**
|
|
|
|
* ClutterBehaviour:
|
|
|
|
*
|
|
|
|
* #ClutterBehaviour-struct contains only private data and should
|
|
|
|
* be accessed with the functions below.
|
|
|
|
*
|
2012-08-27 08:48:36 +00:00
|
|
|
*
|
2010-11-06 15:54:21 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.6
|
2008-07-01 10:08:28 +00:00
|
|
|
*/
|
2006-08-13 23:55:52 +00:00
|
|
|
struct _ClutterBehaviour
|
|
|
|
{
|
2006-11-15 23:37:53 +00:00
|
|
|
/*< private >*/
|
|
|
|
GObject parent;
|
2006-08-13 23:55:52 +00:00
|
|
|
ClutterBehaviourPrivate *priv;
|
|
|
|
};
|
|
|
|
|
2007-08-07 14:03:58 +00:00
|
|
|
/**
|
2012-04-30 16:12:12 +00:00
|
|
|
* ClutterBehaviourClass:
|
2007-08-07 14:03:58 +00:00
|
|
|
* @alpha_notify: virtual function, called each time the #ClutterAlpha
|
|
|
|
* computes a new alpha value; the actors to which the behaviour applies
|
|
|
|
* should be changed in this function. Every subclass of #ClutterBehaviour
|
|
|
|
* must implement this virtual function
|
|
|
|
* @applied: signal class handler for the ClutterBehaviour::applied signal
|
|
|
|
* @removed: signal class handler for the ClutterBehaviour::removed signal
|
|
|
|
*
|
|
|
|
* Base class for behaviours.
|
|
|
|
*
|
2012-08-27 08:48:36 +00:00
|
|
|
*
|
2010-11-06 15:54:21 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.6
|
2007-08-07 14:03:58 +00:00
|
|
|
*/
|
2006-08-13 23:55:52 +00:00
|
|
|
struct _ClutterBehaviourClass
|
|
|
|
{
|
2007-08-07 14:03:58 +00:00
|
|
|
/*< private >*/
|
2006-08-15 20:38:25 +00:00
|
|
|
GObjectClass parent_class;
|
2006-08-29 Jorn Baayen <jorn@openedhand.com>
* clutter/clutter-behaviour.c: (_clutter_behaviour_finalize),
(_clutter_behaviour_set_property),
(_clutter_behaviour_get_property), (clutter_behaviour_class_init),
(clutter_behaviour_init), (clutter_behaviour_apply),
(clutter_behaviour_remove), (clutter_behaviour_remove_all),
(clutter_behaviour_actors_foreach):
* clutter/clutter-behaviour.h:
* clutter/clutter-behaviours.c:
(clutter_behaviour_property_change),
(clutter_behaviour_opacity_dispose),
(clutter_behaviour_opacity_finalize),
(clutter_behaviour_opacity_class_init),
(clutter_behaviour_opacity_init):
* clutter/clutter-behaviours.h:
* clutter/clutter-marshal.list:
* examples/behave.c: (main):
Behaviours track generic GObject properties.
* clutter/clutter-video-texture.h:
Remove signal prototypes - they are already specified in
clutter-media.h.
2006-08-29 13:20:29 +00:00
|
|
|
|
2007-08-07 14:03:58 +00:00
|
|
|
/*< public >*/
|
2006-11-17 18:45:31 +00:00
|
|
|
/* vfunc, not signal */
|
|
|
|
void (*alpha_notify) (ClutterBehaviour *behave,
|
2009-01-20 16:42:49 +00:00
|
|
|
gdouble alpha_value);
|
2006-09-08 20:57:31 +00:00
|
|
|
|
2007-08-07 14:03:58 +00:00
|
|
|
/* signals */
|
2007-07-22 22:30:47 +00:00
|
|
|
void (*applied) (ClutterBehaviour *behave,
|
2007-06-12 10:36:28 +00:00
|
|
|
ClutterActor *actor);
|
2007-07-22 22:30:47 +00:00
|
|
|
void (*removed) (ClutterBehaviour *behave,
|
2007-06-12 10:36:28 +00:00
|
|
|
ClutterActor *actor);
|
|
|
|
|
2007-08-07 14:03:58 +00:00
|
|
|
/*< private >*/
|
2006-11-17 18:45:31 +00:00
|
|
|
/* padding, for future expansion */
|
2006-11-15 23:37:53 +00:00
|
|
|
void (*_clutter_behaviour1) (void);
|
|
|
|
void (*_clutter_behaviour2) (void);
|
|
|
|
void (*_clutter_behaviour3) (void);
|
|
|
|
void (*_clutter_behaviour4) (void);
|
|
|
|
void (*_clutter_behaviour5) (void);
|
|
|
|
void (*_clutter_behaviour6) (void);
|
|
|
|
};
|
2006-09-08 20:57:31 +00:00
|
|
|
|
2012-05-03 10:35:20 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-11-15 23:37:53 +00:00
|
|
|
GType clutter_behaviour_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 16:12:52 +00:00
|
|
|
void clutter_behaviour_apply (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 16:12:52 +00:00
|
|
|
void clutter_behaviour_remove (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2007-07-25 13:12:24 +00:00
|
|
|
void clutter_behaviour_remove_all (ClutterBehaviour *behave);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 16:12:52 +00:00
|
|
|
void clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
|
|
|
|
ClutterBehaviourForeachFunc func,
|
|
|
|
gpointer data);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2007-01-18 12:33:15 +00:00
|
|
|
gint clutter_behaviour_get_n_actors (ClutterBehaviour *behave);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2007-01-18 12:33:15 +00:00
|
|
|
ClutterActor *clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
|
2007-07-26 15:14:45 +00:00
|
|
|
gint index_);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 16:12:52 +00:00
|
|
|
GSList * clutter_behaviour_get_actors (ClutterBehaviour *behave);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 16:12:52 +00:00
|
|
|
ClutterAlpha *clutter_behaviour_get_alpha (ClutterBehaviour *behave);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 16:12:52 +00:00
|
|
|
void clutter_behaviour_set_alpha (ClutterBehaviour *behave,
|
|
|
|
ClutterAlpha *alpha);
|
2012-02-27 15:10:13 +00:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2007-07-22 22:30:47 +00:00
|
|
|
gboolean clutter_behaviour_is_applied (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor);
|
2007-03-27 21:09:11 +00:00
|
|
|
|
2006-08-13 23:55:52 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2010-11-06 15:54:21 +00:00
|
|
|
#endif /* __CLUTTER_BEHAVIOUR_H__ */
|