[AdgStroke] Using adg_entity_apply_local_matrix()
[adg.git] / adg / adg-arrow-style.h
blob2dbfd0978f9c7eb03a9211c788f02f25d7a0747a
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_ARROW_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_ARROW_STYLE, AdgArrowStyle))
33 #define ADG_ARROW_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_ARROW_STYLE, AdgArrowStyleClass))
34 #define ADG_IS_ARROW_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_ARROW_STYLE))
35 #define ADG_IS_ARROW_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_ARROW_STYLE))
36 #define ADG_ARROW_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_ARROW_STYLE, AdgArrowStyleClass))
37 #define ADG_SLOT_ARROW_STYLE (_adg_arrow_style_get_slot())
39 typedef struct _AdgArrowStyle AdgArrowStyle;
40 typedef struct _AdgArrowStyleClass AdgArrowStyleClass;
42 /**
43 * AdgArrowRenderer:
44 * @arrow_style: an #AdgArrowStyle object
45 * @cr: a #cairo_t drawing context
46 * @segment: the #CpmlSegment where rendering the arrow
48 * Callback that renders a custom arrow at the start position in @segment.
49 * If you need an ending arrow, you should reverse the segment and recall
50 * this function.
51 **/
52 typedef void (*AdgArrowRenderer) (AdgArrowStyle *arrow_style,
53 cairo_t *cr,
54 CpmlSegment *segment);
56 struct _AdgArrowStyle {
57 /*< private >*/
58 AdgStyle parent;
59 gpointer data;
62 struct _AdgArrowStyleClass {
63 /*< private >*/
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__ */