ARB
Main Page
Namespaces
Classes
Files
File List
File Members
WINDOW
aw_xfig.hxx
Go to the documentation of this file.
1
// =============================================================== //
2
// //
3
// File : aw_xfig.hxx //
4
// Purpose : //
5
// //
6
// Institute of Microbiology (Technical University Munich) //
7
// http://www.arb-home.de/ //
8
// //
9
// =============================================================== //
10
11
#ifndef AW_XFIG_HXX
12
#define AW_XFIG_HXX
13
14
#ifndef AW_BASE_HXX
15
#include "
aw_base.hxx
"
16
#endif
17
#ifndef ARBDB_BASE_H
18
#include <
arbdb_base.h
>
19
#endif
20
#ifndef ARBTOOLS_H
21
#include <
arbtools.h
>
22
#endif
23
24
25
const
int
XFIG_DEFAULT_FONT_WIDTH
= 8;
26
const
int
XFIG_DEFAULT_FONT_HEIGHT
= 13;
27
28
const
int
MAX_LINE_WIDTH
= 20;
29
const
int
MAX_XFIG_LENGTH
= 100000;
30
31
class
AW_device
;
32
33
char
*
aw_get_font_from_xfig
(
int
fontnr);
34
35
struct
AW_xfig_line
{
36
struct
AW_xfig_line
*
next
;
37
38
short
x0
,
y0
;
39
short
x1
,
y1
;
40
short
color
;
41
int
gc
;
42
};
43
44
struct
AW_xfig_text
{
45
struct
AW_xfig_text
*
next
;
46
47
short
x
,
y
;
48
short
pix_len
;
49
char
*
text
;
50
AW_font
font
;
51
short
fontsize
;
52
int
center
;
53
short
color
;
54
int
gc
;
55
};
56
57
struct
AW_xfig_pos
{
58
short
x
,
y
;
59
int
center
;
60
};
61
62
class
AW_xfig
:
virtual
Noncopyable
{
63
void
calc_scaling(
int
font_width,
int
font_height);
64
65
void
init(
int
font_width,
int
font_height) {
66
text
=
NULp
;
67
at_pos_hash
=
NULp
;
68
69
memset(
line
, 0,
sizeof
(
line
));
70
71
minx
= 0;
maxx
= 0;
centerx
= 0;
72
miny
= 0;
maxy
= 0;
centery
= 0;
73
74
size_x
=
size_y
= 0;
75
76
calc_scaling(font_width, font_height);
77
}
78
79
public
:
80
struct
AW_xfig_text
*
text
;
81
struct
AW_xfig_line
*
line
[
MAX_LINE_WIDTH
];
82
83
GB_HASH
*
at_pos_hash
;
// hash table for named positions
84
85
int
minx
,
miny
;
86
int
maxx
,
maxy
;
87
int
size_x
,
size_y
;
88
int
centerx
,
centery
;
89
90
double
font_scale
;
91
double
dpi_scale
;
92
93
AW_xfig
(
const
char
*filename,
int
font_width,
int
font_height);
94
AW_xfig
(
int
font_width,
int
font_height);
// creates an empty drawing area
95
96
~AW_xfig
();
97
void
print
(
AW_device
*device);
// you can scale it
98
void
create_gcs
(
AW_device
*device,
int
screen_depth);
// create the gcs
99
100
void
add_line
(
int
x1
,
int
y1
,
int
x2,
int
y2,
int
width);
// add a line to xfig
101
};
102
103
104
/* xfig format ::
105
106
text::
107
108
4 0 font(-1== default) fontsize depth color ?? angle justified(4=left) flags width x y text^A
109
110
lines::
111
112
2 art depth width color ....
113
x y x y 9999 9999
114
115
*/
116
117
#else
118
#error aw_xfig.hxx included twice
119
#endif // AW_XFIG_HXX
AW_xfig_line::x0
short x0
Definition:
aw_xfig.hxx:38
AW_xfig_line::color
short color
Definition:
aw_xfig.hxx:40
MAX_XFIG_LENGTH
const int MAX_XFIG_LENGTH
Definition:
aw_xfig.hxx:29
MAX_LINE_WIDTH
const int MAX_LINE_WIDTH
Definition:
aw_xfig.hxx:28
AW_xfig_text::y
short y
Definition:
aw_xfig.hxx:47
AW_xfig_line::gc
int gc
Definition:
aw_xfig.hxx:41
AW_xfig::dpi_scale
double dpi_scale
Definition:
aw_xfig.hxx:91
AW_xfig_text::pix_len
short pix_len
Definition:
aw_xfig.hxx:48
AW_xfig_pos::y
short y
Definition:
aw_xfig.hxx:58
AW_xfig_text::gc
int gc
Definition:
aw_xfig.hxx:54
AW_xfig::line
struct AW_xfig_line * line[MAX_LINE_WIDTH]
Definition:
aw_xfig.hxx:81
AW_xfig::size_y
int size_y
Definition:
aw_xfig.hxx:87
AW_xfig::maxx
int maxx
Definition:
aw_xfig.hxx:86
aw_base.hxx
AW_xfig::AW_xfig
AW_xfig(const char *filename, int font_width, int font_height)
Definition:
AW_xfig.cxx:83
AW_xfig_text::fontsize
short fontsize
Definition:
aw_xfig.hxx:51
AW_xfig_text
Definition:
aw_xfig.hxx:44
AW_xfig_text::color
short color
Definition:
aw_xfig.hxx:53
GB_HASH
Definition:
adhash.cxx:28
AW_xfig::font_scale
double font_scale
Definition:
aw_xfig.hxx:90
AW_xfig_text::x
short x
Definition:
aw_xfig.hxx:47
AW_xfig::miny
int miny
Definition:
aw_xfig.hxx:85
AW_xfig::~AW_xfig
~AW_xfig()
Definition:
AW_xfig.cxx:436
AW_xfig::size_x
int size_x
Definition:
aw_xfig.hxx:87
AW_xfig::centerx
int centerx
Definition:
aw_xfig.hxx:88
AW_device
Definition:
aw_device.hxx:356
aw_get_font_from_xfig
char * aw_get_font_from_xfig(int fontnr)
AW_xfig
Definition:
aw_xfig.hxx:62
arbdb_base.h
AW_xfig_line::next
struct AW_xfig_line * next
Definition:
aw_xfig.hxx:36
AW_xfig_text::font
AW_font font
Definition:
aw_xfig.hxx:50
AW_xfig_pos::center
int center
Definition:
aw_xfig.hxx:59
AW_xfig::text
struct AW_xfig_text * text
Definition:
aw_xfig.hxx:80
AW_xfig::centery
int centery
Definition:
aw_xfig.hxx:88
AW_xfig::maxy
int maxy
Definition:
aw_xfig.hxx:86
arbtools.h
XFIG_DEFAULT_FONT_WIDTH
const int XFIG_DEFAULT_FONT_WIDTH
Definition:
aw_xfig.hxx:25
AW_xfig::create_gcs
void create_gcs(AW_device *device, int screen_depth)
Definition:
AW_xfig.cxx:504
AW_xfig_text::center
int center
Definition:
aw_xfig.hxx:52
AW_xfig_text::text
char * text
Definition:
aw_xfig.hxx:49
AW_xfig_line::x1
short x1
Definition:
aw_xfig.hxx:39
AW_xfig::add_line
void add_line(int x1, int y1, int x2, int y2, int width)
Definition:
AW_xfig.cxx:533
NULp
#define NULp
Definition:
cxxforward.h:116
AW_xfig_pos
Definition:
aw_xfig.hxx:57
AW_xfig_line
Definition:
aw_xfig.hxx:35
AW_xfig_pos::x
short x
Definition:
aw_xfig.hxx:58
AW_xfig_line::y0
short y0
Definition:
aw_xfig.hxx:38
AW_xfig::print
void print(AW_device *device)
Definition:
AW_xfig.cxx:461
AW_xfig::at_pos_hash
GB_HASH * at_pos_hash
Definition:
aw_xfig.hxx:83
int
AW_xfig::minx
int minx
Definition:
aw_xfig.hxx:85
AW_xfig_text::next
struct AW_xfig_text * next
Definition:
aw_xfig.hxx:45
AW_xfig_line::y1
short y1
Definition:
aw_xfig.hxx:39
XFIG_DEFAULT_FONT_HEIGHT
const int XFIG_DEFAULT_FONT_HEIGHT
Definition:
aw_xfig.hxx:26
Noncopyable
Definition:
arbtools.h:39
Generated by
1.8.8