aboutsummaryrefslogtreecommitdiffstats
path: root/libgnomecanvas/gnome-canvas-path-def.h
blob: c3f6b2514700eee75a2c4ede200d55d1725d8133 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef GNOME_CANVAS_PATH_DEF_H
#define GNOME_CANVAS_PATH_DEF_H

/*
 * GnomeCanvasPathDef
 *
 * (C) 1999-2000 Lauris Kaplinski <lauris@ximian.com>
 * Released under LGPL
 *
 * This is mostly like GnomeCanvasBpathDef, but with added functionality:
 * - can be constructed from scratch, from existing bpath of from static bpath
 * - Path is always terminated with ART_END
 * - Has closed flag
 * - has concat, split and copy methods
 *
 */

#include <glib-object.h>
#include <libart_lgpl/art_bpath.h>

G_BEGIN_DECLS

typedef struct _GnomeCanvasPathDef GnomeCanvasPathDef;

#define GNOME_TYPE_CANVAS_PATH_DEF  (gnome_canvas_path_def_get_type ())
GType gnome_canvas_path_def_get_type (void) G_GNUC_CONST;

/* Constructors */

GnomeCanvasPathDef * gnome_canvas_path_def_new (void);
GnomeCanvasPathDef * gnome_canvas_path_def_new_sized (gint length);
GnomeCanvasPathDef * gnome_canvas_path_def_new_from_bpath (ArtBpath * bpath);
GnomeCanvasPathDef * gnome_canvas_path_def_new_from_static_bpath (ArtBpath * bpath);
GnomeCanvasPathDef * gnome_canvas_path_def_new_from_foreign_bpath (ArtBpath * bpath);

void gnome_canvas_path_def_ref (GnomeCanvasPathDef * path);
void gnome_canvas_path_def_finish (GnomeCanvasPathDef * path);
void gnome_canvas_path_def_ensure_space (GnomeCanvasPathDef * path, gint space);

/*
 * Misc constructors
 * All these return NEW path, not unrefing old
 * Also copy and duplicate force bpath to be private (otherwise you
 * would use ref :)
 */

void gnome_canvas_path_def_copy (GnomeCanvasPathDef * dst, const GnomeCanvasPathDef * src);
GnomeCanvasPathDef * gnome_canvas_path_def_duplicate (const GnomeCanvasPathDef * path);
GnomeCanvasPathDef * gnome_canvas_path_def_concat (const GSList * list);
GSList * gnome_canvas_path_def_split (const GnomeCanvasPathDef * path);
GnomeCanvasPathDef * gnome_canvas_path_def_open_parts (const GnomeCanvasPathDef * path);
GnomeCanvasPathDef * gnome_canvas_path_def_closed_parts (const GnomeCanvasPathDef * path);
GnomeCanvasPathDef * gnome_canvas_path_def_close_all (const GnomeCanvasPathDef * path);

/* Destructor */

void gnome_canvas_path_def_unref (GnomeCanvasPathDef * path);

/* Methods */

/* Sets GnomeCanvasPathDef to zero length */

void gnome_canvas_path_def_reset (GnomeCanvasPathDef * path);

/* Drawing methods */

void gnome_canvas_path_def_moveto (GnomeCanvasPathDef * path, gdouble x, gdouble y);
void gnome_canvas_path_def_lineto (GnomeCanvasPathDef * path, gdouble x, gdouble y);

/* Does not create new ArtBpath, but simply changes last lineto position */

void gnome_canvas_path_def_lineto_moving (GnomeCanvasPathDef * path, gdouble x, gdouble y);
void gnome_canvas_path_def_curveto (GnomeCanvasPathDef * path, gdouble x0, gdouble y0,gdouble x1, gdouble y1, gdouble x2, gdouble y2);
void gnome_canvas_path_def_closepath (GnomeCanvasPathDef * path);

/* Does not draw new line to startpoint, but moves last lineto */

void gnome_canvas_path_def_closepath_current (GnomeCanvasPathDef * path);

/* Various methods */

ArtBpath * gnome_canvas_path_def_bpath (const GnomeCanvasPathDef * path);
gint gnome_canvas_path_def_length (const GnomeCanvasPathDef * path);
gboolean gnome_canvas_path_def_is_empty (const GnomeCanvasPathDef * path);
gboolean gnome_canvas_path_def_has_currentpoint (const GnomeCanvasPathDef * path);
void gnome_canvas_path_def_currentpoint (const GnomeCanvasPathDef * path, ArtPoint * p);
ArtBpath * gnome_canvas_path_def_last_bpath (const GnomeCanvasPathDef * path);
ArtBpath * gnome_canvas_path_def_first_bpath (const GnomeCanvasPathDef * path);
gboolean gnome_canvas_path_def_any_open (const GnomeCanvasPathDef * path);
gboolean gnome_canvas_path_def_all_open (const GnomeCanvasPathDef * path);
gboolean gnome_canvas_path_def_any_closed (const GnomeCanvasPathDef * path);
gboolean gnome_canvas_path_def_all_closed (const GnomeCanvasPathDef * path);

G_END_DECLS

#endif