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>
31 #define ADG_TYPE_ARROW_STYLE (adg_arrow_style_get_type ())
32 #define ADG_SLOT_ARROW_STYLE (adg_arrow_style_get_slot ())
33 #define ADG_ARROW_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADG_TYPE_ARROW_STYLE, AdgArrowStyle))
34 #define ADG_ARROW_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ADG_TYPE_ARROW_STYLE, AdgArrowStyleClass))
35 #define ADG_IS_ARROW_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ADG_TYPE_ARROW_STYLE))
36 #define ADG_IS_ARROW_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ADG_TYPE_ARROW_STYLE))
37 #define ADG_ARROW_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ADG_TYPE_ARROW_STYLE, AdgArrowStyleClass))
39 typedef struct _AdgArrowStyle AdgArrowStyle
;
40 typedef struct _AdgArrowStyleClass AdgArrowStyleClass
;
41 typedef struct _AdgArrowStylePrivate AdgArrowStylePrivate
;
45 * @arrow_style: an #AdgArrowStyle object
46 * @cr: a #cairo_t drawing context
47 * @segment: the CpmlPath segment where rendering the arrow
49 * Callback that renders a custom arrow at the start position in @segment.
50 * If you need an ending arrow, you should reverse the segment and recall
53 typedef void (*AdgArrowRenderer
) (AdgArrowStyle
*arrow_style
,
57 struct _AdgArrowStyle
{
60 AdgArrowStylePrivate
*priv
;
63 struct _AdgArrowStyleClass
{
64 AdgStyleClass parent_class
;
68 GType
adg_arrow_style_get_type (void) G_GNUC_CONST
;
69 AdgStyleSlot
adg_arrow_style_get_slot (void) G_GNUC_CONST
;
70 AdgStyle
* adg_arrow_style_new (void);
72 void adg_arrow_style_render (AdgArrowStyle
*arrow_style
,
76 gdouble
adg_arrow_style_get_size (AdgArrowStyle
*arrow_style
);
77 void adg_arrow_style_set_size (AdgArrowStyle
*arrow_style
,
79 gdouble
adg_arrow_style_get_angle (AdgArrowStyle
*arrow_style
);
80 void adg_arrow_style_set_angle (AdgArrowStyle
*arrow_style
,
82 gdouble
adg_arrow_style_get_margin (AdgArrowStyle
*arrow_style
);
83 void adg_arrow_style_set_margin (AdgArrowStyle
*arrow_style
,
85 const AdgArrowRenderer
86 adg_arrow_style_get_renderer (AdgArrowStyle
*arrow_style
);
87 void adg_arrow_style_set_renderer (AdgArrowStyle
*arrow_style
,
88 AdgArrowRenderer renderer
);
93 #endif /* __ADG_ARROW_STYLE_H__ */