[AdgPath] Added adg_path_append_{primitive,segment}()
[adg.git] / adg / adg-arrow-style.h
blob697874885b0c8585208dcca62a879a37a4c1d3de
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_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>
29 G_BEGIN_DECLS
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;
43 /**
44 * AdgArrowRenderer:
45 * @arrow_style: an #AdgArrowStyle object
46 * @cr: a #cairo_t drawing context
47 * @segment: the #CpmlSegment 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
51 * this function.
52 **/
53 typedef void (*AdgArrowRenderer) (AdgArrowStyle *arrow_style,
54 cairo_t *cr,
55 CpmlSegment *segment);
57 struct _AdgArrowStyle {
58 AdgStyle style;
59 /*< private >*/
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,
73 cairo_t *cr,
74 CpmlSegment *segment);
76 gdouble adg_arrow_style_get_size (AdgArrowStyle *arrow_style);
77 void adg_arrow_style_set_size (AdgArrowStyle *arrow_style,
78 gdouble size);
79 gdouble adg_arrow_style_get_angle (AdgArrowStyle *arrow_style);
80 void adg_arrow_style_set_angle (AdgArrowStyle *arrow_style,
81 gdouble angle);
82 gdouble adg_arrow_style_get_margin (AdgArrowStyle *arrow_style);
83 void adg_arrow_style_set_margin (AdgArrowStyle *arrow_style,
84 gdouble margin);
85 AdgArrowRenderer
86 adg_arrow_style_get_renderer (AdgArrowStyle *arrow_style);
87 void adg_arrow_style_set_renderer (AdgArrowStyle *arrow_style,
88 AdgArrowRenderer renderer);
90 G_END_DECLS
93 #endif /* __ADG_ARROW_STYLE_H__ */