[docs] Updated TODO.xml
[adg.git] / adg / adg-entity.h
blobc9f00c91ffb03bea7ef46b06e2845ee5b2a34896
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-context.h>
26 #include <adg/adg-matrix.h>
27 #include <adg/adg-enums.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 typedef struct _AdgEntity AdgEntity;
41 typedef struct _AdgEntityClass AdgEntityClass;
43 ADG_FORWARD_DECL(AdgCanvas);
46 struct _AdgEntity {
47 /*< private >*/
48 GInitiallyUnowned parent;
49 gpointer data;
52 struct _AdgEntityClass {
53 /*< private >*/
54 GInitiallyUnownedClass parent_class;
56 /*< public >*/
57 /* Signals */
58 void (*parent_set) (AdgEntity *entity,
59 AdgEntity *old_parent);
60 void (*context_set) (AdgEntity *entity,
61 AdgContext *old_context);
63 /* Virtual Table */
64 gboolean (*invalidate) (AdgEntity *entity);
65 gboolean (*render) (AdgEntity *entity,
66 cairo_t *cr);
70 GType adg_entity_get_type (void) G_GNUC_CONST;
71 AdgCanvas * adg_entity_get_canvas (AdgEntity *entity);
73 AdgEntity * adg_entity_get_parent (AdgEntity *entity);
74 void adg_entity_set_parent (AdgEntity *entity,
75 AdgEntity *parent);
76 AdgContext * adg_entity_context (AdgEntity *entity);
77 AdgContext * adg_entity_get_context (AdgEntity *entity);
78 void adg_entity_set_context (AdgEntity *entity,
79 AdgContext *context);
80 gboolean adg_entity_get_rendered (AdgEntity *entity);
81 void adg_entity_set_rendered (AdgEntity *entity,
82 gboolean rendered);
83 void adg_entity_get_global_map (AdgEntity *entity,
84 AdgMatrix *map);
85 void adg_entity_set_global_map (AdgEntity *entity,
86 const AdgMatrix *map);
87 void adg_entity_transform_global_map (AdgEntity *entity,
88 const AdgMatrix *transformation);
89 void adg_entity_get_global_matrix (AdgEntity *entity,
90 AdgMatrix *matrix);
91 void adg_entity_get_local_map (AdgEntity *entity,
92 AdgMatrix *map);
93 void adg_entity_set_local_map (AdgEntity *entity,
94 const AdgMatrix *map);
95 void adg_entity_transform_local_map (AdgEntity *entity,
96 const AdgMatrix *transformation);
97 void adg_entity_get_local_matrix (AdgEntity *entity,
98 AdgMatrix *matrix);
99 AdgStyle * adg_entity_get_style (AdgEntity *entity,
100 AdgStyleSlot style_slot);
101 void adg_entity_apply (AdgEntity *entity,
102 AdgStyleSlot style_slot,
103 cairo_t *cr);
104 void adg_entity_apply_font (AdgEntity *entity,
105 AdgFontStyleId font_id,
106 cairo_t *cr);
107 void adg_entity_invalidate (AdgEntity *entity);
108 void adg_entity_render (AdgEntity *entity,
109 cairo_t *cr);
111 G_END_DECLS
114 #endif /* __ADG_ENTITY_H__ */