summaryrefslogtreecommitdiffstats
path: root/plug-ins/selection-to-path/types.h
blob: 9b040fa3a194a76dde623325fee468709e1e262a (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
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
/* types.h: general types.
 *
 * Copyright (C) 1992 Free Software Foundation, Inc.
 *
 * 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 3, 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, see <https://www.gnu.org/licenses/>.
 */

#ifndef TYPES_H
#define TYPES_H

/* Booleans.  */
typedef enum { false = 0, true = 1 } boolean;

/* The X11 library defines `FALSE' and `TRUE', and so we only want to
   define them if necessary.  */
#ifndef FALSE
#define FALSE false
#define TRUE true
#endif /* FALSE */

/* The usual null-terminated string.  */
typedef char *string;

/* A generic pointer in ANSI C.  */
typedef void *address;

/* We use `real' for our floating-point variables.  */
typedef double real;

/* A character code.  Perhaps someday we will allow for 16-bit
   character codes, but for now we are restricted to 256 characters per
   font (like TeX and PostScript).  */
typedef unsigned char charcode_type;


/* Used in file formats.  */
typedef unsigned char one_byte;
typedef signed char signed_byte;
typedef unsigned short two_bytes;
typedef short signed_2_bytes;
typedef unsigned int four_bytes;
typedef int signed_4_bytes;
typedef int byte_count_type;

/* These are intended to be used for output in file formats where a
   ``byte'' is defined to be eight bits, regardless of the hardware.  */
#define ONE_BYTE_BIG  (1 << 8)
#define TWO_BYTES_BIG  (1 << 16)
#define THREE_BYTES_BIG (1 << 24)


/* Complex numbers.  */
typedef struct
{
  real real;
  real imag;
} complex;
typedef enum { first_complex_part, second_complex_part} complex_part_type;
typedef enum { polar_rep, rectangular_rep} complex_rep_type;


/* Dimensions of a rectangle.  */
typedef struct
{
  unsigned height, width;
} dimensions_type;

#define DIMENSIONS_HEIGHT(d) ((d).height)
#define DIMENSIONS_WIDTH(d) ((d).width)


/* Cartesian points.  */
typedef struct
{
  int x, y;
} coordinate_type;

typedef struct
{
  double x, y;
} real_coordinate_type;

#if 0
typedef struct
{
  double       align_threshold;
  double       corner_always_threshold;
  unsigned int corner_surround;
  double       corner_threshold;
  double       error_threshold;
  unsigned int filter_alternative_surround;
  double       filter_epsilon;
  unsigned int filter_iteration_count;
  double       filter_percent;
  unsigned int filter_secondary_surround;
  unsigned int filter_surround;
  boolean      keep_knees;
  double       line_reversion_threshold;
  double       line_threshold;
  double       reparameterize_improvement;
  double       reparameterize_threshold;
  double       subdivide_search;
  unsigned int subdivide_surround;
  double       subdivide_threshold;
  unsigned int tangent_surround;
} SELVALS;

#else

typedef struct
{
  double       align_threshold;
  double       corner_always_threshold;
  double       corner_surround;
  double       corner_threshold;
  double       error_threshold;
  double       filter_alternative_surround;
  double       filter_epsilon;
  double       filter_iteration_count;
  double       filter_percent;
  double       filter_secondary_surround;
  double       filter_surround;
  boolean      keep_knees;
  double       line_reversion_threshold;
  double       line_threshold;
  double       reparameterize_improvement;
  double       reparameterize_threshold;
  double       subdivide_search;
  double       subdivide_surround;
  double       subdivide_threshold;
  double       tangent_surround;
} SELVALS;

#endif /* 1 */

#endif /* not TYPES_H */