1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007-2008, 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 Library 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 * Library 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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #ifndef __ADG_ENTITY_H__
22 #define __ADG_ENTITY_H__
24 #include <adg/adg-matrix.h>
25 #include <adg/adg-style.h>
31 /* Forward declarations */
32 typedef struct _AdgCanvas AdgCanvas
;
35 #define ADG_TYPE_ENTITY (adg_entity_get_type ())
36 #define ADG_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADG_TYPE_ENTITY, AdgEntity))
37 #define ADG_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ADG_TYPE_ENTITY, AdgEntityClass))
38 #define ADG_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ADG_TYPE_ENTITY))
39 #define ADG_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ADG_TYPE_ENTITY))
40 #define ADG_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ADG_TYPE_ENTITY, AdgEntityClass))
43 typedef struct _AdgEntity AdgEntity
;
44 typedef struct _AdgEntityClass AdgEntityClass
;
45 typedef struct _AdgEntityPrivate AdgEntityPrivate
;
50 GInitiallyUnowned initially_unowned
;
53 AdgEntityPrivate
*priv
;
56 struct _AdgEntityClass
58 GInitiallyUnownedClass parent_class
;
61 void (*model_matrix_changed
) (AdgEntity
*entity
,
62 AdgMatrix
*parent_matrix
);
63 void (*paper_matrix_changed
) (AdgEntity
*entity
,
64 AdgMatrix
*parent_matrix
);
65 void (*render
) (AdgEntity
*entity
,
69 const AdgLineStyle
* (*get_line_style
) (AdgEntity
*entity
);
70 void (*set_line_style
) (AdgEntity
*entity
,
71 AdgLineStyle
*line_style
);
72 const AdgFontStyle
* (*get_font_style
) (AdgEntity
*entity
);
73 void (*set_font_style
) (AdgEntity
*entity
,
74 AdgFontStyle
*font_style
);
75 const AdgArrowStyle
* (*get_arrow_style
) (AdgEntity
*entity
);
76 void (*set_arrow_style
) (AdgEntity
*entity
,
77 AdgArrowStyle
*arrow_style
);
78 const AdgDimStyle
* (*get_dim_style
) (AdgEntity
*entity
);
79 void (*set_dim_style
) (AdgEntity
*entity
,
80 AdgDimStyle
*dim_style
);
81 const AdgMatrix
* (*get_model_matrix
) (AdgEntity
*entity
);
82 const AdgMatrix
* (*get_paper_matrix
) (AdgEntity
*entity
);
86 #define ADG_CALLBACK(f) ((AdgCallback) (f))
89 typedef void (*AdgCallback
) (AdgEntity
*entity
, gpointer user_data
);
92 GType
adg_entity_get_type (void) G_GNUC_CONST
;
93 AdgCanvas
* adg_entity_get_canvas (AdgEntity
*entity
);
94 const AdgMatrix
* adg_entity_get_model_matrix (AdgEntity
*entity
);
95 const AdgMatrix
* adg_entity_get_paper_matrix (AdgEntity
*entity
);
96 void adg_entity_model_matrix_changed (AdgEntity
*entity
,
97 const AdgMatrix
*parent_matrix
);
98 void adg_entity_paper_matrix_changed (AdgEntity
*entity
,
99 const AdgMatrix
*parent_matrix
);
100 const AdgLineStyle
* adg_entity_get_line_style (AdgEntity
*entity
);
101 void adg_entity_set_line_style (AdgEntity
*entity
,
102 AdgLineStyle
*line_style
);
103 const AdgFontStyle
* adg_entity_get_font_style (AdgEntity
*entity
);
104 void adg_entity_set_font_style (AdgEntity
*entity
,
105 AdgFontStyle
*font_style
);
106 const AdgArrowStyle
* adg_entity_get_arrow_style (AdgEntity
*entity
);
107 void adg_entity_set_arrow_style (AdgEntity
*entity
,
108 AdgArrowStyle
*arrow_style
);
109 const AdgDimStyle
* adg_entity_get_dim_style (AdgEntity
*entity
);
110 void adg_entity_set_dim_style (AdgEntity
*entity
,
111 AdgDimStyle
*dim_style
);
112 gboolean
adg_entity_model_matrix_applied (AdgEntity
*entity
);
113 gboolean
adg_entity_paper_matrix_applied (AdgEntity
*entity
);
114 gboolean
adg_entity_model_applied (AdgEntity
*entity
);
115 void adg_entity_render (AdgEntity
*entity
,
122 #endif /* __ADG_ENTITY_H__ */