File: create.h

package info (click to toggle)
dia 0.97.3%2Bgit20160930-9
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 54,372 kB
  • sloc: ansic: 155,065; xml: 16,326; python: 6,641; cpp: 4,935; makefile: 3,833; sh: 540; perl: 137; sed: 19
file content (149 lines) | stat: -rw-r--r-- 4,748 bytes parent folder | download | duplicates (6)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* Dia -- an diagram creation/manipulation program
 * Copyright (C) 2001 Lars Clausen
 *
 * This program 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; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

/*!
 * \defgroup ObjectCreate Creation of standard objects
 * \brief Helpers for creation of the non-trivial standard objects
 *
 * \ingroup StandardObjects
 *
 * Typical import plug-ins translate some vector representation of the import format
 * into _DiaObject representations. This set of functions and structures simplifies 
 * the creation of standard objects.
 */

#ifndef STANDARD_OBJECT_CREATE_H
#define STANDARD_OBJECT_CREATE_H

#include "diatypes.h"

#include <glib.h>

G_BEGIN_DECLS

/*!
 * \brief Can be used as extra parameter at create. Usually discouraged, you can set via StdProp API
 * \ingroup ObjectCreate
 */
struct _MultipointCreateData {
  int num_points; /**< count */
  Point *points; /**< data */
};

/*! 
 * \brief Can be used as extra parameter at create. Usually discouraged, you can set via StdProp API
 * \ingroup ObjectCreate
 */
struct _BezierCreateData {
  int num_points; /**< count */
  BezPoint *points; /**< data */
};

/*!
 * \brief Create a text object for the diagram.
 * @param xpos X position (in cm from the origin) of the object.
 * @param ypos Y position (in cm from the origin) of the object.
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_text(real xpos, real ypos);
/*!
 * \brief Create an ellipse object for the diagram
 * @param xpos top-left corner
 * @param ypos top-left corner
 * @param width the horizontal diameter
 * @param height the vertical diameter
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_ellipse(real xpos, real ypos, real width, real height);
/*!
 * \brief Create a rectangular box
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_box(real xpos, real ypos, real width, real height);
/*!
 * \brief Create a _Polyline with arrows
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_polyline(int num_points,  Point *points,
				    Arrow *end_arrow, Arrow *start_arrow);
/*!
 * \brief Create a \ref _Zigzagline with arrows
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_zigzagline(int num_points, const Point *points,
				      const Arrow *end_arrow, const Arrow *start_arrow);
/*!
 * \brief Create a \ref _Polygon
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_polygon(int num_points, Point *points);
/*!
 * \brief Create a \ref _Bezierline with arrows
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_bezierline(int num_points, BezPoint *points,
				      Arrow *end_arrow, Arrow *start_arrow);
/*!
 * \brief Create a \ref _Beziergon
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_beziergon(int num_points, BezPoint *points);
/*!
 * \brief Create a \ref _StdPath
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_path(int num_points, BezPoint *points);
/*!
 * \brief Create a \ref _StdPath from the given _Text
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_path_from_text (const Text *text);

/*!
 * \brief Create an \ref _Arc with arrows 
 * @param x1 arc start position
 * @param y1 arc start position
 * @param x2 arc end position
 * @param y2 arc end position
 * @param curve_distance perpendicular distance from the center of the chord to the circumference
 * @param end_arrow end _Arrow
 * @param start_arrow start _Arrow
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_arc(real x1, real y1, real x2, real y2,
			       real curve_distance, 
			       Arrow *end_arrow, Arrow *start_arrow);
/*! 
 * \brief Create an \ref _Image object from file with the given size and position 
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_image(real xpos, real ypos, real width, real height, char *file);
/*!
 * \brief Create a _Group of objects given by list.
 * The objects in list must not be added to the diagram at the same time.
 * \ingroup ObjectCreate
 */
DiaObject *create_standard_group(GList *items);

DiaObject *create_standard_path_from_object (DiaObject *obj);

DiaObject *create_standard_path_from_list (GList *objects, PathCombineMode  mode);

G_END_DECLS

#endif