aboutsummaryrefslogtreecommitdiff
path: root/src/ink.h
blob: 4842b9a49f1af087072a55cd23f493aac65e84a6 (plain)
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
/*
 * ink.h
 *
 * Routines for handling Ink
 *
 * (c) 2002-2005 Thomas White <taw27@srcf.ucam.org>
 *  Part of TuxMessenger - GTK+-based MSN Messenger client
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 dated June, 1991. 
 *
 * This package is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details. 
 *
 * You should have received a copy of the GNU General Public License
 * along with this package; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA. 
 *
 */

#ifndef INK_H
#define INK_H

typedef struct stru_inkpoint {

	struct stru_inkpoint *next;	/* Next point in linked list */
	
	double x;
	double y;
	
	struct stru_inkpoint *prev;	/* Previous point in linked list */
	
} InkPoint;

typedef struct stru_inkstroke {

	struct stru_inkstroke *next;		/* Next stroke in linked list */
	InkPoint *points;			/* Linked list of points. */
	
	InkPoint *last_point;		/* Last point in list (saves rescanning) */
	
} InkStroke;

/* Opaque! */
typedef struct {

	InkStroke *strokes;			/* Linked list of strokes */
	
	InkStroke *last_stroke;			/* Last stroke in list (saves rescanning) */
	
} Ink;

extern Ink *ink_new();
extern Ink *ink_new_from_isf(const char *isf);
extern void ink_destroy(Ink *ink);

extern InkStroke *ink_stroke_new(Ink *ink);
extern InkStroke *ink_stroke_get_last(Ink *ink);

extern InkPoint *ink_point_add(InkStroke *stroke, double x, double y);
extern InkPoint *ink_point_get_last(InkStroke *stroke);
extern InkPoint *ink_point_get_previous(InkPoint *point);

#endif	/* INK_H */