[ADG] Moved include dependencies from .h to .c
[adg.git] / src / adg / adg-entity.h
blob34d7fbb8cbf76d62fcd4fddb28a5cf794bdf5ff9
1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009,2010,2011 Nicola Fontana <ntd at entidi.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #if !defined(__ADG_H__)
22 #error "Only <adg.h> can be included directly."
23 #endif
26 #ifndef __ADG_ENTITY_H__
27 #define __ADG_ENTITY_H__
30 G_BEGIN_DECLS
32 #define ADG_TYPE_ENTITY (adg_entity_get_type())
33 #define ADG_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_ENTITY, AdgEntity))
34 #define ADG_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_ENTITY, AdgEntityClass))
35 #define ADG_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_ENTITY))
36 #define ADG_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_ENTITY))
37 #define ADG_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_ENTITY, AdgEntityClass))
40 /* Forward declarations */
41 ADG_FORWARD_DECL(AdgCanvas);
42 ADG_FORWARD_DECL(AdgStyle);
43 ADG_FORWARD_DECL(AdgPoint);
44 typedef gint AdgDress;
47 typedef struct _AdgEntity AdgEntity;
48 typedef struct _AdgEntityClass AdgEntityClass;
51 struct _AdgEntity {
52 /*< private >*/
53 GInitiallyUnowned parent;
54 gpointer data;
57 struct _AdgEntityClass {
58 /*< private >*/
59 GInitiallyUnownedClass parent_class;
60 /*< public >*/
61 /* Signals */
62 void (*parent_set) (AdgEntity *entity,
63 AdgEntity *old_parent);
64 void (*global_changed) (AdgEntity *entity);
65 void (*local_changed) (AdgEntity *entity);
67 /* Virtual Table */
68 void (*invalidate) (AdgEntity *entity);
69 void (*arrange) (AdgEntity *entity);
70 void (*render) (AdgEntity *entity,
71 cairo_t *cr);
75 void adg_switch_extents (gboolean state);
77 GType adg_entity_get_type (void) G_GNUC_CONST;
78 AdgCanvas * adg_entity_get_canvas (AdgEntity *entity);
79 void adg_entity_set_parent (AdgEntity *entity,
80 AdgEntity *parent);
81 AdgEntity * adg_entity_get_parent (AdgEntity *entity);
82 void adg_entity_set_global_map (AdgEntity *entity,
83 const AdgMatrix *map);
84 void adg_entity_transform_global_map(AdgEntity *entity,
85 const AdgMatrix *transformation,
86 AdgTransformMode mode);
87 const AdgMatrix *adg_entity_get_global_map (AdgEntity *entity);
88 const AdgMatrix *adg_entity_get_global_matrix (AdgEntity *entity);
89 void adg_entity_set_local_map (AdgEntity *entity,
90 const AdgMatrix *map);
91 void adg_entity_transform_local_map (AdgEntity *entity,
92 const AdgMatrix *transformation,
93 AdgTransformMode mode);
94 const AdgMatrix *adg_entity_get_local_map (AdgEntity *entity);
95 const AdgMatrix *adg_entity_get_local_matrix (AdgEntity *entity);
96 void adg_entity_set_local_method (AdgEntity *entity,
97 AdgMixMethod local_method);
98 AdgMixMethod adg_entity_get_local_method (AdgEntity *entity);
99 void adg_entity_set_extents (AdgEntity *entity,
100 const CpmlExtents *extents);
101 const CpmlExtents *
102 adg_entity_get_extents (AdgEntity *entity);
103 void adg_entity_set_style (AdgEntity *entity,
104 AdgDress dress,
105 AdgStyle *style);
106 AdgStyle * adg_entity_get_style (AdgEntity *entity,
107 AdgDress dress);
108 AdgStyle * adg_entity_style (AdgEntity *entity,
109 AdgDress dress);
110 void adg_entity_apply_dress (AdgEntity *entity,
111 AdgDress dress,
112 cairo_t *cr);
113 void adg_entity_global_changed (AdgEntity *entity);
114 void adg_entity_local_changed (AdgEntity *entity);
115 void adg_entity_invalidate (AdgEntity *entity);
116 void adg_entity_arrange (AdgEntity *entity);
117 void adg_entity_render (AdgEntity *entity,
118 cairo_t *cr);
119 AdgPoint * adg_entity_point (AdgEntity *entity,
120 AdgPoint *old_point,
121 AdgPoint *new_point);
123 G_END_DECLS
126 #endif /* __ADG_ENTITY_H__ */