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
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2006-09-08 20:57:31 +00:00
|
|
|
#ifndef _HAVE_CLUTTER_BEHAVIOUR_H
|
|
|
|
#define _HAVE_CLUTTER_BEHAVIOUR_H
|
2006-08-13 23:55:52 +00:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
2006-11-15 23:37:53 +00:00
|
|
|
#include <clutter/clutter-alpha.h>
|
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 _ClutterBehaviour ClutterBehaviour;
|
|
|
|
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
|
|
|
|
* @data: optional data passed to the function
|
|
|
|
*
|
|
|
|
* This function is passed to clutter_behaviour_foreach_actor() and
|
|
|
|
* will be called for each actor driven by @behaviour.
|
2007-08-07 14:03:58 +00:00
|
|
|
*
|
|
|
|
* Since: 0.2
|
2006-12-08 16:12:52 +00:00
|
|
|
*/
|
|
|
|
typedef void (*ClutterBehaviourForeachFunc) (ClutterBehaviour *behaviour,
|
|
|
|
ClutterActor *actor,
|
|
|
|
gpointer data);
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
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,
|
|
|
|
guint32 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
|
|
|
|
2006-11-15 23:37:53 +00:00
|
|
|
GType clutter_behaviour_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2006-12-08 16:12:52 +00:00
|
|
|
void clutter_behaviour_apply (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor);
|
|
|
|
void clutter_behaviour_remove (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor);
|
2007-07-25 13:12:24 +00:00
|
|
|
void clutter_behaviour_remove_all (ClutterBehaviour *behave);
|
2006-12-08 16:12:52 +00:00
|
|
|
void clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
|
|
|
|
ClutterBehaviourForeachFunc func,
|
|
|
|
gpointer data);
|
2007-01-18 12:33:15 +00:00
|
|
|
gint clutter_behaviour_get_n_actors (ClutterBehaviour *behave);
|
|
|
|
ClutterActor *clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
|
2007-07-26 15:14:45 +00:00
|
|
|
gint index_);
|
2006-12-08 16:12:52 +00:00
|
|
|
GSList * clutter_behaviour_get_actors (ClutterBehaviour *behave);
|
|
|
|
ClutterAlpha *clutter_behaviour_get_alpha (ClutterBehaviour *behave);
|
|
|
|
void clutter_behaviour_set_alpha (ClutterBehaviour *behave,
|
|
|
|
ClutterAlpha *alpha);
|
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
|
|
|
|
|
2006-09-08 20:57:31 +00:00
|
|
|
#endif
|