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_ARROW_STYLE_H__
22 #define __ADG_ARROW_STYLE_H__
24 #include <adg/adg-style.h>
25 #include <adg/adg-enums.h>
26 #include <cpml/cpml.h>
32 #define ADG_TYPE_ARROW_STYLE (adg_arrow_style_get_type ())
33 #define ADG_SLOT_ARROW_STYLE (adg_arrow_style_get_slot ())
34 #define ADG_ARROW_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADG_TYPE_ARROW_STYLE, AdgArrowStyle))
35 #define ADG_ARROW_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ADG_TYPE_ARROW_STYLE, AdgArrowStyleClass))
36 #define ADG_IS_ARROW_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ADG_TYPE_ARROW_STYLE))
37 #define ADG_IS_ARROW_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ADG_TYPE_ARROW_STYLE))
38 #define ADG_ARROW_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ADG_TYPE_ARROW_STYLE, AdgArrowStyleClass))
40 typedef struct _AdgArrowStyle AdgArrowStyle
;
41 typedef struct _AdgArrowStyleClass AdgArrowStyleClass
;
42 typedef struct _AdgArrowStylePrivate AdgArrowStylePrivate
;
46 * @arrow_style: an #AdgArrowStyle object
47 * @cr: a #cairo_t drawing context
48 * @segment: the CpmlPath segment where rendering the arrow
50 * Callback that renders a custom arrow at the start position in @segment.
51 * If you need an ending arrow, you should reverse the segment and recall
54 typedef void (*AdgArrowRenderer
) (AdgArrowStyle
*arrow_style
,
63 AdgArrowStylePrivate
*priv
;
66 struct _AdgArrowStyleClass
68 AdgStyleClass parent_class
;
72 GType
adg_arrow_style_get_type (void) G_GNUC_CONST
;
73 AdgStyleSlot
adg_arrow_style_get_slot (void) G_GNUC_CONST
;
74 AdgStyle
* adg_arrow_style_new (void);
76 void adg_arrow_style_render (AdgArrowStyle
*arrow_style
,
80 gdouble
adg_arrow_style_get_size (AdgArrowStyle
*arrow_style
);
81 void adg_arrow_style_set_size (AdgArrowStyle
*arrow_style
,
83 gdouble
adg_arrow_style_get_angle (AdgArrowStyle
*arrow_style
);
84 void adg_arrow_style_set_angle (AdgArrowStyle
*arrow_style
,
86 gdouble
adg_arrow_style_get_margin (AdgArrowStyle
*arrow_style
);
87 void adg_arrow_style_set_margin (AdgArrowStyle
*arrow_style
,
89 const AdgArrowRenderer
90 adg_arrow_style_get_renderer (AdgArrowStyle
*arrow_style
);
91 void adg_arrow_style_set_renderer (AdgArrowStyle
*arrow_style
,
92 AdgArrowRenderer renderer
);
98 #endif /* __ADG_ARROW_STYLE_H__ */