update to 1.10.4
[profile/ivi/clutter.git] / clutter / clutter-constraint.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2010  Intel Corporation.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * Author:
22  *   Emmanuele Bassi <ebassi@linux.intel.com>
23  */
24
25 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
26 #error "Only <clutter/clutter.h> can be included directly."
27 #endif
28
29 #ifndef __CLUTTER_CONSTRAINT_H__
30 #define __CLUTTER_CONSTRAINT_H__
31
32 #include <clutter/clutter-actor-meta.h>
33
34 G_BEGIN_DECLS
35
36 #define CLUTTER_TYPE_CONSTRAINT                 (clutter_constraint_get_type ())
37 #define CLUTTER_CONSTRAINT(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CONSTRAINT, ClutterConstraint))
38 #define CLUTTER_IS_CONSTRAINT(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CONSTRAINT))
39 #define CLUTTER_CONSTRAINT_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_CONSTRAINT, ClutterConstraintClass))
40 #define CLUTTER_IS_CONSTRAINT_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_CONSTRAINT))
41 #define CLUTTER_CONSTRAINT_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_CONSTRAINT, ClutterConstraintClass))
42
43 typedef struct _ClutterConstraintClass          ClutterConstraintClass;
44
45 /**
46  * ClutterConstraint:
47  *
48  * The <structname>ClutterConstraint</structname> structure contains only
49  * private data and should be accessed using the provided API
50  *
51  * Since: 1.4
52  */
53 struct _ClutterConstraint
54 {
55   /*< private >*/
56   ClutterActorMeta parent_instance;
57 };
58
59 /**
60  * ClutterConstraintClass:
61  *
62  * The <structname>ClutterConstraintClass</structname> structure contains
63  * only private data
64  *
65  * Since: 1.4
66  */
67 struct _ClutterConstraintClass
68 {
69   /*< private >*/
70   ClutterActorMetaClass parent_class;
71
72   void (* update_allocation) (ClutterConstraint *constraint,
73                               ClutterActor      *actor,
74                               ClutterActorBox   *allocation);
75
76   /*< private >*/
77   void (* _clutter_constraint1) (void);
78   void (* _clutter_constraint2) (void);
79   void (* _clutter_constraint3) (void);
80   void (* _clutter_constraint4) (void);
81   void (* _clutter_constraint5) (void);
82   void (* _clutter_constraint6) (void);
83   void (* _clutter_constraint7) (void);
84   void (* _clutter_constraint8) (void);
85 };
86
87 GType clutter_constraint_get_type (void) G_GNUC_CONST;
88
89 /* ClutterActor API */
90 void               clutter_actor_add_constraint            (ClutterActor      *self,
91                                                             ClutterConstraint *constraint);
92 void               clutter_actor_add_constraint_with_name  (ClutterActor      *self,
93                                                             const gchar       *name,
94                                                             ClutterConstraint *constraint);
95 void               clutter_actor_remove_constraint         (ClutterActor      *self,
96                                                             ClutterConstraint *constraint);
97 void               clutter_actor_remove_constraint_by_name (ClutterActor      *self,
98                                                             const gchar       *name);
99 GList *            clutter_actor_get_constraints           (ClutterActor      *self);
100 ClutterConstraint *clutter_actor_get_constraint            (ClutterActor      *self,
101                                                             const gchar       *name);
102 void               clutter_actor_clear_constraints         (ClutterActor      *self);
103
104 gboolean           clutter_actor_has_constraints           (ClutterActor *self);
105
106 G_END_DECLS
107
108 #endif /* __CLUTTER_CONSTRAINT_H__ */