1 | #ifndef GNOME_CANVAS_PATH_DEF_H |
---|
2 | #define GNOME_CANVAS_PATH_DEF_H |
---|
3 | |
---|
4 | /* |
---|
5 | * GnomeCanvasPathDef |
---|
6 | * |
---|
7 | * (C) 1999-2000 Lauris Kaplinski <lauris@ximian.com> |
---|
8 | * Released under LGPL |
---|
9 | * |
---|
10 | * This is mostly like GnomeCanvasBpathDef, but with added functionality: |
---|
11 | * - can be constructed from scratch, from existing bpath of from static bpath |
---|
12 | * - Path is always terminated with ART_END |
---|
13 | * - Has closed flag |
---|
14 | * - has concat, split and copy methods |
---|
15 | * |
---|
16 | */ |
---|
17 | |
---|
18 | #include <glib.h> |
---|
19 | #include <libart_lgpl/art_bpath.h> |
---|
20 | |
---|
21 | G_BEGIN_DECLS |
---|
22 | |
---|
23 | typedef struct _GnomeCanvasPathDef GnomeCanvasPathDef; |
---|
24 | |
---|
25 | /* Constructors */ |
---|
26 | |
---|
27 | GnomeCanvasPathDef * gnome_canvas_path_def_new (void); |
---|
28 | GnomeCanvasPathDef * gnome_canvas_path_def_new_sized (gint length); |
---|
29 | GnomeCanvasPathDef * gnome_canvas_path_def_new_from_bpath (ArtBpath * bpath); |
---|
30 | GnomeCanvasPathDef * gnome_canvas_path_def_new_from_static_bpath (ArtBpath * bpath); |
---|
31 | GnomeCanvasPathDef * gnome_canvas_path_def_new_from_foreign_bpath (ArtBpath * bpath); |
---|
32 | |
---|
33 | void gnome_canvas_path_def_ref (GnomeCanvasPathDef * path); |
---|
34 | void gnome_canvas_path_def_finish (GnomeCanvasPathDef * path); |
---|
35 | void gnome_canvas_path_def_ensure_space (GnomeCanvasPathDef * path, gint space); |
---|
36 | |
---|
37 | /* |
---|
38 | * Misc constructors |
---|
39 | * All these return NEW path, not unrefing old |
---|
40 | * Also copy and duplicate force bpath to be private (otherwise you |
---|
41 | * would use ref :) |
---|
42 | */ |
---|
43 | |
---|
44 | void gnome_canvas_path_def_copy (GnomeCanvasPathDef * dst, const GnomeCanvasPathDef * src); |
---|
45 | GnomeCanvasPathDef * gnome_canvas_path_def_duplicate (const GnomeCanvasPathDef * path); |
---|
46 | GnomeCanvasPathDef * gnome_canvas_path_def_concat (const GSList * list); |
---|
47 | GSList * gnome_canvas_path_def_split (const GnomeCanvasPathDef * path); |
---|
48 | GnomeCanvasPathDef * gnome_canvas_path_def_open_parts (const GnomeCanvasPathDef * path); |
---|
49 | GnomeCanvasPathDef * gnome_canvas_path_def_closed_parts (const GnomeCanvasPathDef * path); |
---|
50 | GnomeCanvasPathDef * gnome_canvas_path_def_close_all (const GnomeCanvasPathDef * path); |
---|
51 | |
---|
52 | /* Destructor */ |
---|
53 | |
---|
54 | void gnome_canvas_path_def_unref (GnomeCanvasPathDef * path); |
---|
55 | |
---|
56 | /* Methods */ |
---|
57 | |
---|
58 | /* Sets GnomeCanvasPathDef to zero length */ |
---|
59 | |
---|
60 | void gnome_canvas_path_def_reset (GnomeCanvasPathDef * path); |
---|
61 | |
---|
62 | /* Drawing methods */ |
---|
63 | |
---|
64 | void gnome_canvas_path_def_moveto (GnomeCanvasPathDef * path, gdouble x, gdouble y); |
---|
65 | void gnome_canvas_path_def_lineto (GnomeCanvasPathDef * path, gdouble x, gdouble y); |
---|
66 | |
---|
67 | /* Does not create new ArtBpath, but simply changes last lineto position */ |
---|
68 | |
---|
69 | void gnome_canvas_path_def_lineto_moving (GnomeCanvasPathDef * path, gdouble x, gdouble y); |
---|
70 | void gnome_canvas_path_def_curveto (GnomeCanvasPathDef * path, gdouble x0, gdouble y0,gdouble x1, gdouble y1, gdouble x2, gdouble y2); |
---|
71 | void gnome_canvas_path_def_closepath (GnomeCanvasPathDef * path); |
---|
72 | |
---|
73 | /* Does not draw new line to startpoint, but moves last lineto */ |
---|
74 | |
---|
75 | void gnome_canvas_path_def_closepath_current (GnomeCanvasPathDef * path); |
---|
76 | |
---|
77 | /* Various methods */ |
---|
78 | |
---|
79 | ArtBpath * gnome_canvas_path_def_bpath (const GnomeCanvasPathDef * path); |
---|
80 | gint gnome_canvas_path_def_length (const GnomeCanvasPathDef * path); |
---|
81 | gboolean gnome_canvas_path_def_is_empty (const GnomeCanvasPathDef * path); |
---|
82 | gboolean gnome_canvas_path_def_has_currentpoint (const GnomeCanvasPathDef * path); |
---|
83 | void gnome_canvas_path_def_currentpoint (const GnomeCanvasPathDef * path, ArtPoint * p); |
---|
84 | ArtBpath * gnome_canvas_path_def_last_bpath (const GnomeCanvasPathDef * path); |
---|
85 | ArtBpath * gnome_canvas_path_def_first_bpath (const GnomeCanvasPathDef * path); |
---|
86 | gboolean gnome_canvas_path_def_any_open (const GnomeCanvasPathDef * path); |
---|
87 | gboolean gnome_canvas_path_def_all_open (const GnomeCanvasPathDef * path); |
---|
88 | gboolean gnome_canvas_path_def_any_closed (const GnomeCanvasPathDef * path); |
---|
89 | gboolean gnome_canvas_path_def_all_closed (const GnomeCanvasPathDef * path); |
---|
90 | |
---|
91 | G_END_DECLS |
---|
92 | |
---|
93 | #endif |
---|