1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009 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 #ifndef __ADG_ENTITY_H__
22 #define __ADG_ENTITY_H__
24 #include <adg/adg-util.h>
25 #include <adg/adg-matrix.h>
26 #include <adg/adg-dress.h>
31 #define ADG_TYPE_ENTITY (adg_entity_get_type())
32 #define ADG_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_ENTITY, AdgEntity))
33 #define ADG_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_ENTITY, AdgEntityClass))
34 #define ADG_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_ENTITY))
35 #define ADG_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_ENTITY))
36 #define ADG_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_ENTITY, AdgEntityClass))
39 typedef struct _AdgEntity AdgEntity
;
40 typedef struct _AdgEntityClass AdgEntityClass
;
42 ADG_FORWARD_DECL(AdgCanvas
);
47 GInitiallyUnowned parent
;
51 struct _AdgEntityClass
{
53 GInitiallyUnownedClass parent_class
;
56 void (*parent_set
) (AdgEntity
*entity
,
57 AdgEntity
*old_parent
);
59 void (*get_global_matrix
) (AdgEntity
*entity
,
61 void (*get_local_matrix
) (AdgEntity
*entity
,
63 void (*invalidate
) (AdgEntity
*entity
);
64 void (*render
) (AdgEntity
*entity
,
69 GType
adg_entity_get_type (void) G_GNUC_CONST
;
70 AdgCanvas
* adg_entity_get_canvas (AdgEntity
*entity
);
72 AdgEntity
* adg_entity_get_parent (AdgEntity
*entity
);
73 void adg_entity_set_parent (AdgEntity
*entity
,
75 void adg_entity_get_global_map (AdgEntity
*entity
,
77 void adg_entity_set_global_map (AdgEntity
*entity
,
78 const AdgMatrix
*map
);
79 void adg_entity_before_global_map (AdgEntity
*entity
,
80 const AdgMatrix
*transformation
);
81 void adg_entity_after_global_map (AdgEntity
*entity
,
82 const AdgMatrix
*transformation
);
83 void adg_entity_get_global_matrix (AdgEntity
*entity
,
85 void adg_entity_get_local_map (AdgEntity
*entity
,
87 void adg_entity_set_local_map (AdgEntity
*entity
,
88 const AdgMatrix
*map
);
89 void adg_entity_before_local_map (AdgEntity
*entity
,
90 const AdgMatrix
*transformation
);
91 void adg_entity_after_local_map (AdgEntity
*entity
,
92 const AdgMatrix
*transformation
);
93 void adg_entity_get_local_matrix (AdgEntity
*entity
,
95 void adg_entity_apply_local_matrix (AdgEntity
*entity
,
97 AdgStyle
* adg_entity_style (AdgEntity
*entity
,
99 AdgStyle
* adg_entity_get_style (AdgEntity
*entity
,
101 void adg_entity_set_style (AdgEntity
*entity
,
104 void adg_entity_apply_dress (AdgEntity
*entity
,
107 void adg_entity_invalidate (AdgEntity
*entity
);
108 void adg_entity_render (AdgEntity
*entity
,
114 #endif /* __ADG_ENTITY_H__ */