* added GDK_PIXBUF_LIBS in order to create pixbuf.dll
[dia.git] / lib / poly_conn.h
blob3bebadda2f8de6f090466ec73d98c55af8699bad
1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1999 Alexander Larsson
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program 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
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #ifndef POLY_CONN_H
19 #define POLY_CONN_H
21 #include "diatypes.h"
22 #include "object.h"
23 #include "boundingbox.h"
25 #define HANDLE_CORNER (HANDLE_CUSTOM1)
27 /* This is a subclass of Object used to help implementing objects
28 * that connect points with polygonal line-segments.
30 struct _PolyConn {
31 /* Object must be first because this is a 'subclass' of it. */
32 Object object;
34 int numpoints; /* >= 2 */
35 Point *points;
37 PolyBBExtras extra_spacing;
41 void polyconn_update_data(PolyConn *poly);
42 void polyconn_update_boundingbox(PolyConn *poly);
43 void polyconn_simple_draw(PolyConn *poly, DiaRenderer *renderer, real width);
44 void polyconn_init(PolyConn *poly, int num_points);
45 void polyconn_set_points(PolyConn *poly, int num_points, Point *points);
46 void polyconn_destroy(PolyConn *poly);
47 void polyconn_copy(PolyConn *from, PolyConn *to);
48 void polyconn_save(PolyConn *poly, ObjectNode obj_node);
49 void polyconn_load(PolyConn *poly, ObjectNode obj_node); /* NOTE: Does object_init() */
50 ObjectChange *polyconn_add_point(PolyConn *poly, int segment, Point *point);
51 ObjectChange *polyconn_remove_point(PolyConn *poly, int point);
52 void polyconn_move_handle(PolyConn *poly, Handle *id,
53 Point *to, HandleMoveReason reason);
54 void polyconn_move(PolyConn *poly, Point *to);
55 real polyconn_distance_from(PolyConn *poly, Point *point,
56 real line_width);
57 Handle *polyconn_closest_handle(PolyConn *poly, Point *point);
58 int polyconn_closest_segment(PolyConn *poly, Point *point,
59 real line_width);
60 #endif /* POLY_CONN_H */