Tab expansion in all the source files
[adg.git] / adg / adg-arrow-style.h
blobfc80fea8691ef8c02263da93f52cee5ff867d476
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>
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 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
51 * this function.
52 **/
53 typedef void (*AdgArrowRenderer) (AdgArrowStyle *arrow_style,
54 cairo_t *cr,
55 CpmlPath *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 CpmlPath *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 const 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__ */