2006-11-15 18:37:53 -05: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 06:08:28 -04:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2006-11-15 18:37:53 -05:00
|
|
|
*/
|
|
|
|
|
2008-10-30 13:04:34 -04: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 19:55:52 -04:00
|
|
|
|
2007-07-26 09:13:23 -04:00
|
|
|
#include <clutter/clutter-types.h>
|
2006-08-13 19:55:52 -04:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2006-09-08 16:57:31 -04:00
|
|
|
#define CLUTTER_TYPE_BEHAVIOUR clutter_behaviour_get_type()
|
2006-08-13 19:55:52 -04:00
|
|
|
|
2006-09-08 16:57:31 -04:00
|
|
|
#define CLUTTER_BEHAVIOUR(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviour))
|
2006-08-13 19:55:52 -04:00
|
|
|
|
2006-09-08 16:57:31 -04:00
|
|
|
#define CLUTTER_BEHAVIOUR_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass))
|
2006-08-13 19:55:52 -04:00
|
|
|
|
2006-09-08 16:57:31 -04: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 09:12:56 -05:00
|
|
|
typedef struct _ClutterBehaviourPrivate ClutterBehaviourPrivate;
|
|
|
|
typedef struct _ClutterBehaviourClass ClutterBehaviourClass;
|
2006-12-08 11:12:52 -05:00
|
|
|
|
|
|
|
/**
|
2007-08-07 10:03:58 -04:00
|
|
|
* ClutterBehaviourForeachFunc:
|
2006-12-08 11:12:52 -05:00
|
|
|
* @behaviour: the #ClutterBehaviour
|
|
|
|
* @actor: an actor driven by @behaviour
|
2011-07-27 03:14:10 -04:00
|
|
|
* @data: (closure): optional data passed to the function
|
2006-12-08 11:12:52 -05:00
|
|
|
*
|
2010-11-18 09:14:37 -05:00
|
|
|
* This function is passed to clutter_behaviour_actors_foreach() and
|
2006-12-08 11:12:52 -05:00
|
|
|
* will be called for each actor driven by @behaviour.
|
2007-08-07 10:03:58 -04:00
|
|
|
*
|
|
|
|
* Since: 0.2
|
2010-11-06 11:54:21 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.6
|
2006-12-08 11:12:52 -05:00
|
|
|
*/
|
|
|
|
typedef void (*ClutterBehaviourForeachFunc) (ClutterBehaviour *behaviour,
|
|
|
|
ClutterActor *actor,
|
|
|
|
gpointer data);
|
|
|
|
|
2008-07-01 06:08:28 -04:00
|
|
|
/**
|
|
|
|
* ClutterBehaviour:
|
|
|
|
*
|
|
|
|
* #ClutterBehaviour-struct contains only private data and should
|
|
|
|
* be accessed with the functions below.
|
|
|
|
*
|
|
|
|
* Since: 0.2
|
2010-11-06 11:54:21 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.6
|
2008-07-01 06:08:28 -04:00
|
|
|
*/
|
2006-08-13 19:55:52 -04:00
|
|
|
struct _ClutterBehaviour
|
|
|
|
{
|
2006-11-15 18:37:53 -05:00
|
|
|
/*< private >*/
|
|
|
|
GObject parent;
|
2006-08-13 19:55:52 -04:00
|
|
|
ClutterBehaviourPrivate *priv;
|
|
|
|
};
|
|
|
|
|
2007-08-07 10:03:58 -04:00
|
|
|
/**
|
|
|
|
* ClutterBehaviourClass
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* Since: 0.2
|
2010-11-06 11:54:21 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.6
|
2007-08-07 10:03:58 -04:00
|
|
|
*/
|
2006-08-13 19:55:52 -04:00
|
|
|
struct _ClutterBehaviourClass
|
|
|
|
{
|
2007-08-07 10:03:58 -04:00
|
|
|
/*< private >*/
|
2006-08-15 16:38:25 -04: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 09:20:29 -04:00
|
|
|
|
2007-08-07 10:03:58 -04:00
|
|
|
/*< public >*/
|
2006-11-17 13:45:31 -05:00
|
|
|
/* vfunc, not signal */
|
|
|
|
void (*alpha_notify) (ClutterBehaviour *behave,
|
2009-01-20 11:42:49 -05:00
|
|
|
gdouble alpha_value);
|
2006-09-08 16:57:31 -04:00
|
|
|
|
2007-08-07 10:03:58 -04:00
|
|
|
/* signals */
|
2007-07-22 18:30:47 -04:00
|
|
|
void (*applied) (ClutterBehaviour *behave,
|
2007-06-12 06:36:28 -04:00
|
|
|
ClutterActor *actor);
|
2007-07-22 18:30:47 -04:00
|
|
|
void (*removed) (ClutterBehaviour *behave,
|
2007-06-12 06:36:28 -04:00
|
|
|
ClutterActor *actor);
|
|
|
|
|
2007-08-07 10:03:58 -04:00
|
|
|
/*< private >*/
|
2006-11-17 13:45:31 -05:00
|
|
|
/* padding, for future expansion */
|
2006-11-15 18:37:53 -05: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 16:57:31 -04:00
|
|
|
|
2006-11-15 18:37:53 -05:00
|
|
|
GType clutter_behaviour_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 11:12:52 -05:00
|
|
|
void clutter_behaviour_apply (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 11:12:52 -05:00
|
|
|
void clutter_behaviour_remove (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2007-07-25 09:12:24 -04:00
|
|
|
void clutter_behaviour_remove_all (ClutterBehaviour *behave);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 11:12:52 -05:00
|
|
|
void clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
|
|
|
|
ClutterBehaviourForeachFunc func,
|
|
|
|
gpointer data);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2007-01-18 07:33:15 -05:00
|
|
|
gint clutter_behaviour_get_n_actors (ClutterBehaviour *behave);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2007-01-18 07:33:15 -05:00
|
|
|
ClutterActor *clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
|
2007-07-26 11:14:45 -04:00
|
|
|
gint index_);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 11:12:52 -05:00
|
|
|
GSList * clutter_behaviour_get_actors (ClutterBehaviour *behave);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 11:12:52 -05:00
|
|
|
ClutterAlpha *clutter_behaviour_get_alpha (ClutterBehaviour *behave);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2006-12-08 11:12:52 -05:00
|
|
|
void clutter_behaviour_set_alpha (ClutterBehaviour *behave,
|
|
|
|
ClutterAlpha *alpha);
|
2012-02-27 10:10:13 -05:00
|
|
|
CLUTTER_DEPRECATED_IN_1_6
|
2007-07-22 18:30:47 -04:00
|
|
|
gboolean clutter_behaviour_is_applied (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor);
|
2007-03-27 17:09:11 -04:00
|
|
|
|
2006-08-13 19:55:52 -04:00
|
|
|
G_END_DECLS
|
|
|
|
|
2010-11-06 11:54:21 -04:00
|
|
|
#endif /* __CLUTTER_BEHAVIOUR_H__ */
|