Implemented adg_line_style_new()
[adg.git] / adg / adg-entity.h
blob35ada24eb3feede6afb758b8a4964070e67686de
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-line-style.h>
26 #include <adg/adg-font-style.h>
27 #include <adg/adg-arrow-style.h>
28 #include <adg/adg-dim-style.h>
31 G_BEGIN_DECLS
34 /* Forward declarations */
35 typedef struct _AdgCanvas AdgCanvas;
38 #define ADG_TYPE_ENTITY (adg_entity_get_type ())
39 #define ADG_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADG_TYPE_ENTITY, AdgEntity))
40 #define ADG_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ADG_TYPE_ENTITY, AdgEntityClass))
41 #define ADG_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ADG_TYPE_ENTITY))
42 #define ADG_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ADG_TYPE_ENTITY))
43 #define ADG_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ADG_TYPE_ENTITY, AdgEntityClass))
46 typedef struct _AdgEntity AdgEntity;
47 typedef struct _AdgEntityClass AdgEntityClass;
48 typedef struct _AdgEntityPrivate AdgEntityPrivate;
51 struct _AdgEntity
53 GInitiallyUnowned initially_unowned;
55 /*< private >*/
56 AdgEntityPrivate *priv;
59 struct _AdgEntityClass
61 GInitiallyUnownedClass parent_class;
63 /* Signals */
64 void (*model_matrix_changed) (AdgEntity *entity,
65 AdgMatrix *parent_matrix);
66 void (*paper_matrix_changed) (AdgEntity *entity,
67 AdgMatrix *parent_matrix);
68 void (*render) (AdgEntity *entity,
69 cairo_t *cr);
71 /* Virtual Table */
72 const AdgLineStyle * (*get_line_style) (AdgEntity *entity);
73 void (*set_line_style) (AdgEntity *entity,
74 AdgLineStyle *line_style);
75 const AdgFontStyle * (*get_font_style) (AdgEntity *entity);
76 void (*set_font_style) (AdgEntity *entity,
77 AdgFontStyle *font_style);
78 const AdgArrowStyle * (*get_arrow_style) (AdgEntity *entity);
79 void (*set_arrow_style) (AdgEntity *entity,
80 AdgArrowStyle *arrow_style);
81 const AdgDimStyle * (*get_dim_style) (AdgEntity *entity);
82 void (*set_dim_style) (AdgEntity *entity,
83 AdgDimStyle *dim_style);
84 const AdgMatrix * (*get_model_matrix) (AdgEntity *entity);
85 const AdgMatrix * (*get_paper_matrix) (AdgEntity *entity);
89 #define ADG_CALLBACK(f) ((AdgCallback) (f))
92 typedef void (*AdgCallback) (AdgEntity *entity, gpointer user_data);
95 GType adg_entity_get_type (void) G_GNUC_CONST;
96 AdgCanvas * adg_entity_get_canvas (AdgEntity *entity);
97 const AdgMatrix * adg_entity_get_model_matrix (AdgEntity *entity);
98 const AdgMatrix * adg_entity_get_paper_matrix (AdgEntity *entity);
99 void adg_entity_model_matrix_changed (AdgEntity *entity,
100 const AdgMatrix*parent_matrix);
101 void adg_entity_paper_matrix_changed (AdgEntity *entity,
102 const AdgMatrix*parent_matrix);
103 const AdgLineStyle * adg_entity_get_line_style (AdgEntity *entity);
104 void adg_entity_set_line_style (AdgEntity *entity,
105 AdgLineStyle *line_style);
106 const AdgFontStyle * adg_entity_get_font_style (AdgEntity *entity);
107 void adg_entity_set_font_style (AdgEntity *entity,
108 AdgFontStyle *font_style);
109 const AdgArrowStyle * adg_entity_get_arrow_style (AdgEntity *entity);
110 void adg_entity_set_arrow_style (AdgEntity *entity,
111 AdgArrowStyle *arrow_style);
112 const AdgDimStyle * adg_entity_get_dim_style (AdgEntity *entity);
113 void adg_entity_set_dim_style (AdgEntity *entity,
114 AdgDimStyle *dim_style);
115 gboolean adg_entity_model_matrix_applied (AdgEntity *entity);
116 gboolean adg_entity_paper_matrix_applied (AdgEntity *entity);
117 gboolean adg_entity_model_applied (AdgEntity *entity);
118 void adg_entity_render (AdgEntity *entity,
119 cairo_t *cr);
122 G_END_DECLS
125 #endif /* __ADG_ENTITY_H__ */